forked from AuroraMiddleware/gtk
Rename gtk_activatable_reset to gtk_activatable_sync_action_properties,
* gtk/gtk.symbols: * gtk/gtkactivatable.[hc]: Rename gtk_activatable_reset to gtk_activatable_sync_action_properties, since the previous name was deemed too generic. Update all implementations. svn path=/trunk/; revision=22389
This commit is contained in:
parent
005f5773df
commit
e6f6ee193d
@ -1,3 +1,10 @@
|
|||||||
|
2009-02-22 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
* gtk/gtk.symbols:
|
||||||
|
* gtk/gtkactivatable.[hc]: Rename gtk_activatable_reset to
|
||||||
|
gtk_activatable_sync_action_properties, since the previous name
|
||||||
|
was deemed too generic. Update all implementations.
|
||||||
|
|
||||||
2009-02-19 Ray Strode <rstrode@redhat.com>
|
2009-02-19 Ray Strode <rstrode@redhat.com>
|
||||||
|
|
||||||
* gdk/x11/gdkscreen-x11.c
|
* gdk/x11/gdkscreen-x11.c
|
||||||
|
@ -236,7 +236,7 @@ GtkActivatableIface
|
|||||||
gtk_activatable_do_set_related_action
|
gtk_activatable_do_set_related_action
|
||||||
gtk_activatable_get_related_action
|
gtk_activatable_get_related_action
|
||||||
gtk_activatable_get_use_action_appearance
|
gtk_activatable_get_use_action_appearance
|
||||||
gtk_activatable_reset
|
gtk_activatable_sync_action_properties
|
||||||
gtk_activatable_set_related_action
|
gtk_activatable_set_related_action
|
||||||
gtk_activatable_set_use_action_appearance
|
gtk_activatable_set_use_action_appearance
|
||||||
<SUBSECTION Standard>
|
<SUBSECTION Standard>
|
||||||
|
@ -234,7 +234,7 @@ gtk_activatable_do_set_related_action
|
|||||||
gtk_activatable_get_related_action
|
gtk_activatable_get_related_action
|
||||||
gtk_activatable_get_type G_GNUC_CONST
|
gtk_activatable_get_type G_GNUC_CONST
|
||||||
gtk_activatable_get_use_action_appearance
|
gtk_activatable_get_use_action_appearance
|
||||||
gtk_activatable_reset
|
gtk_activatable_sync_action_properties
|
||||||
gtk_activatable_set_related_action
|
gtk_activatable_set_related_action
|
||||||
gtk_activatable_set_use_action_appearance
|
gtk_activatable_set_use_action_appearance
|
||||||
#endif
|
#endif
|
||||||
|
@ -23,29 +23,30 @@
|
|||||||
*
|
*
|
||||||
* Activatable widgets can be connected to a #GtkAction and reflects
|
* Activatable widgets can be connected to a #GtkAction and reflects
|
||||||
* the state of its action. A #GtkActivatable can also provide feedback
|
* the state of its action. A #GtkActivatable can also provide feedback
|
||||||
* through its action, as they are responsible for activating their
|
* through its action, as they are responsible for activating their
|
||||||
* related actions.
|
* related actions.
|
||||||
*
|
*
|
||||||
* <refsect2>
|
* <refsect2>
|
||||||
* <title>Implementing GtkActivatable</title>
|
* <title>Implementing GtkActivatable</title>
|
||||||
* <para>
|
* <para>
|
||||||
* When extending a class that is already #GtkActivatable; it is only
|
* When extending a class that is already #GtkActivatable; it is only
|
||||||
* necessary to implement the #GtkActivatable->reset() and #GtkActivatable->update()
|
* necessary to implement the #GtkActivatable->sync_action_properties()
|
||||||
* methods and chain up to the parent implementation, however when introducing
|
* and #GtkActivatable->update() methods and chain up to the parent
|
||||||
|
* implementation, however when introducing
|
||||||
* a new #GtkActivatable class; the #GtkActivatable:related-action and
|
* a new #GtkActivatable class; the #GtkActivatable:related-action and
|
||||||
* #GtkActivatable:use-action-appearance properties need to be handled by
|
* #GtkActivatable:use-action-appearance properties need to be handled by
|
||||||
* the implementor. Handling these properties is mostly a matter of installing
|
* the implementor. Handling these properties is mostly a matter of installing
|
||||||
* the action pointer and boolean flag on your instance, and calling
|
* the action pointer and boolean flag on your instance, and calling
|
||||||
* gtk_activatable_do_set_related_action() and gtk_activatable_reset() at the
|
* gtk_activatable_do_set_related_action() and
|
||||||
* appropriate times.
|
* gtk_activatable_sync_action_properties() at the appropriate times.
|
||||||
* </para>
|
* </para>
|
||||||
* <example>
|
* <example>
|
||||||
* <title>A class fragment implementing #GtkActivatable</title>
|
* <title>A class fragment implementing #GtkActivatable</title>
|
||||||
* <programlisting><![CDATA[
|
* <programlisting><![CDATA[
|
||||||
*
|
*
|
||||||
* enum {
|
* enum {
|
||||||
* ...
|
* ...
|
||||||
*
|
*
|
||||||
* PROP_ACTIVATABLE_RELATED_ACTION,
|
* PROP_ACTIVATABLE_RELATED_ACTION,
|
||||||
* PROP_ACTIVATABLE_USE_ACTION_APPEARANCE
|
* PROP_ACTIVATABLE_USE_ACTION_APPEARANCE
|
||||||
* }
|
* }
|
||||||
@ -61,33 +62,33 @@
|
|||||||
*
|
*
|
||||||
* ...
|
* ...
|
||||||
*
|
*
|
||||||
* static void foo_bar_activatable_interface_init (GtkActivatableIface *iface);
|
* static void foo_bar_activatable_interface_init (GtkActivatableIface *iface);
|
||||||
* static void foo_bar_activatable_update (GtkActivatable *activatable,
|
* static void foo_bar_activatable_update (GtkActivatable *activatable,
|
||||||
* GtkAction *action,
|
* GtkAction *action,
|
||||||
* const gchar *property_name);
|
* const gchar *property_name);
|
||||||
* static void foo_bar_activatable_reset (GtkActivatable *activatable,
|
* static void foo_bar_activatable_sync_action_properties (GtkActivatable *activatable,
|
||||||
* GtkAction *action);
|
* GtkAction *action);
|
||||||
* ...
|
* ...
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* static void
|
* static void
|
||||||
* foo_bar_class_init (FooBarClass *klass)
|
* foo_bar_class_init (FooBarClass *klass)
|
||||||
* {
|
* {
|
||||||
*
|
*
|
||||||
* ...
|
* ...
|
||||||
*
|
*
|
||||||
* g_object_class_override_property (gobject_class, PROP_ACTIVATABLE_RELATED_ACTION, "related-action");
|
* g_object_class_override_property (gobject_class, PROP_ACTIVATABLE_RELATED_ACTION, "related-action");
|
||||||
* g_object_class_override_property (gobject_class, PROP_ACTIVATABLE_USE_ACTION_APPEARANCE, "use-action-appearance");
|
* g_object_class_override_property (gobject_class, PROP_ACTIVATABLE_USE_ACTION_APPEARANCE, "use-action-appearance");
|
||||||
*
|
*
|
||||||
* ...
|
* ...
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* static void
|
* static void
|
||||||
* foo_bar_activatable_interface_init (GtkActivatableIface *iface)
|
* foo_bar_activatable_interface_init (GtkActivatableIface *iface)
|
||||||
* {
|
* {
|
||||||
* iface->update = foo_bar_activatable_update;
|
* iface->update = foo_bar_activatable_update;
|
||||||
* iface->reset = foo_bar_activatable_reset;
|
* iface->sync_action_properties = foo_bar_activatable_sync_action_properties;
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* ... Break the reference using gtk_activatable_do_set_related_action()...
|
* ... Break the reference using gtk_activatable_do_set_related_action()...
|
||||||
@ -173,7 +174,7 @@
|
|||||||
* {
|
* {
|
||||||
* priv->use_action_appearance = use_appearance;
|
* priv->use_action_appearance = use_appearance;
|
||||||
*
|
*
|
||||||
* gtk_activatable_reset (GTK_ACTIVATABLE (bar), priv->action);
|
* gtk_activatable_sync_action_properties (GTK_ACTIVATABLE (bar), priv->action);
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
@ -195,9 +196,9 @@
|
|||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* ... Selectively reset and update activatable depending on the use-action-appearance property ...
|
* ... Selectively reset and update activatable depending on the use-action-appearance property ...
|
||||||
* static void
|
* static void
|
||||||
* gtk_button_activatable_reset (GtkActivatable *activatable,
|
* gtk_button_activatable_sync_action_properties (GtkActivatable *activatable,
|
||||||
* GtkAction *action)
|
* GtkAction *action)
|
||||||
* {
|
* {
|
||||||
* GtkButtonPrivate *priv = GTK_BUTTON_GET_PRIVATE (activatable);
|
* GtkButtonPrivate *priv = GTK_BUTTON_GET_PRIVATE (activatable);
|
||||||
*
|
*
|
||||||
@ -227,8 +228,8 @@
|
|||||||
*
|
*
|
||||||
* static void
|
* static void
|
||||||
* foo_bar_activatable_update (GtkActivatable *activatable,
|
* foo_bar_activatable_update (GtkActivatable *activatable,
|
||||||
* GtkAction *action,
|
* GtkAction *action,
|
||||||
* const gchar *property_name)
|
* const gchar *property_name)
|
||||||
* {
|
* {
|
||||||
* FooBarPrivate *priv = FOO_BAR_GET_PRIVATE (activatable);
|
* FooBarPrivate *priv = FOO_BAR_GET_PRIVATE (activatable);
|
||||||
*
|
*
|
||||||
@ -316,7 +317,8 @@ gtk_activatable_class_init (gpointer g_iface)
|
|||||||
* should be ignored by the #GtkActivatable when this property is %FALSE.
|
* should be ignored by the #GtkActivatable when this property is %FALSE.
|
||||||
*
|
*
|
||||||
* <note><para>#GtkActivatable implementors need to handle this property
|
* <note><para>#GtkActivatable implementors need to handle this property
|
||||||
* and call gtk_activatable_reset() on the activatable widget when it changes.</para></note>
|
* and call gtk_activatable_sync_action_properties() on the activatable
|
||||||
|
* widget when it changes.</para></note>
|
||||||
*
|
*
|
||||||
* Since: 2.16
|
* Since: 2.16
|
||||||
*/
|
*/
|
||||||
@ -348,29 +350,30 @@ gtk_activatable_update (GtkActivatable *activatable,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gtk_activatable_reset:
|
* gtk_activatable_sync_action_properties:
|
||||||
* @activatable: a #GtkActivatable
|
* @activatable: a #GtkActivatable
|
||||||
* @action: the related #GtkAction or %NULL
|
* @action: the related #GtkAction or %NULL
|
||||||
*
|
*
|
||||||
* This is called to update the activatable completely, this is called internally when
|
* This is called to update the activatable completely, this is called
|
||||||
* the #GtkActivatable::related-action property is set or unset and by the implementing
|
* internally when the #GtkActivatable::related-action property is set
|
||||||
* class when #GtkActivatable::use-action-appearance changes.
|
* or unset and by the implementing class when
|
||||||
|
* #GtkActivatable::use-action-appearance changes.
|
||||||
*
|
*
|
||||||
* Since: 2.16
|
* Since: 2.16
|
||||||
**/
|
**/
|
||||||
void
|
void
|
||||||
gtk_activatable_reset (GtkActivatable *activatable,
|
gtk_activatable_sync_action_properties (GtkActivatable *activatable,
|
||||||
GtkAction *action)
|
GtkAction *action)
|
||||||
{
|
{
|
||||||
GtkActivatableIface *iface;
|
GtkActivatableIface *iface;
|
||||||
|
|
||||||
g_return_if_fail (GTK_IS_ACTIVATABLE (activatable));
|
g_return_if_fail (GTK_IS_ACTIVATABLE (activatable));
|
||||||
|
|
||||||
iface = GTK_ACTIVATABLE_GET_IFACE (activatable);
|
iface = GTK_ACTIVATABLE_GET_IFACE (activatable);
|
||||||
if (iface->reset)
|
if (iface->sync_action_properties)
|
||||||
iface->reset (activatable, action);
|
iface->sync_action_properties (activatable, action);
|
||||||
else
|
else
|
||||||
g_critical ("GtkActivatable->reset() unimplemented for type %s",
|
g_critical ("GtkActivatable->sync_action_properties() unimplemented for type %s",
|
||||||
g_type_name (G_OBJECT_TYPE (activatable)));
|
g_type_name (G_OBJECT_TYPE (activatable)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -450,16 +453,16 @@ gtk_activatable_do_set_related_action (GtkActivatable *activatable,
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* We don't want prev_action to be activated
|
* We don't want prev_action to be activated
|
||||||
* during the reset() call when syncing "active".
|
* during the sync_action_properties() call when syncing "active".
|
||||||
*/
|
*/
|
||||||
gtk_action_block_activate (prev_action);
|
gtk_action_block_activate (prev_action);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Some applications rely on their proxy UI to be set up
|
/* Some applications rely on their proxy UI to be set up
|
||||||
* before they receive the ::connect-proxy signal, so we
|
* before they receive the ::connect-proxy signal, so we
|
||||||
* need to call reset() before add_to_proxy_list().
|
* need to call sync_action_properties() before add_to_proxy_list().
|
||||||
*/
|
*/
|
||||||
gtk_activatable_reset (activatable, action);
|
gtk_activatable_sync_action_properties (activatable, action);
|
||||||
|
|
||||||
if (prev_action)
|
if (prev_action)
|
||||||
{
|
{
|
||||||
@ -470,9 +473,9 @@ gtk_activatable_do_set_related_action (GtkActivatable *activatable,
|
|||||||
if (action)
|
if (action)
|
||||||
{
|
{
|
||||||
g_object_ref (action);
|
g_object_ref (action);
|
||||||
|
|
||||||
g_signal_connect (G_OBJECT (action), "notify", G_CALLBACK (gtk_activatable_action_notify), activatable);
|
g_signal_connect (G_OBJECT (action), "notify", G_CALLBACK (gtk_activatable_action_notify), activatable);
|
||||||
|
|
||||||
_gtk_action_add_to_proxy_list (action, GTK_WIDGET (activatable));
|
_gtk_action_add_to_proxy_list (action, GTK_WIDGET (activatable));
|
||||||
|
|
||||||
g_object_set_data (activatable, "gtk-action", action);
|
g_object_set_data (activatable, "gtk-action", action);
|
||||||
@ -511,17 +514,19 @@ gtk_activatable_get_related_action (GtkActivatable *activatable)
|
|||||||
* @activatable: a #GtkActivatable
|
* @activatable: a #GtkActivatable
|
||||||
* @use_appearance: whether to use the actions appearance
|
* @use_appearance: whether to use the actions appearance
|
||||||
*
|
*
|
||||||
* Sets whether this activatable should reset its layout and appearance
|
* Sets whether this activatable should reset its layout and appearance
|
||||||
* when setting the related action or when the action changes appearance
|
* when setting the related action or when the action changes appearance
|
||||||
*
|
*
|
||||||
* <note><para>#GtkActivatable implementors need to handle the #GtkActivatable:use-action-appearance
|
* <note><para>#GtkActivatable implementors need to handle the
|
||||||
* property and call gtk_activatable_reset() to update @activatable if needed.</para></note>
|
* #GtkActivatable:use-action-appearance property and call
|
||||||
|
* gtk_activatable_sync_action_properties() to update @activatable
|
||||||
|
* if needed.</para></note>
|
||||||
*
|
*
|
||||||
* Since: 2.16
|
* Since: 2.16
|
||||||
**/
|
**/
|
||||||
void
|
void
|
||||||
gtk_activatable_set_use_action_appearance (GtkActivatable *activatable,
|
gtk_activatable_set_use_action_appearance (GtkActivatable *activatable,
|
||||||
gboolean use_appearance)
|
gboolean use_appearance)
|
||||||
{
|
{
|
||||||
g_object_set (activatable, "use-action-appearance", use_appearance, NULL);
|
g_object_set (activatable, "use-action-appearance", use_appearance, NULL);
|
||||||
}
|
}
|
||||||
|
@ -45,8 +45,8 @@ typedef struct _GtkActivatableIface GtkActivatableIface;
|
|||||||
* @update: Called to update the activatable when its related action's properties change.
|
* @update: Called to update the activatable when its related action's properties change.
|
||||||
* You must check the #GtkActivatable:use-action-appearance property only apply action
|
* You must check the #GtkActivatable:use-action-appearance property only apply action
|
||||||
* properties that are meant to effect the appearance accordingly.
|
* properties that are meant to effect the appearance accordingly.
|
||||||
* @reset: Called to update the activatable completely, this is called internally when
|
* @sync_action_properties: Called to update the activatable completely, this is called internally when
|
||||||
* #GtkActivatable::related-action property is set or unset and by the implementor when
|
* #GtkActivatable::related-action property is set or unset and by the implementor when
|
||||||
* #GtkActivatable::use-action-appearance changes.<note><para>This method can be called
|
* #GtkActivatable::use-action-appearance changes.<note><para>This method can be called
|
||||||
* with a %NULL action at times</para></note>
|
* with a %NULL action at times</para></note>
|
||||||
*
|
*
|
||||||
@ -58,17 +58,17 @@ struct _GtkActivatableIface
|
|||||||
GTypeInterface g_iface;
|
GTypeInterface g_iface;
|
||||||
|
|
||||||
/* virtual table */
|
/* virtual table */
|
||||||
void (* update) (GtkActivatable *activatable,
|
void (* update) (GtkActivatable *activatable,
|
||||||
GtkAction *action,
|
GtkAction *action,
|
||||||
const gchar *property_name);
|
const gchar *property_name);
|
||||||
void (* reset) (GtkActivatable *activatable,
|
void (* sync_action_properties) (GtkActivatable *activatable,
|
||||||
GtkAction *action);
|
GtkAction *action);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
GType gtk_activatable_get_type (void) G_GNUC_CONST;
|
GType gtk_activatable_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
void gtk_activatable_reset (GtkActivatable *activatable,
|
void gtk_activatable_sync_action_properties (GtkActivatable *activatable,
|
||||||
GtkAction *action);
|
GtkAction *action);
|
||||||
|
|
||||||
void gtk_activatable_set_related_action (GtkActivatable *activatable,
|
void gtk_activatable_set_related_action (GtkActivatable *activatable,
|
||||||
|
@ -148,16 +148,16 @@ static void gtk_button_grab_notify (GtkWidget *widget,
|
|||||||
gboolean was_grabbed);
|
gboolean was_grabbed);
|
||||||
|
|
||||||
|
|
||||||
static void gtk_button_activatable_interface_init (GtkActivatableIface *iface);
|
static void gtk_button_activatable_interface_init (GtkActivatableIface *iface);
|
||||||
static void gtk_button_activatable_update (GtkActivatable *activatable,
|
static void gtk_button_update (GtkActivatable *activatable,
|
||||||
GtkAction *action,
|
GtkAction *action,
|
||||||
const gchar *property_name);
|
const gchar *property_name);
|
||||||
static void gtk_button_activatable_reset (GtkActivatable *activatable,
|
static void gtk_button_sync_action_properties (GtkActivatable *activatable,
|
||||||
GtkAction *action);
|
GtkAction *action);
|
||||||
static void gtk_button_set_related_action (GtkButton *button,
|
static void gtk_button_set_related_action (GtkButton *button,
|
||||||
GtkAction *action);
|
GtkAction *action);
|
||||||
static void gtk_button_set_use_action_appearance (GtkButton *button,
|
static void gtk_button_set_use_action_appearance (GtkButton *button,
|
||||||
gboolean use_appearance);
|
gboolean use_appearance);
|
||||||
|
|
||||||
static guint button_signals[LAST_SIGNAL] = { 0 };
|
static guint button_signals[LAST_SIGNAL] = { 0 };
|
||||||
|
|
||||||
@ -741,8 +741,8 @@ gtk_button_get_property (GObject *object,
|
|||||||
static void
|
static void
|
||||||
gtk_button_activatable_interface_init (GtkActivatableIface *iface)
|
gtk_button_activatable_interface_init (GtkActivatableIface *iface)
|
||||||
{
|
{
|
||||||
iface->update = gtk_button_activatable_update;
|
iface->update = gtk_button_update;
|
||||||
iface->reset = gtk_button_activatable_reset;
|
iface->sync_action_properties = gtk_button_sync_action_properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -808,9 +808,9 @@ activatable_update_gicon (GtkButton *button,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_button_activatable_update (GtkActivatable *activatable,
|
gtk_button_update (GtkActivatable *activatable,
|
||||||
GtkAction *action,
|
GtkAction *action,
|
||||||
const gchar *property_name)
|
const gchar *property_name)
|
||||||
{
|
{
|
||||||
GtkButtonPrivate *priv = GTK_BUTTON_GET_PRIVATE (activatable);
|
GtkButtonPrivate *priv = GTK_BUTTON_GET_PRIVATE (activatable);
|
||||||
|
|
||||||
@ -837,9 +837,9 @@ gtk_button_activatable_update (GtkActivatable *activatable,
|
|||||||
activatable_update_icon_name (GTK_BUTTON (activatable), action);
|
activatable_update_icon_name (GTK_BUTTON (activatable), action);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_button_activatable_reset (GtkActivatable *activatable,
|
gtk_button_sync_action_properties (GtkActivatable *activatable,
|
||||||
GtkAction *action)
|
GtkAction *action)
|
||||||
{
|
{
|
||||||
GtkButtonPrivate *priv = GTK_BUTTON_GET_PRIVATE (activatable);
|
GtkButtonPrivate *priv = GTK_BUTTON_GET_PRIVATE (activatable);
|
||||||
|
|
||||||
@ -863,8 +863,8 @@ gtk_button_activatable_reset (GtkActivatable *activatable,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_button_set_related_action (GtkButton *button,
|
gtk_button_set_related_action (GtkButton *button,
|
||||||
GtkAction *action)
|
GtkAction *action)
|
||||||
{
|
{
|
||||||
GtkButtonPrivate *priv = GTK_BUTTON_GET_PRIVATE (button);
|
GtkButtonPrivate *priv = GTK_BUTTON_GET_PRIVATE (button);
|
||||||
|
|
||||||
@ -877,7 +877,7 @@ gtk_button_set_related_action (GtkButton *button,
|
|||||||
*/
|
*/
|
||||||
g_signal_handlers_disconnect_by_func (button, gtk_real_button_clicked, NULL);
|
g_signal_handlers_disconnect_by_func (button, gtk_real_button_clicked, NULL);
|
||||||
if (action)
|
if (action)
|
||||||
g_signal_connect_after (button, "clicked",
|
g_signal_connect_after (button, "clicked",
|
||||||
G_CALLBACK (gtk_real_button_clicked), NULL);
|
G_CALLBACK (gtk_real_button_clicked), NULL);
|
||||||
|
|
||||||
gtk_activatable_do_set_related_action (GTK_ACTIVATABLE (button), action);
|
gtk_activatable_do_set_related_action (GTK_ACTIVATABLE (button), action);
|
||||||
@ -886,16 +886,16 @@ gtk_button_set_related_action (GtkButton *button,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_button_set_use_action_appearance (GtkButton *button,
|
gtk_button_set_use_action_appearance (GtkButton *button,
|
||||||
gboolean use_appearance)
|
gboolean use_appearance)
|
||||||
{
|
{
|
||||||
GtkButtonPrivate *priv = GTK_BUTTON_GET_PRIVATE (button);
|
GtkButtonPrivate *priv = GTK_BUTTON_GET_PRIVATE (button);
|
||||||
|
|
||||||
if (priv->use_action_appearance != use_appearance)
|
if (priv->use_action_appearance != use_appearance)
|
||||||
{
|
{
|
||||||
priv->use_action_appearance = use_appearance;
|
priv->use_action_appearance = use_appearance;
|
||||||
|
|
||||||
gtk_activatable_reset (GTK_ACTIVATABLE (button), priv->action);
|
gtk_activatable_sync_action_properties (GTK_ACTIVATABLE (button), priv->action);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,10 +65,10 @@ static void gtk_check_menu_item_get_property (GObject *obj
|
|||||||
GParamSpec *pspec);
|
GParamSpec *pspec);
|
||||||
|
|
||||||
static void gtk_check_menu_item_activatable_interface_init (GtkActivatableIface *iface);
|
static void gtk_check_menu_item_activatable_interface_init (GtkActivatableIface *iface);
|
||||||
static void gtk_check_menu_item_activatable_update (GtkActivatable *activatable,
|
static void gtk_check_menu_item_update (GtkActivatable *activatable,
|
||||||
GtkAction *action,
|
GtkAction *action,
|
||||||
const gchar *property_name);
|
const gchar *property_name);
|
||||||
static void gtk_check_menu_item_activatable_reset (GtkActivatable *activatable,
|
static void gtk_check_menu_item_sync_action_properties (GtkActivatable *activatable,
|
||||||
GtkAction *action);
|
GtkAction *action);
|
||||||
|
|
||||||
static GtkActivatableIface *parent_activatable_iface;
|
static GtkActivatableIface *parent_activatable_iface;
|
||||||
@ -148,14 +148,14 @@ static void
|
|||||||
gtk_check_menu_item_activatable_interface_init (GtkActivatableIface *iface)
|
gtk_check_menu_item_activatable_interface_init (GtkActivatableIface *iface)
|
||||||
{
|
{
|
||||||
parent_activatable_iface = g_type_interface_peek_parent (iface);
|
parent_activatable_iface = g_type_interface_peek_parent (iface);
|
||||||
iface->update = gtk_check_menu_item_activatable_update;
|
iface->update = gtk_check_menu_item_update;
|
||||||
iface->reset = gtk_check_menu_item_activatable_reset;
|
iface->sync_action_properties = gtk_check_menu_item_sync_action_properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_check_menu_item_activatable_update (GtkActivatable *activatable,
|
gtk_check_menu_item_update (GtkActivatable *activatable,
|
||||||
GtkAction *action,
|
GtkAction *action,
|
||||||
const gchar *property_name)
|
const gchar *property_name)
|
||||||
{
|
{
|
||||||
GtkCheckMenuItem *check_menu_item;
|
GtkCheckMenuItem *check_menu_item;
|
||||||
|
|
||||||
@ -174,19 +174,19 @@ gtk_check_menu_item_activatable_update (GtkActivatable *activatable,
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (strcmp (property_name, "draw-as-radio") == 0)
|
if (strcmp (property_name, "draw-as-radio") == 0)
|
||||||
gtk_check_menu_item_set_draw_as_radio (check_menu_item,
|
gtk_check_menu_item_set_draw_as_radio (check_menu_item,
|
||||||
gtk_toggle_action_get_draw_as_radio (GTK_TOGGLE_ACTION (action)));
|
gtk_toggle_action_get_draw_as_radio (GTK_TOGGLE_ACTION (action)));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_check_menu_item_activatable_reset (GtkActivatable *activatable,
|
gtk_check_menu_item_sync_action_properties (GtkActivatable *activatable,
|
||||||
GtkAction *action)
|
GtkAction *action)
|
||||||
{
|
{
|
||||||
GtkCheckMenuItem *check_menu_item;
|
GtkCheckMenuItem *check_menu_item;
|
||||||
|
|
||||||
check_menu_item = GTK_CHECK_MENU_ITEM (activatable);
|
check_menu_item = GTK_CHECK_MENU_ITEM (activatable);
|
||||||
|
|
||||||
parent_activatable_iface->reset (activatable, action);
|
parent_activatable_iface->sync_action_properties (activatable, action);
|
||||||
|
|
||||||
if (!GTK_IS_TOGGLE_ACTION (action))
|
if (!GTK_IS_TOGGLE_ACTION (action))
|
||||||
return;
|
return;
|
||||||
@ -198,7 +198,7 @@ gtk_check_menu_item_activatable_reset (GtkActivatable *activatable,
|
|||||||
if (!gtk_activatable_get_use_action_appearance (activatable))
|
if (!gtk_activatable_get_use_action_appearance (activatable))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
gtk_check_menu_item_set_draw_as_radio (check_menu_item,
|
gtk_check_menu_item_set_draw_as_radio (check_menu_item,
|
||||||
gtk_toggle_action_get_draw_as_radio (GTK_TOGGLE_ACTION (action)));
|
gtk_toggle_action_get_draw_as_radio (GTK_TOGGLE_ACTION (action)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,10 +72,10 @@ static void gtk_image_menu_item_screen_changed (GtkWidget *widget,
|
|||||||
static void gtk_image_menu_item_recalculate (GtkImageMenuItem *image_menu_item);
|
static void gtk_image_menu_item_recalculate (GtkImageMenuItem *image_menu_item);
|
||||||
|
|
||||||
static void gtk_image_menu_item_activatable_interface_init (GtkActivatableIface *iface);
|
static void gtk_image_menu_item_activatable_interface_init (GtkActivatableIface *iface);
|
||||||
static void gtk_image_menu_item_activatable_update (GtkActivatable *activatable,
|
static void gtk_image_menu_item_update (GtkActivatable *activatable,
|
||||||
GtkAction *action,
|
GtkAction *action,
|
||||||
const gchar *property_name);
|
const gchar *property_name);
|
||||||
static void gtk_image_menu_item_activatable_reset (GtkActivatable *activatable,
|
static void gtk_image_menu_item_sync_action_properties (GtkActivatable *activatable,
|
||||||
GtkAction *action);
|
GtkAction *action);
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@ -552,8 +552,8 @@ static void
|
|||||||
gtk_image_menu_item_activatable_interface_init (GtkActivatableIface *iface)
|
gtk_image_menu_item_activatable_interface_init (GtkActivatableIface *iface)
|
||||||
{
|
{
|
||||||
parent_activatable_iface = g_type_interface_peek_parent (iface);
|
parent_activatable_iface = g_type_interface_peek_parent (iface);
|
||||||
iface->update = gtk_image_menu_item_activatable_update;
|
iface->update = gtk_image_menu_item_update;
|
||||||
iface->reset = gtk_image_menu_item_activatable_reset;
|
iface->sync_action_properties = gtk_image_menu_item_sync_action_properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@ -609,10 +609,10 @@ activatable_update_icon_name (GtkImageMenuItem *image_menu_item, GtkAction *acti
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_image_menu_item_activatable_update (GtkActivatable *activatable,
|
gtk_image_menu_item_update (GtkActivatable *activatable,
|
||||||
GtkAction *action,
|
GtkAction *action,
|
||||||
const gchar *property_name)
|
const gchar *property_name)
|
||||||
{
|
{
|
||||||
GtkImageMenuItem *image_menu_item;
|
GtkImageMenuItem *image_menu_item;
|
||||||
GtkWidget *image;
|
GtkWidget *image;
|
||||||
@ -635,8 +635,8 @@ gtk_image_menu_item_activatable_update (GtkActivatable *activatable,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_image_menu_item_activatable_reset (GtkActivatable *activatable,
|
gtk_image_menu_item_sync_action_properties (GtkActivatable *activatable,
|
||||||
GtkAction *action)
|
GtkAction *action)
|
||||||
{
|
{
|
||||||
GtkImageMenuItem *image_menu_item;
|
GtkImageMenuItem *image_menu_item;
|
||||||
GtkWidget *image;
|
GtkWidget *image;
|
||||||
@ -644,7 +644,7 @@ gtk_image_menu_item_activatable_reset (GtkActivatable *activatable,
|
|||||||
|
|
||||||
image_menu_item = GTK_IMAGE_MENU_ITEM (activatable);
|
image_menu_item = GTK_IMAGE_MENU_ITEM (activatable);
|
||||||
|
|
||||||
parent_activatable_iface->reset (activatable, action);
|
parent_activatable_iface->sync_action_properties (activatable, action);
|
||||||
|
|
||||||
if (!action)
|
if (!action)
|
||||||
return;
|
return;
|
||||||
|
@ -134,10 +134,10 @@ static void gtk_menu_item_buildable_add_child (GtkBuildable *buildab
|
|||||||
const gchar *type);
|
const gchar *type);
|
||||||
|
|
||||||
static void gtk_menu_item_activatable_interface_init (GtkActivatableIface *iface);
|
static void gtk_menu_item_activatable_interface_init (GtkActivatableIface *iface);
|
||||||
static void gtk_menu_item_activatable_update (GtkActivatable *activatable,
|
static void gtk_menu_item_update (GtkActivatable *activatable,
|
||||||
GtkAction *action,
|
GtkAction *action,
|
||||||
const gchar *property_name);
|
const gchar *property_name);
|
||||||
static void gtk_menu_item_activatable_reset (GtkActivatable *activatable,
|
static void gtk_menu_item_sync_action_properties (GtkActivatable *activatable,
|
||||||
GtkAction *action);
|
GtkAction *action);
|
||||||
static void gtk_menu_item_set_related_action (GtkMenuItem *menu_item,
|
static void gtk_menu_item_set_related_action (GtkMenuItem *menu_item,
|
||||||
GtkAction *action);
|
GtkAction *action);
|
||||||
@ -576,15 +576,15 @@ gtk_menu_item_buildable_add_child (GtkBuildable *buildable,
|
|||||||
static void
|
static void
|
||||||
gtk_menu_item_activatable_interface_init (GtkActivatableIface *iface)
|
gtk_menu_item_activatable_interface_init (GtkActivatableIface *iface)
|
||||||
{
|
{
|
||||||
iface->update = gtk_menu_item_activatable_update;
|
iface->update = gtk_menu_item_update;
|
||||||
iface->reset = gtk_menu_item_activatable_reset;
|
iface->sync_action_properties = gtk_menu_item_sync_action_properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
activatable_update_label (GtkMenuItem *menu_item, GtkAction *action)
|
activatable_update_label (GtkMenuItem *menu_item, GtkAction *action)
|
||||||
{
|
{
|
||||||
GtkWidget *child = GTK_BIN (menu_item)->child;
|
GtkWidget *child = GTK_BIN (menu_item)->child;
|
||||||
|
|
||||||
if (GTK_IS_LABEL (child))
|
if (GTK_IS_LABEL (child))
|
||||||
{
|
{
|
||||||
const gchar *label;
|
const gchar *label;
|
||||||
@ -597,9 +597,9 @@ activatable_update_label (GtkMenuItem *menu_item, GtkAction *action)
|
|||||||
gboolean _gtk_menu_is_empty (GtkWidget *menu);
|
gboolean _gtk_menu_is_empty (GtkWidget *menu);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_menu_item_activatable_update (GtkActivatable *activatable,
|
gtk_menu_item_update (GtkActivatable *activatable,
|
||||||
GtkAction *action,
|
GtkAction *action,
|
||||||
const gchar *property_name)
|
const gchar *property_name)
|
||||||
{
|
{
|
||||||
GtkMenuItem *menu_item = GTK_MENU_ITEM (activatable);
|
GtkMenuItem *menu_item = GTK_MENU_ITEM (activatable);
|
||||||
GtkMenuItemPrivate *priv = GET_PRIVATE (menu_item);
|
GtkMenuItemPrivate *priv = GET_PRIVATE (menu_item);
|
||||||
@ -617,8 +617,8 @@ gtk_menu_item_activatable_update (GtkActivatable *activatable,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_menu_item_activatable_reset (GtkActivatable *activatable,
|
gtk_menu_item_sync_action_properties (GtkActivatable *activatable,
|
||||||
GtkAction *action)
|
GtkAction *action)
|
||||||
{
|
{
|
||||||
GtkMenuItem *menu_item = GTK_MENU_ITEM (activatable);
|
GtkMenuItem *menu_item = GTK_MENU_ITEM (activatable);
|
||||||
GtkMenuItemPrivate *priv = GET_PRIVATE (menu_item);
|
GtkMenuItemPrivate *priv = GET_PRIVATE (menu_item);
|
||||||
@ -626,7 +626,7 @@ gtk_menu_item_activatable_reset (GtkActivatable *activatable,
|
|||||||
if (!action)
|
if (!action)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_gtk_action_sync_menu_visible (action, GTK_WIDGET (menu_item),
|
_gtk_action_sync_menu_visible (action, GTK_WIDGET (menu_item),
|
||||||
_gtk_menu_is_empty (gtk_menu_item_get_submenu (menu_item)));
|
_gtk_menu_is_empty (gtk_menu_item_get_submenu (menu_item)));
|
||||||
|
|
||||||
gtk_widget_set_sensitive (GTK_WIDGET (menu_item), gtk_action_is_sensitive (action));
|
gtk_widget_set_sensitive (GTK_WIDGET (menu_item), gtk_action_is_sensitive (action));
|
||||||
@ -634,14 +634,14 @@ gtk_menu_item_activatable_reset (GtkActivatable *activatable,
|
|||||||
if (priv->use_action_appearance)
|
if (priv->use_action_appearance)
|
||||||
{
|
{
|
||||||
GtkWidget *label = GTK_BIN (menu_item)->child;
|
GtkWidget *label = GTK_BIN (menu_item)->child;
|
||||||
|
|
||||||
/* make sure label is a label */
|
/* make sure label is a label */
|
||||||
if (label && !GTK_IS_LABEL (label))
|
if (label && !GTK_IS_LABEL (label))
|
||||||
{
|
{
|
||||||
gtk_container_remove (GTK_CONTAINER (menu_item), label);
|
gtk_container_remove (GTK_CONTAINER (menu_item), label);
|
||||||
label = NULL;
|
label = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!label)
|
if (!label)
|
||||||
label = g_object_new (GTK_TYPE_ACCEL_LABEL,
|
label = g_object_new (GTK_TYPE_ACCEL_LABEL,
|
||||||
"use-underline", TRUE,
|
"use-underline", TRUE,
|
||||||
@ -649,18 +649,18 @@ gtk_menu_item_activatable_reset (GtkActivatable *activatable,
|
|||||||
"visible", TRUE,
|
"visible", TRUE,
|
||||||
"parent", menu_item,
|
"parent", menu_item,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
if (GTK_IS_ACCEL_LABEL (label) && gtk_action_get_accel_path (action))
|
if (GTK_IS_ACCEL_LABEL (label) && gtk_action_get_accel_path (action))
|
||||||
g_object_set (label,
|
g_object_set (label,
|
||||||
"accel-closure", gtk_action_get_accel_closure (action),
|
"accel-closure", gtk_action_get_accel_closure (action),
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
activatable_update_label (menu_item, action);
|
activatable_update_label (menu_item, action);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_menu_item_set_related_action (GtkMenuItem *menu_item,
|
gtk_menu_item_set_related_action (GtkMenuItem *menu_item,
|
||||||
GtkAction *action)
|
GtkAction *action)
|
||||||
{
|
{
|
||||||
GtkMenuItemPrivate *priv = GET_PRIVATE (menu_item);
|
GtkMenuItemPrivate *priv = GET_PRIVATE (menu_item);
|
||||||
@ -691,7 +691,7 @@ gtk_menu_item_set_related_action (GtkMenuItem *menu_item,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_menu_item_set_use_action_appearance (GtkMenuItem *menu_item,
|
gtk_menu_item_set_use_action_appearance (GtkMenuItem *menu_item,
|
||||||
gboolean use_appearance)
|
gboolean use_appearance)
|
||||||
{
|
{
|
||||||
GtkMenuItemPrivate *priv = GET_PRIVATE (menu_item);
|
GtkMenuItemPrivate *priv = GET_PRIVATE (menu_item);
|
||||||
@ -699,8 +699,8 @@ gtk_menu_item_set_use_action_appearance (GtkMenuItem *menu_item,
|
|||||||
if (priv->use_action_appearance != use_appearance)
|
if (priv->use_action_appearance != use_appearance)
|
||||||
{
|
{
|
||||||
priv->use_action_appearance = use_appearance;
|
priv->use_action_appearance = use_appearance;
|
||||||
|
|
||||||
gtk_activatable_reset (GTK_ACTIVATABLE (menu_item), priv->action);
|
gtk_activatable_sync_action_properties (GTK_ACTIVATABLE (menu_item), priv->action);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1094,9 +1094,9 @@ _gtk_recent_chooser_selection_changed (GtkRecentChooser *chooser)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_gtk_recent_chooser_activatable_update (GtkActivatable *activatable,
|
_gtk_recent_chooser_update (GtkActivatable *activatable,
|
||||||
GtkAction *action,
|
GtkAction *action,
|
||||||
const gchar *property_name)
|
const gchar *property_name)
|
||||||
{
|
{
|
||||||
GtkRecentChooser *recent_chooser = GTK_RECENT_CHOOSER (activatable);
|
GtkRecentChooser *recent_chooser = GTK_RECENT_CHOOSER (activatable);
|
||||||
GtkRecentChooser *action_chooser = GTK_RECENT_CHOOSER (action);
|
GtkRecentChooser *action_chooser = GTK_RECENT_CHOOSER (action);
|
||||||
@ -1124,8 +1124,8 @@ _gtk_recent_chooser_activatable_update (GtkActivatable *activatable,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_gtk_recent_chooser_activatable_reset (GtkActivatable *activatable,
|
_gtk_recent_chooser_sync_action_properties (GtkActivatable *activatable,
|
||||||
GtkAction *action)
|
GtkAction *action)
|
||||||
{
|
{
|
||||||
GtkRecentChooser *recent_chooser = GTK_RECENT_CHOOSER (activatable);
|
GtkRecentChooser *recent_chooser = GTK_RECENT_CHOOSER (activatable);
|
||||||
GtkRecentChooser *action_chooser = GTK_RECENT_CHOOSER (action);
|
GtkRecentChooser *action_chooser = GTK_RECENT_CHOOSER (action);
|
||||||
@ -1148,7 +1148,7 @@ _gtk_recent_chooser_activatable_reset (GtkActivatable *activatable,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_gtk_recent_chooser_set_related_action (GtkRecentChooser *recent_chooser,
|
_gtk_recent_chooser_set_related_action (GtkRecentChooser *recent_chooser,
|
||||||
GtkAction *action)
|
GtkAction *action)
|
||||||
{
|
{
|
||||||
GtkAction *prev_action;
|
GtkAction *prev_action;
|
||||||
@ -1185,8 +1185,8 @@ _gtk_recent_chooser_set_use_action_appearance (GtkRecentChooser *recent_chooser,
|
|||||||
{
|
{
|
||||||
|
|
||||||
g_object_set_qdata (G_OBJECT (recent_chooser), quark_gtk_use_action_appearance, GINT_TO_POINTER (!use_appearance));
|
g_object_set_qdata (G_OBJECT (recent_chooser), quark_gtk_use_action_appearance, GINT_TO_POINTER (!use_appearance));
|
||||||
|
|
||||||
gtk_activatable_reset (GTK_ACTIVATABLE (recent_chooser), action);
|
gtk_activatable_sync_action_properties (GTK_ACTIVATABLE (recent_chooser), action);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -284,10 +284,10 @@ static gboolean recent_view_query_tooltip_cb (GtkWidget *widget,
|
|||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
|
|
||||||
static void gtk_recent_chooser_activatable_iface_init (GtkActivatableIface *iface);
|
static void gtk_recent_chooser_activatable_iface_init (GtkActivatableIface *iface);
|
||||||
static void gtk_recent_chooser_activatable_update (GtkActivatable *activatable,
|
static void gtk_recent_chooser_update (GtkActivatable *activatable,
|
||||||
GtkAction *action,
|
GtkAction *action,
|
||||||
const gchar *property_name);
|
const gchar *property_name);
|
||||||
static void gtk_recent_chooser_activatable_reset (GtkActivatable *activatable,
|
static void gtk_recent_chooser_sync_action_properties (GtkActivatable *activatable,
|
||||||
GtkAction *action);
|
GtkAction *action);
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (GtkRecentChooserDefault,
|
G_DEFINE_TYPE_WITH_CODE (GtkRecentChooserDefault,
|
||||||
@ -318,12 +318,12 @@ gtk_recent_chooser_iface_init (GtkRecentChooserIface *iface)
|
|||||||
iface->list_filters = gtk_recent_chooser_default_list_filters;
|
iface->list_filters = gtk_recent_chooser_default_list_filters;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_recent_chooser_activatable_iface_init (GtkActivatableIface *iface)
|
gtk_recent_chooser_activatable_iface_init (GtkActivatableIface *iface)
|
||||||
|
|
||||||
{
|
{
|
||||||
iface->update = gtk_recent_chooser_activatable_update;
|
iface->update = gtk_recent_chooser_update;
|
||||||
iface->reset = gtk_recent_chooser_activatable_reset;
|
iface->sync_action_properties = gtk_recent_chooser_sync_action_properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -1948,10 +1948,10 @@ set_recent_manager (GtkRecentChooserDefault *impl,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_recent_chooser_activatable_update (GtkActivatable *activatable,
|
gtk_recent_chooser_update (GtkActivatable *activatable,
|
||||||
GtkAction *action,
|
GtkAction *action,
|
||||||
const gchar *property_name)
|
const gchar *property_name)
|
||||||
{
|
{
|
||||||
if (strcmp (property_name, "visible") == 0)
|
if (strcmp (property_name, "visible") == 0)
|
||||||
{
|
{
|
||||||
@ -1964,13 +1964,13 @@ gtk_recent_chooser_activatable_update (GtkActivatable *activatable,
|
|||||||
if (strcmp (property_name, "sensitive") == 0)
|
if (strcmp (property_name, "sensitive") == 0)
|
||||||
gtk_widget_set_sensitive (GTK_WIDGET (activatable), gtk_action_is_sensitive (action));
|
gtk_widget_set_sensitive (GTK_WIDGET (activatable), gtk_action_is_sensitive (action));
|
||||||
|
|
||||||
_gtk_recent_chooser_activatable_update (activatable, action, property_name);
|
_gtk_recent_chooser_update (activatable, action, property_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_recent_chooser_activatable_reset (GtkActivatable *activatable,
|
gtk_recent_chooser_sync_action_properties (GtkActivatable *activatable,
|
||||||
GtkAction *action)
|
GtkAction *action)
|
||||||
{
|
{
|
||||||
if (action)
|
if (action)
|
||||||
{
|
{
|
||||||
@ -1982,7 +1982,7 @@ gtk_recent_chooser_activatable_reset (GtkActivatable *activatable,
|
|||||||
gtk_widget_set_sensitive (GTK_WIDGET (activatable), gtk_action_is_sensitive (action));
|
gtk_widget_set_sensitive (GTK_WIDGET (activatable), gtk_action_is_sensitive (action));
|
||||||
}
|
}
|
||||||
|
|
||||||
_gtk_recent_chooser_activatable_reset (activatable, action);
|
_gtk_recent_chooser_sync_action_properties (activatable, action);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -161,10 +161,10 @@ static void manager_changed_cb (GtkRecentManager *manager,
|
|||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
|
|
||||||
static void gtk_recent_chooser_activatable_iface_init (GtkActivatableIface *iface);
|
static void gtk_recent_chooser_activatable_iface_init (GtkActivatableIface *iface);
|
||||||
static void gtk_recent_chooser_activatable_update (GtkActivatable *activatable,
|
static void gtk_recent_chooser_update (GtkActivatable *activatable,
|
||||||
GtkAction *action,
|
GtkAction *action,
|
||||||
const gchar *property_name);
|
const gchar *property_name);
|
||||||
static void gtk_recent_chooser_activatable_reset (GtkActivatable *activatable,
|
static void gtk_recent_chooser_sync_action_properties (GtkActivatable *activatable,
|
||||||
GtkAction *action);
|
GtkAction *action);
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (GtkRecentChooserMenu,
|
G_DEFINE_TYPE_WITH_CODE (GtkRecentChooserMenu,
|
||||||
@ -193,12 +193,11 @@ gtk_recent_chooser_iface_init (GtkRecentChooserIface *iface)
|
|||||||
iface->list_filters = gtk_recent_chooser_menu_list_filters;
|
iface->list_filters = gtk_recent_chooser_menu_list_filters;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_recent_chooser_activatable_iface_init (GtkActivatableIface *iface)
|
gtk_recent_chooser_activatable_iface_init (GtkActivatableIface *iface)
|
||||||
|
{
|
||||||
{
|
iface->update = gtk_recent_chooser_update;
|
||||||
iface->update = gtk_recent_chooser_activatable_update;
|
iface->sync_action_properties = gtk_recent_chooser_sync_action_properties;
|
||||||
iface->reset = gtk_recent_chooser_activatable_reset;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -1173,24 +1172,24 @@ gtk_recent_chooser_menu_set_show_tips (GtkRecentChooserMenu *menu,
|
|||||||
gtk_container_foreach (GTK_CONTAINER (menu), foreach_set_shot_tips, menu);
|
gtk_container_foreach (GTK_CONTAINER (menu), foreach_set_shot_tips, menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_recent_chooser_activatable_update (GtkActivatable *activatable,
|
gtk_recent_chooser_update (GtkActivatable *activatable,
|
||||||
GtkAction *action,
|
GtkAction *action,
|
||||||
const gchar *property_name)
|
const gchar *property_name)
|
||||||
{
|
{
|
||||||
if (strcmp (property_name, "sensitive") == 0)
|
if (strcmp (property_name, "sensitive") == 0)
|
||||||
gtk_widget_set_sensitive (GTK_WIDGET (activatable), gtk_action_is_sensitive (action));
|
gtk_widget_set_sensitive (GTK_WIDGET (activatable), gtk_action_is_sensitive (action));
|
||||||
|
|
||||||
_gtk_recent_chooser_activatable_update (activatable, action, property_name);
|
_gtk_recent_chooser_update (activatable, action, property_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_recent_chooser_activatable_reset (GtkActivatable *activatable,
|
gtk_recent_chooser_sync_action_properties (GtkActivatable *activatable,
|
||||||
GtkAction *action)
|
GtkAction *action)
|
||||||
{
|
{
|
||||||
gtk_widget_set_sensitive (GTK_WIDGET (activatable), gtk_action_is_sensitive (action));
|
gtk_widget_set_sensitive (GTK_WIDGET (activatable), gtk_action_is_sensitive (action));
|
||||||
|
|
||||||
_gtk_recent_chooser_activatable_reset (activatable, action);
|
_gtk_recent_chooser_sync_action_properties (activatable, action);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -38,10 +38,10 @@ GList * _gtk_recent_chooser_get_items (GtkRecentChooser
|
|||||||
void _gtk_recent_chooser_item_activated (GtkRecentChooser *chooser);
|
void _gtk_recent_chooser_item_activated (GtkRecentChooser *chooser);
|
||||||
void _gtk_recent_chooser_selection_changed (GtkRecentChooser *chooser);
|
void _gtk_recent_chooser_selection_changed (GtkRecentChooser *chooser);
|
||||||
|
|
||||||
void _gtk_recent_chooser_activatable_update (GtkActivatable *activatable,
|
void _gtk_recent_chooser_update (GtkActivatable *activatable,
|
||||||
GtkAction *action,
|
GtkAction *action,
|
||||||
const gchar *property_name);
|
const gchar *property_name);
|
||||||
void _gtk_recent_chooser_activatable_reset (GtkActivatable *activatable,
|
void _gtk_recent_chooser_sync_action_properties (GtkActivatable *activatable,
|
||||||
GtkAction *action);
|
GtkAction *action);
|
||||||
void _gtk_recent_chooser_set_related_action (GtkRecentChooser *recent_chooser,
|
void _gtk_recent_chooser_set_related_action (GtkRecentChooser *recent_chooser,
|
||||||
GtkAction *action);
|
GtkAction *action);
|
||||||
|
@ -71,11 +71,11 @@ static void gtk_toggle_button_update_state (GtkButton *button);
|
|||||||
|
|
||||||
|
|
||||||
static void gtk_toggle_button_activatable_interface_init (GtkActivatableIface *iface);
|
static void gtk_toggle_button_activatable_interface_init (GtkActivatableIface *iface);
|
||||||
static void gtk_toggle_button_activatable_update (GtkActivatable *activatable,
|
static void gtk_toggle_button_update (GtkActivatable *activatable,
|
||||||
GtkAction *action,
|
GtkAction *action,
|
||||||
const gchar *property_name);
|
const gchar *property_name);
|
||||||
static void gtk_toggle_button_activatable_reset (GtkActivatable *activatable,
|
static void gtk_toggle_button_sync_action_properties (GtkActivatable *activatable,
|
||||||
GtkAction *action);
|
GtkAction *action);
|
||||||
|
|
||||||
static GtkActivatableIface *parent_activatable_iface;
|
static GtkActivatableIface *parent_activatable_iface;
|
||||||
static guint toggle_button_signals[LAST_SIGNAL] = { 0 };
|
static guint toggle_button_signals[LAST_SIGNAL] = { 0 };
|
||||||
@ -151,19 +151,18 @@ gtk_toggle_button_init (GtkToggleButton *toggle_button)
|
|||||||
GTK_BUTTON (toggle_button)->depress_on_activate = TRUE;
|
GTK_BUTTON (toggle_button)->depress_on_activate = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
static void
|
gtk_toggle_button_activatable_interface_init (GtkActivatableIface *iface)
|
||||||
gtk_toggle_button_activatable_interface_init (GtkActivatableIface *iface)
|
|
||||||
{
|
{
|
||||||
parent_activatable_iface = g_type_interface_peek_parent (iface);
|
parent_activatable_iface = g_type_interface_peek_parent (iface);
|
||||||
iface->update = gtk_toggle_button_activatable_update;
|
iface->update = gtk_toggle_button_update;
|
||||||
iface->reset = gtk_toggle_button_activatable_reset;
|
iface->sync_action_properties = gtk_toggle_button_sync_action_properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_toggle_button_activatable_update (GtkActivatable *activatable,
|
gtk_toggle_button_update (GtkActivatable *activatable,
|
||||||
GtkAction *action,
|
GtkAction *action,
|
||||||
const gchar *property_name)
|
const gchar *property_name)
|
||||||
{
|
{
|
||||||
GtkToggleButton *button;
|
GtkToggleButton *button;
|
||||||
|
|
||||||
@ -181,12 +180,12 @@ gtk_toggle_button_activatable_update (GtkActivatable *activatable,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_toggle_button_activatable_reset (GtkActivatable *activatable,
|
gtk_toggle_button_sync_action_properties (GtkActivatable *activatable,
|
||||||
GtkAction *action)
|
GtkAction *action)
|
||||||
{
|
{
|
||||||
GtkToggleButton *button;
|
GtkToggleButton *button;
|
||||||
|
|
||||||
parent_activatable_iface->reset (activatable, action);
|
parent_activatable_iface->sync_action_properties (activatable, action);
|
||||||
|
|
||||||
if (!GTK_IS_TOGGLE_ACTION (action))
|
if (!GTK_IS_TOGGLE_ACTION (action))
|
||||||
return;
|
return;
|
||||||
|
@ -71,10 +71,10 @@ static void menu_item_activated (GtkWidget *widget,
|
|||||||
|
|
||||||
|
|
||||||
static void gtk_toggle_tool_button_activatable_interface_init (GtkActivatableIface *iface);
|
static void gtk_toggle_tool_button_activatable_interface_init (GtkActivatableIface *iface);
|
||||||
static void gtk_toggle_tool_button_activatable_update (GtkActivatable *activatable,
|
static void gtk_toggle_tool_button_update (GtkActivatable *activatable,
|
||||||
GtkAction *action,
|
GtkAction *action,
|
||||||
const gchar *property_name);
|
const gchar *property_name);
|
||||||
static void gtk_toggle_tool_button_activatable_reset (GtkActivatable *activatable,
|
static void gtk_toggle_tool_button_sync_action_properties (GtkActivatable *activatable,
|
||||||
GtkAction *action);
|
GtkAction *action);
|
||||||
|
|
||||||
static GtkActivatableIface *parent_activatable_iface;
|
static GtkActivatableIface *parent_activatable_iface;
|
||||||
@ -311,18 +311,18 @@ button_toggled (GtkWidget *widget,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_toggle_tool_button_activatable_interface_init (GtkActivatableIface *iface)
|
gtk_toggle_tool_button_activatable_interface_init (GtkActivatableIface *iface)
|
||||||
{
|
{
|
||||||
parent_activatable_iface = g_type_interface_peek_parent (iface);
|
parent_activatable_iface = g_type_interface_peek_parent (iface);
|
||||||
iface->update = gtk_toggle_tool_button_activatable_update;
|
iface->update = gtk_toggle_tool_button_update;
|
||||||
iface->reset = gtk_toggle_tool_button_activatable_reset;
|
iface->sync_action_properties = gtk_toggle_tool_button_sync_action_properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_toggle_tool_button_activatable_update (GtkActivatable *activatable,
|
gtk_toggle_tool_button_update (GtkActivatable *activatable,
|
||||||
GtkAction *action,
|
GtkAction *action,
|
||||||
const gchar *property_name)
|
const gchar *property_name)
|
||||||
{
|
{
|
||||||
GtkToggleToolButton *button;
|
GtkToggleToolButton *button;
|
||||||
|
|
||||||
@ -339,12 +339,12 @@ gtk_toggle_tool_button_activatable_update (GtkActivatable *activatable,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_toggle_tool_button_activatable_reset (GtkActivatable *activatable,
|
gtk_toggle_tool_button_sync_action_properties (GtkActivatable *activatable,
|
||||||
GtkAction *action)
|
GtkAction *action)
|
||||||
{
|
{
|
||||||
GtkToggleToolButton *button;
|
GtkToggleToolButton *button;
|
||||||
|
|
||||||
parent_activatable_iface->reset (activatable, action);
|
parent_activatable_iface->sync_action_properties (activatable, action);
|
||||||
|
|
||||||
if (!GTK_IS_TOGGLE_ACTION (action))
|
if (!GTK_IS_TOGGLE_ACTION (action))
|
||||||
return;
|
return;
|
||||||
|
@ -80,10 +80,10 @@ static void gtk_tool_button_style_set (GtkWidget *widget,
|
|||||||
static void gtk_tool_button_construct_contents (GtkToolItem *tool_item);
|
static void gtk_tool_button_construct_contents (GtkToolItem *tool_item);
|
||||||
|
|
||||||
static void gtk_tool_button_activatable_interface_init (GtkActivatableIface *iface);
|
static void gtk_tool_button_activatable_interface_init (GtkActivatableIface *iface);
|
||||||
static void gtk_tool_button_activatable_update (GtkActivatable *activatable,
|
static void gtk_tool_button_update (GtkActivatable *activatable,
|
||||||
GtkAction *action,
|
GtkAction *action,
|
||||||
const gchar *property_name);
|
const gchar *property_name);
|
||||||
static void gtk_tool_button_activatable_reset (GtkActivatable *activatable,
|
static void gtk_tool_button_sync_action_properties (GtkActivatable *activatable,
|
||||||
GtkAction *action);
|
GtkAction *action);
|
||||||
|
|
||||||
|
|
||||||
@ -740,14 +740,14 @@ static void
|
|||||||
gtk_tool_button_activatable_interface_init (GtkActivatableIface *iface)
|
gtk_tool_button_activatable_interface_init (GtkActivatableIface *iface)
|
||||||
{
|
{
|
||||||
parent_activatable_iface = g_type_interface_peek_parent (iface);
|
parent_activatable_iface = g_type_interface_peek_parent (iface);
|
||||||
iface->update = gtk_tool_button_activatable_update;
|
iface->update = gtk_tool_button_update;
|
||||||
iface->reset = gtk_tool_button_activatable_reset;
|
iface->sync_action_properties = gtk_tool_button_sync_action_properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_tool_button_activatable_update (GtkActivatable *activatable,
|
gtk_tool_button_update (GtkActivatable *activatable,
|
||||||
GtkAction *action,
|
GtkAction *action,
|
||||||
const gchar *property_name)
|
const gchar *property_name)
|
||||||
{
|
{
|
||||||
GtkToolButton *button;
|
GtkToolButton *button;
|
||||||
GtkWidget *image;
|
GtkWidget *image;
|
||||||
@ -789,14 +789,14 @@ gtk_tool_button_activatable_update (GtkActivatable *activatable,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_tool_button_activatable_reset (GtkActivatable *activatable,
|
gtk_tool_button_sync_action_properties (GtkActivatable *activatable,
|
||||||
GtkAction *action)
|
GtkAction *action)
|
||||||
{
|
{
|
||||||
GtkToolButton *button;
|
GtkToolButton *button;
|
||||||
GIcon *icon;
|
GIcon *icon;
|
||||||
const gchar *stock_id;
|
const gchar *stock_id;
|
||||||
|
|
||||||
parent_activatable_iface->reset (activatable, action);
|
parent_activatable_iface->sync_action_properties (activatable, action);
|
||||||
|
|
||||||
if (!action)
|
if (!action)
|
||||||
return;
|
return;
|
||||||
|
@ -128,10 +128,10 @@ static gboolean gtk_tool_item_real_set_tooltip (GtkToolItem *tool_item,
|
|||||||
const gchar *tip_private);
|
const gchar *tip_private);
|
||||||
|
|
||||||
static void gtk_tool_item_activatable_interface_init (GtkActivatableIface *iface);
|
static void gtk_tool_item_activatable_interface_init (GtkActivatableIface *iface);
|
||||||
static void gtk_tool_item_activatable_update (GtkActivatable *activatable,
|
static void gtk_tool_item_update (GtkActivatable *activatable,
|
||||||
GtkAction *action,
|
GtkAction *action,
|
||||||
const gchar *property_name);
|
const gchar *property_name);
|
||||||
static void gtk_tool_item_activatable_reset (GtkActivatable *activatable,
|
static void gtk_tool_item_sync_action_properties (GtkActivatable *activatable,
|
||||||
GtkAction *action);
|
GtkAction *action);
|
||||||
static void gtk_tool_item_set_related_action (GtkToolItem *item,
|
static void gtk_tool_item_set_related_action (GtkToolItem *item,
|
||||||
GtkAction *action);
|
GtkAction *action);
|
||||||
@ -579,17 +579,17 @@ _gtk_tool_item_create_menu_proxy (GtkToolItem *item)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_tool_item_activatable_interface_init (GtkActivatableIface *iface)
|
gtk_tool_item_activatable_interface_init (GtkActivatableIface *iface)
|
||||||
{
|
{
|
||||||
iface->update = gtk_tool_item_activatable_update;
|
iface->update = gtk_tool_item_update;
|
||||||
iface->reset = gtk_tool_item_activatable_reset;
|
iface->sync_action_properties = gtk_tool_item_sync_action_properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_tool_item_activatable_update (GtkActivatable *activatable,
|
gtk_tool_item_update (GtkActivatable *activatable,
|
||||||
GtkAction *action,
|
GtkAction *action,
|
||||||
const gchar *property_name)
|
const gchar *property_name)
|
||||||
{
|
{
|
||||||
if (strcmp (property_name, "visible") == 0)
|
if (strcmp (property_name, "visible") == 0)
|
||||||
{
|
{
|
||||||
@ -614,9 +614,9 @@ gtk_tool_item_activatable_update (GtkActivatable *activatable,
|
|||||||
gtk_action_get_is_important (action));
|
gtk_action_get_is_important (action));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_tool_item_activatable_reset (GtkActivatable *activatable,
|
gtk_tool_item_sync_action_properties (GtkActivatable *activatable,
|
||||||
GtkAction *action)
|
GtkAction *action)
|
||||||
{
|
{
|
||||||
if (!action)
|
if (!action)
|
||||||
return;
|
return;
|
||||||
@ -656,14 +656,14 @@ gtk_tool_item_set_related_action (GtkToolItem *item,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_tool_item_set_use_action_appearance (GtkToolItem *item,
|
gtk_tool_item_set_use_action_appearance (GtkToolItem *item,
|
||||||
gboolean use_appearance)
|
gboolean use_appearance)
|
||||||
{
|
{
|
||||||
if (item->priv->use_action_appearance != use_appearance)
|
if (item->priv->use_action_appearance != use_appearance)
|
||||||
{
|
{
|
||||||
item->priv->use_action_appearance = use_appearance;
|
item->priv->use_action_appearance = use_appearance;
|
||||||
|
|
||||||
gtk_activatable_reset (GTK_ACTIVATABLE (item), item->priv->action);
|
gtk_activatable_sync_action_properties (GTK_ACTIVATABLE (item), item->priv->action);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user