Add properties decorated and gravity. (#80234)

2003-07-18  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkwindow.c: Add properties decorated and gravity.  (#80234)
This commit is contained in:
Matthias Clasen 2003-07-18 22:00:20 +00:00 committed by Matthias Clasen
parent eaae0a6b61
commit 7fa902f60b
6 changed files with 61 additions and 3 deletions

View File

@ -1,5 +1,7 @@
2003-07-18 Matthias Clasen <maclas@gmx.de> 2003-07-18 Matthias Clasen <maclas@gmx.de>
* gtk/gtkwindow.c: Add properties decorated and gravity. (#80234)
* gtk/gtktextview.c (gtk_text_view_class_init): Add a new keybinding signal, move_viewport. * gtk/gtktextview.c (gtk_text_view_class_init): Add a new keybinding signal, move_viewport.
(gtk_text_view_move_viewport): New function which implements the move_viewport functionality. (gtk_text_view_move_viewport): New function which implements the move_viewport functionality.
(gtk_text_view_move_cursor_internal): If the cursor is not visible, move the viewport. (#78669) (gtk_text_view_move_cursor_internal): If the cursor is not visible, move the viewport. (#78669)

View File

@ -1,5 +1,7 @@
2003-07-18 Matthias Clasen <maclas@gmx.de> 2003-07-18 Matthias Clasen <maclas@gmx.de>
* gtk/gtkwindow.c: Add properties decorated and gravity. (#80234)
* gtk/gtktextview.c (gtk_text_view_class_init): Add a new keybinding signal, move_viewport. * gtk/gtktextview.c (gtk_text_view_class_init): Add a new keybinding signal, move_viewport.
(gtk_text_view_move_viewport): New function which implements the move_viewport functionality. (gtk_text_view_move_viewport): New function which implements the move_viewport functionality.
(gtk_text_view_move_cursor_internal): If the cursor is not visible, move the viewport. (#78669) (gtk_text_view_move_cursor_internal): If the cursor is not visible, move the viewport. (#78669)

View File

@ -1,5 +1,7 @@
2003-07-18 Matthias Clasen <maclas@gmx.de> 2003-07-18 Matthias Clasen <maclas@gmx.de>
* gtk/gtkwindow.c: Add properties decorated and gravity. (#80234)
* gtk/gtktextview.c (gtk_text_view_class_init): Add a new keybinding signal, move_viewport. * gtk/gtktextview.c (gtk_text_view_class_init): Add a new keybinding signal, move_viewport.
(gtk_text_view_move_viewport): New function which implements the move_viewport functionality. (gtk_text_view_move_viewport): New function which implements the move_viewport functionality.
(gtk_text_view_move_cursor_internal): If the cursor is not visible, move the viewport. (#78669) (gtk_text_view_move_cursor_internal): If the cursor is not visible, move the viewport. (#78669)

View File

@ -1,5 +1,7 @@
2003-07-18 Matthias Clasen <maclas@gmx.de> 2003-07-18 Matthias Clasen <maclas@gmx.de>
* gtk/gtkwindow.c: Add properties decorated and gravity. (#80234)
* gtk/gtktextview.c (gtk_text_view_class_init): Add a new keybinding signal, move_viewport. * gtk/gtktextview.c (gtk_text_view_class_init): Add a new keybinding signal, move_viewport.
(gtk_text_view_move_viewport): New function which implements the move_viewport functionality. (gtk_text_view_move_viewport): New function which implements the move_viewport functionality.
(gtk_text_view_move_cursor_internal): If the cursor is not visible, move the viewport. (#78669) (gtk_text_view_move_cursor_internal): If the cursor is not visible, move the viewport. (#78669)

View File

@ -1,5 +1,7 @@
2003-07-18 Matthias Clasen <maclas@gmx.de> 2003-07-18 Matthias Clasen <maclas@gmx.de>
* gtk/gtkwindow.c: Add properties decorated and gravity. (#80234)
* gtk/gtktextview.c (gtk_text_view_class_init): Add a new keybinding signal, move_viewport. * gtk/gtktextview.c (gtk_text_view_class_init): Add a new keybinding signal, move_viewport.
(gtk_text_view_move_viewport): New function which implements the move_viewport functionality. (gtk_text_view_move_viewport): New function which implements the move_viewport functionality.
(gtk_text_view_move_cursor_internal): If the cursor is not visible, move the viewport. (#78669) (gtk_text_view_move_cursor_internal): If the cursor is not visible, move the viewport. (#78669)

View File

@ -73,6 +73,8 @@ enum {
PROP_TYPE_HINT, PROP_TYPE_HINT,
PROP_SKIP_TASKBAR_HINT, PROP_SKIP_TASKBAR_HINT,
PROP_SKIP_PAGER_HINT, PROP_SKIP_PAGER_HINT,
PROP_DECORATED,
PROP_GRAVITY,
/* Readonly properties */ /* Readonly properties */
PROP_IS_ACTIVE, PROP_IS_ACTIVE,
@ -459,7 +461,6 @@ gtk_window_class_init (GtkWindowClass *klass)
GTK_TYPE_WINDOW_TYPE, GTK_TYPE_WINDOW_TYPE,
GTK_WINDOW_TOPLEVEL, GTK_WINDOW_TOPLEVEL,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
/* Regular Props */ /* Regular Props */
g_object_class_install_property (gobject_class, g_object_class_install_property (gobject_class,
PROP_TITLE, PROP_TITLE,
@ -604,6 +605,38 @@ gtk_window_class_init (GtkWindowClass *klass)
FALSE, FALSE,
G_PARAM_READWRITE)); G_PARAM_READWRITE));
/**
* GtkWindow:decorated:
*
* Whether the window should be decorated by the window manager.
*
* Since: 2.4
*/
g_object_class_install_property (gobject_class,
PROP_DECORATED,
g_param_spec_boolean ("decorated",
_("Decorated"),
_("Whether the window should be decorated by the window manager"),
TRUE,
G_PARAM_READWRITE));
/**
* GtkWindow:gravity:
*
* The window gravity of the window. See gtk_window_move() and #GdkGravity for
* more details about window gravity.
*
* Since: 2.4
*/
g_object_class_install_property (gobject_class,
PROP_GRAVITY,
g_param_spec_enum ("gravity",
_("Gravity"),
_("The window gravity of the window"),
GDK_TYPE_GRAVITY,
GDK_GRAVITY_NORTH_WEST,
G_PARAM_READWRITE));
window_signals[SET_FOCUS] = window_signals[SET_FOCUS] =
g_signal_new ("set_focus", g_signal_new ("set_focus",
G_TYPE_FROM_CLASS (gobject_class), G_TYPE_FROM_CLASS (gobject_class),
@ -823,7 +856,12 @@ gtk_window_set_property (GObject *object,
gtk_window_set_skip_pager_hint (window, gtk_window_set_skip_pager_hint (window,
g_value_get_boolean (value)); g_value_get_boolean (value));
break; break;
case PROP_DECORATED:
gtk_window_set_decorated (window, g_value_get_boolean (value));
break;
case PROP_GRAVITY:
gtk_window_set_gravity (window, g_value_get_enum (value));
break;
default: default:
break; break;
} }
@ -907,6 +945,12 @@ gtk_window_get_property (GObject *object,
g_value_set_boolean (value, g_value_set_boolean (value,
gtk_window_get_skip_pager_hint (window)); gtk_window_get_skip_pager_hint (window));
break; break;
case PROP_DECORATED:
g_value_set_boolean (value, gtk_window_get_decorated (window));
break;
case PROP_GRAVITY:
g_value_set_enum (value, gtk_window_get_gravity (window));
break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break; break;
@ -2223,6 +2267,8 @@ gtk_window_set_decorated (GtkWindow *window,
gdk_window_set_decorations (GTK_WIDGET (window)->window, gdk_window_set_decorations (GTK_WIDGET (window)->window,
0); 0);
} }
g_object_notify (G_OBJECT (window), "decorated");
} }
/** /**
@ -5455,7 +5501,7 @@ gtk_window_expose (GtkWidget *widget,
* If this function is called on a window with setting of %TRUE, before * If this function is called on a window with setting of %TRUE, before
* it is realized or showed, it will have a "frame" window around * it is realized or showed, it will have a "frame" window around
* @window->window, accessible in @window->frame. Using the signal * @window->window, accessible in @window->frame. Using the signal
* frame_event you can recieve all events targeted at the frame. * frame_event you can receive all events targeted at the frame.
* *
* This function is used by the linux-fb port to implement managed * This function is used by the linux-fb port to implement managed
* windows, but it could concievably be used by X-programs that * windows, but it could concievably be used by X-programs that
@ -5959,6 +6005,8 @@ gtk_window_set_gravity (GtkWindow *window,
/* gtk_window_move_resize() will adapt gravity /* gtk_window_move_resize() will adapt gravity
*/ */
gtk_widget_queue_resize (GTK_WIDGET (window)); gtk_widget_queue_resize (GTK_WIDGET (window));
g_object_notify (G_OBJECT (window), "gravity");
} }
} }