[gimp/gimp-2-10] app: get rid of a few more GtkAction warnings, and a little cleanup
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gimp-2-10] app: get rid of a few more GtkAction warnings, and a little cleanup
- Date: Fri, 5 Jul 2019 10:44:56 +0000 (UTC)
commit d9349a57301ebe5920c514acd6660b861f1a3521
Author: Michael Natterer <mitch gimp org>
Date: Fri Jul 5 12:32:36 2019 +0200
app: get rid of a few more GtkAction warnings, and a little cleanup
(cherry picked from commit f7007d5161e7c8b2262641607c61e29a598582d6)
app/actions/view-commands.c | 6 +++---
app/widgets/gimpaction.c | 28 +++++++++++++++++++++++++++-
app/widgets/gimpaction.h | 6 ++++++
app/widgets/gimpactiongroup.c | 6 +++---
app/widgets/gimpactionimpl.c | 2 +-
app/widgets/gimpcolorpanel.c | 30 ++++++++++++++++--------------
app/widgets/gimpeditor.c | 4 ++--
app/widgets/gimpradioaction.c | 4 +---
app/widgets/gimptoggleaction.c | 4 +---
9 files changed, 60 insertions(+), 30 deletions(-)
---
diff --git a/app/actions/view-commands.c b/app/actions/view-commands.c
index 3d62ec33a4..0b4c4ffba7 100644
--- a/app/actions/view-commands.c
+++ b/app/actions/view-commands.c
@@ -38,7 +38,6 @@
#include "widgets/gimpcolordialog.h"
#include "widgets/gimpdock.h"
#include "widgets/gimpdialogfactory.h"
-#include "widgets/gimptoggleaction.h"
#include "widgets/gimpuimanager.h"
#include "widgets/gimpwidgets-utils.h"
#include "widgets/gimpwindowstrategy.h"
@@ -301,9 +300,10 @@ view_zoom_other_cmd_callback (GimpAction *action,
return_if_no_shell (shell, data);
/* check if we are activated by the user or from
- * view_actions_set_zoom(), also SIC GTK_TOGGLE_ACTION()
+ * view_actions_set_zoom(), also this is really a GtkToggleAction
+ * NOT a GimpToggleAction
*/
- if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)) &&
+ if (gtk_toggle_action_get_active ((GtkToggleAction *) action) &&
shell->other_scale != gimp_zoom_model_get_factor (shell->zoom))
{
gimp_display_shell_scale_dialog (shell);
diff --git a/app/widgets/gimpaction.c b/app/widgets/gimpaction.c
index 2e815a8b36..88cae45fa0 100644
--- a/app/widgets/gimpaction.c
+++ b/app/widgets/gimpaction.c
@@ -161,12 +161,32 @@ gimp_action_get_tooltip (GimpAction *action)
return gtk_action_get_tooltip ((GtkAction *) action);
}
+void
+gimp_action_set_icon_name (GimpAction *action,
+ const gchar *icon_name)
+{
+ gtk_action_set_icon_name ((GtkAction *) action, icon_name);
+}
+
const gchar *
gimp_action_get_icon_name (GimpAction *action)
{
return gtk_action_get_icon_name ((GtkAction *) action);
}
+void
+gimp_action_set_gicon (GimpAction *action,
+ GIcon *icon)
+{
+ gtk_action_set_gicon ((GtkAction *) action, icon);
+}
+
+GIcon *
+gimp_action_get_gicon (GimpAction *action)
+{
+ return gtk_action_get_gicon ((GtkAction *) action);
+}
+
void
gimp_action_set_help_id (GimpAction *action,
const gchar *help_id)
@@ -256,6 +276,12 @@ gimp_action_connect_accelerator (GimpAction *action)
gtk_action_connect_accelerator ((GtkAction *) action);
}
+GSList *
+gimp_action_get_proxies (GimpAction *action)
+{
+ return gtk_action_get_proxies ((GtkAction *) action);
+}
+
void
gimp_action_activate (GimpAction *action)
{
@@ -357,7 +383,7 @@ gimp_action_tooltip_notify (GimpAction *action,
{
GSList *list;
- for (list = gtk_action_get_proxies (GTK_ACTION (action));
+ for (list = gimp_action_get_proxies (action);
list;
list = g_slist_next (list))
{
diff --git a/app/widgets/gimpaction.h b/app/widgets/gimpaction.h
index 923fdf3444..58bd798cd1 100644
--- a/app/widgets/gimpaction.h
+++ b/app/widgets/gimpaction.h
@@ -67,6 +67,10 @@ void gimp_action_set_icon_name (GimpAction *action,
const gchar *icon_name);
const gchar * gimp_action_get_icon_name (GimpAction *action);
+void gimp_action_set_gicon (GimpAction *action,
+ GIcon *icon);
+GIcon * gimp_action_get_gicon (GimpAction *action);
+
void gimp_action_set_help_id (GimpAction *action,
const gchar *help_id);
const gchar * gimp_action_get_help_id (GimpAction *action);
@@ -91,6 +95,8 @@ void gimp_action_set_accel_group (GimpAction *action,
GtkAccelGroup *accel_group);
void gimp_action_connect_accelerator (GimpAction *action);
+GSList * gimp_action_get_proxies (GimpAction *action);
+
void gimp_action_activate (GimpAction *action);
gint gimp_action_name_compare (GimpAction *action1,
diff --git a/app/widgets/gimpactiongroup.c b/app/widgets/gimpactiongroup.c
index 40cbdcda05..04bd1b65e5 100644
--- a/app/widgets/gimpactiongroup.c
+++ b/app/widgets/gimpactiongroup.c
@@ -694,7 +694,7 @@ gimp_action_group_add_procedure_actions (GimpActionGroup *group,
* This function removes @action from @group and clean any
* accelerator this action may have set.
* If you wish to only remove the action from the group, use
- * gtk_action_group_remove_action() instead.
+ * gimp_action_group_remove_action() instead.
*/
void
gimp_action_group_remove_action_and_accel (GimpActionGroup *group,
@@ -857,7 +857,7 @@ gimp_action_group_set_action_pixbuf (GimpActionGroup *group,
return;
}
- gtk_action_set_gicon (GTK_ACTION (action), G_ICON (pixbuf));
+ gimp_action_set_gicon (action, G_ICON (pixbuf));
}
@@ -1064,5 +1064,5 @@ gimp_action_group_set_action_always_show_image (GimpActionGroup *group,
return;
}
- gtk_action_set_always_show_image (GTK_ACTION (action), always_show_image);
+ gtk_action_set_always_show_image ((GtkAction *) action, always_show_image);
}
diff --git a/app/widgets/gimpactionimpl.c b/app/widgets/gimpactionimpl.c
index 00156e09a4..cd0d51c31b 100644
--- a/app/widgets/gimpactionimpl.c
+++ b/app/widgets/gimpactionimpl.c
@@ -227,7 +227,7 @@ gimp_action_impl_set_property (GObject *object,
{
GSList *list;
- for (list = gtk_action_get_proxies (GTK_ACTION (impl));
+ for (list = gimp_action_get_proxies (GIMP_ACTION (impl));
list;
list = g_slist_next (list))
{
diff --git a/app/widgets/gimpcolorpanel.c b/app/widgets/gimpcolorpanel.c
index 7fa5245677..ccb816ead9 100644
--- a/app/widgets/gimpcolorpanel.c
+++ b/app/widgets/gimpcolorpanel.c
@@ -31,6 +31,8 @@
#include "core/gimpcontext.h"
#include "core/gimpmarshal.h"
+#include "gimpaction.h"
+#include "gimpactiongroup.h"
#include "gimpactionimpl.h"
#include "gimpcolordialog.h"
#include "gimpcolorpanel.h"
@@ -128,8 +130,8 @@ gimp_color_panel_button_press (GtkWidget *widget,
GimpColorButton *color_button;
GimpColorPanel *color_panel;
GtkUIManager *ui_manager;
- GtkActionGroup *group;
- GtkAction *action;
+ GimpActionGroup *group;
+ GimpAction *action;
GimpRGB color;
color_button = GIMP_COLOR_BUTTON (widget);
@@ -138,32 +140,32 @@ gimp_color_panel_button_press (GtkWidget *widget,
group = gtk_ui_manager_get_action_groups (ui_manager)->data;
- action = gtk_action_group_get_action (group,
- "color-button-use-foreground");
- gtk_action_set_visible (action, color_panel->context != NULL);
+ action = gimp_action_group_get_action (group,
+ "color-button-use-foreground");
+ gimp_action_set_visible (action, color_panel->context != NULL);
- action = gtk_action_group_get_action (group,
- "color-button-use-background");
- gtk_action_set_visible (action, color_panel->context != NULL);
+ action = gimp_action_group_get_action (group,
+ "color-button-use-background");
+ gimp_action_set_visible (action, color_panel->context != NULL);
if (color_panel->context)
{
- action = gtk_action_group_get_action (group,
- "color-button-use-foreground");
+ action = gimp_action_group_get_action (group,
+ "color-button-use-foreground");
gimp_context_get_foreground (color_panel->context, &color);
g_object_set (action, "color", &color, NULL);
- action = gtk_action_group_get_action (group,
- "color-button-use-background");
+ action = gimp_action_group_get_action (group,
+ "color-button-use-background");
gimp_context_get_background (color_panel->context, &color);
g_object_set (action, "color", &color, NULL);
}
- action = gtk_action_group_get_action (group, "color-button-use-black");
+ action = gimp_action_group_get_action (group, "color-button-use-black");
gimp_rgba_set (&color, 0.0, 0.0, 0.0, GIMP_OPACITY_OPAQUE);
g_object_set (action, "color", &color, NULL);
- action = gtk_action_group_get_action (group, "color-button-use-white");
+ action = gimp_action_group_get_action (group, "color-button-use-white");
gimp_rgba_set (&color, 1.0, 1.0, 1.0, GIMP_OPACITY_OPAQUE);
g_object_set (action, "color", &color, NULL);
}
diff --git a/app/widgets/gimpeditor.c b/app/widgets/gimpeditor.c
index 47a866a36c..01517fc80c 100644
--- a/app/widgets/gimpeditor.c
+++ b/app/widgets/gimpeditor.c
@@ -674,8 +674,8 @@ gimp_editor_add_action_button (GimpEditor *editor,
gtk_container_add (GTK_CONTAINER (button), image);
gtk_widget_show (image);
- gtk_activatable_set_related_action (GTK_ACTIVATABLE (button),
- GTK_ACTION (action));
+ gtk_activatable_set_related_action ((GtkActivatable *) button,
+ (GtkAction *) action);
gtk_box_pack_start (GTK_BOX (editor->priv->button_box), button,
TRUE, TRUE, 0);
gtk_widget_show (button);
diff --git a/app/widgets/gimpradioaction.c b/app/widgets/gimpradioaction.c
index 3d6b92b139..3f18178b2a 100644
--- a/app/widgets/gimpradioaction.c
+++ b/app/widgets/gimpradioaction.c
@@ -76,9 +76,7 @@ static void
gimp_radio_action_changed (GtkRadioAction *action,
GtkRadioAction *current)
{
- gint value;
-
- value = gtk_radio_action_get_current_value (GTK_RADIO_ACTION (action));
+ gint value = gtk_radio_action_get_current_value (action);
gimp_action_emit_change_state (GIMP_ACTION (action),
g_variant_new_int32 (value));
diff --git a/app/widgets/gimptoggleaction.c b/app/widgets/gimptoggleaction.c
index 26add803a7..a196ad8cca 100644
--- a/app/widgets/gimptoggleaction.c
+++ b/app/widgets/gimptoggleaction.c
@@ -74,9 +74,7 @@ gimp_toggle_action_connect_proxy (GtkAction *action,
static void
gimp_toggle_action_toggled (GtkToggleAction *action)
{
- gboolean value;
-
- value = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
+ gboolean value = gimp_toggle_action_get_active (action);
gimp_action_emit_change_state (GIMP_ACTION (action),
g_variant_new_boolean (value));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]