Commit 8f601762 authored by Michael Natterer's avatar Michael Natterer 😴

Add API for some sealed widget flags

- gtk_widget_has_focus() for GTK_WIDGET_HAS_FOCUS()
- gtk_widget_get_sensitive() for GTK_WIDGET_SENSITIVE()
- gtk_widget_is_sensitive() for GTK_WIDGET_IS_SENSITIVE()
parent 66ae394e
......@@ -4978,6 +4978,7 @@ gtk_widget_get_parent_window
gtk_widget_get_pointer
gtk_widget_get_root_window
gtk_widget_get_screen
gtk_widget_get_sensitive
gtk_widget_get_settings
gtk_widget_get_size_request
gtk_widget_get_snapshot
......@@ -4990,6 +4991,7 @@ gtk_widget_get_type G_GNUC_CONST
gtk_widget_get_visual
gtk_widget_grab_default
gtk_widget_grab_focus
gtk_widget_has_focus
gtk_widget_has_screen
gtk_widget_hide
gtk_widget_hide_all
......@@ -4997,6 +4999,7 @@ gtk_widget_hide_on_delete
gtk_widget_intersect
gtk_widget_is_ancestor
gtk_widget_is_focus
gtk_widget_is_sensitive
gtk_widget_keynav_failed
gtk_widget_list_accel_closures
gtk_widget_list_mnemonic_labels
......
......@@ -5258,6 +5258,26 @@ gtk_widget_real_keynav_failed (GtkWidget *widget,
return TRUE;
}
/**
* gtk_widget_has_focus:
* @widget: a #GtkWidget
*
* Determines if the widget has the global input focus. See
* gtk_widget_is_focus() for the difference between having the global
* input focus, and only having the focus within a toplevel.
*
* Return value: %TRUE if the widget has the global input focus.
*
* Since: 2.18
**/
gboolean
gtk_widget_has_focus (GtkWidget *widget)
{
g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
return GTK_WIDGET_HAS_FOCUS (widget);
}
/**
* gtk_widget_is_focus:
* @widget: a #GtkWidget
......@@ -5566,6 +5586,42 @@ gtk_widget_set_sensitive (GtkWidget *widget,
g_object_notify (G_OBJECT (widget), "sensitive");
}
/**
* gtk_widget_get_sensitive:
* @widget: a #GtkWidget
*
* Returns: %TRUE if the widget is sensitive (in the sense of returning
* the value that has been set using gtk_widget_set_sensitive()). The
* effective sensitivity of a widget is however determined by both its
* own and its parent widget's sensitivity. See gtk_widget_is_sensitive().
*
* Since: 2.18
**/
gboolean
gtk_widget_get_sensitive (GtkWidget *widget)
{
g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
return GTK_WIDGET_SENSITIVE (widget);
}
/**
* gtk_widget_is_sensitive:
* @widget: a #GtkWidget
*
* Returns: %TRUE if the widget is effectively sensitive, which means
* it is sensitive itself and also its parent widget is sensntive
*
* Since: 2.18
**/
gboolean
gtk_widget_is_sensitive (GtkWidget *widget)
{
g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
return GTK_WIDGET_IS_SENSITIVE (widget);
}
/**
* gtk_widget_set_parent:
* @widget: a #GtkWidget
......
......@@ -548,6 +548,7 @@ void gtk_widget_child_notify (GtkWidget *widget,
const gchar *child_property);
void gtk_widget_thaw_child_notify (GtkWidget *widget);
gboolean gtk_widget_has_focus (GtkWidget *widget);
gboolean gtk_widget_is_focus (GtkWidget *widget);
void gtk_widget_grab_focus (GtkWidget *widget);
void gtk_widget_grab_default (GtkWidget *widget);
......@@ -557,8 +558,12 @@ void gtk_widget_set_name (GtkWidget *widget,
G_CONST_RETURN gchar* gtk_widget_get_name (GtkWidget *widget);
void gtk_widget_set_state (GtkWidget *widget,
GtkStateType state);
void gtk_widget_set_sensitive (GtkWidget *widget,
gboolean sensitive);
gboolean gtk_widget_get_sensitive (GtkWidget *widget);
gboolean gtk_widget_is_sensitive (GtkWidget *widget);
void gtk_widget_set_app_paintable (GtkWidget *widget,
gboolean app_paintable);
void gtk_widget_set_double_buffered (GtkWidget *widget,
......
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