+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
+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
+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
+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
+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
+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
+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
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);
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);
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);
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) {
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) {
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) {
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;
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)
{
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;
{
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;
}
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)
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;
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);
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);
{
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);
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;
image->bpl = bpl32;
image->byte_order = GDK_MSB_FIRST;
+ image->bits_per_pixel = 1;
image->bpp = 1;
return(image);
} /* gdk_image_new_bitmap() */
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;
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;
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,
#define MIN_SYNC_TIME 2
-void
+static void
gdk_colormap_sync (GdkColormap *colormap,
gboolean force)
{
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;
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);
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);
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;
}
}
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;
/* 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')