XEmacs 21.4.9 "Informed Management".
[chise/xemacs-chise.git.1] / src / glyphs.c
index e8f0d9b..6fbe951 100644 (file)
@@ -46,7 +46,7 @@ Boston, MA 02111-1307, USA.  */
 #include "specifier.h"
 #include "window.h"
 
-#ifdef HAVE_XPM
+#if defined (HAVE_XPM) && !defined (HAVE_GTK)
 #include <X11/xpm.h>
 #endif
 
@@ -1004,7 +1004,7 @@ print_image_instance (Lisp_Object obj, Lisp_Object printcharfun,
          print_internal
            (IMAGE_INSTANCE_WIDGET_FACE (ii), printcharfun, 0);
        }
-
+      /* fallthrough */
 
     case IMAGE_SUBWINDOW:
       sprintf (buf, " %dx%d", IMAGE_INSTANCE_WIDTH (ii),
@@ -2270,6 +2270,8 @@ query_string_geometry (Lisp_Object string, Lisp_Object face,
   struct face_cachel *cachel;
   Lisp_Object frame = DOMAIN_FRAME (domain);
 
+  CHECK_STRING (string);
+
   /* Compute height */
   if (height)
     {
@@ -2811,6 +2813,14 @@ xface_possible_dest_types (void)
  *                             XPM                                    *
  **********************************************************************/
 
+#ifdef HAVE_GTK
+/* Gtk has to be gratuitously different, eh? */
+Lisp_Object
+pixmap_to_lisp_data (Lisp_Object name, int ok_if_data_invalid)
+{
+  return (make_string_from_file (name));
+}
+#else
 Lisp_Object
 pixmap_to_lisp_data (Lisp_Object name, int ok_if_data_invalid)
 {
@@ -2892,6 +2902,7 @@ pixmap_to_lisp_data (Lisp_Object name, int ok_if_data_invalid)
 
   return Qnil; /* not reached */
 }
+#endif /* !HAVE_GTK */
 
 static void
 check_valid_xpm_color_symbols (Lisp_Object data)
@@ -3138,13 +3149,15 @@ image_instantiate (Lisp_Object specifier, Lisp_Object matchspec,
        signal_simple_error_2 ("Wrong domain for image instance",
                               instantiator, domain);
     }
+  /* How ugly !! An image instanciator that uses a kludgy syntax to snarf in
+     face properties. There's a design flaw here. -- didier */
   else if (VECTORP (instantiator)
           && EQ (INSTANTIATOR_TYPE (instantiator), Qinherit))
     {
       assert (XVECTOR_LENGTH (instantiator) == 3);
       return (FACE_PROPERTY_INSTANCE
              (Fget_face (XVECTOR_DATA (instantiator)[2]),
-              Qbackground_pixmap, domain, 0, depth));
+              Qbackground_pixmap, domain, 1, depth));
     }
   else
     {
@@ -3169,7 +3182,7 @@ image_instantiate (Lisp_Object specifier, Lisp_Object matchspec,
        {
          pointer_fg = FACE_FOREGROUND (Vpointer_face, domain);
          pointer_bg = FACE_BACKGROUND (Vpointer_face, domain);
-         hash_key = list4 (glyph, INSTANTIATOR_TYPE (instantiator), 
+         hash_key = list4 (glyph, INSTANTIATOR_TYPE (instantiator),
                            pointer_fg, pointer_bg);
        }
       else
@@ -4410,9 +4423,9 @@ check_for_ignored_expose (struct frame* f, int x, int y, int width, int height)
         we have to check for overlaps. Being conservative, we will
         check for exposures wholly contained by the subwindow - this
         might give us what we want.*/
-      if (ei->x <= x && ei->y <= y
-         && ei->x + ei->width >= x + width
-         && ei->y + ei->height >= y + height)
+      if (ei->x <= (unsigned) x && ei->y <= (unsigned) y
+         && ei->x + ei->width >= (unsigned) (x + width)
+         && ei->y + ei->height >= (unsigned) (y + height))
        {
 #ifdef DEBUG_WIDGETS
          stderr_out ("ignored %d+%d, %dx%d for exposure %d+%d, %dx%d\n",
@@ -4480,15 +4493,15 @@ int find_matching_subwindow (struct frame* f, int x, int y, int width, int heigh
 
       if (IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP (ii)
          &&
-         IMAGE_INSTANCE_DISPLAY_X (ii) <= x
+         IMAGE_INSTANCE_DISPLAY_X (ii) <= (unsigned) x
          &&
-         IMAGE_INSTANCE_DISPLAY_Y (ii) <= y
+         IMAGE_INSTANCE_DISPLAY_Y (ii) <= (unsigned) y
          &&
          IMAGE_INSTANCE_DISPLAY_X (ii)
-         + IMAGE_INSTANCE_DISPLAY_WIDTH (ii) >= x + width
+         + IMAGE_INSTANCE_DISPLAY_WIDTH (ii) >= (unsigned) (x + width)
          &&
          IMAGE_INSTANCE_DISPLAY_Y (ii)
-         + IMAGE_INSTANCE_DISPLAY_HEIGHT (ii) >= y + height)
+         + IMAGE_INSTANCE_DISPLAY_HEIGHT (ii) >= (unsigned) (y + height))
        {
          return 1;
        }
@@ -5169,7 +5182,7 @@ image_instantiator_format_create (void)
   Vimage_instantiator_format_list = Qnil;
   staticpro (&Vimage_instantiator_format_list);
 
-  dumpstruct (&the_image_instantiator_format_entry_dynarr, &iifed_description);
+  dump_add_root_struct_ptr (&the_image_instantiator_format_entry_dynarr, &iifed_description);
 
   INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (nothing, "nothing");