[gtk+/wip/baedert/box: 31/68] menuitem: Stop implementing GtkActivatable



commit e021221ec3dabdea0b96f05059a8800ed0c442f7
Author: Timm Bäder <mail baedert org>
Date:   Thu Oct 13 16:06:03 2016 +0200

    menuitem: Stop implementing GtkActivatable

 demos/widget-factory/widget-factory.ui |   31 ----
 gtk/gtkcheckmenuitem.c                 |   95 +------------
 gtk/gtkmenuitem.c                      |  260 --------------------------------
 gtk/gtkmenuitemprivate.h               |    2 -
 4 files changed, 1 insertions(+), 387 deletions(-)
---
diff --git a/demos/widget-factory/widget-factory.ui b/demos/widget-factory/widget-factory.ui
index 7b87e28..3ea03b6 100644
--- a/demos/widget-factory/widget-factory.ui
+++ b/demos/widget-factory/widget-factory.ui
@@ -2243,7 +2243,6 @@ microphone-sensitivity-medium-symbolic</property>
                                     <child>
                                       <object class="GtkMenuItem" id="menuitem1">
                                         <property name="visible">1</property>
-                                        <property name="use_action_appearance">0</property>
                                         <property name="label" translatable="yes">_File</property>
                                         <property name="use_underline">1</property>
                                         <child type="submenu">
@@ -2253,7 +2252,6 @@ microphone-sensitivity-medium-symbolic</property>
                                               <object class="GtkMenuItem" id="menuitem101">
                                                 <property name="label" translatable="yes">_New</property>
                                                 <property name="visible">1</property>
-                                                <property name="use_action_appearance">0</property>
                                                 <property name="use_underline">1</property>
                                               </object>
                                             </child>
@@ -2261,7 +2259,6 @@ microphone-sensitivity-medium-symbolic</property>
                                               <object class="GtkMenuItem" id="menuitem102">
                                                 <property name="label" translatable="yes">_Open</property>
                                                 <property name="visible">1</property>
-                                                <property name="use_action_appearance">0</property>
                                                 <property name="use_underline">1</property>
                                               </object>
                                             </child>
@@ -2269,7 +2266,6 @@ microphone-sensitivity-medium-symbolic</property>
                                               <object class="GtkMenuItem" id="menuitem103">
                                                 <property name="label" translatable="yes">_Save</property>
                                                 <property name="visible">1</property>
-                                                <property name="use_action_appearance">0</property>
                                                 <property name="use_underline">1</property>
                                               </object>
                                             </child>
@@ -2277,21 +2273,18 @@ microphone-sensitivity-medium-symbolic</property>
                                               <object class="GtkMenuItem" id="menuitem104">
                                                 <property name="label" translatable="yes">Save _As</property>
                                                 <property name="visible">1</property>
-                                                <property name="use_action_appearance">0</property>
                                                 <property name="use_underline">1</property>
                                               </object>
                                             </child>
                                             <child>
                                               <object class="GtkSeparatorMenuItem" id="separatormenuitem1">
                                                 <property name="visible">1</property>
-                                                <property name="use_action_appearance">0</property>
                                               </object>
                                             </child>
                                             <child>
                                               <object class="GtkMenuItem" id="quitmenuitem">
                                                 <property name="label" translatable="yes">_Quit</property>
                                                 <property name="visible">1</property>
-                                                <property name="use_action_appearance">0</property>
                                                 <property name="use_underline">1</property>
                                                 <property name="action_name">app.quit</property>
                                               </object>
@@ -2303,7 +2296,6 @@ microphone-sensitivity-medium-symbolic</property>
                                     <child>
                                       <object class="GtkMenuItem" id="menuitem2">
                                         <property name="visible">1</property>
-                                        <property name="use_action_appearance">0</property>
                                         <property name="label" translatable="yes">_Edit</property>
                                         <property name="use_underline">1</property>
                                         <child type="submenu">
@@ -2314,7 +2306,6 @@ microphone-sensitivity-medium-symbolic</property>
                                                 <property name="label" translatable="yes">Cu_t</property>
                                                 <property name="visible">1</property>
                                                 <property name="can_focus">1</property>
-                                                <property name="use_action_appearance">0</property>
                                                 <property name="use_underline">1</property>
                                               </object>
                                             </child>
@@ -2322,7 +2313,6 @@ microphone-sensitivity-medium-symbolic</property>
                                               <object class="GtkMenuItem" id="menuitem107">
                                                 <property name="label" translatable="yes">_Copy</property>
                                                 <property name="visible">1</property>
-                                                <property name="use_action_appearance">0</property>
                                                 <property name="use_underline">1</property>
                                               </object>
                                             </child>
@@ -2330,7 +2320,6 @@ microphone-sensitivity-medium-symbolic</property>
                                               <object class="GtkMenuItem" id="menuitem108">
                                                 <property name="label" translatable="yes">_Paste</property>
                                                 <property name="visible">1</property>
-                                                <property name="use_action_appearance">0</property>
                                                 <property name="use_underline">1</property>
                                               </object>
                                             </child>
@@ -2338,7 +2327,6 @@ microphone-sensitivity-medium-symbolic</property>
                                               <object class="GtkMenuItem" id="deletemenuitem">
                                                 <property name="label" translatable="yes">_Delete</property>
                                                 <property name="visible">1</property>
-                                                <property name="use_action_appearance">0</property>
                                                 <property name="use_underline">1</property>
                                                 <property name="action_name">win.delete</property>
                                               </object>
@@ -2364,7 +2352,6 @@ microphone-sensitivity-medium-symbolic</property>
                                                         <property name="label">_Check</property>
                                                         <property name="active">1</property>
                                                         <property name="visible">1</property>
-                                                        <property name="use_action_appearance">0</property>
                                                         <property name="use_underline">1</property>
                                                       </object>
                                                     </child>
@@ -2374,7 +2361,6 @@ microphone-sensitivity-medium-symbolic</property>
                                                         <property name="active">1</property>
                                                         <property name="visible">1</property>
                                                         <property name="sensitive">0</property>
-                                                        <property name="use_action_appearance">0</property>
                                                         <property name="use_underline">1</property>
                                                       </object>
                                                     </child>
@@ -2383,7 +2369,6 @@ microphone-sensitivity-medium-symbolic</property>
                                                         <property name="label">_Check</property>
                                                         <property name="visible">1</property>
                                                         <property name="inconsistent">1</property>
-                                                        <property name="use_action_appearance">0</property>
                                                         <property name="use_underline">1</property>
                                                       </object>
                                                     </child>
@@ -2391,7 +2376,6 @@ microphone-sensitivity-medium-symbolic</property>
                                                       <object class="GtkCheckMenuItem" id="checkmenuitem4">
                                                         <property name="label">_Check</property>
                                                         <property name="visible">1</property>
-                                                        <property name="use_action_appearance">0</property>
                                                         <property name="use_underline">1</property>
                                                       </object>
                                                     </child>
@@ -2400,7 +2384,6 @@ microphone-sensitivity-medium-symbolic</property>
                                                         <property name="label">_Check</property>
                                                         <property name="visible">1</property>
                                                         <property name="sensitive">0</property>
-                                                        <property name="use_action_appearance">0</property>
                                                         <property name="use_underline">1</property>
                                                       </object>
                                                     </child>
@@ -2410,7 +2393,6 @@ microphone-sensitivity-medium-symbolic</property>
                                                         <property name="visible">1</property>
                                                         <property name="inconsistent">1</property>
                                                         <property name="sensitive">0</property>
-                                                        <property name="use_action_appearance">0</property>
                                                         <property name="use_underline">1</property>
                                                       </object>
                                                     </child>
@@ -2424,7 +2406,6 @@ microphone-sensitivity-medium-symbolic</property>
                                                         <property name="label">_Radio</property>
                                                         <property name="active">1</property>
                                                         <property name="visible">1</property>
-                                                        <property name="use_action_appearance">0</property>
                                                         <property name="use_underline">1</property>
                                                       </object>
                                                     </child>
@@ -2434,7 +2415,6 @@ microphone-sensitivity-medium-symbolic</property>
                                                         <property name="active">1</property>
                                                         <property name="visible">1</property>
                                                         <property name="sensitive">0</property>
-                                                        <property name="use_action_appearance">0</property>
                                                         <property name="use_underline">1</property>
                                                       </object>
                                                     </child>
@@ -2443,7 +2423,6 @@ microphone-sensitivity-medium-symbolic</property>
                                                         <property name="label">_Radio</property>
                                                         <property name="visible">1</property>
                                                         <property name="inconsistent">1</property>
-                                                        <property name="use_action_appearance">0</property>
                                                         <property name="use_underline">1</property>
                                                       </object>
                                                     </child>
@@ -2451,7 +2430,6 @@ microphone-sensitivity-medium-symbolic</property>
                                                       <object class="GtkRadioMenuItem" id="radiomenuitem4">
                                                         <property name="label">_Radio</property>
                                                         <property name="visible">1</property>
-                                                        <property name="use_action_appearance">0</property>
                                                         <property name="use_underline">1</property>
                                                       </object>
                                                     </child>
@@ -2460,7 +2438,6 @@ microphone-sensitivity-medium-symbolic</property>
                                                         <property name="label">_Radio</property>
                                                         <property name="visible">1</property>
                                                         <property name="sensitive">0</property>
-                                                        <property name="use_action_appearance">0</property>
                                                         <property name="use_underline">1</property>
                                                       </object>
                                                     </child>
@@ -2470,7 +2447,6 @@ microphone-sensitivity-medium-symbolic</property>
                                                         <property name="visible">1</property>
                                                         <property name="inconsistent">1</property>
                                                         <property name="sensitive">0</property>
-                                                        <property name="use_action_appearance">0</property>
                                                         <property name="use_underline">1</property>
                                                       </object>
                                                     </child>
@@ -2485,7 +2461,6 @@ microphone-sensitivity-medium-symbolic</property>
                                     <child>
                                       <object class="GtkMenuItem" id="menuitem3">
                                         <property name="visible">1</property>
-                                        <property name="use_action_appearance">0</property>
                                         <property name="label" translatable="yes">_View</property>
                                         <property name="use_underline">1</property>
                                         <child type="submenu">
@@ -2495,7 +2470,6 @@ microphone-sensitivity-medium-symbolic</property>
                                               <object class="GtkCheckMenuItem" id="darkmenuitem">
                                                 <property name="label">_Dark theme</property>
                                                 <property name="visible">1</property>
-                                                <property name="use_action_appearance">0</property>
                                                 <property name="use_underline">1</property>
                                                 <property name="action_name">win.dark</property>
                                               </object>
@@ -2505,7 +2479,6 @@ microphone-sensitivity-medium-symbolic</property>
                                                 <property name="label">_Toolbar</property>
                                                 <property name="visible">1</property>
                                                 <property name="active">1</property>
-                                                <property name="use_action_appearance">0</property>
                                                 <property name="use_underline">1</property>
                                                 <property name="action_name">win.toolbar</property>
                                               </object>
@@ -2515,7 +2488,6 @@ microphone-sensitivity-medium-symbolic</property>
                                                 <property name="label">_Statusbar</property>
                                                 <property name="visible">1</property>
                                                 <property name="active">1</property>
-                                                <property name="use_action_appearance">0</property>
                                                 <property name="use_underline">1</property>
                                                 <property name="action_name">win.statusbar</property>
                                               </object>
@@ -2524,7 +2496,6 @@ microphone-sensitivity-medium-symbolic</property>
                                               <object class="GtkMenuItem" id="bgmenuitem">
                                                 <property name="label">_Select Background</property>
                                                 <property name="visible">1</property>
-                                                <property name="use_action_appearance">0</property>
                                                 <property name="use_underline">1</property>
                                                 <property name="action_name">win.background</property>
                                               </object>
@@ -2536,7 +2507,6 @@ microphone-sensitivity-medium-symbolic</property>
                                     <child>
                                       <object class="GtkMenuItem" id="menuitem4">
                                         <property name="visible">1</property>
-                                        <property name="use_action_appearance">0</property>
                                         <property name="label" translatable="yes">_Help</property>
                                         <property name="use_underline">1</property>
                                         <child type="submenu">
@@ -2546,7 +2516,6 @@ microphone-sensitivity-medium-symbolic</property>
                                               <object class="GtkMenuItem" id="aboutmenuitem">
                                                 <property name="label" translatable="yes">_About</property>
                                                 <property name="visible">1</property>
-                                                <property name="use_action_appearance">0</property>
                                                 <property name="use_underline">1</property>
                                                 <property name="action_name">app.about</property>
                                               </object>
diff --git a/gtk/gtkcheckmenuitem.c b/gtk/gtkcheckmenuitem.c
index f7a40d1..b86a01b 100644
--- a/gtk/gtkcheckmenuitem.c
+++ b/gtk/gtkcheckmenuitem.c
@@ -27,7 +27,6 @@
 #include "gtkcheckmenuitemprivate.h"
 #include "gtkmenuitemprivate.h"
 #include "gtkaccellabel.h"
-#include "deprecated/gtkactivatable.h"
 #include "deprecated/gtktoggleaction.h"
 #include "gtkmarshalers.h"
 #include "gtkprivate.h"
@@ -107,22 +106,10 @@ static void gtk_check_menu_item_state_flags_changed (GtkWidget        *widget,
 static void gtk_check_menu_item_direction_changed   (GtkWidget        *widget,
                                                      GtkTextDirection  previous_dir);
 
-static void gtk_check_menu_item_activatable_interface_init (GtkActivatableIface  *iface);
-static void gtk_check_menu_item_update                     (GtkActivatable       *activatable,
-                                                            GtkAction            *action,
-                                                            const gchar          *property_name);
-static void gtk_check_menu_item_sync_action_properties     (GtkActivatable       *activatable,
-                                                            GtkAction            *action);
-
-static GtkActivatableIface *parent_activatable_iface;
 static guint                check_menu_item_signals[LAST_SIGNAL] = { 0 };
 
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
 G_DEFINE_TYPE_WITH_CODE (GtkCheckMenuItem, gtk_check_menu_item, GTK_TYPE_MENU_ITEM,
-                         G_ADD_PRIVATE (GtkCheckMenuItem)
-                         G_IMPLEMENT_INTERFACE (GTK_TYPE_ACTIVATABLE,
-                                                gtk_check_menu_item_activatable_interface_init))
-G_GNUC_END_IGNORE_DEPRECATIONS;
+                         G_ADD_PRIVATE (GtkCheckMenuItem))
 
 static void
 gtk_check_menu_item_size_allocate (GtkWidget     *widget,
@@ -258,86 +245,6 @@ gtk_check_menu_item_class_init (GtkCheckMenuItemClass *klass)
   gtk_widget_class_set_css_name (widget_class, "menuitem");
 }
 
-static void 
-gtk_check_menu_item_activatable_interface_init (GtkActivatableIface  *iface)
-{
-  parent_activatable_iface = g_type_interface_peek_parent (iface);
-  iface->update = gtk_check_menu_item_update;
-  iface->sync_action_properties = gtk_check_menu_item_sync_action_properties;
-}
-
-static void
-gtk_check_menu_item_update (GtkActivatable *activatable,
-                            GtkAction      *action,
-                            const gchar    *property_name)
-{
-  GtkCheckMenuItem *check_menu_item;
-  gboolean use_action_appearance;
-
-  check_menu_item = GTK_CHECK_MENU_ITEM (activatable);
-
-  parent_activatable_iface->update (activatable, action, property_name);
-
-  G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
-
-  if (strcmp (property_name, "active") == 0)
-    {
-      gtk_action_block_activate (action);
-      gtk_check_menu_item_set_active (check_menu_item, gtk_toggle_action_get_active (GTK_TOGGLE_ACTION 
(action)));
-      gtk_action_unblock_activate (action);
-    }
-
-  use_action_appearance = gtk_activatable_get_use_action_appearance (activatable);
-  G_GNUC_END_IGNORE_DEPRECATIONS;
-
-  if (!use_action_appearance)
-    return;
-
-  if (strcmp (property_name, "draw-as-radio") == 0)
-    {
-      G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
-      gtk_check_menu_item_set_draw_as_radio (check_menu_item,
-                                             gtk_toggle_action_get_draw_as_radio (GTK_TOGGLE_ACTION 
(action)));
-      G_GNUC_END_IGNORE_DEPRECATIONS;
-    }
-}
-
-static void
-gtk_check_menu_item_sync_action_properties (GtkActivatable *activatable,
-                                            GtkAction      *action)
-{
-  GtkCheckMenuItem *check_menu_item;
-  gboolean use_action_appearance;
-  gboolean is_toggle_action;
-
-  check_menu_item = GTK_CHECK_MENU_ITEM (activatable);
-
-  parent_activatable_iface->sync_action_properties (activatable, action);
-
-  G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
-  is_toggle_action = GTK_IS_TOGGLE_ACTION (action);
-  G_GNUC_END_IGNORE_DEPRECATIONS;
-
-  if (!is_toggle_action)
-    return;
-
-  G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
-  gtk_action_block_activate (action);
-
-  gtk_check_menu_item_set_active (check_menu_item, gtk_toggle_action_get_active (GTK_TOGGLE_ACTION 
(action)));
-  gtk_action_unblock_activate (action);
-  use_action_appearance = gtk_activatable_get_use_action_appearance (activatable);
-  G_GNUC_END_IGNORE_DEPRECATIONS;
-
-  if (!use_action_appearance)
-    return;
-
-  G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
-  gtk_check_menu_item_set_draw_as_radio (check_menu_item,
-                                         gtk_toggle_action_get_draw_as_radio (GTK_TOGGLE_ACTION (action)));
-  G_GNUC_END_IGNORE_DEPRECATIONS;
-}
-
 /**
  * gtk_check_menu_item_new:
  *
diff --git a/gtk/gtkmenuitem.c b/gtk/gtkmenuitem.c
index 121a9eb..c91a378 100644
--- a/gtk/gtkmenuitem.c
+++ b/gtk/gtkmenuitem.c
@@ -40,7 +40,6 @@
 #include "gtkseparatormenuitem.h"
 #include "gtkprivate.h"
 #include "gtkbuildable.h"
-#include "deprecated/gtkactivatable.h"
 #include "gtkwidgetprivate.h"
 #include "gtkintl.h"
 #include "gtksettings.h"
@@ -123,10 +122,6 @@ enum {
 
   LAST_PROP,
 
-  /* activatable properties */
-  PROP_ACTIVATABLE_RELATED_ACTION = LAST_PROP,
-  PROP_ACTIVATABLE_USE_ACTION_APPEARANCE,
-
   PROP_ACTION_NAME,
   PROP_ACTION_TARGET
 };
@@ -195,32 +190,18 @@ static void gtk_menu_item_buildable_custom_finished(GtkBuildable        *buildab
                                                     gpointer             user_data);
 
 static void gtk_menu_item_actionable_interface_init  (GtkActionableInterface *iface);
-static void gtk_menu_item_activatable_interface_init (GtkActivatableIface  *iface);
-static void gtk_menu_item_update                     (GtkActivatable       *activatable,
-                                                      GtkAction            *action,
-                                                      const gchar          *property_name);
-static void gtk_menu_item_sync_action_properties     (GtkActivatable       *activatable,
-                                                      GtkAction            *action);
-static void gtk_menu_item_set_related_action         (GtkMenuItem          *menu_item, 
-                                                      GtkAction            *action);
-static void gtk_menu_item_set_use_action_appearance  (GtkMenuItem          *menu_item, 
-                                                      gboolean              use_appearance);
 
 static guint menu_item_signals[LAST_SIGNAL] = { 0 };
 static GParamSpec *menu_item_props[LAST_PROP];
 
 static GtkBuildableIface *parent_buildable_iface;
 
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
 G_DEFINE_TYPE_WITH_CODE (GtkMenuItem, gtk_menu_item, GTK_TYPE_BIN,
                          G_ADD_PRIVATE (GtkMenuItem)
                          G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
                                                 gtk_menu_item_buildable_interface_init)
-                         G_IMPLEMENT_INTERFACE (GTK_TYPE_ACTIVATABLE,
-                                                gtk_menu_item_activatable_interface_init)
                          G_IMPLEMENT_INTERFACE (GTK_TYPE_ACTIONABLE,
                                                 gtk_menu_item_actionable_interface_init))
-G_GNUC_END_IGNORE_DEPRECATIONS;
 
 static void
 gtk_menu_item_set_action_name (GtkActionable *actionable,
@@ -790,9 +771,6 @@ gtk_menu_item_class_init (GtkMenuItemClass *klass)
 
   g_object_class_install_properties (gobject_class, LAST_PROP, menu_item_props);
 
-  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_ACTION_NAME, "action-name");
   g_object_class_override_property (gobject_class, PROP_ACTION_TARGET, "action-target");
 
@@ -811,9 +789,6 @@ gtk_menu_item_init (GtkMenuItem *menu_item)
 
   gtk_widget_set_has_window (GTK_WIDGET (menu_item), FALSE);
 
-  priv->action = NULL;
-  priv->use_action_appearance = TRUE;
-  
   priv->submenu = NULL;
   priv->toggle_size = 0;
   priv->accelerator_width = 0;
@@ -822,9 +797,7 @@ gtk_menu_item_init (GtkMenuItem *menu_item)
   else
     priv->submenu_direction = GTK_DIRECTION_RIGHT;
   priv->submenu_placement = GTK_TOP_BOTTOM;
-  priv->use_action_appearance = TRUE;
   priv->timer = 0;
-  priv->action = NULL;
 
   widget_node = gtk_widget_get_css_node (GTK_WIDGET (menu_item));
   priv->gadget = gtk_css_custom_gadget_new_for_node (widget_node,
@@ -900,15 +873,6 @@ gtk_menu_item_dispose (GObject *object)
 
   g_clear_object (&priv->action_helper);
 
-  if (priv->action)
-    {
-      G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
-      gtk_action_disconnect_accelerator (priv->action);
-      gtk_activatable_do_set_related_action (GTK_ACTIVATABLE (menu_item), NULL);
-      G_GNUC_END_IGNORE_DEPRECATIONS;
-      priv->action = NULL;
-    }
-
   g_clear_object (&priv->arrow_gadget);
   g_clear_object (&priv->gadget);
 
@@ -937,12 +901,6 @@ gtk_menu_item_set_property (GObject      *object,
     case PROP_USE_UNDERLINE:
       gtk_menu_item_set_use_underline (menu_item, g_value_get_boolean (value));
       break;
-    case PROP_ACTIVATABLE_RELATED_ACTION:
-      gtk_menu_item_set_related_action (menu_item, g_value_get_object (value));
-      break;
-    case PROP_ACTIVATABLE_USE_ACTION_APPEARANCE:
-      gtk_menu_item_set_use_action_appearance (menu_item, g_value_get_boolean (value));
-      break;
     case PROP_ACTION_NAME:
       gtk_menu_item_set_action_name (GTK_ACTIONABLE (menu_item), g_value_get_string (value));
       break;
@@ -978,12 +936,6 @@ gtk_menu_item_get_property (GObject    *object,
     case PROP_USE_UNDERLINE:
       g_value_set_boolean (value, gtk_menu_item_get_use_underline (menu_item));
       break;
-    case PROP_ACTIVATABLE_RELATED_ACTION:
-      g_value_set_object (value, priv->action);
-      break;
-    case PROP_ACTIVATABLE_USE_ACTION_APPEARANCE:
-      g_value_set_boolean (value, priv->use_action_appearance);
-      break;
     case PROP_ACTION_NAME:
       g_value_set_string (value, gtk_action_helper_get_action_name (priv->action_helper));
       break;
@@ -1082,211 +1034,6 @@ gtk_menu_item_buildable_custom_finished (GtkBuildable *buildable,
     parent_buildable_iface->custom_finished (buildable, builder, child, tagname, user_data);
 }
 
-
-static void
-gtk_menu_item_activatable_interface_init (GtkActivatableIface *iface)
-{
-  iface->update = gtk_menu_item_update;
-  iface->sync_action_properties = gtk_menu_item_sync_action_properties;
-}
-
-static void
-activatable_update_label (GtkMenuItem *menu_item, GtkAction *action)
-{
-  GtkWidget *child;
-
-  child = gtk_bin_get_child (GTK_BIN (menu_item));
-
-  if (GTK_IS_LABEL (child))
-    {
-      const gchar *label;
-
-      G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
-      label = gtk_action_get_label (action);
-      G_GNUC_END_IGNORE_DEPRECATIONS;
-      gtk_menu_item_set_label (menu_item, label);
-    }
-}
-
-/*
- * gtk_menu_is_empty:
- * @menu: (allow-none): a #GtkMenu or %NULL
- * 
- * Determines whether @menu is empty. A menu is considered empty if it
- * the only visible children are “filler” menu items which were
- * inserted to mark the menu as empty.
- * 
- * This function is used by #GtkAction.
- *
- * Returns: whether @menu is empty.
- **/
-static gboolean
-gtk_menu_is_empty (GtkWidget *menu)
-{
-  GList *children, *cur;
-  gboolean result = TRUE;
-
-  g_return_val_if_fail (menu == NULL || GTK_IS_MENU (menu), TRUE);
-
-  if (!menu)
-    return FALSE;
-
-  children = gtk_container_get_children (GTK_CONTAINER (menu));
-
-  cur = children;
-  while (cur) 
-    {
-      if (gtk_widget_get_visible (cur->data))
-       {
-         if (!g_object_get_data (cur->data, "gtk-empty-menu-item"))
-            {
-             result = FALSE;
-              break;
-            }
-       }
-      cur = cur->next;
-    }
-  g_list_free (children);
-
-  return result;
-}
-
-
-static void
-gtk_menu_item_update (GtkActivatable *activatable,
-                      GtkAction      *action,
-                      const gchar    *property_name)
-{
-  GtkMenuItem *menu_item = GTK_MENU_ITEM (activatable);
-  GtkMenuItemPrivate *priv = menu_item->priv;
-
-  if (strcmp (property_name, "visible") == 0)
-    {
-      G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
-      _gtk_action_sync_menu_visible (action, GTK_WIDGET (menu_item),
-                                     gtk_menu_is_empty (gtk_menu_item_get_submenu (menu_item)));
-      G_GNUC_END_IGNORE_DEPRECATIONS;
-    }
-  else if (strcmp (property_name, "sensitive") == 0)
-    {
-      G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
-      gtk_widget_set_sensitive (GTK_WIDGET (menu_item), gtk_action_is_sensitive (action));
-      G_GNUC_END_IGNORE_DEPRECATIONS;
-    }
-  else if (priv->use_action_appearance)
-    {
-      if (strcmp (property_name, "label") == 0)
-        activatable_update_label (menu_item, action);
-    }
-}
-
-static void
-gtk_menu_item_sync_action_properties (GtkActivatable *activatable,
-                                      GtkAction      *action)
-{
-  GtkMenuItem *menu_item = GTK_MENU_ITEM (activatable);
-  GtkMenuItemPrivate *priv = menu_item->priv;
-  GtkWidget *label;
-
-  if (!priv->use_action_appearance || !action)
-    {
-      label = gtk_bin_get_child (GTK_BIN (menu_item));
-
-      if (GTK_IS_ACCEL_LABEL (label))
-        gtk_accel_label_set_accel_widget (GTK_ACCEL_LABEL (label), GTK_WIDGET (menu_item));
-    }
-
-  if (!action)
-    return;
-
-  _gtk_action_sync_menu_visible (action, GTK_WIDGET (menu_item),
-                                 gtk_menu_is_empty (gtk_menu_item_get_submenu (menu_item)));
-
-  G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
-  gtk_widget_set_sensitive (GTK_WIDGET (menu_item), gtk_action_is_sensitive (action));
-  G_GNUC_END_IGNORE_DEPRECATIONS;
-
-  if (priv->use_action_appearance)
-    {
-      label = gtk_bin_get_child (GTK_BIN (menu_item));
-
-      /* make sure label is a label, deleting it otherwise */
-      if (label && !GTK_IS_LABEL (label))
-        {
-          gtk_container_remove (GTK_CONTAINER (menu_item), label);
-          label = NULL;
-        }
-      /* Make sure that menu_item has a label and that any
-       * accelerators are set */
-      gtk_menu_item_ensure_label (menu_item);
-      gtk_menu_item_set_use_underline (menu_item, TRUE);
-      /* Make label point to the menu_item's label */
-      label = gtk_bin_get_child (GTK_BIN (menu_item));
-
-      G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
-      if (GTK_IS_ACCEL_LABEL (label) && gtk_action_get_accel_path (action))
-        {
-          gtk_accel_label_set_accel_widget (GTK_ACCEL_LABEL (label), NULL);
-          gtk_accel_label_set_accel_closure (GTK_ACCEL_LABEL (label),
-                                             gtk_action_get_accel_closure (action));
-        }
-      G_GNUC_END_IGNORE_DEPRECATIONS;
-
-      activatable_update_label (menu_item, action);
-    }
-}
-
-static void
-gtk_menu_item_set_related_action (GtkMenuItem *menu_item,
-                                  GtkAction   *action)
-{
-    GtkMenuItemPrivate *priv = menu_item->priv;
-
-    if (priv->action == action)
-      return;
-
-    G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
-
-    if (priv->action)
-      {
-        gtk_action_disconnect_accelerator (priv->action);
-      }
-
-    if (action)
-      {
-        const gchar *accel_path;
-
-        accel_path = gtk_action_get_accel_path (action);
-        if (accel_path)
-          {
-            gtk_action_connect_accelerator (action);
-            gtk_menu_item_set_accel_path (menu_item, accel_path);
-          }
-      }
-
-    gtk_activatable_do_set_related_action (GTK_ACTIVATABLE (menu_item), action);
-
-    G_GNUC_END_IGNORE_DEPRECATIONS;
-
-    priv->action = action;
-}
-
-static void
-gtk_menu_item_set_use_action_appearance (GtkMenuItem *menu_item,
-                                         gboolean     use_appearance)
-{
-    GtkMenuItemPrivate *priv = menu_item->priv;
-
-    if (priv->use_action_appearance != use_appearance)
-      {
-        priv->use_action_appearance = use_appearance;
-
-        G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
-        gtk_activatable_sync_action_properties (GTK_ACTIVATABLE (menu_item), priv->action);
-        G_GNUC_END_IGNORE_DEPRECATIONS;
-      }
-}
-
 static void
 update_node_classes (GtkMenuItem *menu_item)
 {
@@ -1658,15 +1405,8 @@ gtk_real_menu_item_activate (GtkMenuItem *menu_item)
 {
   GtkMenuItemPrivate *priv = menu_item->priv;
 
-  G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
-
   if (priv->action_helper)
     gtk_action_helper_activate (priv->action_helper);
-
-  if (priv->action)
-    gtk_action_activate (priv->action);
-
-  G_GNUC_END_IGNORE_DEPRECATIONS;
 }
 
 
diff --git a/gtk/gtkmenuitemprivate.h b/gtk/gtkmenuitemprivate.h
index 910cacb..a59e84b 100644
--- a/gtk/gtkmenuitemprivate.h
+++ b/gtk/gtkmenuitemprivate.h
@@ -38,7 +38,6 @@ struct _GtkMenuItemPrivate
 
   gchar  *accel_path;
 
-  GtkAction *action;
   GtkActionHelper *action_helper;
 
   GtkCssGadget *gadget;
@@ -48,7 +47,6 @@ struct _GtkMenuItemPrivate
   guint submenu_direction      : 1;
   guint right_justify          : 1;
   guint from_menubar           : 1;
-  guint use_action_appearance  : 1;
   guint reserve_indicator      : 1;
 };
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]