summaryrefslogtreecommitdiff
path: root/gtk/gtkwindow.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2003-10-28 15:43:43 +0000
committerOwen Taylor <otaylor@src.gnome.org>2003-10-28 15:43:43 +0000
commit097c3fe625f3a63c9a1a5cb071085fb1c8db4bc2 (patch)
tree811070dac3a2c105d2f29939b6c42cba5bfdd3c4 /gtk/gtkwindow.c
parent6ccf2d2d09ad77f736ed827f34b6695804e882fe (diff)
downloadgdk-pixbuf-097c3fe625f3a63c9a1a5cb071085fb1c8db4bc2.tar.gz
Add getters corresponding to the is_active and has_toplevel_focus
Tue Oct 28 10:34:24 2003 Owen Taylor <otaylor@redhat.com> * gtk/gtkwindow.[ch] (gtk_window_is_active, gtk_has_toplevel_focus): Add getters corresponding to the is_active and has_toplevel_focus properties. (#122531)
Diffstat (limited to 'gtk/gtkwindow.c')
-rw-r--r--gtk/gtkwindow.c70
1 files changed, 68 insertions, 2 deletions
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 36f3bbd80..35f409f51 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -6340,11 +6340,77 @@ gtk_window_check_screen (GtkWindow *window)
GdkScreen*
gtk_window_get_screen (GtkWindow *window)
{
- g_return_val_if_fail (GTK_IS_WINDOW (window), NULL);
+ g_return_val_if_fail (GTK_IS_WINDOW (window), NULL);
- return window->screen;
+ return window->screen;
+}
+
+/**
+ * gtk_window_is_active:
+ * @window: a #GtkWindow
+ *
+ * Returns whether the window is part of the current active toplevel.
+ * (That is, the toplevel window receiving keystrokes.)
+ * The return value is %TRUE if the window is active toplevel
+ * itself, but also if it is, say, a #GtkPlug embedded in the active toplevel.
+ * You might use this function if you wanted to draw a widget
+ * differently in an active window from a widget in an inactive window.
+ * See gtk_window_has_toplevel_focus()
+ *
+ * Return value: %TRUE if the window part of the current active window.
+ *
+ * Since: 2.4
+ **/
+gboolean
+gtk_window_is_active (GtkWindow *window)
+{
+ g_return_val_if_fail (GTK_IS_WINDOW (window), FALSE);
+
+ return window->is_active;
}
+/**
+ * gtk_window_has_toplevel_focus:
+ * @window: a #GtkWindow
+ *
+ * Returns whether the input focus is within this GtkWindow.
+ * For real toplevel windows, this is identical to gtk_window_is_active(),
+ * but for embedded windows, like #GtkPlug, the results will differ.
+ *
+ * Return value: %TRUE if the the input focus is within this GtkWindow
+ *
+ * Since: 2.4
+ **/
+gboolean
+gtk_window_has_toplevel_focus (GtkWindow *window)
+{
+ g_return_val_if_fail (GTK_IS_WINDOW (window), FALSE);
+
+ return window->has_toplevel_focus;
+}
+
+/**
+ * gtk_window_get_is_active:
+ * @window: a #GtkWindow
+ *
+ * Returns whether the window is part of the current active toplevel.
+ * The return value is %TRUE if the window is active toplevel
+ * itself, but also if it is a GtkPlug embedded in the active toplevel.
+ * You might use this function if you wanted to draw a widget
+ * differently in an active window from a widget in an inactive window.
+ *
+ * Return value: %TRUE if the window is the current active window.
+ *
+ * Since: 2.4
+ **/
+static gboolean
+gtk_window
+_is_active (GtkWIndow *window)
+{
+ g_return_val_if_fail (GTK_IS_WINDOW (window), FALSE);
+
+ return window->is_active;
+}
static void
gtk_window_group_class_init (GtkWindowGroupClass *klass)