Commit 097c3fe6 authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor

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)
parent 6ccf2d2d
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)
Tue Oct 28 10:18:55 2003 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_is_active):
2003-10-28 Mark McLoughlin <mark@skynet.ie>
* gtk/gtkexpander.c:
......
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)
Tue Oct 28 10:18:55 2003 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_is_active):
2003-10-28 Mark McLoughlin <mark@skynet.ie>
* gtk/gtkexpander.c:
......
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)
Tue Oct 28 10:18:55 2003 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_is_active):
2003-10-28 Mark McLoughlin <mark@skynet.ie>
* gtk/gtkexpander.c:
......
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)
Tue Oct 28 10:18:55 2003 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_is_active):
2003-10-28 Mark McLoughlin <mark@skynet.ie>
* gtk/gtkexpander.c:
......
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)
Tue Oct 28 10:18:55 2003 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_is_active):
2003-10-28 Mark McLoughlin <mark@skynet.ie>
* gtk/gtkexpander.c:
......
......@@ -4335,6 +4335,8 @@ gtk_window_set_transient_for
gtk_window_set_destroy_with_parent
gtk_window_set_screen
gtk_window_get_screen
gtk_window_is_active
gtk_window_has_toplevel_focus
gtk_window_list_toplevels
gtk_window_add_mnemonic
gtk_window_remove_mnemonic
......
......@@ -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)
......
......@@ -225,6 +225,11 @@ void gtk_window_set_screen (GtkWindow *window,
GdkScreen *screen);
GdkScreen* gtk_window_get_screen (GtkWindow *window);
gboolean gtk_window_is_active (GtkWindow *window);
gboolean gtk_window_has_toplevel_focus (GtkWindow *window);
/* gtk_window_set_has_frame () must be called before realizing the window_*/
void gtk_window_set_has_frame (GtkWindow *window,
gboolean setting);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment