Remove GtkImageMenuItem

This commit is contained in:
Timm Bäder 2016-10-03 18:25:18 +02:00 committed by Benjamin Otte
parent 8a3595236d
commit 155fa4664d
10 changed files with 6 additions and 1264 deletions

View File

@ -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 \

View File

@ -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;

File diff suppressed because it is too large Load Diff

View File

@ -1,99 +0,0 @@
/* GTK - The GIMP Toolkit
* Copyright (C) Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#ifndef __GTK_IMAGE_MENU_ITEM_H__
#define __GTK_IMAGE_MENU_ITEM_H__
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <gtk/gtk.h> can be included directly."
#endif
#include <gtk/gtkmenuitem.h>
G_BEGIN_DECLS
#define GTK_TYPE_IMAGE_MENU_ITEM (gtk_image_menu_item_get_type ())
#define GTK_IMAGE_MENU_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_IMAGE_MENU_ITEM, GtkImageMenuItem))
#define GTK_IMAGE_MENU_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_IMAGE_MENU_ITEM, GtkImageMenuItemClass))
#define GTK_IS_IMAGE_MENU_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_IMAGE_MENU_ITEM))
#define GTK_IS_IMAGE_MENU_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_IMAGE_MENU_ITEM))
#define GTK_IMAGE_MENU_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_IMAGE_MENU_ITEM, GtkImageMenuItemClass))
typedef struct _GtkImageMenuItem GtkImageMenuItem;
typedef struct _GtkImageMenuItemPrivate GtkImageMenuItemPrivate;
typedef struct _GtkImageMenuItemClass GtkImageMenuItemClass;
struct _GtkImageMenuItem
{
GtkMenuItem menu_item;
/*< private >*/
GtkImageMenuItemPrivate *priv;
};
/**
* GtkImageMenuItemClass:
* @parent_class: The parent class.
*/
struct _GtkImageMenuItemClass
{
GtkMenuItemClass parent_class;
/*< private >*/
/* Padding for future expansion */
void (*_gtk_reserved1) (void);
void (*_gtk_reserved2) (void);
void (*_gtk_reserved3) (void);
void (*_gtk_reserved4) (void);
};
GDK_DEPRECATED_IN_3_10_FOR(gtk_menu_item_get_type)
GType gtk_image_menu_item_get_type (void) G_GNUC_CONST;
GDK_DEPRECATED_IN_3_10_FOR(gtk_menu_item_new)
GtkWidget* gtk_image_menu_item_new (void);
GDK_DEPRECATED_IN_3_10_FOR(gtk_menu_item_new_with_label)
GtkWidget* gtk_image_menu_item_new_with_label (const gchar *label);
GDK_DEPRECATED_IN_3_10_FOR(gtk_menu_item_new_with_mnemonic)
GtkWidget* gtk_image_menu_item_new_with_mnemonic (const gchar *label);
GDK_DEPRECATED_IN_3_10
void gtk_image_menu_item_set_always_show_image (GtkImageMenuItem *image_menu_item,
gboolean always_show);
GDK_DEPRECATED_IN_3_10
gboolean gtk_image_menu_item_get_always_show_image (GtkImageMenuItem *image_menu_item);
GDK_DEPRECATED_IN_3_10
void gtk_image_menu_item_set_image (GtkImageMenuItem *image_menu_item,
GtkWidget *image);
GDK_DEPRECATED_IN_3_10
GtkWidget* gtk_image_menu_item_get_image (GtkImageMenuItem *image_menu_item);
GDK_DEPRECATED_IN_3_10
void gtk_image_menu_item_set_accel_group (GtkImageMenuItem *image_menu_item,
GtkAccelGroup *accel_group);
G_END_DECLS
#endif /* __GTK_IMAGE_MENU_ITEM_H__ */

View File

@ -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);

View File

@ -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);
}

View File

@ -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>

View File

@ -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"

View File

@ -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"

View File

@ -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);