diff src/glyphs-widget.c @ 771:943eaba38521

[xemacs-hg @ 2002-03-13 08:51:24 by ben] The big ben-mule-21-5 check-in! Various files were added and deleted. See CHANGES-ben-mule. There are still some test suite failures. No crashes, though. Many of the failures have to do with problems in the test suite itself rather than in the actual code. I'll be addressing these in the next day or so -- none of the test suite failures are at all critical. Meanwhile I'll be trying to address the biggest issues -- i.e. build or run failures, which will almost certainly happen on various platforms. All comments should be sent to ben@xemacs.org -- use a Cc: if necessary when sending to mailing lists. There will be pre- and post- tags, something like pre-ben-mule-21-5-merge-in, and post-ben-mule-21-5-merge-in.
author ben
date Wed, 13 Mar 2002 08:54:06 +0000
parents 183866b06e0b
children e38acbeb1cae
line wrap: on
line diff
--- a/src/glyphs-widget.c	Fri Mar 08 13:33:14 2002 +0000
+++ b/src/glyphs-widget.c	Wed Mar 13 08:54:06 2002 +0000
@@ -435,6 +435,20 @@
     }
 }
 
+static void
+widget_query_string_geometry (Lisp_Object string, Lisp_Object face,
+			      int *width, int *height, Lisp_Object domain)
+{
+  struct device *d = DOMAIN_XDEVICE (domain);
+
+  if (HAS_DEVMETH_P (d, widget_query_string_geometry))
+    DEVMETH (d, widget_query_string_geometry,
+	     (string, face, width, height, domain));
+  else
+    query_string_geometry (string, face, width, height, 0, domain);
+    
+}
+
 /* Query for a widgets desired geometry. If no type specific method is
    provided then use the widget text to calculate sizes. */
 static void
@@ -478,9 +492,9 @@
 
 	      /* Then if we are allowed to resize the widget, make the
 		 size the same as the text dimensions. */
-	      query_string_geometry (IMAGE_INSTANCE_WIDGET_TEXT (ii),
-				     IMAGE_INSTANCE_WIDGET_FACE (ii),
-				     &w, &h, 0, domain);
+	      widget_query_string_geometry (IMAGE_INSTANCE_WIDGET_TEXT (ii),
+					    IMAGE_INSTANCE_WIDGET_FACE (ii),
+					    &w, &h, domain);
 	      /* Adjust the size for borders. */
 	      if (IMAGE_INSTANCE_SUBWINDOW_H_RESIZEP (ii))
 		*width = w + 2 * WIDGET_BORDER_WIDTH;
@@ -773,9 +787,9 @@
 {
   Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
   int w, h;
-  query_string_geometry (IMAGE_INSTANCE_WIDGET_TEXT (ii),
-			 IMAGE_INSTANCE_WIDGET_FACE (ii),
-			 &w, &h, 0, domain);
+  widget_query_string_geometry (IMAGE_INSTANCE_WIDGET_TEXT (ii),
+				IMAGE_INSTANCE_WIDGET_FACE (ii),
+				&w, &h, domain);
   /* Adjust the size for borders. */
   if (IMAGE_INSTANCE_SUBWINDOW_H_RESIZEP (ii))
     {
@@ -804,9 +818,9 @@
   if (*width)
     {
       /* #### what should this be. reconsider when X has tree views. */
-      query_string_geometry (IMAGE_INSTANCE_WIDGET_TEXT (ii),
-			     IMAGE_INSTANCE_WIDGET_FACE (ii),
-			     width, 0, 0, domain);
+      widget_query_string_geometry (IMAGE_INSTANCE_WIDGET_TEXT (ii),
+				    IMAGE_INSTANCE_WIDGET_FACE (ii),
+				    width, 0, domain);
     }
   if (*height)
     {
@@ -833,9 +847,9 @@
     {
       int h, w;
 
-      query_string_geometry (XGUI_ITEM (XCAR (rest))->name,
-			     IMAGE_INSTANCE_WIDGET_FACE (ii),
-			     &w, &h, 0, domain);
+      widget_query_string_geometry (XGUI_ITEM (XCAR (rest))->name,
+				    IMAGE_INSTANCE_WIDGET_FACE (ii),
+				    &w, &h, domain);
       tw += 5 * WIDGET_BORDER_WIDTH; /* some bias */
       tw += w;
       th = max (th, h + 2 * WIDGET_BORDER_HEIGHT);