[patch] gdk goes to 1 bit screens




Hello,

This is a patch for gdk that allows you to run at least most
of testgtk and gzilla (and probably a bunch of gnome apps) on
1 bit displays.  I have only tested this a limited amount, but
know this is what does not work on 1 bit displays after this 
patch:

gtkpreview, though with some comments it can be made silent to allow
            you to pop it up -- specifically the check or # of avail
            colors.
GIMP, even after the above is working, because of pixmap code for
      the toolbar (and probably lots more reasons, that's as far as
      I got today)

Some stuff is funky in gtk on B/W, but works way better then I 
thought it would considering the simplicity of this patch.

Available from 
ftp://ftp.gimp.org:/pub/gtk/patches/gtk-amundson-971122-0.patch.gz

---

*** gdkcolor.c.orig	Sat Nov 22 19:22:36 1997
--- gdkcolor.c	Sat Nov 22 19:43:17 1997
***************
*** 187,193 ****
  	  xpalette[i].blue = 0;
  	}
  
!       XQueryColors (gdk_display, private->xcolormap, xpalette, 256);
  
        for (i = 0; i < 256; i++)
  	{
--- 187,194 ----
  	  xpalette[i].blue = 0;
  	}
  
!       XQueryColors (gdk_display, private->xcolormap, xpalette, 
!                     private->visual->colormap_size);
  
        for (i = 0; i < 256; i++)
  	{

*** gdkvisual.c.orig	Sat Nov 22 19:00:56 1997
--- gdkvisual.c	Sat Nov 22 19:41:43 1997
***************
*** 55,61 ****
  void
  gdk_visual_init ()
  {
!   static gint possible_depths[5] = { 32, 24, 16, 15, 8 };
    static GdkVisualType possible_types[6] =
      {
        GDK_VISUAL_DIRECT_COLOR,
--- 55,61 ----
  void
  gdk_visual_init ()
  {
!   static gint possible_depths[6] = { 32, 24, 16, 15, 8, 1 };
    static GdkVisualType possible_types[6] =
      {
        GDK_VISUAL_DIRECT_COLOR,
***************
*** 66,72 ****
        GDK_VISUAL_STATIC_GRAY
      };
  
!   static gint npossible_depths = 5;
    static gint npossible_types = 6;
  
    XVisualInfo *visual_list;
--- 66,72 ----
        GDK_VISUAL_STATIC_GRAY
      };
  
!   static gint npossible_depths = 6;
    static gint npossible_types = 6;
  
    XVisualInfo *visual_list;
***************
*** 85,91 ****
    nvisuals = 0;
    for (i = 0; i < nxvisuals; i++)
      {
!       if (visual_list[i].depth >= 8)
  	{
  #ifdef __cplusplus
  	  switch (visual_list[i].c_class)
--- 85,91 ----
    nvisuals = 0;
    for (i = 0; i < nxvisuals; i++)
      {
!       if (visual_list[i].depth >= 1)
  	{
  #ifdef __cplusplus
  	  switch (visual_list[i].c_class)

--
Shawn T. Amundson		Complete Internet Solutions
Senior Systems Administrator	Minneapolis, Minnesota, USA
amundson@CompleteIS.com		http://www.CompleteIS.com/~amundson

while (i) { last }
    i, do exist.
    forever;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]