summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtkcolorsel.c5
-rw-r--r--gtk/gtkcolorseldialog.c4
-rw-r--r--gtk/gtkdnd.c2
-rw-r--r--gtk/gtkgc.c1
-rw-r--r--gtk/gtklayout.c1
-rw-r--r--gtk/gtklayout.h1
-rw-r--r--gtk/gtkwidget.c110
-rw-r--r--gtk/gtkwidget.h6
-rw-r--r--gtk/testgtk.c10
-rw-r--r--gtk/testrgb.c5
10 files changed, 14 insertions, 131 deletions
diff --git a/gtk/gtkcolorsel.c b/gtk/gtkcolorsel.c
index 26d34078e8..61f28f8e9d 100644
--- a/gtk/gtkcolorsel.c
+++ b/gtk/gtkcolorsel.c
@@ -488,9 +488,6 @@ color_sample_new (GtkColorSelection *colorsel)
priv = colorsel->private_data;
- gtk_widget_push_visual(gdk_rgb_get_visual());
- gtk_widget_push_colormap(gdk_rgb_get_cmap());
-
priv->sample_area = gtk_hbox_new (FALSE, 0);
priv->old_sample = gtk_drawing_area_new ();
priv->cur_sample = gtk_drawing_area_new ();
@@ -499,8 +496,6 @@ color_sample_new (GtkColorSelection *colorsel)
TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (priv->sample_area), priv->cur_sample,
TRUE, TRUE, 0);
- gtk_widget_pop_visual();
- gtk_widget_pop_colormap();
gtk_signal_connect(GTK_OBJECT (priv->old_sample), "expose_event",
GTK_SIGNAL_FUNC (color_old_sample_expose),
diff --git a/gtk/gtkcolorseldialog.c b/gtk/gtkcolorseldialog.c
index d1fd6480ae..92f1280cad 100644
--- a/gtk/gtkcolorseldialog.c
+++ b/gtk/gtkcolorseldialog.c
@@ -81,10 +81,7 @@ gtk_color_selection_dialog_init (GtkColorSelectionDialog *colorseldiag)
{
GtkWidget *action_area_button_box, *frame;
- gtk_widget_set_visual (GTK_WIDGET (colorseldiag), gdk_rgb_get_visual ());
gtk_widget_set_colormap (GTK_WIDGET (colorseldiag), gdk_rgb_get_cmap ());
-
- gtk_widget_push_visual (gdk_rgb_get_visual ());
gtk_widget_push_colormap (gdk_rgb_get_cmap ());
frame = gtk_frame_new (NULL);
@@ -122,7 +119,6 @@ gtk_color_selection_dialog_init (GtkColorSelectionDialog *colorseldiag)
gtk_widget_show (colorseldiag->help_button);
gtk_widget_pop_colormap ();
- gtk_widget_pop_visual ();
}
GtkWidget*
diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c
index 0cd1bf863c..5f21feff8f 100644
--- a/gtk/gtkdnd.c
+++ b/gtk/gtkdnd.c
@@ -1993,14 +1993,12 @@ gtk_drag_set_icon_pixmap (GdkDragContext *context,
gdk_window_get_size (pixmap, &width, &height);
- gtk_widget_push_visual (gdk_colormap_get_visual (colormap));
gtk_widget_push_colormap (colormap);
window = gtk_window_new (GTK_WINDOW_POPUP);
gtk_widget_set_events (window, GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK);
gtk_widget_set_app_paintable (GTK_WIDGET (window), TRUE);
- gtk_widget_pop_visual ();
gtk_widget_pop_colormap ();
gtk_widget_set_usize (window, width, height);
diff --git a/gtk/gtkgc.c b/gtk/gtkgc.c
index 8692240251..d001c39dac 100644
--- a/gtk/gtkgc.c
+++ b/gtk/gtkgc.c
@@ -157,6 +157,7 @@ gtk_gc_new (gpointer key)
}
gc = gdk_gc_new_with_values (drawable->drawable, &keyval->values, keyval->mask);
+ gdk_gc_set_colormap (gc, keyval->colormap);
return (gpointer) gc;
}
diff --git a/gtk/gtklayout.c b/gtk/gtklayout.c
index 499ea186d2..f824519412 100644
--- a/gtk/gtklayout.c
+++ b/gtk/gtklayout.c
@@ -417,7 +417,6 @@ gtk_layout_init (GtkLayout *layout)
layout->bin_window = NULL;
- layout->configure_serial = 0;
layout->scroll_x = 0;
layout->scroll_y = 0;
layout->visibility = GDK_VISIBILITY_PARTIAL;
diff --git a/gtk/gtklayout.h b/gtk/gtklayout.h
index 0cf7a12e4a..95a3382381 100644
--- a/gtk/gtklayout.h
+++ b/gtk/gtklayout.h
@@ -68,7 +68,6 @@ struct _GtkLayout {
GdkWindow *bin_window;
GdkVisibilityState visibility;
- gulong configure_serial;
gint scroll_x;
gint scroll_y;
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index e67d3297c5..d85872d39e 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -188,11 +188,9 @@ static guint widget_signals[LAST_SIGNAL] = { 0 };
static GMemChunk *aux_info_mem_chunk = NULL;
static GdkColormap *default_colormap = NULL;
-static GdkVisual *default_visual = NULL;
static GtkStyle *gtk_default_style = NULL;
static GSList *colormap_stack = NULL;
-static GSList *visual_stack = NULL;
static GSList *style_stack = NULL;
static guint composite_child_stack = 0;
@@ -208,7 +206,6 @@ static const gchar *saved_default_style_key = "gtk-saved-default-style";
static guint saved_default_style_key_id = 0;
static const gchar *shape_info_key = "gtk-shape-info";
static const gchar *colormap_key = "gtk-colormap";
-static const gchar *visual_key = "gtk-visual";
static const gchar *rc_style_key = "gtk-rc-style";
static guint rc_style_key_id = 0;
@@ -1005,7 +1002,6 @@ static void
gtk_widget_init (GtkWidget *widget)
{
GdkColormap *colormap;
- GdkVisual *visual;
GTK_PRIVATE_FLAGS (widget) = 0;
widget->state = GTK_STATE_NORMAL;
@@ -1030,13 +1026,9 @@ gtk_widget_init (GtkWidget *widget)
gtk_style_ref (widget->style);
colormap = gtk_widget_peek_colormap ();
- visual = gtk_widget_peek_visual ();
if (colormap != gtk_widget_get_default_colormap ())
gtk_widget_set_colormap (widget, colormap);
-
- if (visual != gtk_widget_get_default_visual ())
- gtk_widget_set_visual (widget, visual);
}
/*****************************************
@@ -3585,24 +3577,9 @@ gtk_widget_get_colormap (GtkWidget *widget)
GdkVisual*
gtk_widget_get_visual (GtkWidget *widget)
{
- GdkVisual *visual;
-
- g_return_val_if_fail (widget != NULL, NULL);
g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
-
- if (widget->window)
- {
- visual = gdk_window_get_visual (widget->window);
- /* If window was destroyed previously, we'll get NULL here */
- if (visual)
- return visual;
- }
-
- visual = gtk_object_get_data (GTK_OBJECT (widget), visual_key);
- if (visual)
- return visual;
- return gtk_widget_get_default_visual ();
+ return gdk_colormap_get_visual (gtk_widget_get_colormap (widget));
}
/*****************************************
@@ -3634,31 +3611,6 @@ gtk_widget_set_colormap (GtkWidget *widget, GdkColormap *colormap)
}
/*****************************************
- * gtk_widget_set_visual:
- * Set the colormap for the widget to the given
- * value. Widget must not have been previously
- * realized. This probably should only be used
- * from an init() function.
- * arguments:
- * widget:
- * visual:
- * results:
- *****************************************/
-
-void
-gtk_widget_set_visual (GtkWidget *widget, GdkVisual *visual)
-{
- g_return_if_fail (widget != NULL);
- g_return_if_fail (GTK_IS_WIDGET (widget));
- g_return_if_fail (!GTK_WIDGET_REALIZED (widget));
- g_return_if_fail (visual != NULL);
-
- gtk_object_set_data (GTK_OBJECT (widget),
- visual_key,
- visual);
-}
-
-/*****************************************
* gtk_widget_get_events:
*
* arguments:
@@ -3828,22 +3780,6 @@ gtk_widget_push_colormap (GdkColormap *cmap)
}
/*****************************************
- * gtk_widget_push_visual:
- *
- * arguments:
- *
- * results:
- *****************************************/
-
-void
-gtk_widget_push_visual (GdkVisual *visual)
-{
- g_return_if_fail (visual != NULL);
-
- visual_stack = g_slist_prepend (visual_stack, visual);
-}
-
-/*****************************************
* gtk_widget_pop_colormap:
*
* arguments:
@@ -3865,27 +3801,6 @@ gtk_widget_pop_colormap (void)
}
/*****************************************
- * gtk_widget_pop_visual:
- *
- * arguments:
- *
- * results:
- *****************************************/
-
-void
-gtk_widget_pop_visual (void)
-{
- GSList *tmp;
-
- if (visual_stack)
- {
- tmp = visual_stack;
- visual_stack = visual_stack->next;
- g_slist_free_1 (tmp);
- }
-}
-
-/*****************************************
* gtk_widget_set_default_colormap:
*
* arguments:
@@ -3907,20 +3822,6 @@ gtk_widget_set_default_colormap (GdkColormap *colormap)
}
/*****************************************
- * gtk_widget_set_default_visual:
- *
- * arguments:
- *
- * results:
- *****************************************/
-
-void
-gtk_widget_set_default_visual (GdkVisual *visual)
-{
- default_visual = visual;
-}
-
-/*****************************************
* gtk_widget_get_default_colormap:
*
* arguments:
@@ -3948,10 +3849,7 @@ gtk_widget_get_default_colormap (void)
GdkVisual*
gtk_widget_get_default_visual (void)
{
- if (!default_visual)
- default_visual = gdk_visual_get_system ();
-
- return default_visual;
+ return gdk_colormap_get_visual (gtk_widget_get_default_colormap ());
}
/**
@@ -4304,9 +4202,7 @@ gtk_widget_peek_colormap (void)
static GdkVisual*
gtk_widget_peek_visual (void)
{
- if (visual_stack)
- return (GdkVisual*) visual_stack->data;
- return gtk_widget_get_default_visual ();
+ return gdk_colormap_get_visual (gtk_widget_peek_colormap ());
}
static void
diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h
index 8fae055e30..ee2dbd4a72 100644
--- a/gtk/gtkwidget.h
+++ b/gtk/gtkwidget.h
@@ -548,9 +548,6 @@ GdkVisual* gtk_widget_get_visual (GtkWidget *widget);
*/
void gtk_widget_set_colormap (GtkWidget *widget,
GdkColormap *colormap);
-void gtk_widget_set_visual (GtkWidget *widget,
- GdkVisual *visual);
-
gint gtk_widget_get_events (GtkWidget *widget);
void gtk_widget_get_pointer (GtkWidget *widget,
@@ -595,18 +592,15 @@ void gtk_widget_reset_rc_styles (GtkWidget *widget);
*/
void gtk_widget_push_style (GtkStyle *style);
void gtk_widget_push_colormap (GdkColormap *cmap);
-void gtk_widget_push_visual (GdkVisual *visual);
void gtk_widget_push_composite_child (void);
void gtk_widget_pop_composite_child (void);
void gtk_widget_pop_style (void);
void gtk_widget_pop_colormap (void);
-void gtk_widget_pop_visual (void);
/* Set certain default values to be used at widget creation time.
*/
void gtk_widget_set_default_style (GtkStyle *style);
void gtk_widget_set_default_colormap (GdkColormap *colormap);
-void gtk_widget_set_default_visual (GdkVisual *visual);
GtkStyle* gtk_widget_get_default_style (void);
GdkColormap* gtk_widget_get_default_colormap (void);
GdkVisual* gtk_widget_get_default_visual (void);
diff --git a/gtk/testgtk.c b/gtk/testgtk.c
index 4c8fd24e5a..d16a659a25 100644
--- a/gtk/testgtk.c
+++ b/gtk/testgtk.c
@@ -7437,11 +7437,9 @@ create_color_preview (void)
if (!window)
{
- gtk_widget_push_visual (gdk_rgb_get_visual ());
gtk_widget_push_colormap (gdk_rgb_get_cmap ());
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_widget_pop_colormap ();
- gtk_widget_pop_visual ();
gtk_signal_connect (GTK_OBJECT (window), "destroy",
GTK_SIGNAL_FUNC(color_preview_destroy),
@@ -8647,6 +8645,13 @@ create_main_window (void)
gtk_widget_show_all (window);
}
+void
+pixbuf_init ()
+{
+ if (file_exists ("../gdk-pixbuf/.libs/libpixbufloader-pnm.so"))
+ putenv ("GDK_PIXBUF_MODULEDIR=../gdk-pixbuf/.libs");
+}
+
int
main (int argc, char *argv[])
{
@@ -8654,6 +8659,7 @@ main (int argc, char *argv[])
srand (time (NULL));
+ pixbuf_init ();
gtk_set_locale ();
/* Check to see if we are being run from the correct
diff --git a/gtk/testrgb.c b/gtk/testrgb.c
index c629598bee..3721a6cd64 100644
--- a/gtk/testrgb.c
+++ b/gtk/testrgb.c
@@ -46,8 +46,8 @@ quit_func (GtkWidget *widget, gpointer dummy)
gtk_main_quit ();
}
-#define WIDTH 320
-#define HEIGHT 200
+#define WIDTH 640
+#define HEIGHT 400
#define NUM_ITERS 100
static void
@@ -284,7 +284,6 @@ main (int argc, char **argv)
gdk_rgb_init ();
gtk_widget_set_default_colormap (gdk_rgb_get_cmap ());
- gtk_widget_set_default_visual (gdk_rgb_get_visual ());
new_testrgb_window ();
gtk_main ();