diff options
author | Tim Janik <timj@gtk.org> | 1998-12-16 06:03:14 +0000 |
---|---|---|
committer | Tim Janik <timj@src.gnome.org> | 1998-12-16 06:03:14 +0000 |
commit | 017dfc9e4ee30ef271b5392a5f45d37ab0ad2e87 (patch) | |
tree | 92e3c52ac9d7e59bbeaf8687d2d2c37c1eaba2c6 | |
parent | 2c9c7efb2349e145f9af38677d54c4d818c069b0 (diff) | |
download | gdk-pixbuf-017dfc9e4ee30ef271b5392a5f45d37ab0ad2e87.tar.gz |
version bump to 1.1.8, binary age 0, interface age 0, depend on GLib
Wed Dec 16 05:26:32 1998 Tim Janik <timj@gtk.org>
* configure.in: version bump to 1.1.8, binary age 0, interface age 0,
depend on GLib 1.1.8.
* gdk/gdkprivate.h:
* gdk/gdkglobals.c: removed last Gdk threads specific bits.
* gtk/gtkmain.c (gtk_init): s/g_thread_supported/g_thread_supported()/.
* gtk/gtkprivate.h: changed GTK_THREADS_ENTER and GTK_THREADS_LEAVE
to function macros GTK_THREADS_ENTER() and GTK_THREADS_LEAVE().
honour G_THREADS_ENABLED in the definition of GTK_THREADS_ENTER()
and GTK_THREADS_LEAVE(). changed callers accordingly.
-rw-r--r-- | gtk/Makefile.am | 8 | ||||
-rw-r--r-- | gtk/gtkaccellabel.c | 4 | ||||
-rw-r--r-- | gtk/gtkclist.c | 8 | ||||
-rw-r--r-- | gtk/gtkcolorsel.c | 6 | ||||
-rw-r--r-- | gtk/gtkcombo.c | 4 | ||||
-rw-r--r-- | gtk/gtkcontainer.c | 4 | ||||
-rw-r--r-- | gtk/gtkdnd.c | 6 | ||||
-rw-r--r-- | gtk/gtkentry.c | 4 | ||||
-rw-r--r-- | gtk/gtklist.c | 8 | ||||
-rw-r--r-- | gtk/gtkmain.c | 33 | ||||
-rw-r--r-- | gtk/gtkmenuitem.c | 4 | ||||
-rw-r--r-- | gtk/gtknotebook.c | 4 | ||||
-rw-r--r-- | gtk/gtkprivate.h | 22 | ||||
-rw-r--r-- | gtk/gtkrange.c | 6 | ||||
-rw-r--r-- | gtk/gtkselection.c | 8 | ||||
-rw-r--r-- | gtk/gtkspinbutton.c | 4 | ||||
-rw-r--r-- | gtk/gtktext.c | 4 | ||||
-rw-r--r-- | gtk/gtktooltips.c | 6 | ||||
-rw-r--r-- | gtk/gtkwidget.c | 33 | ||||
-rw-r--r-- | gtk/gtkwidget.h | 8 | ||||
-rw-r--r-- | gtk/gtkwindow.c | 4 |
21 files changed, 115 insertions, 73 deletions
diff --git a/gtk/Makefile.am b/gtk/Makefile.am index 29b2768ad..628f7dabe 100644 --- a/gtk/Makefile.am +++ b/gtk/Makefile.am @@ -295,7 +295,13 @@ stamp-m: @REBUILD@ gtkmarshal.list genmarshal.pl && echo timestamp > stamp-m libgtk_la_LDFLAGS = \ - -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) -release $(LT_RELEASE) + -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) -release $(LT_RELEASE) \ + @GLIB_LIBS@ \ + @x_ldflags@ \ + @x_libs@ \ + -lm +# $(top_builddir)/gdk/libgdk.la + # We create a dummy theme for the default GTK+ theme diff --git a/gtk/gtkaccellabel.c b/gtk/gtkaccellabel.c index bf24190ec..407e283f2 100644 --- a/gtk/gtkaccellabel.c +++ b/gtk/gtkaccellabel.c @@ -354,9 +354,9 @@ gtk_accel_label_refetch_idle (GtkAccelLabel *accel_label) { gboolean retval; - GTK_THREADS_ENTER; + GTK_THREADS_ENTER (); retval = gtk_accel_label_refetch (accel_label); - GTK_THREADS_LEAVE; + GTK_THREADS_LEAVE (); return retval; } diff --git a/gtk/gtkclist.c b/gtk/gtkclist.c index 8b6b92c56..718eaec82 100644 --- a/gtk/gtkclist.c +++ b/gtk/gtkclist.c @@ -7014,7 +7014,7 @@ horizontal_timeout (GtkCList *clist) GdkEventMotion event; GdkModifierType mask; - GTK_THREADS_ENTER; + GTK_THREADS_ENTER (); clist->htimer = 0; gdk_window_get_pointer (clist->clist_window, &x, &y, &mask); @@ -7026,7 +7026,7 @@ horizontal_timeout (GtkCList *clist) gtk_clist_motion (GTK_WIDGET (clist), &event); - GTK_THREADS_LEAVE; + GTK_THREADS_LEAVE (); return FALSE; } @@ -7038,7 +7038,7 @@ vertical_timeout (GtkCList *clist) GdkEventMotion event; GdkModifierType mask; - GTK_THREADS_ENTER; + GTK_THREADS_ENTER (); clist->vtimer = 0; gdk_window_get_pointer (clist->clist_window, &x, &y, &mask); @@ -7050,7 +7050,7 @@ vertical_timeout (GtkCList *clist) gtk_clist_motion (GTK_WIDGET (clist), &event); - GTK_THREADS_LEAVE; + GTK_THREADS_LEAVE (); return FALSE; } diff --git a/gtk/gtkcolorsel.c b/gtk/gtkcolorsel.c index e33790127..23a621a27 100644 --- a/gtk/gtkcolorsel.c +++ b/gtk/gtkcolorsel.c @@ -864,7 +864,7 @@ gtk_color_selection_drag_begin (GtkWidget *widget, GdkColor bg; window = gtk_window_new(GTK_WINDOW_POPUP); - GTK_WIDGET_SET_FLAGS (window, GTK_USER_DRAW); + gtk_widget_set_app_paintable (GTK_WIDGET (window), TRUE); gtk_widget_set_usize (window, 48, 32); gtk_widget_realize (window); @@ -1028,13 +1028,13 @@ gtk_color_selection_value_timeout (GtkColorSelection *colorsel) { gint x, y; - GTK_THREADS_ENTER; + GTK_THREADS_ENTER (); gdk_window_get_pointer (colorsel->value_area->window, &x, &y, NULL); gtk_color_selection_update_value (colorsel, y); gtk_color_selection_color_changed (colorsel); - GTK_THREADS_LEAVE; + GTK_THREADS_LEAVE (); return (TRUE); } diff --git a/gtk/gtkcombo.c b/gtk/gtkcombo.c index dceffd2f9..c9302b43e 100644 --- a/gtk/gtkcombo.c +++ b/gtk/gtkcombo.c @@ -237,9 +237,9 @@ gtk_combo_focus_idle (GtkCombo * combo) { if (combo) { - GTK_THREADS_ENTER; + GTK_THREADS_ENTER (); gtk_widget_grab_focus (combo->entry); - GTK_THREADS_LEAVE; + GTK_THREADS_LEAVE (); } return FALSE; } diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c index bbb3953a1..31eb7816d 100644 --- a/gtk/gtkcontainer.c +++ b/gtk/gtkcontainer.c @@ -811,7 +811,7 @@ gtk_container_get_resize_container (GtkContainer *container) static gboolean gtk_container_idle_sizer (gpointer data) { - GTK_THREADS_ENTER; + GTK_THREADS_ENTER (); /* we may be invoked with a container_resize_queue of NULL, because * queue_resize could have been adding an extra idle function while @@ -833,7 +833,7 @@ gtk_container_idle_sizer (gpointer data) gtk_container_check_resize (GTK_CONTAINER (widget)); } - GTK_THREADS_LEAVE; + GTK_THREADS_LEAVE (); return FALSE; } diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c index 2ca778dd3..9dcb375c7 100644 --- a/gtk/gtkdnd.c +++ b/gtk/gtkdnd.c @@ -1756,7 +1756,7 @@ gtk_drag_set_icon_pixmap (GdkDragContext *context, gtk_widget_push_colormap (colormap); window = gtk_window_new (GTK_WINDOW_POPUP); - GTK_WIDGET_SET_FLAGS (window, GTK_USER_DRAW); + gtk_widget_set_app_paintable (GTK_WIDGET (window), TRUE); gtk_widget_pop_visual (); gtk_widget_pop_colormap (); @@ -2272,7 +2272,7 @@ gtk_drag_anim_timeout (gpointer data) gint x, y; gboolean retval; - GTK_THREADS_ENTER; + GTK_THREADS_ENTER (); if (anim->step == anim->n_steps) { @@ -2295,7 +2295,7 @@ gtk_drag_anim_timeout (gpointer data) retval = TRUE; } - GTK_THREADS_LEAVE; + GTK_THREADS_LEAVE (); return retval; } diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index c77b15632..39a01313b 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -1481,13 +1481,13 @@ gtk_entry_timer (gpointer data) { GtkEntry *entry; - GTK_THREADS_ENTER; + GTK_THREADS_ENTER (); entry = GTK_ENTRY (data); entry->timer = 0; gtk_entry_draw_text (entry); - GTK_THREADS_LEAVE; + GTK_THREADS_LEAVE (); return FALSE; } diff --git a/gtk/gtklist.c b/gtk/gtklist.c index ce004f3e8..32856d73a 100644 --- a/gtk/gtklist.c +++ b/gtk/gtklist.c @@ -2309,7 +2309,7 @@ gtk_list_horizontal_timeout (GtkWidget *list) GdkEventMotion event; GdkModifierType mask; - GTK_THREADS_ENTER; + GTK_THREADS_ENTER (); GTK_LIST (list)->htimer = 0; gdk_window_get_pointer (list->window, &x, &y, &mask); @@ -2321,7 +2321,7 @@ gtk_list_horizontal_timeout (GtkWidget *list) gtk_list_motion_notify (list, &event); - GTK_THREADS_LEAVE; + GTK_THREADS_LEAVE (); return FALSE; } @@ -2334,7 +2334,7 @@ gtk_list_vertical_timeout (GtkWidget *list) GdkEventMotion event; GdkModifierType mask; - GTK_THREADS_ENTER; + GTK_THREADS_ENTER (); GTK_LIST (list)->vtimer = 0; gdk_window_get_pointer (list->window, &x, &y, &mask); @@ -2346,7 +2346,7 @@ gtk_list_vertical_timeout (GtkWidget *list) gtk_list_motion_notify (list, &event); - GTK_THREADS_LEAVE; + GTK_THREADS_LEAVE (); return FALSE; } diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c index ce7f2fa73..949aab3c4 100644 --- a/gtk/gtkmain.c +++ b/gtk/gtkmain.c @@ -43,8 +43,6 @@ #include "gtkdebug.h" #include "gtkintl.h" -extern gboolean gdk_using_threads; - /* Private type definitions */ typedef struct _GtkInitFunction GtkInitFunction; @@ -187,9 +185,9 @@ gtk_init (int *argc, * single threaded until gtk_init(). */ - if (g_thread_supported) + if (g_thread_supported ()) gtk_threads_mutex = g_mutex_new (); - + #if 0 g_set_error_handler (gtk_error); g_set_warning_handler (gtk_warning); @@ -461,9 +459,9 @@ gtk_main (void) loop = g_main_new (); main_loops = g_slist_prepend (main_loops, loop); - GTK_THREADS_LEAVE; + GTK_THREADS_LEAVE (); g_main_run (loop); - GTK_THREADS_ENTER; + GTK_THREADS_ENTER (); g_main_destroy (loop); @@ -1075,12 +1073,12 @@ gtk_idle_remove_by_data (gpointer data) } guint -gtk_input_add_full (gint source, - GdkInputCondition condition, - GdkInputFunction function, - GtkCallbackMarshal marshal, - gpointer data, - GtkDestroyNotify destroy) +gtk_input_add_full (gint source, + GdkInputCondition condition, + GdkInputFunction function, + GtkCallbackMarshal marshal, + gpointer data, + GtkDestroyNotify destroy) { if (marshal) { @@ -1111,6 +1109,7 @@ static void gtk_destroy_closure (gpointer data) { GtkClosure *closure = data; + if (closure->destroy) (closure->destroy) (closure->data); g_free (closure); @@ -1131,8 +1130,8 @@ gtk_invoke_idle_timeout (gpointer data) } static void -gtk_invoke_input (gpointer data, - gint source, +gtk_invoke_input (gpointer data, + gint source, GdkInputCondition condition) { GtkClosure *closure = data; @@ -1150,7 +1149,7 @@ gtk_invoke_input (gpointer data, closure->marshal (NULL, closure->data, 2, args); } -GdkEvent * +GdkEvent* gtk_get_current_event (void) { if (current_events) @@ -1252,13 +1251,13 @@ gtk_propagate_event (GtkWidget *widget, void gtk_threads_enter () { - GTK_THREADS_ENTER; + GTK_THREADS_ENTER (); } void gtk_threads_leave () { - GTK_THREADS_LEAVE; + GTK_THREADS_LEAVE (); } #if 0 diff --git a/gtk/gtkmenuitem.c b/gtk/gtkmenuitem.c index bfafefc03..1af6d8e17 100644 --- a/gtk/gtkmenuitem.c +++ b/gtk/gtkmenuitem.c @@ -621,7 +621,7 @@ gtk_menu_item_select_timeout (gpointer data) { GtkMenuItem *menu_item; - GTK_THREADS_ENTER; + GTK_THREADS_ENTER (); menu_item = GTK_MENU_ITEM (data); menu_item->timer = 0; @@ -644,7 +644,7 @@ gtk_menu_item_select_timeout (gpointer data) gtk_menu_shell_select_item (submenu, submenu->children->data); } - GTK_THREADS_LEAVE; + GTK_THREADS_LEAVE (); return FALSE; } diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index eace09ef8..f8f30549d 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -1837,7 +1837,7 @@ gtk_notebook_timer (GtkNotebook *notebook) { gboolean retval = FALSE; - GTK_THREADS_ENTER; + GTK_THREADS_ENTER (); if (notebook->timer) { @@ -1866,7 +1866,7 @@ gtk_notebook_timer (GtkNotebook *notebook) retval = TRUE; } - GTK_THREADS_LEAVE; + GTK_THREADS_LEAVE (); return retval; } diff --git a/gtk/gtkprivate.h b/gtk/gtkprivate.h index 17a7b3f87..9c22b1019 100644 --- a/gtk/gtkprivate.h +++ b/gtk/gtkprivate.h @@ -64,14 +64,20 @@ typedef enum extern GMutex *gtk_threads_mutex; -#define GTK_THREADS_ENTER G_STMT_START { \ - if (gtk_threads_mutex) \ - g_mutex_lock (gtk_threads_mutex); \ - } G_STMT_END -#define GTK_THREADS_LEAVE G_STMT_START { \ - if (gtk_threads_mutex) \ - g_mutex_unlock (gtk_threads_mutex); \ - } G_STMT_END +#ifdef G_THREADS_ENABLED +# define GTK_THREADS_ENTER() G_STMT_START { \ + if (gtk_threads_mutex) \ + g_mutex_lock (gtk_threads_mutex); \ + } G_STMT_END +# define GTK_THREADS_LEAVE() G_STMT_START { \ + if (gtk_threads_mutex) \ + g_mutex_unlock (gtk_threads_mutex); \ + } G_STMT_END +#else /* !G_THREADS_ENABLED */ +# define GTK_THREADS_ENTER() +# define GTK_THREADS_LEAVE() +#endif /* !G_THREADS_ENABLED */ + #ifdef __cplusplus } diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c index 485c58f7e..e75d7046a 100644 --- a/gtk/gtkrange.c +++ b/gtk/gtkrange.c @@ -1237,7 +1237,7 @@ gtk_real_range_timer (GtkRange *range) { gint return_val; - GTK_THREADS_ENTER; + GTK_THREADS_ENTER (); return_val = TRUE; if (range->click_child == RANGE_CLASS (range)->slider) @@ -1259,7 +1259,7 @@ gtk_real_range_timer (GtkRange *range) (gpointer) range); else { - GTK_THREADS_LEAVE; + GTK_THREADS_LEAVE (); return FALSE; } range->need_timer = FALSE; @@ -1287,7 +1287,7 @@ gtk_real_range_timer (GtkRange *range) return_val = gtk_range_scroll (range, -1); } - GTK_THREADS_LEAVE; + GTK_THREADS_LEAVE (); return return_val; } diff --git a/gtk/gtkselection.c b/gtk/gtkselection.c index 0b4ea6fa4..06cb5ceac 100644 --- a/gtk/gtkselection.c +++ b/gtk/gtkselection.c @@ -1092,7 +1092,7 @@ gtk_selection_incr_timeout (GtkIncrInfo *info) GList *tmp_list; gboolean retval; - GTK_THREADS_ENTER; + GTK_THREADS_ENTER (); /* Determine if retrieval has finished by checking if it still in list of pending retrievals */ @@ -1129,7 +1129,7 @@ gtk_selection_incr_timeout (GtkIncrInfo *info) retval = TRUE; /* timeout will happen again */ } - GTK_THREADS_LEAVE; + GTK_THREADS_LEAVE (); return retval; } @@ -1334,7 +1334,7 @@ gtk_selection_retrieval_timeout (GtkRetrievalInfo *info) GList *tmp_list; gboolean retval; - GTK_THREADS_ENTER; + GTK_THREADS_ENTER (); /* Determine if retrieval has finished by checking if it still in list of pending retrievals */ @@ -1369,7 +1369,7 @@ gtk_selection_retrieval_timeout (GtkRetrievalInfo *info) retval = TRUE; /* timeout will happen again */ } - GTK_THREADS_LEAVE; + GTK_THREADS_LEAVE (); return retval; } diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c index 58f69d616..d3d4ef6b8 100644 --- a/gtk/gtkspinbutton.c +++ b/gtk/gtkspinbutton.c @@ -910,7 +910,7 @@ gtk_spin_button_timer (GtkSpinButton *spin_button) { gboolean retval = FALSE; - GTK_THREADS_ENTER; + GTK_THREADS_ENTER (); if (spin_button->timer) { @@ -943,7 +943,7 @@ gtk_spin_button_timer (GtkSpinButton *spin_button) } } - GTK_THREADS_LEAVE; + GTK_THREADS_LEAVE (); return retval; } diff --git a/gtk/gtktext.c b/gtk/gtktext.c index 79a208a42..0a629e0b1 100644 --- a/gtk/gtktext.c +++ b/gtk/gtktext.c @@ -1701,7 +1701,7 @@ gtk_text_scroll_timeout (gpointer data) gint x, y; GdkModifierType mask; - GTK_THREADS_ENTER; + GTK_THREADS_ENTER (); text = GTK_TEXT (data); @@ -1718,7 +1718,7 @@ gtk_text_scroll_timeout (gpointer data) gtk_text_motion_notify (GTK_WIDGET (text), &event); } - GTK_THREADS_LEAVE; + GTK_THREADS_LEAVE (); return FALSE; } diff --git a/gtk/gtktooltips.c b/gtk/gtktooltips.c index eeef326ca..41bb12d71 100644 --- a/gtk/gtktooltips.c +++ b/gtk/gtktooltips.c @@ -176,7 +176,7 @@ gtk_tooltips_force_window (GtkTooltips *tooltips) if (!tooltips->tip_window) { tooltips->tip_window = gtk_window_new (GTK_WINDOW_POPUP); - GTK_WIDGET_SET_FLAGS (tooltips->tip_window, GTK_USER_DRAW); + gtk_widget_set_app_paintable (tooltips->tip_window, TRUE); gtk_window_set_policy (GTK_WINDOW (tooltips->tip_window), FALSE, FALSE, TRUE); gtk_signal_connect_object (GTK_OBJECT (tooltips->tip_window), @@ -495,13 +495,13 @@ gtk_tooltips_timeout (gpointer data) { GtkTooltips *tooltips = (GtkTooltips *) data; - GTK_THREADS_ENTER; + GTK_THREADS_ENTER (); if (tooltips->active_tips_data != NULL && GTK_WIDGET_DRAWABLE (tooltips->active_tips_data->widget)) gtk_tooltips_draw_tips (tooltips); - GTK_THREADS_LEAVE; + GTK_THREADS_LEAVE (); return FALSE; } diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index 4df977577..449beed6e 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -102,6 +102,7 @@ enum { ARG_HEIGHT, ARG_VISIBLE, ARG_SENSITIVE, + ARG_APP_PAINTABLE, ARG_CAN_FOCUS, ARG_HAS_FOCUS, ARG_CAN_DEFAULT, @@ -270,6 +271,7 @@ gtk_widget_class_init (GtkWidgetClass *klass) gtk_object_add_arg_type ("GtkWidget::height", GTK_TYPE_INT, GTK_ARG_READWRITE, ARG_HEIGHT); gtk_object_add_arg_type ("GtkWidget::visible", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_VISIBLE); gtk_object_add_arg_type ("GtkWidget::sensitive", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_SENSITIVE); + gtk_object_add_arg_type ("GtkWidget::app_paintable", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_APP_PAINTABLE); gtk_object_add_arg_type ("GtkWidget::can_focus", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_CAN_FOCUS); gtk_object_add_arg_type ("GtkWidget::has_focus", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_HAS_FOCUS); gtk_object_add_arg_type ("GtkWidget::can_default", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_CAN_DEFAULT); @@ -807,6 +809,9 @@ gtk_widget_set_arg (GtkObject *object, case ARG_SENSITIVE: gtk_widget_set_sensitive (widget, GTK_VALUE_BOOL (*arg)); break; + case ARG_APP_PAINTABLE: + gtk_widget_set_app_paintable (widget, GTK_VALUE_BOOL (*arg)); + break; case ARG_CAN_FOCUS: saved_flags = GTK_WIDGET_FLAGS (widget); if (GTK_VALUE_BOOL (*arg)) @@ -920,6 +925,9 @@ gtk_widget_get_arg (GtkObject *object, case ARG_SENSITIVE: GTK_VALUE_BOOL (*arg) = (GTK_WIDGET_SENSITIVE (widget) != FALSE); break; + case ARG_APP_PAINTABLE: + GTK_VALUE_BOOL (*arg) = (GTK_WIDGET_APP_PAINTABLE (widget) != FALSE); + break; case ARG_CAN_FOCUS: GTK_VALUE_BOOL (*arg) = (GTK_WIDGET_CAN_FOCUS (widget) != FALSE); break; @@ -1950,7 +1958,7 @@ gtk_widget_idle_draw (gpointer data) GSList *draw_data_list; GtkWidget *widget; - GTK_THREADS_ENTER; + GTK_THREADS_ENTER (); /* Translate all draw requests to be allocation-relative */ widget_list = gtk_widget_redraw_queue; @@ -2133,7 +2141,7 @@ gtk_widget_idle_draw (gpointer data) g_slist_free (gtk_widget_redraw_queue); gtk_widget_redraw_queue = NULL; - GTK_THREADS_LEAVE; + GTK_THREADS_LEAVE (); return FALSE; } @@ -3041,6 +3049,27 @@ gtk_widget_set_state (GtkWidget *widget, } } +void +gtk_widget_set_app_paintable (GtkWidget *widget, + gboolean app_paintable) +{ + g_return_if_fail (widget != NULL); + g_return_if_fail (GTK_IS_WIDGET (widget)); + + app_paintable = (app_paintable != FALSE); + + if (GTK_WIDGET_APP_PAINTABLE (widget) != app_paintable) + { + if (app_paintable) + GTK_WIDGET_SET_FLAGS (widget, GTK_APP_PAINTABLE); + else + GTK_WIDGET_UNSET_FLAGS (widget, GTK_APP_PAINTABLE); + + if (GTK_WIDGET_DRAWABLE (widget)) + gtk_widget_queue_clear (widget); + } +} + /***************************************** * gtk_widget_set_sensitive: * diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h index 34db356f9..3706d1801 100644 --- a/gtk/gtkwidget.h +++ b/gtk/gtkwidget.h @@ -51,7 +51,7 @@ typedef enum GTK_RC_STYLE = 1 << 16, GTK_COMPOSITE_CHILD = 1 << 17, GTK_NO_REPARENT = 1 << 18, - GTK_USER_DRAW = 1 << 19 + GTK_APP_PAINTABLE = 1 << 19 } GtkWidgetFlags; /* Macro for casting a pointer to a GtkWidget or GtkWidgetClass pointer. @@ -89,7 +89,7 @@ typedef enum #define GTK_WIDGET_HAS_GRAB(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_HAS_GRAB) != 0) #define GTK_WIDGET_RC_STYLE(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_RC_STYLE) != 0) #define GTK_WIDGET_COMPOSITE_CHILD(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_COMPOSITE_CHILD) != 0) -#define GTK_WIDGET_USER_DRAW(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_USER_DRAW) != 0) +#define GTK_WIDGET_APP_PAINTABLE(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_APP_PAINTABLE) != 0) /* Macros for setting and clearing widget flags. */ @@ -499,7 +499,9 @@ gchar* gtk_widget_get_name (GtkWidget *widget); void gtk_widget_set_state (GtkWidget *widget, GtkStateType state); void gtk_widget_set_sensitive (GtkWidget *widget, - gint sensitive); + gboolean sensitive); +void gtk_widget_set_app_paintable (GtkWidget *widget, + gboolean app_paintable); void gtk_widget_set_parent (GtkWidget *widget, GtkWidget *parent); void gtk_widget_set_parent_window (GtkWidget *widget, diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index c61e934d1..b4c29219a 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -1634,7 +1634,7 @@ gtk_window_expose (GtkWidget *widget, g_return_val_if_fail (GTK_IS_WINDOW (widget), FALSE); g_return_val_if_fail (event != NULL, FALSE); - if (!GTK_WIDGET_USER_DRAW (widget)) + if (!GTK_WIDGET_APP_PAINTABLE (widget)) gtk_window_paint (widget, &event->area); if (GTK_WIDGET_CLASS (parent_class)->expose_event) @@ -1647,7 +1647,7 @@ static void gtk_window_draw (GtkWidget *widget, GdkRectangle *area) { - if (!GTK_WIDGET_USER_DRAW (widget)) + if (!GTK_WIDGET_APP_PAINTABLE (widget)) gtk_window_paint (widget, area); if (GTK_WIDGET_CLASS (parent_class)->draw) |