X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Finclude%2Fgtk%2Fgtk.in.h;h=a7f916a62539a66f0cf43a31d2e414a51924bbe1;hb=refs%2Fbuilds%2F20130116032122%2Fpspp;hp=966111d4257521bfcf47b253b77046f7897c57cc;hpb=f95002ec226b18f52773e747cae7e1d00302ad1a;p=pspp diff --git a/src/ui/gui/include/gtk/gtk.in.h b/src/ui/gui/include/gtk/gtk.in.h index 966111d425..a7f916a625 100644 --- a/src/ui/gui/include/gtk/gtk.in.h +++ b/src/ui/gui/include/gtk/gtk.in.h @@ -1,5 +1,5 @@ /* Wrapper for . - Copyright (C) 2011 Free Software Foundation, Inc. + Copyright (C) 2011, 2012 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -42,6 +42,31 @@ gtk_widget_get_realized (GtkWidget *widget) return (GTK_WIDGET_FLAGS (widget) & GTK_REALIZED) != 0; } + +/** + * gtk_widget_set_realized: + * @widget: a #GtkWidget + * @realized: %TRUE to mark the widget as realized + * + * Marks the widget as being realized. + * + * This function should only ever be called in a derived widget's + * "realize" or "unrealize" implementation. + * + * Since: 2.20 + */ +static inline void +gtk_widget_set_realized (GtkWidget *widget, + gboolean realized) +{ + g_return_if_fail (GTK_IS_WIDGET (widget)); + + if (realized) + GTK_OBJECT_FLAGS (widget) |= GTK_REALIZED; + else + GTK_OBJECT_FLAGS (widget) &= ~(GTK_REALIZED); +} + #endif /* gtk < 2.20 */ #if !GTK_CHECK_VERSION(2,20,0) @@ -62,6 +87,31 @@ gtk_widget_get_mapped (GtkWidget *widget) return (GTK_WIDGET_FLAGS (widget) & GTK_MAPPED) != 0; } + +/** + * gtk_widget_set_mapped: + * @widget: a #GtkWidget + * @mapped: %TRUE to mark the widget as mapped + * + * Marks the widget as being realized. + * + * This function should only ever be called in a derived widget's + * "map" or "unmap" implementation. + * + * Since: 2.20 + */ +static inline void +gtk_widget_set_mapped (GtkWidget *widget, + gboolean mapped) +{ + g_return_if_fail (GTK_IS_WIDGET (widget)); + + if (mapped) + GTK_OBJECT_FLAGS (widget) |= GTK_MAPPED; + else + GTK_OBJECT_FLAGS (widget) &= ~(GTK_MAPPED); +} + #endif /* gtk < 2.20 */ #if !GTK_CHECK_VERSION(2,18,0)