(M-47926): Unify M047926.
[chise/xemacs-chise.git-] / src / glyphs-x.c
index 9ce627b..9a0e296 100644 (file)
@@ -1000,12 +1000,13 @@ int read_bitmap_data_from_file (const char *filename, unsigned int *width,
 static Pixmap
 pixmap_from_xbm_inline (Lisp_Object device, int width, int height,
                        /* Note that data is in ext-format! */
-                       const Extbyte *bits)
+                       const char *bits)
 {
-  return XCreatePixmapFromBitmapData (DEVICE_X_DISPLAY (XDEVICE(device)),
-                                     XtWindow (DEVICE_XT_APP_SHELL (XDEVICE (device))),
-                                     (char *) bits, width, height,
-                                     1, 0, 1);
+  return XCreatePixmapFromBitmapData
+    (DEVICE_X_DISPLAY (XDEVICE (device)),
+     XtWindow (DEVICE_XT_APP_SHELL (XDEVICE (device))),
+     (char *) bits, width, height,
+     1, 0, 1);
 }
 
 /* Given inline data for a mono pixmap, initialize the given
@@ -1168,7 +1169,7 @@ xbm_instantiate_1 (Lisp_Object image_instance, Lisp_Object instantiator,
       mask = pixmap_from_xbm_inline (IMAGE_INSTANCE_DEVICE (ii),
                                     XINT (XCAR (mask_data)),
                                     XINT (XCAR (XCDR (mask_data))),
-                                    (const unsigned char *) ext_data);
+                                    ext_data);
     }
 
   init_image_instance_from_xbm_inline (ii, width, height, bits,
@@ -2209,8 +2210,8 @@ x_redisplay_widget (Lisp_Image_Instance *p)
         reference to the real values rather than a copy thus any
         changes we make to the values we get back will look like they
         have already been applied. If we rebuild the widget tree then
-        we may lose propertie. */
-      wv = copy_widget_value_tree (lw_get_all_values
+        we may lose properties. */
+      wv = copy_widget_value_tree (lw_get_all_values 
                                   (IMAGE_INSTANCE_X_WIDGET_LWID (p)),
                                   NO_CHANGE);
     }
@@ -2953,6 +2954,17 @@ image_instantiator_format_create_glyphs_x (void)
   IIFORMAT_HAS_METHOD (autodetect, validate);
   IIFORMAT_HAS_METHOD (autodetect, normalize);
   IIFORMAT_HAS_METHOD (autodetect, possible_dest_types);
+  /* #### autodetect is flawed IMO: 
+  1. It makes the assumption that you can detect whether the user
+  wanted a cursor or a string based on the data, since the data is a
+  string you have to prioritise cursors. Instead we will force users
+  to pick the appropriate image type, this is what we do under
+  MS-Windows anyway.
+  2. It doesn't fit with the new domain model - you cannot tell which
+  domain it needs to be instantiated in until you've actually
+  instantiated it, which mucks up caching.
+  3. It only copes with cursors and strings which seems bogus. */
+  IIFORMAT_HAS_SHARED_METHOD (autodetect, governing_domain, subwindow);
   IIFORMAT_HAS_METHOD (autodetect, instantiate);
   IIFORMAT_VALID_CONSOLE (x, autodetect);
 
@@ -2980,7 +2992,7 @@ complex_vars_of_glyphs_x (void)
      vector3 (Qxbm, Q_data,                                    \
              list3 (make_int (name##_width),                   \
                     make_int (name##_height),                  \
-                    make_ext_string (name##_bits,              \
+                    make_ext_string ((Extbyte *) name##_bits,  \
                                      sizeof (name##_bits),     \
                                      Qbinary))),               \
      Qglobal, Qx, Qnil)