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)
This commit is contained in:
		@ -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)
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user