[gtk+/wip/baedert/box: 55/68] Remove GtkRadioAction
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/baedert/box: 55/68] Remove GtkRadioAction
- Date: Mon, 17 Oct 2016 15:46:03 +0000 (UTC)
commit 51829cdb4a2381cae44df295c712ce4698cf6280
Author: Timm Bäder <mail baedert org>
Date: Sun Oct 16 17:46:00 2016 +0200
Remove GtkRadioAction
docs/reference/gtk/gtk4-sections.txt | 22 --
gtk/deprecated/Makefile.inc | 2 -
gtk/deprecated/gtkactiongroup.c | 14 +-
gtk/deprecated/gtkradioaction.c | 614 ----------------------------------
gtk/deprecated/gtkradioaction.h | 96 ------
gtk/gtk.h | 1 -
tests/testactions.c | 53 ---
tests/testmerge.c | 26 --
testsuite/gtk/notify.c | 14 +-
9 files changed, 3 insertions(+), 839 deletions(-)
---
diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt
index 63c764a..1dbf54d 100644
--- a/docs/reference/gtk/gtk4-sections.txt
+++ b/docs/reference/gtk/gtk4-sections.txt
@@ -2415,28 +2415,6 @@ gtk_progress_bar_get_type
</SECTION>
<SECTION>
-<FILE>gtkradioaction</FILE>
-<TITLE>GtkRadioAction</TITLE>
-GtkRadioAction
-gtk_radio_action_new
-gtk_radio_action_get_group
-gtk_radio_action_set_group
-gtk_radio_action_join_group
-gtk_radio_action_get_current_value
-gtk_radio_action_set_current_value
-<SUBSECTION Standard>
-GTK_TYPE_RADIO_ACTION
-GTK_RADIO_ACTION
-GTK_RADIO_ACTION_CLASS
-GTK_IS_RADIO_ACTION
-GTK_IS_RADIO_ACTION_CLASS
-GTK_RADIO_ACTION_GET_CLASS
-<SUBSECTION Private>
-gtk_radio_action_get_type
-GtkRadioActionPrivate
-</SECTION>
-
-<SECTION>
<FILE>gtkradiobutton</FILE>
<TITLE>GtkRadioButton</TITLE>
GtkRadioButton
diff --git a/gtk/deprecated/Makefile.inc b/gtk/deprecated/Makefile.inc
index c61a564..706061a 100644
--- a/gtk/deprecated/Makefile.inc
+++ b/gtk/deprecated/Makefile.inc
@@ -3,7 +3,6 @@ deprecated_h_sources = \
deprecated/gtkaction.h \
deprecated/gtkactiongroup.h \
deprecated/gtkgradient.h \
- deprecated/gtkradioaction.h \
deprecated/gtkrecentaction.h \
deprecated/gtksymboliccolor.h \
deprecated/gtktoggleaction.h \
@@ -18,7 +17,6 @@ deprecated_c_sources = \
deprecated/gtkaction.c \
deprecated/gtkactiongroup.c \
deprecated/gtkgradient.c \
- deprecated/gtkradioaction.c \
deprecated/gtkrecentaction.c \
deprecated/gtksymboliccolor.c \
deprecated/gtktoggleaction.c \
diff --git a/gtk/deprecated/gtkactiongroup.c b/gtk/deprecated/gtkactiongroup.c
index b34e5b4..f1e8798 100644
--- a/gtk/deprecated/gtkactiongroup.c
+++ b/gtk/deprecated/gtkactiongroup.c
@@ -92,7 +92,6 @@
#include "gtkbuildable.h"
#include "gtkicontheme.h"
#include "gtktoggleaction.h"
-#include "gtkradioaction.h"
#include "gtkaccelmap.h"
#include "gtkmarshalers.h"
#include "gtkbuilderprivate.h"
@@ -1394,13 +1393,13 @@ gtk_action_group_add_radio_actions_full (GtkActionGroup *action_group
*/
guint i;
GSList *group = NULL;
- GtkRadioAction *first_action = NULL;
+ GtkAction *first_action = NULL;
g_return_if_fail (GTK_IS_ACTION_GROUP (action_group));
for (i = 0; i < n_entries; i++)
{
- GtkRadioAction *action;
+ GtkAction *action;
const gchar *label;
const gchar *tooltip;
@@ -1410,12 +1409,6 @@ gtk_action_group_add_radio_actions_full (GtkActionGroup *action_group
label = gtk_action_group_translate_string (action_group, entries[i].label);
tooltip = gtk_action_group_translate_string (action_group, entries[i].tooltip);
- action = gtk_radio_action_new (entries[i].name,
- label,
- tooltip,
- NULL,
- entries[i].value);
-
if (entries[i].stock_id)
{
g_object_set (action, "icon-name", entries[i].stock_id, NULL);
@@ -1424,9 +1417,6 @@ gtk_action_group_add_radio_actions_full (GtkActionGroup *action_group
if (i == 0)
first_action = action;
- gtk_radio_action_set_group (action, group);
- group = gtk_radio_action_get_group (action);
-
if (value == entries[i].value)
gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), TRUE);
diff --git a/gtk/gtk.h b/gtk/gtk.h
index ac265ce..5dc0da6 100644
--- a/gtk/gtk.h
+++ b/gtk/gtk.h
@@ -248,7 +248,6 @@
#include <gtk/deprecated/gtkaction.h>
#include <gtk/deprecated/gtkactiongroup.h>
#include <gtk/deprecated/gtkgradient.h>
-#include <gtk/deprecated/gtkradioaction.h>
#include <gtk/deprecated/gtkrecentaction.h>
#include <gtk/deprecated/gtksymboliccolor.h>
#include <gtk/deprecated/gtktoggleaction.h>
diff --git a/tests/testactions.c b/tests/testactions.c
index 97598f9..2e15bc4 100644
--- a/tests/testactions.c
+++ b/tests/testactions.c
@@ -43,17 +43,6 @@ toggle_action (GtkAction *action)
static void
-radio_action (GtkAction *action)
-{
- const gchar *name = gtk_action_get_name (action);
- const gchar *typename = G_OBJECT_TYPE_NAME (action);
-
- g_message ("Action %s (type=%s) activated (active=%d) (value %d)", name, typename,
- gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)),
- gtk_radio_action_get_current_value (GTK_RADIO_ACTION (action)));
-}
-
-static void
recent_action (GtkAction *action)
{
const gchar *name = gtk_action_get_name (action);
@@ -93,20 +82,6 @@ show_accel_dialog (GtkAction *action)
}
static void
-toolbar_style (GtkAction *action)
-{
- GtkToolbarStyle style;
-
- g_return_if_fail (toolbar != NULL);
-
- radio_action (action);
-
- style = gtk_radio_action_get_current_value (GTK_RADIO_ACTION (action));
-
- gtk_toolbar_set_style (toolbar, style);
-}
-
-static void
toolbar_size_small (GtkAction *action)
{
g_return_if_fail (toolbar != NULL);
@@ -164,26 +139,6 @@ enum {
JUSTIFY_FILL
};
-static GtkRadioActionEntry justify_entries[] = {
- { "justify-left", GTK_STOCK_JUSTIFY_LEFT, "_Left", "<control>L",
- "Left justify the text", JUSTIFY_LEFT },
- { "justify-center", GTK_STOCK_JUSTIFY_CENTER, "C_enter", "<control>E",
- "Center justify the text", JUSTIFY_CENTER },
- { "justify-right", GTK_STOCK_JUSTIFY_RIGHT, "_Right", "<control>R",
- "Right justify the text", JUSTIFY_RIGHT },
- { "justify-fill", GTK_STOCK_JUSTIFY_FILL, "_Fill", "<control>J",
- "Fill justify the text", JUSTIFY_FILL }
-};
-static guint n_justify_entries = G_N_ELEMENTS (justify_entries);
-
-static GtkRadioActionEntry toolbar_entries[] = {
- { "toolbar-icons", NULL, "Icons", NULL, NULL, GTK_TOOLBAR_ICONS },
- { "toolbar-text", NULL, "Text", NULL, NULL, GTK_TOOLBAR_TEXT },
- { "toolbar-both", NULL, "Both", NULL, NULL, GTK_TOOLBAR_BOTH },
- { "toolbar-both-horiz", NULL, "Both Horizontal", NULL, NULL, GTK_TOOLBAR_BOTH_HORIZ }
-};
-static guint n_toolbar_entries = G_N_ELEMENTS (toolbar_entries);
-
/* XML description of the menus for the test app. The parser understands
* a subset of the Bonobo UI XML format, and uses GMarkup for parsing */
static const gchar *ui_info =
@@ -426,14 +381,6 @@ main (int argc, char **argv)
gtk_action_group_add_toggle_actions (action_group,
toggle_entries, n_toggle_entries,
NULL);
- gtk_action_group_add_radio_actions (action_group,
- justify_entries, n_justify_entries,
- JUSTIFY_LEFT,
- G_CALLBACK (radio_action), NULL);
- gtk_action_group_add_radio_actions (action_group,
- toolbar_entries, n_toolbar_entries,
- GTK_TOOLBAR_BOTH,
- G_CALLBACK (toolbar_style), NULL);
gtk_action_group_add_action_with_accel (action_group, action, NULL);
create_window (action_group);
diff --git a/tests/testmerge.c b/tests/testmerge.c
index 2a1fa55..b4f7993 100644
--- a/tests/testmerge.c
+++ b/tests/testmerge.c
@@ -153,16 +153,6 @@ toggle_action (GtkAction *action)
}
-static void
-radio_action_changed (GtkAction *action, GtkRadioAction *current)
-{
- g_message ("RadioAction %s (type=%s) activated (active=%d) (value %d)",
- gtk_action_get_name (GTK_ACTION (current)),
- G_OBJECT_TYPE_NAME (GTK_ACTION (current)),
- gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (current)),
- gtk_radio_action_get_current_value (current));
-}
-
static GtkActionEntry entries[] = {
{ "FileMenuAction", NULL, "_File" },
{ "EditMenuAction", NULL, "_Edit" },
@@ -196,18 +186,6 @@ enum {
JUSTIFY_FILL
};
-static GtkRadioActionEntry radio_entries[] = {
- { "justify-left", GTK_STOCK_JUSTIFY_LEFT, NULL, "<control>L",
- "Left justify the text", JUSTIFY_LEFT },
- { "justify-center", GTK_STOCK_JUSTIFY_CENTER, NULL, "<super>E",
- "Center justify the text", JUSTIFY_CENTER },
- { "justify-right", GTK_STOCK_JUSTIFY_RIGHT, NULL, "<hyper>R",
- "Right justify the text", JUSTIFY_RIGHT },
- { "justify-fill", GTK_STOCK_JUSTIFY_FILL, NULL, "<super><hyper>J",
- "Fill justify the text", JUSTIFY_FILL },
-};
-static guint n_radio_entries = G_N_ELEMENTS (radio_entries);
-
static void
add_widget (GtkUIManager *merge,
GtkWidget *widget,
@@ -585,10 +563,6 @@ main (int argc, char **argv)
gtk_action_group_add_toggle_actions (action_group,
toggle_entries, n_toggle_entries,
NULL);
- gtk_action_group_add_radio_actions (action_group,
- radio_entries, n_radio_entries,
- JUSTIFY_RIGHT,
- G_CALLBACK (radio_action_changed), NULL);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_default_size (GTK_WINDOW (window), -1, 400);
diff --git a/testsuite/gtk/notify.c b/testsuite/gtk/notify.c
index 853385f..c56db0a 100644
--- a/testsuite/gtk/notify.c
+++ b/testsuite/gtk/notify.c
@@ -362,21 +362,9 @@ test_type (gconstpointer data)
/* Deprecated, not getting fixed */
if (g_str_equal (g_type_name (type), "GtkColorSelection") ||
- g_str_equal (g_type_name (type), "GtkHPaned") ||
- g_str_equal (g_type_name (type), "GtkVPaned") ||
- g_str_equal (g_type_name (type), "GtkHScale") ||
- g_str_equal (g_type_name (type), "GtkVScale") ||
- g_str_equal (g_type_name (type), "GtkHScrollbar") ||
- g_str_equal (g_type_name (type), "GtkVScrollbar") ||
- g_str_equal (g_type_name (type), "GtkHSeparator") ||
- g_str_equal (g_type_name (type), "GtkVSeparator") ||
- g_str_equal (g_type_name (type), "GtkVBox") ||
- g_str_equal (g_type_name (type), "GtkArrow") ||
g_str_equal (g_type_name (type), "GtkNumerableIcon") ||
- g_str_equal (g_type_name (type), "GtkRadioAction") ||
g_str_equal (g_type_name (type), "GtkToggleAction") ||
- g_str_equal (g_type_name (type), "GtkUIManager") ||
- g_str_equal (g_type_name (type), "GtkImageMenuItem"))
+ g_str_equal (g_type_name (type), "GtkUIManager"))
return;
/* These can't be freely constructed/destroyed */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]