]> Pileus Git - ~andy/gtk/commitdiff
Make gdk_colormap_sync private since it was never exported in a header
authorOwen Taylor <otaylor@redhat.com>
Fri, 2 Feb 2001 22:19:31 +0000 (22:19 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Fri, 2 Feb 2001 22:19:31 +0000 (22:19 +0000)
Fri Feb  2 17:16:09 2001  Owen Taylor  <otaylor@redhat.com>

* gdk/x11/gdkcolor-x11.c (gdk_colormap_sync): Make
gdk_colormap_sync private since it was never exported
in a header file.

* gdk/x11/gdkcolor-x11.c (gdk_colormap_new): Fill in
colormap->colors[] for StaticGray, StaticColor colormaps.

* gdk/gdkpixbuf-drawable.c: Fix problems where image->bpp
was being used as if it was image->bits_per_pixel.

* gdk/gdkimage.h, gdk/x11/gdkimage-x11.c: Save the bits-per-pixel
for the image in the GdkImage structure since it isn't
reconstructable, and we need it to handle packed types

* gdk/win32/gdkimage-win32.c: Set image->bits_per_pixel. (I'm making
the assumption that on Win32 image->bits_per_pixel == image->depth,
always.

* gdk/linux-fb/gdkimage-fb.c: Set image->bits_per_pixel.

* gdk/gdkrgb.c (gdk_rgb_select_conv): Exit with an informative
warning message if no converter can be found.

16 files changed:
ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
examples/packer/pack.c
gdk/gdkimage.h
gdk/gdkpixbuf-drawable.c
gdk/gdkrgb.c
gdk/linux-fb/gdkimage-fb.c
gdk/win32/gdkimage-win32.c
gdk/x11/gdkcolor-x11.c
gdk/x11/gdkimage-x11.c
gtk/fnmatch.c

index a37e7e993b13d271dfafebd790a04cf6c9dc1b8e..cf3e71877a466b5711767ad5e2271ceb9fb92e3e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,36 @@
+Fri Feb  2 17:16:09 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/x11/gdkcolor-x11.c (gdk_colormap_sync): Make
+       gdk_colormap_sync private since it was never exported
+       in a header file.
+
+       * gdk/x11/gdkcolor-x11.c (gdk_colormap_new): Fill in
+       colormap->colors[] for StaticGray, StaticColor colormaps.
+
+       * gdk/gdkpixbuf-drawable.c: Fix problems where image->bpp
+       was being used as if it was image->bits_per_pixel.
+
+       * gdk/gdkimage.h, gdk/x11/gdkimage-x11.c: Save the bits-per-pixel
+       for the image in the GdkImage structure since it isn't
+       reconstructable, and we need it to handle packed types
+
+       * gdk/win32/gdkimage-win32.c: Set image->bits_per_pixel. (I'm making
+       the assumption that on Win32 image->bits_per_pixel == image->depth,
+       always.
+
+       * gdk/linux-fb/gdkimage-fb.c: Set image->bits_per_pixel.
+
+       * gdk/gdkrgb.c (gdk_rgb_select_conv): Exit with an informative
+       warning message if no converter can be found. 
+
+Fri Feb  2 15:09:51 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/fnmatch.c (FOLD): Fix problem with passing signed
+       chars to isupper() / tolower(). (#567)
+
+       * examples/packer/pack.c: Add GINT_TO_POINTER, GPOINTER_TO_INT
+       to clear up 64-bit warnings. (#567)
+
 Fri Feb  2 12:26:50 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkrc.c (gtk_rc_add_initial_default_files): Get rid of
index a37e7e993b13d271dfafebd790a04cf6c9dc1b8e..cf3e71877a466b5711767ad5e2271ceb9fb92e3e 100644 (file)
@@ -1,3 +1,36 @@
+Fri Feb  2 17:16:09 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/x11/gdkcolor-x11.c (gdk_colormap_sync): Make
+       gdk_colormap_sync private since it was never exported
+       in a header file.
+
+       * gdk/x11/gdkcolor-x11.c (gdk_colormap_new): Fill in
+       colormap->colors[] for StaticGray, StaticColor colormaps.
+
+       * gdk/gdkpixbuf-drawable.c: Fix problems where image->bpp
+       was being used as if it was image->bits_per_pixel.
+
+       * gdk/gdkimage.h, gdk/x11/gdkimage-x11.c: Save the bits-per-pixel
+       for the image in the GdkImage structure since it isn't
+       reconstructable, and we need it to handle packed types
+
+       * gdk/win32/gdkimage-win32.c: Set image->bits_per_pixel. (I'm making
+       the assumption that on Win32 image->bits_per_pixel == image->depth,
+       always.
+
+       * gdk/linux-fb/gdkimage-fb.c: Set image->bits_per_pixel.
+
+       * gdk/gdkrgb.c (gdk_rgb_select_conv): Exit with an informative
+       warning message if no converter can be found. 
+
+Fri Feb  2 15:09:51 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/fnmatch.c (FOLD): Fix problem with passing signed
+       chars to isupper() / tolower(). (#567)
+
+       * examples/packer/pack.c: Add GINT_TO_POINTER, GPOINTER_TO_INT
+       to clear up 64-bit warnings. (#567)
+
 Fri Feb  2 12:26:50 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkrc.c (gtk_rc_add_initial_default_files): Get rid of
index a37e7e993b13d271dfafebd790a04cf6c9dc1b8e..cf3e71877a466b5711767ad5e2271ceb9fb92e3e 100644 (file)
@@ -1,3 +1,36 @@
+Fri Feb  2 17:16:09 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/x11/gdkcolor-x11.c (gdk_colormap_sync): Make
+       gdk_colormap_sync private since it was never exported
+       in a header file.
+
+       * gdk/x11/gdkcolor-x11.c (gdk_colormap_new): Fill in
+       colormap->colors[] for StaticGray, StaticColor colormaps.
+
+       * gdk/gdkpixbuf-drawable.c: Fix problems where image->bpp
+       was being used as if it was image->bits_per_pixel.
+
+       * gdk/gdkimage.h, gdk/x11/gdkimage-x11.c: Save the bits-per-pixel
+       for the image in the GdkImage structure since it isn't
+       reconstructable, and we need it to handle packed types
+
+       * gdk/win32/gdkimage-win32.c: Set image->bits_per_pixel. (I'm making
+       the assumption that on Win32 image->bits_per_pixel == image->depth,
+       always.
+
+       * gdk/linux-fb/gdkimage-fb.c: Set image->bits_per_pixel.
+
+       * gdk/gdkrgb.c (gdk_rgb_select_conv): Exit with an informative
+       warning message if no converter can be found. 
+
+Fri Feb  2 15:09:51 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/fnmatch.c (FOLD): Fix problem with passing signed
+       chars to isupper() / tolower(). (#567)
+
+       * examples/packer/pack.c: Add GINT_TO_POINTER, GPOINTER_TO_INT
+       to clear up 64-bit warnings. (#567)
+
 Fri Feb  2 12:26:50 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkrc.c (gtk_rc_add_initial_default_files): Get rid of
index a37e7e993b13d271dfafebd790a04cf6c9dc1b8e..cf3e71877a466b5711767ad5e2271ceb9fb92e3e 100644 (file)
@@ -1,3 +1,36 @@
+Fri Feb  2 17:16:09 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/x11/gdkcolor-x11.c (gdk_colormap_sync): Make
+       gdk_colormap_sync private since it was never exported
+       in a header file.
+
+       * gdk/x11/gdkcolor-x11.c (gdk_colormap_new): Fill in
+       colormap->colors[] for StaticGray, StaticColor colormaps.
+
+       * gdk/gdkpixbuf-drawable.c: Fix problems where image->bpp
+       was being used as if it was image->bits_per_pixel.
+
+       * gdk/gdkimage.h, gdk/x11/gdkimage-x11.c: Save the bits-per-pixel
+       for the image in the GdkImage structure since it isn't
+       reconstructable, and we need it to handle packed types
+
+       * gdk/win32/gdkimage-win32.c: Set image->bits_per_pixel. (I'm making
+       the assumption that on Win32 image->bits_per_pixel == image->depth,
+       always.
+
+       * gdk/linux-fb/gdkimage-fb.c: Set image->bits_per_pixel.
+
+       * gdk/gdkrgb.c (gdk_rgb_select_conv): Exit with an informative
+       warning message if no converter can be found. 
+
+Fri Feb  2 15:09:51 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/fnmatch.c (FOLD): Fix problem with passing signed
+       chars to isupper() / tolower(). (#567)
+
+       * examples/packer/pack.c: Add GINT_TO_POINTER, GPOINTER_TO_INT
+       to clear up 64-bit warnings. (#567)
+
 Fri Feb  2 12:26:50 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkrc.c (gtk_rc_add_initial_default_files): Get rid of
index a37e7e993b13d271dfafebd790a04cf6c9dc1b8e..cf3e71877a466b5711767ad5e2271ceb9fb92e3e 100644 (file)
@@ -1,3 +1,36 @@
+Fri Feb  2 17:16:09 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/x11/gdkcolor-x11.c (gdk_colormap_sync): Make
+       gdk_colormap_sync private since it was never exported
+       in a header file.
+
+       * gdk/x11/gdkcolor-x11.c (gdk_colormap_new): Fill in
+       colormap->colors[] for StaticGray, StaticColor colormaps.
+
+       * gdk/gdkpixbuf-drawable.c: Fix problems where image->bpp
+       was being used as if it was image->bits_per_pixel.
+
+       * gdk/gdkimage.h, gdk/x11/gdkimage-x11.c: Save the bits-per-pixel
+       for the image in the GdkImage structure since it isn't
+       reconstructable, and we need it to handle packed types
+
+       * gdk/win32/gdkimage-win32.c: Set image->bits_per_pixel. (I'm making
+       the assumption that on Win32 image->bits_per_pixel == image->depth,
+       always.
+
+       * gdk/linux-fb/gdkimage-fb.c: Set image->bits_per_pixel.
+
+       * gdk/gdkrgb.c (gdk_rgb_select_conv): Exit with an informative
+       warning message if no converter can be found. 
+
+Fri Feb  2 15:09:51 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/fnmatch.c (FOLD): Fix problem with passing signed
+       chars to isupper() / tolower(). (#567)
+
+       * examples/packer/pack.c: Add GINT_TO_POINTER, GPOINTER_TO_INT
+       to clear up 64-bit warnings. (#567)
+
 Fri Feb  2 12:26:50 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkrc.c (gtk_rc_add_initial_default_files): Get rid of
index a37e7e993b13d271dfafebd790a04cf6c9dc1b8e..cf3e71877a466b5711767ad5e2271ceb9fb92e3e 100644 (file)
@@ -1,3 +1,36 @@
+Fri Feb  2 17:16:09 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/x11/gdkcolor-x11.c (gdk_colormap_sync): Make
+       gdk_colormap_sync private since it was never exported
+       in a header file.
+
+       * gdk/x11/gdkcolor-x11.c (gdk_colormap_new): Fill in
+       colormap->colors[] for StaticGray, StaticColor colormaps.
+
+       * gdk/gdkpixbuf-drawable.c: Fix problems where image->bpp
+       was being used as if it was image->bits_per_pixel.
+
+       * gdk/gdkimage.h, gdk/x11/gdkimage-x11.c: Save the bits-per-pixel
+       for the image in the GdkImage structure since it isn't
+       reconstructable, and we need it to handle packed types
+
+       * gdk/win32/gdkimage-win32.c: Set image->bits_per_pixel. (I'm making
+       the assumption that on Win32 image->bits_per_pixel == image->depth,
+       always.
+
+       * gdk/linux-fb/gdkimage-fb.c: Set image->bits_per_pixel.
+
+       * gdk/gdkrgb.c (gdk_rgb_select_conv): Exit with an informative
+       warning message if no converter can be found. 
+
+Fri Feb  2 15:09:51 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/fnmatch.c (FOLD): Fix problem with passing signed
+       chars to isupper() / tolower(). (#567)
+
+       * examples/packer/pack.c: Add GINT_TO_POINTER, GPOINTER_TO_INT
+       to clear up 64-bit warnings. (#567)
+
 Fri Feb  2 12:26:50 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkrc.c (gtk_rc_add_initial_default_files): Get rid of
index a37e7e993b13d271dfafebd790a04cf6c9dc1b8e..cf3e71877a466b5711767ad5e2271ceb9fb92e3e 100644 (file)
@@ -1,3 +1,36 @@
+Fri Feb  2 17:16:09 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/x11/gdkcolor-x11.c (gdk_colormap_sync): Make
+       gdk_colormap_sync private since it was never exported
+       in a header file.
+
+       * gdk/x11/gdkcolor-x11.c (gdk_colormap_new): Fill in
+       colormap->colors[] for StaticGray, StaticColor colormaps.
+
+       * gdk/gdkpixbuf-drawable.c: Fix problems where image->bpp
+       was being used as if it was image->bits_per_pixel.
+
+       * gdk/gdkimage.h, gdk/x11/gdkimage-x11.c: Save the bits-per-pixel
+       for the image in the GdkImage structure since it isn't
+       reconstructable, and we need it to handle packed types
+
+       * gdk/win32/gdkimage-win32.c: Set image->bits_per_pixel. (I'm making
+       the assumption that on Win32 image->bits_per_pixel == image->depth,
+       always.
+
+       * gdk/linux-fb/gdkimage-fb.c: Set image->bits_per_pixel.
+
+       * gdk/gdkrgb.c (gdk_rgb_select_conv): Exit with an informative
+       warning message if no converter can be found. 
+
+Fri Feb  2 15:09:51 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/fnmatch.c (FOLD): Fix problem with passing signed
+       chars to isupper() / tolower(). (#567)
+
+       * examples/packer/pack.c: Add GINT_TO_POINTER, GPOINTER_TO_INT
+       to clear up 64-bit warnings. (#567)
+
 Fri Feb  2 12:26:50 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkrc.c (gtk_rc_add_initial_default_files): Get rid of
index 6bde2f082b163e564cd838d1ffd6853665c4d3fd..e8e3af48732b4c62072e67efe2916d7986a4545d 100644 (file)
@@ -159,10 +159,10 @@ main (int argv, char **argc)
     button_left = gtk_toggle_button_new_with_label("Left");
     button_right = gtk_toggle_button_new_with_label("Right");
 
-    gtk_object_set_data(GTK_OBJECT(button_top), "side", (gpointer) GTK_SIDE_TOP);
-    gtk_object_set_data(GTK_OBJECT(button_bottom), "side", (gpointer) GTK_SIDE_BOTTOM);
-    gtk_object_set_data(GTK_OBJECT(button_left), "side", (gpointer) GTK_SIDE_LEFT);
-    gtk_object_set_data(GTK_OBJECT(button_right), "side", (gpointer) GTK_SIDE_RIGHT);
+    gtk_object_set_data(GTK_OBJECT(button_top), "side", GINT_TO_POINTER (GTK_SIDE_TOP));
+    gtk_object_set_data(GTK_OBJECT(button_bottom), "side", GINT_TO_POINTER (GTK_SIDE_BOTTOM));
+    gtk_object_set_data(GTK_OBJECT(button_left), "side", GINT_TO_POINTER (GTK_SIDE_LEFT));
+    gtk_object_set_data(GTK_OBJECT(button_right), "side", GINT_TO_POINTER (GTK_SIDE_RIGHT));
 
     gtk_widget_set_usize(button_top, 50, -1);
     gtk_widget_set_usize(button_bottom, 50, -1);
@@ -230,15 +230,15 @@ main (int argv, char **argc)
     button_sw = gtk_toggle_button_new_with_label("SW");
     button_center = gtk_toggle_button_new_with_label("");
 
-    gtk_object_set_data(GTK_OBJECT(button_n), "anchor", (gpointer) GTK_ANCHOR_N);
-    gtk_object_set_data(GTK_OBJECT(button_nw), "anchor", (gpointer) GTK_ANCHOR_NW);
-    gtk_object_set_data(GTK_OBJECT(button_ne), "anchor", (gpointer) GTK_ANCHOR_NE);
-    gtk_object_set_data(GTK_OBJECT(button_s), "anchor", (gpointer) GTK_ANCHOR_S);
-    gtk_object_set_data(GTK_OBJECT(button_sw), "anchor", (gpointer) GTK_ANCHOR_SW);
-    gtk_object_set_data(GTK_OBJECT(button_se), "anchor", (gpointer) GTK_ANCHOR_SE);
-    gtk_object_set_data(GTK_OBJECT(button_w), "anchor", (gpointer) GTK_ANCHOR_W);
-    gtk_object_set_data(GTK_OBJECT(button_e), "anchor", (gpointer) GTK_ANCHOR_E);
-    gtk_object_set_data(GTK_OBJECT(button_center), "anchor", (gpointer) GTK_ANCHOR_CENTER);
+    gtk_object_set_data(GTK_OBJECT(button_n), "anchor", GINT_TO_POINTER (GTK_ANCHOR_N));
+    gtk_object_set_data(GTK_OBJECT(button_nw), "anchor", GINT_TO_POINTER (GTK_ANCHOR_NW));
+    gtk_object_set_data(GTK_OBJECT(button_ne), "anchor", GINT_TO_POINTER (GTK_ANCHOR_NE));
+    gtk_object_set_data(GTK_OBJECT(button_s), "anchor", GINT_TO_POINTER (GTK_ANCHOR_S));
+    gtk_object_set_data(GTK_OBJECT(button_sw), "anchor", GINT_TO_POINTER (GTK_ANCHOR_SW));
+    gtk_object_set_data(GTK_OBJECT(button_se), "anchor", GINT_TO_POINTER (GTK_ANCHOR_SE));
+    gtk_object_set_data(GTK_OBJECT(button_w), "anchor", GINT_TO_POINTER (GTK_ANCHOR_W));
+    gtk_object_set_data(GTK_OBJECT(button_e), "anchor", GINT_TO_POINTER (GTK_ANCHOR_E));
+    gtk_object_set_data(GTK_OBJECT(button_center), "anchor", GINT_TO_POINTER (GTK_ANCHOR_CENTER));
 
     gtk_signal_connect (GTK_OBJECT (button_n), "toggled",
                         GTK_SIGNAL_FUNC (toggle_anchor), (gpointer) info);
@@ -321,9 +321,9 @@ main (int argv, char **argc)
                    GTK_FILL_X | GTK_PACK_EXPAND,
                    0, 10, 5, 0, 0);
 
-    gtk_object_set_data(GTK_OBJECT(button_fillx), "option", (gpointer) GTK_FILL_X);
-    gtk_object_set_data(GTK_OBJECT(button_filly), "option", (gpointer) GTK_FILL_Y);
-    gtk_object_set_data(GTK_OBJECT(button_expand), "option", (gpointer) GTK_PACK_EXPAND);
+    gtk_object_set_data(GTK_OBJECT(button_fillx), "option", GINT_TO_POINTER (GTK_FILL_X));
+    gtk_object_set_data(GTK_OBJECT(button_filly), "option", GINT_TO_POINTER (GTK_FILL_Y));
+    gtk_object_set_data(GTK_OBJECT(button_expand), "option", GINT_TO_POINTER (GTK_PACK_EXPAND));
 
     gtk_signal_connect (GTK_OBJECT (button_fillx), "toggled",
                         GTK_SIGNAL_FUNC (toggle_options), (gpointer) info);
@@ -373,7 +373,7 @@ toggle_options (GtkWidget *widget, gpointer data)
 
    info = (Info*) data;
  
-   option = (gint) gtk_object_get_data(GTK_OBJECT(widget), "option");
+   option = GPOINTER_TO_INT (gtk_object_get_data(GTK_OBJECT(widget), "option"));
 
    pchild = info->pchild;
    if (pchild == NULL) {
@@ -412,7 +412,7 @@ toggle_anchor (GtkWidget *widget, gpointer data)
    info = (Info*) data;
  
    if (GTK_TOGGLE_BUTTON(widget)->active) {
-       anchor = (gint) gtk_object_get_data(GTK_OBJECT(widget), "anchor");
+       anchor = GPOINTER_TO_INT (gtk_object_get_data(GTK_OBJECT(widget), "anchor"));
 
        pchild = info->pchild;
        if (pchild == NULL) {
@@ -483,7 +483,7 @@ toggle_side (GtkWidget *widget, gpointer data)
  
    if (GTK_TOGGLE_BUTTON(widget)->active) {
 
-       side = (gint) gtk_object_get_data(GTK_OBJECT(widget), "side");
+       side = GPOINTER_TO_INT (gtk_object_get_data(GTK_OBJECT(widget), "side"));
 
        pchild = info->pchild;
        if (pchild == NULL) {
index 16bf59d609fcefe3cc2ecf3d4a28fa5fbfd95923..2c631b35607153fe5c0f46cc6da4d601d379c2ef 100644 (file)
@@ -44,8 +44,9 @@ struct _GdkImage
   gint         width;
   gint         height;
   guint16      depth;
-  guint16      bpp;        /* bytes per pixel */
-  guint16      bpl;        /* bytes per line */
+  guint16      bpp;            /* bytes per pixel */
+  guint16      bpl;            /* bytes per line */
+  guint16       bits_per_pixel; /* bits per pixel */
   gpointer     mem;
 
   gpointer windowing_data;
index 776ebe6067c229d49bee109ec13c15f1e08d9ac6..97539a0e5f4be598fa6d8de3de41a3357f82553a 100644 (file)
@@ -1078,7 +1078,7 @@ rgbconvert (GdkImage    *image,
   GdkVisual *v = gdk_colormap_get_visual(cmap);
 
   d(printf("masks = %x:%x:%x\n", v->red_mask, v->green_mask, v->blue_mask));
-  d(printf("image depth = %d, bpp = %d\n", image->depth, image->bpp));
+  d(printf("image depth = %d, bits per pixel = %d\n", image->depth, image->bits_per_pixel));
 
   switch (v->type)
     {
@@ -1087,13 +1087,14 @@ rgbconvert (GdkImage    *image,
     case GDK_VISUAL_GRAYSCALE:
     case GDK_VISUAL_STATIC_COLOR:
     case GDK_VISUAL_PSEUDO_COLOR:
-      switch (image->bpp)
+      switch (image->bits_per_pixel)
        {
        case 1:
          bank = 0;
          break;
        case 8:
-         bank = 1;
+         if (image->depth == 8)
+           bank = 1;
          break;
        }
       break;
@@ -1102,18 +1103,18 @@ rgbconvert (GdkImage    *image,
        {
        case 15:
          if (v->red_mask == 0x7c00 && v->green_mask == 0x3e0 && v->blue_mask == 0x1f
-             && image->bpp == 16)
+             && image->bits_per_pixel == 16)
            bank = 2;
          break;
        case 16:
          if (v->red_mask == 0xf800 && v->green_mask == 0x7e0 && v->blue_mask == 0x1f
-             && image->bpp == 16)
+             && image->bits_per_pixel == 16)
            bank = 3;
          break;
        case 24:
        case 32:
          if (v->red_mask == 0xff0000 && v->green_mask == 0xff00 && v->blue_mask == 0xff
-             && image->bpp == 32)
+             && image->bits_per_pixel == 32)
            bank = 4;
          break;
        }
index aa24b3cfa8d526eaab4199067020df04709f6f0b..600d1f3b7d194c1e9ce72e52b0c5203f5261b89f 100644 (file)
@@ -2872,13 +2872,7 @@ gdk_rgb_select_conv (GdkRgbInfo *image_info, GdkImage *image)
 
   depth = image_info->visual->depth;
 
-  /* FIXME: save the bpp in the image; this is hack that works for
-   *        common visuals, not otherwise.
-   */
-  if (depth <= 8)
-    bpp = depth;
-  else
-    bpp = 8 * image->bpp;
+  bpp = image->bits_per_pixel;
 
   byte_order = image->byte_order;
   if (gdk_rgb_verbose)
@@ -3031,6 +3025,16 @@ gdk_rgb_select_conv (GdkRgbInfo *image_info, GdkImage *image)
       conv_d = gdk_rgb_convert_gray4_d_pack;
     }
 
+  if (!conv)
+    {
+      g_warning ("Visual type=%s depth=%d, image bpp=%d, %s first\n"
+                "is not supported by GdkRGB. Please submit a bug report\n"
+                "with the above values to bugzilla.gnome.org",
+                visual_names[vtype], depth, bpp,
+                byte_order == GDK_LSB_FIRST ? "lsb" : "msb");
+      exit (1);
+    }
+  
   if (conv_d == NULL)
     conv_d = conv;
 
index 3c112fe60a4fa2c3e86bae6bba1fa9f06eb2d8f4..81251ff2e0b6644627da8f18c5d9e34ef920aca4 100644 (file)
@@ -122,6 +122,7 @@ gdk_image_new_bitmap(GdkVisual *visual,
   image->depth = 1;
 
   image->byte_order = 1 /* MSBFirst */;
+  image->bits_per_pixel = 1;
   image->bpp = 1;
   image->bpl = (w+7)/8;
   image->mem = g_malloc (image->bpl * h / 8);
@@ -148,6 +149,7 @@ gdk_image_new (GdkImageType  type,
   image->depth = visual->depth;
   
   image->byte_order = 0;
+  image->bits_per_pixel = image->depth;
   image->bpp = image->depth/8;
   image->bpl = (width * image->depth + 7) / 8;
   image->mem = g_malloc (image->bpl * height);
@@ -164,7 +166,7 @@ _gdk_fb_get_image (GdkDrawable *drawable,
 {
   GdkImage *image;
   GdkImagePrivateFB *private;
-  gint bits_per_pixel = GDK_DRAWABLE_IMPL_FBDATA (gdk_parent_root)->depth;
+  gint bits_per_pixel = 
   GdkPixmapFBData fbd;
 
   g_return_val_if_fail (drawable != NULL, NULL);
@@ -176,13 +178,14 @@ _gdk_fb_get_image (GdkDrawable *drawable,
   image->visual = gdk_drawable_get_visual (drawable);
   image->width = width;
   image->height = height;
-  image->depth = bits_per_pixel;
+  image->bits_per_pixel = GDK_DRAWABLE_IMPL_FBDATA (gdk_parent_root)->depth;
+  image->depth = image->bits_per_pixel;
 
-  if (bits_per_pixel <= 8)
+  if (image->bits_per_pixel <= 8)
     image->bpp = 1;
-  else if (bits_per_pixel <= 16)
+  else if (image->bits_per_pixel <= 16)
     image->bpp = 2;
-  else if (bits_per_pixel <= 24)
+  else if (image->bits_per_pixel <= 24)
     image->bpp = 3;
   else
     image->bpp = 4;
index 65ada9d6eac8a306904c5c920cad91fcc5d1cd00..32c05702f55bd38773232d5d0f76b63f21868933 100644 (file)
@@ -180,6 +180,7 @@ gdk_image_new_bitmap (GdkVisual *visual,
   image->bpl = bpl32;
   image->byte_order = GDK_MSB_FIRST;
 
+  image->bits_per_pixel = 1;
   image->bpp = 1;
   return(image);
 } /* gdk_image_new_bitmap() */
@@ -307,6 +308,7 @@ gdk_image_new (GdkImageType  type,
       g_warning ("gdk_image_new: depth = %d", image->depth);
       g_assert_not_reached ();
     }
+  image->bits_per_pixel = image->depth;
   image->byte_order = GDK_LSB_FIRST;
   if (image->depth == 1)
     image->bpl = ((width-1)/32 + 1)*4;
@@ -547,6 +549,7 @@ _gdk_win32_get_image (GdkDrawable *drawable,
       g_warning ("gdk_image_get: image->depth = %d", image->depth);
       g_assert_not_reached ();
     }
+  image->bits_per_pixel = image->depth;
   image->byte_order = GDK_LSB_FIRST;
   if (image->depth == 1)
     image->bpl = ((width - 1)/32 + 1)*4;
index a20a302d7262cee2fb10c637c0c03fd33f12b500..d18e8073c92bf4768683756ac7dc12a1779aecc1 100644 (file)
@@ -212,6 +212,14 @@ gdk_colormap_new (GdkVisual *visual,
 
     case GDK_VISUAL_STATIC_GRAY:
     case GDK_VISUAL_STATIC_COLOR:
+      private->private_val = FALSE;
+      private->xcolormap = XCreateColormap (private->xdisplay, gdk_root_window,
+                                           xvisual, AllocNone);
+      
+      colormap->colors = g_new (GdkColor, colormap->size);
+      gdk_colormap_sync (colormap);
+      break;
+      
     case GDK_VISUAL_TRUE_COLOR:
       private->private_val = FALSE;
       private->xcolormap = XCreateColormap (private->xdisplay, gdk_root_window,
@@ -226,7 +234,7 @@ gdk_colormap_new (GdkVisual *visual,
 
 #define MIN_SYNC_TIME 2
 
-void
+static void
 gdk_colormap_sync (GdkColormap *colormap,
                   gboolean     force)
 {
@@ -249,7 +257,7 @@ gdk_colormap_sync (GdkColormap *colormap,
   
   for (i = 0; i < colormap->size; i++)
     {
-      if (private->info[i].ref_count == 0)
+      if (!private->info || private->info[i].ref_count == 0)
        {
          xpalette[nlookup].pixel = i;
          xpalette[nlookup].red = 0;
@@ -297,16 +305,22 @@ gdk_colormap_get_system (void)
       colormap->colors = NULL;
       colormap->size = colormap->visual->colormap_size;
 
-      if ((colormap->visual->type == GDK_VISUAL_GRAYSCALE) ||
-         (colormap->visual->type == GDK_VISUAL_PSEUDO_COLOR))
+      switch (colormap->visual->type)
        {
+       case GDK_VISUAL_GRAYSCALE:
+       case GDK_VISUAL_PSEUDO_COLOR:
          private->info = g_new0 (GdkColorInfo, colormap->size);
-         colormap->colors = g_new (GdkColor, colormap->size);
-         
          private->hash = g_hash_table_new ((GHashFunc) gdk_color_hash,
                                            (GEqualFunc) gdk_color_equal);
-          
+         /* Fall through */
+       case GDK_VISUAL_STATIC_GRAY:
+       case GDK_VISUAL_STATIC_COLOR:
+         colormap->colors = g_new (GdkColor, colormap->size);
          gdk_colormap_sync (colormap, TRUE);
+         
+       case GDK_VISUAL_DIRECT_COLOR:
+       case GDK_VISUAL_TRUE_COLOR:
+         break;
        }
 
       gdk_colormap_add (colormap);
index 1eeee2297597fcfcf33b7bbfab8fedb2a2a43e14..cfdb569ca5e666e4247ba4e6aa0a589626f0b1dc 100644 (file)
@@ -155,6 +155,7 @@ gdk_image_new_bitmap(GdkVisual *visual, gpointer data, gint w, gint h)
   image->width = w;
   image->height = h;
   image->depth = 1;
+  image->bits_per_pixel = 1;
   xvisual = ((GdkVisualPrivate*) visual)->xvisual;
   private->ximage = XCreateImage(private->xdisplay, xvisual, 1, XYBitmap,
                                 0, 0, w ,h, 8, 0);
@@ -364,6 +365,7 @@ gdk_image_new (GdkImageType  type,
          image->mem = private->ximage->data;
          image->bpl = private->ximage->bytes_per_line;
          image->bpp = (private->ximage->bits_per_pixel + 7) / 8;
+         image->bits_per_pixel = private->ximage->bits_per_pixel;
        }
     }
 
@@ -415,14 +417,8 @@ _gdk_x11_get_image (GdkDrawable    *drawable,
 
   image->mem = private->ximage->data;
   image->bpl = private->ximage->bytes_per_line;
-  if (private->ximage->bits_per_pixel <= 8)
-    image->bpp = 1;
-  else if (private->ximage->bits_per_pixel <= 16)
-    image->bpp = 2;
-  else if (private->ximage->bits_per_pixel <= 24)
-    image->bpp = 3;
-  else
-    image->bpp = 4;
+  image->bits_per_pixel = private->ximage->bits_per_pixel;
+  image->bpp = (private->ximage->bits_per_pixel + 7) / 8;
   image->byte_order = private->ximage->byte_order;
 
   return image;
index 79065e6cd737dd3f5a5b10c4290c4f7d9a2665c8..b4ba3c7f0d04c0da49bd287dfd359bd712a0365e 100644 (file)
@@ -68,9 +68,9 @@ fnmatch (pattern, string, flags)
 
 /* Note that this evalutes C many times.  */
 #if !defined(G_OS_WIN32) && !defined(G_WITH_CYGWIN)
-#define FOLD(c)        ((flags & FNM_CASEFOLD) && isupper (c) ? tolower (c) : (c))
+#define FOLD(c)        ((flags & FNM_CASEFOLD) && isupper ((unsigned char )(c)) ? tolower ((unsigned char)(c)) : (c))
 #else
-#define FOLD(c)        (tolower (c))
+#define FOLD(c)        (tolower ((unsigned char)(c)))
 #endif
 
   while ((c = *p++) != '\0')