Commit f7007d51 authored by Michael Natterer's avatar Michael Natterer 😴

app: get rid of a few more GtkAction warnings, and a little cleanup

parent e3d8783a
......@@ -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"
......@@ -300,9 +299,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);
......
......@@ -167,12 +167,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)
......@@ -262,6 +282,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)
{
......@@ -363,7 +389,7 @@ gimp_action_label_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))
{
......@@ -378,7 +404,7 @@ gimp_action_label_notify (GimpAction *action,
if (GTK_IS_LABEL (child))
gtk_label_set_text (GTK_LABEL (child),
gtk_action_get_label (GTK_ACTION (action)));
gimp_action_get_label (action));
}
}
}
......@@ -391,7 +417,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))
{
......
......@@ -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,
......
......@@ -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);
}
......@@ -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))
{
......
......@@ -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);
}
......
......@@ -650,8 +650,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);
......
......@@ -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));
......
......@@ -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));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment