[gtk+/wip/otte/gtk4: 67/121] Remove GtkImageMenuItem



commit c5fea44eb0057b0cee1ede3e8a52b09a80529dd1
Author: Timm Bäder <mail baedert org>
Date:   Mon Oct 3 18:25:18 2016 +0200

    Remove GtkImageMenuItem

 gtk/deprecated/Makefile.inc       |    2 -
 gtk/deprecated/gtkaction.c        |    5 +-
 gtk/deprecated/gtkimagemenuitem.c | 1106 -------------------------------------
 gtk/deprecated/gtkimagemenuitem.h |   99 ----
 gtk/deprecated/gtkrecentaction.c  |    9 +-
 gtk/deprecated/gtkuimanager.c     |   11 -
 gtk/gtk.h                         |    1 -
 gtk/gtkrecentchoosermenu.c        |    1 -
 gtk/gtktoolbutton.c               |    1 -
 testsuite/gtk/builder.c           |   35 +--
 10 files changed, 6 insertions(+), 1264 deletions(-)
---
diff --git a/gtk/deprecated/Makefile.inc b/gtk/deprecated/Makefile.inc
index 8e9f75a..5034a9c 100644
--- a/gtk/deprecated/Makefile.inc
+++ b/gtk/deprecated/Makefile.inc
@@ -14,7 +14,6 @@ deprecated_h_sources =                        \
        deprecated/gtkhseparator.h      \
        deprecated/gtkhsv.h             \
        deprecated/gtkiconfactory.h     \
-       deprecated/gtkimagemenuitem.h   \
        deprecated/gtkradioaction.h     \
        deprecated/gtkrecentaction.h    \
        deprecated/gtkstock.h           \
@@ -53,7 +52,6 @@ deprecated_c_sources =                        \
        deprecated/gtkhseparator.c      \
        deprecated/gtkhsv.c             \
        deprecated/gtkiconfactory.c     \
-       deprecated/gtkimagemenuitem.c   \
        deprecated/gtkradioaction.c     \
        deprecated/gtkrecentaction.c    \
        deprecated/gtkstock.c           \
diff --git a/gtk/deprecated/gtkaction.c b/gtk/deprecated/gtkaction.c
index e48c81e..b684ccd 100644
--- a/gtk/deprecated/gtkaction.c
+++ b/gtk/deprecated/gtkaction.c
@@ -91,7 +91,6 @@
 #include "gtkbutton.h"
 #include "gtkiconfactory.h"
 #include "gtkimage.h"
-#include "gtkimagemenuitem.h"
 #include "gtkintl.h"
 #include "gtklabel.h"
 #include "gtkmarshalers.h"
@@ -222,9 +221,7 @@ gtk_action_class_init (GtkActionClass *klass)
   klass->create_menu_item  = create_menu_item;
   klass->create_tool_item  = create_tool_item;
   klass->create_menu       = NULL;
-  G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
-  klass->menu_item_type    = GTK_TYPE_IMAGE_MENU_ITEM;
-  G_GNUC_END_IGNORE_DEPRECATIONS;
+  klass->menu_item_type    = GTK_TYPE_MENU_ITEM;
   klass->toolbar_item_type = GTK_TYPE_TOOL_BUTTON;
   klass->connect_proxy    = connect_proxy;
   klass->disconnect_proxy = disconnect_proxy;
diff --git a/gtk/deprecated/gtkrecentaction.c b/gtk/deprecated/gtkrecentaction.c
index 3431e37..3aab522 100644
--- a/gtk/deprecated/gtkrecentaction.c
+++ b/gtk/deprecated/gtkrecentaction.c
@@ -23,7 +23,6 @@
 
 #include "gtkintl.h"
 #include "gtkrecentaction.h"
-#include "gtkimagemenuitem.h"
 #include "gtkmenutoolbutton.h"
 #include "gtkrecentchooser.h"
 #include "gtkrecentchoosermenu.h"
@@ -434,9 +433,7 @@ gtk_recent_action_create_menu_item (GtkAction *action)
   GtkWidget *menuitem;
 
   menu = gtk_recent_action_create_menu (action);
-  G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
-  menuitem = g_object_new (GTK_TYPE_IMAGE_MENU_ITEM, NULL);
-  G_GNUC_END_IGNORE_DEPRECATIONS;
+  menuitem = gtk_menu_item_new ();
   gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), menu);
   gtk_widget_show (menu);
 
@@ -654,9 +651,7 @@ gtk_recent_action_class_init (GtkRecentActionClass *klass)
   action_class->create_menu_item = gtk_recent_action_create_menu_item;
   action_class->create_tool_item = gtk_recent_action_create_tool_item;
   action_class->create_menu = gtk_recent_action_create_menu;
-  G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
-  action_class->menu_item_type = GTK_TYPE_IMAGE_MENU_ITEM;
-  G_GNUC_END_IGNORE_DEPRECATIONS;
+  action_class->menu_item_type = GTK_TYPE_MENU_ITEM;
   action_class->toolbar_item_type = GTK_TYPE_MENU_TOOL_BUTTON;
 
   _gtk_recent_chooser_install_properties (gobject_class);
diff --git a/gtk/deprecated/gtkuimanager.c b/gtk/deprecated/gtkuimanager.c
index 86af421..e38b548 100644
--- a/gtk/deprecated/gtkuimanager.c
+++ b/gtk/deprecated/gtkuimanager.c
@@ -34,7 +34,6 @@
 #include "gtkaccellabel.h"
 #include "gtkactivatable.h"
 #include "gtkbuildable.h"
-#include "gtkimagemenuitem.h"
 #include "gtkintl.h"
 #include "gtkmarshalers.h"
 #include "gtkmenu.h"
@@ -2730,16 +2729,6 @@ update_node (GtkUIManager *manager,
              info->proxy = gtk_action_create_menu_item (action);
              g_object_ref_sink (info->proxy);
              gtk_widget_set_name (info->proxy, info->name);
-
-              G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
-
-              if (info->always_show_image_set &&
-                  GTK_IS_IMAGE_MENU_ITEM (info->proxy))
-                gtk_image_menu_item_set_always_show_image (GTK_IMAGE_MENU_ITEM (info->proxy),
-                                                           info->always_show_image);
-
-              G_GNUC_END_IGNORE_DEPRECATIONS;
-
              gtk_menu_shell_insert (GTK_MENU_SHELL (menushell),
                                     info->proxy, pos);
            }
diff --git a/gtk/gtk.h b/gtk/gtk.h
index 4c6a918..4b1bd55 100644
--- a/gtk/gtk.h
+++ b/gtk/gtk.h
@@ -259,7 +259,6 @@
 #include <gtk/deprecated/gtkhscrollbar.h>
 #include <gtk/deprecated/gtkhseparator.h>
 #include <gtk/deprecated/gtkiconfactory.h>
-#include <gtk/deprecated/gtkimagemenuitem.h>
 #include <gtk/deprecated/gtkradioaction.h>
 #include <gtk/deprecated/gtkrecentaction.h>
 #include <gtk/deprecated/gtkstock.h>
diff --git a/gtk/gtkrecentchoosermenu.c b/gtk/gtkrecentchoosermenu.c
index 8da36d4..8921cd7 100644
--- a/gtk/gtkrecentchoosermenu.c
+++ b/gtk/gtkrecentchoosermenu.c
@@ -32,7 +32,6 @@
 #include "gtksettings.h"
 #include "gtkmenushell.h"
 #include "gtkmenuitem.h"
-#include "deprecated/gtkimagemenuitem.h"
 #include "gtkseparatormenuitem.h"
 #include "gtkmenu.h"
 #include "gtkimage.h"
diff --git a/gtk/gtktoolbutton.c b/gtk/gtktoolbutton.c
index 2aa4946..230952a 100644
--- a/gtk/gtktoolbutton.c
+++ b/gtk/gtktoolbutton.c
@@ -22,7 +22,6 @@
 #include "gtktoolbutton.h"
 #include "gtkbutton.h"
 #include "gtkimage.h"
-#include "deprecated/gtkimagemenuitem.h"
 #include "gtklabel.h"
 #include "deprecated/gtkstock.h"
 #include "gtkbox.h"
diff --git a/testsuite/gtk/builder.c b/testsuite/gtk/builder.c
index 364ef3d..fa54f96 100644
--- a/testsuite/gtk/builder.c
+++ b/testsuite/gtk/builder.c
@@ -2264,10 +2264,9 @@ test_menus (void)
     "                  <object class=\"GtkMenu\" id=\"menu1\">"
     "                    <property name=\"visible\">True</property>"
     "                    <child>"
-    "                      <object class=\"GtkImageMenuItem\" id=\"imagemenuitem1\">"
+    "                      <object class=\"GtkMenuItem\" id=\"imagemenuitem1\">"
     "                        <property name=\"label\">gtk-new</property>"
     "                        <property name=\"visible\">True</property>"
-    "                        <property name=\"accel_group\">accelgroup1</property>"
     "                      </object>"
     "                    </child>"
     "                  </object>"
@@ -2296,7 +2295,7 @@ test_menus (void)
     "          <object class=\"GtkMenuBar\" id=\"menubar1\">"
     "            <property name=\"visible\">True</property>"
     "            <child>"
-    "              <object class=\"GtkImageMenuItem\" id=\"imagemenuitem1\">"
+    "              <object class=\"GtkMenuItem\" id=\"imagemenuitem1\">"
     "                <property name=\"visible\">True</property>"
     "                <child>"
     "                  <object class=\"GtkLabel\" id=\"custom1\">"
@@ -2314,49 +2313,21 @@ test_menus (void)
     "<object class=\"GtkAccelGroup\" id=\"accelgroup1\"/>"
     "</interface>";
   GtkBuilder *builder;
-  GtkWidget *child;
   GtkWidget *window, *item;
-  GtkAccelGroup *accel_group;
-  GtkWidget *item_accel_label, *sample_accel_label, *sample_menu_item, *custom;
+  GtkWidget *custom;
 
   /* Check that the item has the correct accel label string set
    */
   builder = builder_new_from_string (buffer, -1, NULL);
   window = (GtkWidget *)gtk_builder_get_object (builder, "window1");
   item = (GtkWidget *)gtk_builder_get_object (builder, "imagemenuitem1");
-  accel_group = (GtkAccelGroup *)gtk_builder_get_object (builder, "accelgroup1");
 
   gtk_widget_show_all (window);
 
-  G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
-  sample_menu_item = gtk_image_menu_item_new ();//_with_label ("Some Label");
-  gtk_image_menu_item_set_accel_group (GTK_IMAGE_MENU_ITEM (sample_menu_item), accel_group);
-  G_GNUC_END_IGNORE_DEPRECATIONS;
-
-  child = gtk_bin_get_child (GTK_BIN (sample_menu_item));
-  g_assert (child);
-  g_assert (GTK_IS_ACCEL_LABEL (child));
-  sample_accel_label = child;
-  gtk_widget_show (sample_accel_label);
-
-  child = gtk_bin_get_child (GTK_BIN (item));
-  g_assert (child);
-  g_assert (GTK_IS_ACCEL_LABEL (child));
-  item_accel_label = child;
-
-  gtk_accel_label_refetch (GTK_ACCEL_LABEL (sample_accel_label));
-  gtk_accel_label_refetch (GTK_ACCEL_LABEL (item_accel_label));
-
-  g_assert (gtk_label_get_text (GTK_LABEL (sample_accel_label)) != NULL);
-  g_assert (gtk_label_get_text (GTK_LABEL (item_accel_label)) != NULL);
-  g_assert (strcmp (gtk_label_get_text (GTK_LABEL (item_accel_label)),
-                   gtk_label_get_text (GTK_LABEL (sample_accel_label))) == 0);
-
   /* Check the menu hierarchy worked here  */
   g_assert (get_parent_menubar (item));
 
   gtk_widget_destroy (GTK_WIDGET (window));
-  gtk_widget_destroy (sample_menu_item);
   g_object_unref (builder);
 
 


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