Add a new property, role, corresponding to gtk_window_[gs]et_role().

2003-03-31  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkwindow.c: Add a new property, role, corresponding to
	gtk_window_[gs]et_role().  (#93904)
This commit is contained in:
Matthias Clasen 2003-03-31 18:07:00 +00:00 committed by Matthias Clasen
parent 6db39098cc
commit 60ea9cad6f
6 changed files with 45 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2003-03-31 Matthias Clasen <maclas@gmx.de>
* gtk/gtkwindow.c: Add a new property, role, corresponding to
gtk_window_[gs]et_role(). (#93904)
Sun Mar 30 03:57:42 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtktreeselection.c (gtk_tree_selection_get_selected_rows):

View File

@ -1,3 +1,8 @@
2003-03-31 Matthias Clasen <maclas@gmx.de>
* gtk/gtkwindow.c: Add a new property, role, corresponding to
gtk_window_[gs]et_role(). (#93904)
Sun Mar 30 03:57:42 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtktreeselection.c (gtk_tree_selection_get_selected_rows):

View File

@ -1,3 +1,8 @@
2003-03-31 Matthias Clasen <maclas@gmx.de>
* gtk/gtkwindow.c: Add a new property, role, corresponding to
gtk_window_[gs]et_role(). (#93904)
Sun Mar 30 03:57:42 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtktreeselection.c (gtk_tree_selection_get_selected_rows):

View File

@ -1,3 +1,8 @@
2003-03-31 Matthias Clasen <maclas@gmx.de>
* gtk/gtkwindow.c: Add a new property, role, corresponding to
gtk_window_[gs]et_role(). (#93904)
Sun Mar 30 03:57:42 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtktreeselection.c (gtk_tree_selection_get_selected_rows):

View File

@ -1,3 +1,8 @@
2003-03-31 Matthias Clasen <maclas@gmx.de>
* gtk/gtkwindow.c: Add a new property, role, corresponding to
gtk_window_[gs]et_role(). (#93904)
Sun Mar 30 03:57:42 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtktreeselection.c (gtk_tree_selection_get_selected_rows):

View File

@ -59,6 +59,7 @@ enum {
/* Normal Props */
PROP_TITLE,
PROP_ROLE,
PROP_ALLOW_SHRINK,
PROP_ALLOW_GROW,
PROP_RESIZABLE,
@ -468,6 +469,14 @@ gtk_window_class_init (GtkWindowClass *klass)
NULL,
G_PARAM_READWRITE));
g_object_class_install_property (gobject_class,
PROP_ROLE,
g_param_spec_string ("role",
_("Window Role"),
_("Unique identifier for the window to be used when restoring a session"),
NULL,
G_PARAM_READWRITE));
g_object_class_install_property (gobject_class,
PROP_ALLOW_SHRINK,
g_param_spec_boolean ("allow_shrink",
@ -759,6 +768,9 @@ gtk_window_set_property (GObject *object,
case PROP_TITLE:
gtk_window_set_title (window, g_value_get_string (value));
break;
case PROP_ROLE:
gtk_window_set_role (window, g_value_get_string (value));
break;
case PROP_ALLOW_SHRINK:
window->allow_shrink = g_value_get_boolean (value);
gtk_widget_queue_resize (GTK_WIDGET (window));
@ -833,6 +845,9 @@ gtk_window_get_property (GObject *object,
case PROP_TYPE:
g_value_set_enum (value, window->type);
break;
case PROP_ROLE:
g_value_set_string (value, window->wm_role);
break;
case PROP_TITLE:
g_value_set_string (value, window->title);
break;
@ -1044,12 +1059,14 @@ gtk_window_set_role (GtkWindow *window,
if (role == window->wm_role)
return;
g_free (window->wm_role);
window->wm_role = g_strdup (role);
if (GTK_WIDGET_REALIZED (window))
g_warning ("gtk_window_set_role(): shouldn't set role after window is realized!\n");
gdk_window_set_role (GTK_WIDGET (window)->window, window->wm_role);
g_object_notify (G_OBJECT (window), "role");
}
/**