*/
#include <gdk/gdk.h>
-#include "gtksignal.h"
#include "gtkinvisible.h"
#include "gtkintl.h"
guint n_construct_properties,
GObjectConstructParam *construct_params);
-GObjectClass *parent_class;
+static GObjectClass *parent_class;
-GtkType
+GType
gtk_invisible_get_type (void)
{
- static GtkType invisible_type = 0;
+ static GType invisible_type = 0;
if (!invisible_type)
{
- static const GtkTypeInfo invisible_info =
+ static const GTypeInfo invisible_info =
{
- "GtkInvisible",
- sizeof (GtkInvisible),
sizeof (GtkInvisibleClass),
- (GtkClassInitFunc) gtk_invisible_class_init,
- (GtkObjectInitFunc) gtk_invisible_init,
- /* reserved_1 */ NULL,
- /* reserved_2 */ NULL,
- (GtkClassInitFunc) NULL,
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) gtk_invisible_class_init,
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (GtkInvisible),
+ 0, /* n_preallocs */
+ (GInstanceInitFunc) gtk_invisible_init,
};
- invisible_type = gtk_type_unique (GTK_TYPE_WIDGET, &invisible_info);
+ invisible_type = g_type_register_static (GTK_TYPE_WIDGET, "GtkInvisible",
+ &invisible_info, 0);
}
return invisible_type;
GTK_WIDGET_UNSET_FLAGS (invisible, GTK_NO_WINDOW);
GTK_WIDGET_SET_FLAGS (invisible, GTK_TOPLEVEL);
- gtk_widget_ref (GTK_WIDGET (invisible));
+ g_object_ref (invisible);
gtk_object_sink (GTK_OBJECT (invisible));
invisible->has_user_ref_count = TRUE;
if (invisible->has_user_ref_count)
{
invisible->has_user_ref_count = FALSE;
- gtk_widget_unref (GTK_WIDGET (invisible));
+ g_object_unref (invisible);
}
}
* Creates a new #GtkInvisible object for a specified screen
*
* Return value: a newly created #GtkInvisible object
+ *
+ * Since: 2.2
**/
GtkWidget*
gtk_invisible_new_for_screen (GdkScreen *screen)
* @screen: a #GdkScreen.
*
* Sets the #GdkScreen where the #GtkInvisible object will be displayed.
+ *
+ * Since: 2.2
**/
void
gtk_invisible_set_screen (GtkInvisible *invisible,
GdkScreen *screen)
{
+ GtkWidget *widget;
+ GdkScreen *previous_screen;
gboolean was_realized;
g_return_if_fail (GTK_IS_INVISIBLE (invisible));
if (screen == invisible->screen)
return;
+ widget = GTK_WIDGET (invisible);
+
+ previous_screen = invisible->screen;
was_realized = GTK_WIDGET_REALIZED (invisible);
if (was_realized)
- gtk_widget_unrealize (GTK_WIDGET (invisible));
+ gtk_widget_unrealize (widget);
invisible->screen = screen;
+ if (screen != previous_screen)
+ _gtk_widget_propagate_screen_changed (widget, previous_screen);
g_object_notify (G_OBJECT (invisible), "screen");
if (was_realized)
- gtk_widget_realize (GTK_WIDGET (invisible));
+ gtk_widget_realize (widget);
}
/**
*
* Returns the #GdkScreen object associated with @invisible
*
- * Return value : the associated #GdkScreen.
+ * Return value: the associated #GdkScreen.
+ *
+ * Since: 2.2
**/
GdkScreen *
gtk_invisible_get_screen (GtkInvisible *invisible)