app: GtkAction -> GAction madness part two

Change all action callbacks so they can be invoked by a GAction:

- add GimpActionCallback typedef:
  void (* cb) (GimpAction*, GVariant*, gpointer)
- change all action callbacks to the GimpActionCallback signature
- add "gimp-activate" and "gimp-change-state" signals to GimpAction,
  with the same signature as the resp. GAction signals
- remove all other custom action signals and only use the new
  GimpAction signals
- pass around appropriate GVariants containing booleans, int32,
  strings
- badly hack around to force a GimpProcedure pointer into a
  uint64 variant
- remove all G_CALLBACK() casts from all action callbacks,
  they all have the same signature now
This commit is contained in:
Michael Natterer 2019-07-04 01:11:48 +02:00
parent c180205601
commit 3b6b3fc189
146 changed files with 2457 additions and 1697 deletions

View file

@ -48,7 +48,7 @@ static const GimpToggleActionEntry brush_editor_toggle_actions[] =
{
{ "brush-editor-edit-active", GIMP_ICON_LINKED,
NC_("brush-editor-action", "Edit Active Brush"), NULL, NULL,
G_CALLBACK (data_editor_edit_active_cmd_callback),
data_editor_edit_active_cmd_callback,
FALSE,
GIMP_HELP_BRUSH_EDITOR_EDIT_ACTIVE }
};

View file

@ -46,43 +46,43 @@ static const GimpActionEntry brushes_actions[] =
{ "brushes-open-as-image", GIMP_ICON_DOCUMENT_OPEN,
NC_("brushes-action", "_Open Brush as Image"), NULL,
NC_("brushes-action", "Open brush as image"),
G_CALLBACK (data_open_as_image_cmd_callback),
data_open_as_image_cmd_callback,
GIMP_HELP_BRUSH_OPEN_AS_IMAGE },
{ "brushes-new", GIMP_ICON_DOCUMENT_NEW,
NC_("brushes-action", "_New Brush"), NULL,
NC_("brushes-action", "Create a new brush"),
G_CALLBACK (data_new_cmd_callback),
data_new_cmd_callback,
GIMP_HELP_BRUSH_NEW },
{ "brushes-duplicate", GIMP_ICON_OBJECT_DUPLICATE,
NC_("brushes-action", "D_uplicate Brush"), NULL,
NC_("brushes-action", "Duplicate this brush"),
G_CALLBACK (data_duplicate_cmd_callback),
data_duplicate_cmd_callback,
GIMP_HELP_BRUSH_DUPLICATE },
{ "brushes-copy-location", GIMP_ICON_EDIT_COPY,
NC_("brushes-action", "Copy Brush _Location"), NULL,
NC_("brushes-action", "Copy brush file location to clipboard"),
G_CALLBACK (data_copy_location_cmd_callback),
data_copy_location_cmd_callback,
GIMP_HELP_BRUSH_COPY_LOCATION },
{ "brushes-show-in-file-manager", GIMP_ICON_FILE_MANAGER,
NC_("brushes-action", "Show in _File Manager"), NULL,
NC_("brushes-action", "Show brush file location in the file manager"),
G_CALLBACK (data_show_in_file_manager_cmd_callback),
data_show_in_file_manager_cmd_callback,
GIMP_HELP_BRUSH_SHOW_IN_FILE_MANAGER },
{ "brushes-delete", GIMP_ICON_EDIT_DELETE,
NC_("brushes-action", "_Delete Brush"), NULL,
NC_("brushes-action", "Delete this brush"),
G_CALLBACK (data_delete_cmd_callback),
data_delete_cmd_callback,
GIMP_HELP_BRUSH_DELETE },
{ "brushes-refresh", GIMP_ICON_VIEW_REFRESH,
NC_("brushes-action", "_Refresh Brushes"), NULL,
NC_("brushes-action", "Refresh brushes"),
G_CALLBACK (data_refresh_cmd_callback),
data_refresh_cmd_callback,
GIMP_HELP_BRUSH_REFRESH }
};
@ -106,7 +106,7 @@ brushes_actions_setup (GimpActionGroup *group)
gimp_action_group_add_string_actions (group, "brushes-action",
brushes_edit_actions,
G_N_ELEMENTS (brushes_edit_actions),
G_CALLBACK (data_edit_cmd_callback));
data_edit_cmd_callback);
}
void

View file

@ -45,13 +45,13 @@ static const GimpActionEntry buffers_actions[] =
{ "buffers-paste-as-new-image", GIMP_ICON_EDIT_PASTE_AS_NEW,
NC_("buffers-action", "Paste Buffer as _New Image"), NULL,
NC_("buffers-action", "Paste the selected buffer as a new image"),
G_CALLBACK (buffers_paste_as_new_image_cmd_callback),
buffers_paste_as_new_image_cmd_callback,
GIMP_HELP_BUFFER_PASTE_AS_NEW_IMAGE },
{ "buffers-delete", GIMP_ICON_EDIT_DELETE,
NC_("buffers-action", "_Delete Buffer"), NULL,
NC_("buffers-action", "Delete the selected buffer"),
G_CALLBACK (buffers_delete_cmd_callback),
buffers_delete_cmd_callback,
GIMP_HELP_BUFFER_DELETE }
};
@ -107,7 +107,7 @@ buffers_actions_setup (GimpActionGroup *group)
gimp_action_group_add_enum_actions (group, "buffers-action",
buffers_paste_actions,
G_N_ELEMENTS (buffers_paste_actions),
G_CALLBACK (buffers_paste_cmd_callback));
buffers_paste_cmd_callback);
}
void

View file

@ -47,14 +47,14 @@
void
buffers_paste_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
GimpContainer *container;
GimpContext *context;
GimpBuffer *buffer;
GimpPasteType paste_type = (GimpPasteType) value;
GimpPasteType paste_type = (GimpPasteType) g_variant_get_int32 (value);
container = gimp_container_view_get_container (editor->view);
context = gimp_container_view_get_context (editor->view);
@ -97,6 +97,7 @@ buffers_paste_cmd_callback (GimpAction *action,
void
buffers_paste_as_new_image_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
@ -125,6 +126,7 @@ buffers_paste_as_new_image_cmd_callback (GimpAction *action,
void
buffers_delete_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);

View file

@ -20,11 +20,13 @@
void buffers_paste_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void buffers_paste_as_new_image_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void buffers_delete_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);

View file

@ -52,58 +52,58 @@ static const GimpActionEntry channels_actions[] =
{ "channels-edit-attributes", GIMP_ICON_EDIT,
NC_("channels-action", "_Edit Channel Attributes..."), NULL,
NC_("channels-action", "Edit the channel's name, color and opacity"),
G_CALLBACK (channels_edit_attributes_cmd_callback),
channels_edit_attributes_cmd_callback,
GIMP_HELP_CHANNEL_EDIT },
{ "channels-new", GIMP_ICON_DOCUMENT_NEW,
NC_("channels-action", "_New Channel..."), NULL,
NC_("channels-action", "Create a new channel"),
G_CALLBACK (channels_new_cmd_callback),
channels_new_cmd_callback,
GIMP_HELP_CHANNEL_NEW },
{ "channels-new-last-values", GIMP_ICON_DOCUMENT_NEW,
NC_("channels-action", "_New Channel"), NULL,
NC_("channels-action", "Create a new channel with last used values"),
G_CALLBACK (channels_new_last_vals_cmd_callback),
channels_new_last_vals_cmd_callback,
GIMP_HELP_CHANNEL_NEW },
{ "channels-duplicate", GIMP_ICON_OBJECT_DUPLICATE,
NC_("channels-action", "D_uplicate Channel"), NULL,
NC_("channels-action",
"Create a duplicate of this channel and add it to the image"),
G_CALLBACK (channels_duplicate_cmd_callback),
channels_duplicate_cmd_callback,
GIMP_HELP_CHANNEL_DUPLICATE },
{ "channels-delete", GIMP_ICON_EDIT_DELETE,
NC_("channels-action", "_Delete Channel"), NULL,
NC_("channels-action", "Delete this channel"),
G_CALLBACK (channels_delete_cmd_callback),
channels_delete_cmd_callback,
GIMP_HELP_CHANNEL_DELETE },
{ "channels-raise", GIMP_ICON_GO_UP,
NC_("channels-action", "_Raise Channel"), NULL,
NC_("channels-action", "Raise this channel one step in the channel stack"),
G_CALLBACK (channels_raise_cmd_callback),
channels_raise_cmd_callback,
GIMP_HELP_CHANNEL_RAISE },
{ "channels-raise-to-top", GIMP_ICON_GO_TOP,
NC_("channels-action", "Raise Channel to _Top"), NULL,
NC_("channels-action",
"Raise this channel to the top of the channel stack"),
G_CALLBACK (channels_raise_to_top_cmd_callback),
channels_raise_to_top_cmd_callback,
GIMP_HELP_CHANNEL_RAISE_TO_TOP },
{ "channels-lower", GIMP_ICON_GO_DOWN,
NC_("channels-action", "_Lower Channel"), NULL,
NC_("channels-action", "Lower this channel one step in the channel stack"),
G_CALLBACK (channels_lower_cmd_callback),
channels_lower_cmd_callback,
GIMP_HELP_CHANNEL_LOWER },
{ "channels-lower-to-bottom", GIMP_ICON_GO_BOTTOM,
NC_("channels-action", "Lower Channel to _Bottom"), NULL,
NC_("channels-action",
"Lower this channel to the bottom of the channel stack"),
G_CALLBACK (channels_lower_to_bottom_cmd_callback),
channels_lower_to_bottom_cmd_callback,
GIMP_HELP_CHANNEL_LOWER_TO_BOTTOM }
};
@ -111,25 +111,25 @@ static const GimpToggleActionEntry channels_toggle_actions[] =
{
{ "channels-visible", GIMP_ICON_VISIBLE,
NC_("channels-action", "Toggle Channel _Visibility"), NULL, NULL,
G_CALLBACK (channels_visible_cmd_callback),
channels_visible_cmd_callback,
FALSE,
GIMP_HELP_CHANNEL_VISIBLE },
{ "channels-linked", GIMP_ICON_LINKED,
NC_("channels-action", "Toggle Channel _Linked State"), NULL, NULL,
G_CALLBACK (channels_linked_cmd_callback),
channels_linked_cmd_callback,
FALSE,
GIMP_HELP_CHANNEL_LINKED },
{ "channels-lock-content", NULL /* GIMP_ICON_LOCK */,
NC_("channels-action", "L_ock Pixels of Channel"), NULL, NULL,
G_CALLBACK (channels_lock_content_cmd_callback),
channels_lock_content_cmd_callback,
FALSE,
GIMP_HELP_CHANNEL_LOCK_PIXELS },
{ "channels-lock-position", GIMP_ICON_TOOL_MOVE,
NC_("channels-action", "L_ock Position of Channel"), NULL, NULL,
G_CALLBACK (channels_lock_position_cmd_callback),
channels_lock_position_cmd_callback,
FALSE,
GIMP_HELP_CHANNEL_LOCK_POSITION }
};
@ -260,17 +260,17 @@ channels_actions_setup (GimpActionGroup *group)
gimp_action_group_add_enum_actions (group, "channels-action",
channels_color_tag_actions,
G_N_ELEMENTS (channels_color_tag_actions),
G_CALLBACK (channels_color_tag_cmd_callback));
channels_color_tag_cmd_callback);
gimp_action_group_add_enum_actions (group, "channels-action",
channels_to_selection_actions,
G_N_ELEMENTS (channels_to_selection_actions),
G_CALLBACK (channels_to_selection_cmd_callback));
channels_to_selection_cmd_callback);
gimp_action_group_add_enum_actions (group, "channels-action",
channels_select_actions,
G_N_ELEMENTS (channels_select_actions),
G_CALLBACK (channels_select_cmd_callback));
channels_select_cmd_callback);
items_actions_setup (group, "channels");
}

View file

@ -91,6 +91,7 @@ static void channels_edit_attributes_callback (GtkWidget *dialog,
void
channels_edit_attributes_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -137,6 +138,7 @@ channels_edit_attributes_cmd_callback (GimpAction *action,
void
channels_new_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -182,6 +184,7 @@ channels_new_cmd_callback (GimpAction *action,
void
channels_new_last_vals_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -208,6 +211,7 @@ channels_new_last_vals_cmd_callback (GimpAction *action,
void
channels_raise_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -220,6 +224,7 @@ channels_raise_cmd_callback (GimpAction *action,
void
channels_raise_to_top_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -232,6 +237,7 @@ channels_raise_to_top_cmd_callback (GimpAction *action,
void
channels_lower_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -244,6 +250,7 @@ channels_lower_cmd_callback (GimpAction *action,
void
channels_lower_to_bottom_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -256,6 +263,7 @@ channels_lower_to_bottom_cmd_callback (GimpAction *action,
void
channels_duplicate_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -308,6 +316,7 @@ channels_duplicate_cmd_callback (GimpAction *action,
void
channels_delete_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -320,13 +329,13 @@ channels_delete_cmd_callback (GimpAction *action,
void
channels_to_selection_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpChannelOps op;
GimpImage *image;
op = (GimpChannelOps) value;
op = (GimpChannelOps) g_variant_get_int32 (value);
if (GIMP_IS_COMPONENT_EDITOR (data))
{
@ -352,75 +361,84 @@ channels_to_selection_cmd_callback (GimpAction *action,
void
channels_visible_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
GimpChannel *channel;
return_if_no_channel (image, channel, data);
items_visible_cmd_callback (action, image, GIMP_ITEM (channel));
items_visible_cmd_callback (action, value, image, GIMP_ITEM (channel));
}
void
channels_linked_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
GimpChannel *channel;
return_if_no_channel (image, channel, data);
items_linked_cmd_callback (action, image, GIMP_ITEM (channel));
items_linked_cmd_callback (action, value, image, GIMP_ITEM (channel));
}
void
channels_lock_content_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
GimpChannel *channel;
return_if_no_channel (image, channel, data);
items_lock_content_cmd_callback (action, image, GIMP_ITEM (channel));
items_lock_content_cmd_callback (action, value, image, GIMP_ITEM (channel));
}
void
channels_lock_position_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
GimpChannel *channel;
return_if_no_channel (image, channel, data);
items_lock_position_cmd_callback (action, image, GIMP_ITEM (channel));
items_lock_position_cmd_callback (action, value, image, GIMP_ITEM (channel));
}
void
channels_color_tag_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpImage *image;
GimpChannel *channel;
GimpColorTag color_tag;
return_if_no_channel (image, channel, data);
color_tag = (GimpColorTag) g_variant_get_int32 (value);
items_color_tag_cmd_callback (action, image, GIMP_ITEM (channel),
(GimpColorTag) value);
color_tag);
}
void
channels_select_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpImage *image;
GimpChannel *channel;
GimpChannel *channel2;
GimpContainer *container;
GimpActionSelectType type;
return_if_no_channel (image, channel, data);
type = (GimpActionSelectType) g_variant_get_int32 (value);
container = gimp_image_get_channels (image);
channel2 = (GimpChannel *) action_select_object ((GimpActionSelectType) value,
container,
channel2 = (GimpChannel *) action_select_object (type, container,
(GimpObject *) channel);
if (channel2 && channel2 != channel)

View file

@ -20,44 +20,57 @@
void channels_edit_attributes_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void channels_new_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void channels_new_last_vals_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void channels_raise_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void channels_raise_to_top_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void channels_lower_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void channels_lower_to_bottom_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void channels_duplicate_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void channels_delete_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void channels_to_selection_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void channels_visible_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void channels_linked_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void channels_lock_content_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void channels_lock_position_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void channels_color_tag_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void channels_select_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);

View file

@ -48,7 +48,7 @@ static const GimpActionEntry colormap_actions[] =
{ "colormap-edit-color", GIMP_ICON_EDIT,
NC_("colormap-action", "_Edit Color..."), NULL,
NC_("colormap-action", "Edit this color"),
G_CALLBACK (colormap_edit_color_cmd_callback),
colormap_edit_color_cmd_callback,
GIMP_HELP_INDEXED_PALETTE_EDIT }
};
@ -104,12 +104,12 @@ colormap_actions_setup (GimpActionGroup *group)
gimp_action_group_add_enum_actions (group, "colormap-action",
colormap_add_color_actions,
G_N_ELEMENTS (colormap_add_color_actions),
G_CALLBACK (colormap_add_color_cmd_callback));
colormap_add_color_cmd_callback);
gimp_action_group_add_enum_actions (group, "colormap-action",
colormap_to_selection_actions,
G_N_ELEMENTS (colormap_to_selection_actions),
G_CALLBACK (colormap_to_selection_cmd_callback));
colormap_to_selection_cmd_callback);
}
void

View file

@ -38,6 +38,7 @@
void
colormap_edit_color_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpColormapEditor *editor = GIMP_COLORMAP_EDITOR (data);
@ -47,19 +48,22 @@ colormap_edit_color_cmd_callback (GimpAction *action,
void
colormap_add_color_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpContext *context;
GimpImage *image;
gboolean background;
return_if_no_context (context, data);
return_if_no_image (image, data);
background = (gboolean) g_variant_get_int32 (value);
if (gimp_image_get_colormap_size (image) < 256)
{
GimpRGB color;
if (value)
if (background)
gimp_context_get_background (context, &color);
else
gimp_context_get_foreground (context, &color);
@ -71,7 +75,7 @@ colormap_add_color_cmd_callback (GimpAction *action,
void
colormap_to_selection_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpColormapSelection *selection;
@ -86,7 +90,7 @@ colormap_to_selection_cmd_callback (GimpAction *action,
selection = GIMP_COLORMAP_SELECTION (editor->selection);
col_index = gimp_colormap_selection_get_index (selection, NULL);
op = (GimpChannelOps) value;
op = (GimpChannelOps) g_variant_get_int32 (value);
gimp_channel_select_by_index (gimp_image_get_mask (image),
gimp_image_get_active_drawable (image),

View file

@ -20,12 +20,13 @@
void colormap_edit_color_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void colormap_add_color_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void colormap_to_selection_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);

View file

@ -81,13 +81,13 @@ static const GimpActionEntry context_actions[] =
NC_("context-action", "_Default Colors"), "D",
NC_("context-action",
"Set foreground color to black, background color to white"),
G_CALLBACK (context_colors_default_cmd_callback),
context_colors_default_cmd_callback,
GIMP_HELP_TOOLBOX_DEFAULT_COLORS },
{ "context-colors-swap", GIMP_ICON_COLORS_SWAP,
NC_("context-action", "S_wap Colors"), "X",
NC_("context-action", "Exchange foreground and background colors"),
G_CALLBACK (context_colors_swap_cmd_callback),
context_colors_swap_cmd_callback,
GIMP_HELP_TOOLBOX_SWAP_COLORS }
};
@ -1098,145 +1098,145 @@ context_actions_setup (GimpActionGroup *group)
gimp_action_group_add_enum_actions (group, "context-action",
context_palette_foreground_actions,
G_N_ELEMENTS (context_palette_foreground_actions),
G_CALLBACK (context_palette_foreground_cmd_callback));
context_palette_foreground_cmd_callback);
gimp_action_group_add_enum_actions (group, "context-action",
context_palette_background_actions,
G_N_ELEMENTS (context_palette_background_actions),
G_CALLBACK (context_palette_background_cmd_callback));
context_palette_background_cmd_callback);
gimp_action_group_add_enum_actions (group, "context-action",
context_colormap_foreground_actions,
G_N_ELEMENTS (context_colormap_foreground_actions),
G_CALLBACK (context_colormap_foreground_cmd_callback));
context_colormap_foreground_cmd_callback);
gimp_action_group_add_enum_actions (group, "context-action",
context_colormap_background_actions,
G_N_ELEMENTS (context_colormap_background_actions),
G_CALLBACK (context_colormap_background_cmd_callback));
context_colormap_background_cmd_callback);
gimp_action_group_add_enum_actions (group, "context-action",
context_swatch_foreground_actions,
G_N_ELEMENTS (context_swatch_foreground_actions),
G_CALLBACK (context_swatch_foreground_cmd_callback));
context_swatch_foreground_cmd_callback);
gimp_action_group_add_enum_actions (group, "context-action",
context_swatch_background_actions,
G_N_ELEMENTS (context_swatch_background_actions),
G_CALLBACK (context_swatch_background_cmd_callback));
context_swatch_background_cmd_callback);
gimp_action_group_add_enum_actions (group, "context-action",
context_foreground_red_actions,
G_N_ELEMENTS (context_foreground_red_actions),
G_CALLBACK (context_foreground_red_cmd_callback));
context_foreground_red_cmd_callback);
gimp_action_group_add_enum_actions (group, "context-action",
context_foreground_green_actions,
G_N_ELEMENTS (context_foreground_green_actions),
G_CALLBACK (context_foreground_green_cmd_callback));
context_foreground_green_cmd_callback);
gimp_action_group_add_enum_actions (group, "context-action",
context_foreground_blue_actions,
G_N_ELEMENTS (context_foreground_blue_actions),
G_CALLBACK (context_foreground_blue_cmd_callback));
context_foreground_blue_cmd_callback);
gimp_action_group_add_enum_actions (group, "context-action",
context_foreground_hue_actions,
G_N_ELEMENTS (context_foreground_hue_actions),
G_CALLBACK (context_foreground_hue_cmd_callback));
context_foreground_hue_cmd_callback);
gimp_action_group_add_enum_actions (group, "context-action",
context_foreground_saturation_actions,
G_N_ELEMENTS (context_foreground_saturation_actions),
G_CALLBACK (context_foreground_saturation_cmd_callback));
context_foreground_saturation_cmd_callback);
gimp_action_group_add_enum_actions (group, "context-action",
context_foreground_value_actions,
G_N_ELEMENTS (context_foreground_value_actions),
G_CALLBACK (context_foreground_value_cmd_callback));
context_foreground_value_cmd_callback);
gimp_action_group_add_enum_actions (group, "context-action",
context_background_red_actions,
G_N_ELEMENTS (context_background_red_actions),
G_CALLBACK (context_background_red_cmd_callback));
context_background_red_cmd_callback);
gimp_action_group_add_enum_actions (group, "context-action",
context_background_green_actions,
G_N_ELEMENTS (context_background_green_actions),
G_CALLBACK (context_background_green_cmd_callback));
context_background_green_cmd_callback);
gimp_action_group_add_enum_actions (group, "context-action",
context_background_blue_actions,
G_N_ELEMENTS (context_background_blue_actions),
G_CALLBACK (context_background_blue_cmd_callback));
context_background_blue_cmd_callback);
gimp_action_group_add_enum_actions (group, "context-action",
context_background_hue_actions,
G_N_ELEMENTS (context_background_hue_actions),
G_CALLBACK (context_background_hue_cmd_callback));
context_background_hue_cmd_callback);
gimp_action_group_add_enum_actions (group, "context-action",
context_background_saturation_actions,
G_N_ELEMENTS (context_background_saturation_actions),
G_CALLBACK (context_background_saturation_cmd_callback));
context_background_saturation_cmd_callback);
gimp_action_group_add_enum_actions (group, "context-action",
context_background_value_actions,
G_N_ELEMENTS (context_background_value_actions),
G_CALLBACK (context_background_value_cmd_callback));
context_background_value_cmd_callback);
gimp_action_group_add_enum_actions (group, "context-action",
context_opacity_actions,
G_N_ELEMENTS (context_opacity_actions),
G_CALLBACK (context_opacity_cmd_callback));
context_opacity_cmd_callback);
gimp_action_group_add_enum_actions (group, "context-action",
context_paint_mode_actions,
G_N_ELEMENTS (context_paint_mode_actions),
G_CALLBACK (context_paint_mode_cmd_callback));
context_paint_mode_cmd_callback);
gimp_action_group_add_enum_actions (group, "context-action",
context_tool_select_actions,
G_N_ELEMENTS (context_tool_select_actions),
G_CALLBACK (context_tool_select_cmd_callback));
context_tool_select_cmd_callback);
gimp_action_group_add_enum_actions (group, "context-action",
context_brush_select_actions,
G_N_ELEMENTS (context_brush_select_actions),
G_CALLBACK (context_brush_select_cmd_callback));
context_brush_select_cmd_callback);
gimp_action_group_add_enum_actions (group, "context-action",
context_pattern_select_actions,
G_N_ELEMENTS (context_pattern_select_actions),
G_CALLBACK (context_pattern_select_cmd_callback));
context_pattern_select_cmd_callback);
gimp_action_group_add_enum_actions (group, "context-action",
context_palette_select_actions,
G_N_ELEMENTS (context_palette_select_actions),
G_CALLBACK (context_palette_select_cmd_callback));
context_palette_select_cmd_callback);
gimp_action_group_add_enum_actions (group, "context-action",
context_gradient_select_actions,
G_N_ELEMENTS (context_gradient_select_actions),
G_CALLBACK (context_gradient_select_cmd_callback));
context_gradient_select_cmd_callback);
gimp_action_group_add_enum_actions (group, "context-action",
context_font_select_actions,
G_N_ELEMENTS (context_font_select_actions),
G_CALLBACK (context_font_select_cmd_callback));
context_font_select_cmd_callback);
gimp_action_group_add_enum_actions (group, "context-action",
context_brush_spacing_actions,
G_N_ELEMENTS (context_brush_spacing_actions),
G_CALLBACK (context_brush_spacing_cmd_callback));
context_brush_spacing_cmd_callback);
gimp_action_group_add_enum_actions (group, "context-action",
context_brush_shape_actions,
G_N_ELEMENTS (context_brush_shape_actions),
G_CALLBACK (context_brush_shape_cmd_callback));
context_brush_shape_cmd_callback);
gimp_action_group_add_enum_actions (group, "context-action",
context_brush_radius_actions,
G_N_ELEMENTS (context_brush_radius_actions),
G_CALLBACK (context_brush_radius_cmd_callback));
context_brush_radius_cmd_callback);
gimp_action_group_add_enum_actions (group, "context-action",
context_brush_spikes_actions,
G_N_ELEMENTS (context_brush_spikes_actions),
G_CALLBACK (context_brush_spikes_cmd_callback));
context_brush_spikes_cmd_callback);
gimp_action_group_add_enum_actions (group, "context-action",
context_brush_hardness_actions,
G_N_ELEMENTS (context_brush_hardness_actions),
G_CALLBACK (context_brush_hardness_cmd_callback));
context_brush_hardness_cmd_callback);
gimp_action_group_add_enum_actions (group, "context-action",
context_brush_aspect_actions,
G_N_ELEMENTS (context_brush_aspect_actions),
G_CALLBACK (context_brush_aspect_cmd_callback));
context_brush_aspect_cmd_callback);
gimp_action_group_add_enum_actions (group, "context-action",
context_brush_angle_actions,
G_N_ELEMENTS (context_brush_angle_actions),
G_CALLBACK (context_brush_angle_cmd_callback));
context_brush_angle_cmd_callback);
}
void

View file

@ -82,6 +82,7 @@ static GimpColormapEditor * context_get_colormap_editor (void);
void
context_colors_default_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpContext *context;
@ -92,6 +93,7 @@ context_colors_default_cmd_callback (GimpAction *action,
void
context_colors_swap_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpContext *context;
@ -103,15 +105,18 @@ context_colors_swap_cmd_callback (GimpAction *action,
#define SELECT_COLOR_CMD_CALLBACK(name, fgbg, use_colormap, use_palette) \
void \
context_##name##_##fgbg##ground_cmd_callback (GimpAction *action, \
gint value, \
GVariant *value, \
gpointer data) \
{ \
GimpContext *context; \
GimpRGB color; \
GimpActionSelectType select_type; \
return_if_no_context (context, data); \
\
select_type = (GimpActionSelectType) g_variant_get_int32 (value); \
\
gimp_context_get_##fgbg##ground (context, &color); \
context_select_color ((GimpActionSelectType) value, &color, \
context_select_color (select_type, &color, \
use_colormap, use_palette); \
gimp_context_set_##fgbg##ground (context, &color); \
}
@ -125,15 +130,18 @@ SELECT_COLOR_CMD_CALLBACK (swatch, back, TRUE, TRUE)
void
context_foreground_red_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpContext *context;
GimpRGB color;
GimpActionSelectType select_type;
return_if_no_context (context, data);
select_type = (GimpActionSelectType) g_variant_get_int32 (value);
gimp_context_get_foreground (context, &color);
color.r = action_select_value ((GimpActionSelectType) value,
color.r = action_select_value (select_type,
color.r,
0.0, 1.0, 1.0,
1.0 / 255.0, 0.01, 0.1, 0.0, FALSE);
@ -142,15 +150,18 @@ context_foreground_red_cmd_callback (GimpAction *action,
void
context_foreground_green_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpContext *context;
GimpRGB color;
GimpActionSelectType select_type;
return_if_no_context (context, data);
select_type = (GimpActionSelectType) g_variant_get_int32 (value);
gimp_context_get_foreground (context, &color);
color.g = action_select_value ((GimpActionSelectType) value,
color.g = action_select_value (select_type,
color.g,
0.0, 1.0, 1.0,
1.0 / 255.0, 0.01, 0.1, 0.0, FALSE);
@ -159,15 +170,18 @@ context_foreground_green_cmd_callback (GimpAction *action,
void
context_foreground_blue_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpContext *context;
GimpRGB color;
GimpActionSelectType select_type;
return_if_no_context (context, data);
select_type = (GimpActionSelectType) g_variant_get_int32 (value);
gimp_context_get_foreground (context, &color);
color.b = action_select_value ((GimpActionSelectType) value,
color.b = action_select_value (select_type,
color.b,
0.0, 1.0, 1.0,
1.0 / 255.0, 0.01, 0.1, 0.0, FALSE);
@ -176,15 +190,18 @@ context_foreground_blue_cmd_callback (GimpAction *action,
void
context_background_red_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpContext *context;
GimpRGB color;
GimpActionSelectType select_type;
return_if_no_context (context, data);
select_type = (GimpActionSelectType) g_variant_get_int32 (value);
gimp_context_get_background (context, &color);
color.r = action_select_value ((GimpActionSelectType) value,
color.r = action_select_value (select_type,
color.r,
0.0, 1.0, 1.0,
1.0 / 255.0, 0.01, 0.1, 0.0, FALSE);
@ -193,15 +210,18 @@ context_background_red_cmd_callback (GimpAction *action,
void
context_background_green_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpContext *context;
GimpRGB color;
GimpActionSelectType select_type;
return_if_no_context (context, data);
select_type = (GimpActionSelectType) g_variant_get_int32 (value);
gimp_context_get_background (context, &color);
color.g = action_select_value ((GimpActionSelectType) value,
color.g = action_select_value (select_type,
color.g,
0.0, 1.0, 1.0,
1.0 / 255.0, 0.01, 0.1, 0.0, FALSE);
@ -210,15 +230,18 @@ context_background_green_cmd_callback (GimpAction *action,
void
context_background_blue_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpContext *context;
GimpRGB color;
GimpActionSelectType select_type;
return_if_no_context (context, data);
select_type = (GimpActionSelectType) g_variant_get_int32 (value);
gimp_context_get_background (context, &color);
color.b = action_select_value ((GimpActionSelectType) value,
color.b = action_select_value (select_type,
color.b,
0.0, 1.0, 1.0,
1.0 / 255.0, 0.01, 0.1, 0.0, FALSE);
@ -227,17 +250,20 @@ context_background_blue_cmd_callback (GimpAction *action,
void
context_foreground_hue_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpContext *context;
GimpRGB color;
GimpHSV hsv;
GimpActionSelectType select_type;
return_if_no_context (context, data);
select_type = (GimpActionSelectType) g_variant_get_int32 (value);
gimp_context_get_foreground (context, &color);
gimp_rgb_to_hsv (&color, &hsv);
hsv.h = action_select_value ((GimpActionSelectType) value,
hsv.h = action_select_value (select_type,
hsv.h,
0.0, 1.0, 1.0,
1.0 / 360.0, 0.01, 0.1, 0.0, FALSE);
@ -247,17 +273,20 @@ context_foreground_hue_cmd_callback (GimpAction *action,
void
context_foreground_saturation_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpContext *context;
GimpRGB color;
GimpHSV hsv;
GimpActionSelectType select_type;
return_if_no_context (context, data);
select_type = (GimpActionSelectType) g_variant_get_int32 (value);
gimp_context_get_foreground (context, &color);
gimp_rgb_to_hsv (&color, &hsv);
hsv.s = action_select_value ((GimpActionSelectType) value,
hsv.s = action_select_value (select_type,
hsv.s,
0.0, 1.0, 1.0,
0.01, 0.01, 0.1, 0.0, FALSE);
@ -267,17 +296,20 @@ context_foreground_saturation_cmd_callback (GimpAction *action,
void
context_foreground_value_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpContext *context;
GimpRGB color;
GimpHSV hsv;
GimpActionSelectType select_type;
return_if_no_context (context, data);
select_type = (GimpActionSelectType) g_variant_get_int32 (value);
gimp_context_get_foreground (context, &color);
gimp_rgb_to_hsv (&color, &hsv);
hsv.v = action_select_value ((GimpActionSelectType) value,
hsv.v = action_select_value (select_type,
hsv.v,
0.0, 1.0, 1.0,
0.01, 0.01, 0.1, 0.0, FALSE);
@ -287,17 +319,20 @@ context_foreground_value_cmd_callback (GimpAction *action,
void
context_background_hue_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpContext *context;
GimpRGB color;
GimpHSV hsv;
GimpActionSelectType select_type;
return_if_no_context (context, data);
select_type = (GimpActionSelectType) g_variant_get_int32 (value);
gimp_context_get_background (context, &color);
gimp_rgb_to_hsv (&color, &hsv);
hsv.h = action_select_value ((GimpActionSelectType) value,
hsv.h = action_select_value (select_type,
hsv.h,
0.0, 1.0, 1.0,
1.0 / 360.0, 0.01, 0.1, 0.0, FALSE);
@ -307,17 +342,20 @@ context_background_hue_cmd_callback (GimpAction *action,
void
context_background_saturation_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpContext *context;
GimpRGB color;
GimpHSV hsv;
GimpActionSelectType select_type;
return_if_no_context (context, data);
select_type = (GimpActionSelectType) g_variant_get_int32 (value);
gimp_context_get_background (context, &color);
gimp_rgb_to_hsv (&color, &hsv);
hsv.s = action_select_value ((GimpActionSelectType) value,
hsv.s = action_select_value (select_type,
hsv.s,
0.0, 1.0, 1.0,
0.01, 0.01, 0.1, 0.0, FALSE);
@ -327,17 +365,20 @@ context_background_saturation_cmd_callback (GimpAction *action,
void
context_background_value_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpContext *context;
GimpRGB color;
GimpHSV hsv;
GimpActionSelectType select_type;
return_if_no_context (context, data);
select_type = (GimpActionSelectType) g_variant_get_int32 (value);
gimp_context_get_background (context, &color);
gimp_rgb_to_hsv (&color, &hsv);
hsv.v = action_select_value ((GimpActionSelectType) value,
hsv.v = action_select_value (select_type,
hsv.v,
0.0, 1.0, 1.0,
0.01, 0.01, 0.1, 0.0, FALSE);
@ -347,18 +388,21 @@ context_background_value_cmd_callback (GimpAction *action,
void
context_opacity_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpContext *context;
GimpToolInfo *tool_info;
GimpActionSelectType select_type;
return_if_no_context (context, data);
select_type = (GimpActionSelectType) g_variant_get_int32 (value);
tool_info = gimp_context_get_tool (context);
if (tool_info && GIMP_IS_TOOL_OPTIONS (tool_info->tool_options))
{
action_select_property ((GimpActionSelectType) value,
action_select_property (select_type,
action_data_get_display (data),
G_OBJECT (tool_info->tool_options),
"opacity",
@ -368,7 +412,7 @@ context_opacity_cmd_callback (GimpAction *action,
void
context_paint_mode_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpContext *context;
@ -377,15 +421,18 @@ context_paint_mode_cmd_callback (GimpAction *action,
gint n_modes;
GimpLayerMode paint_mode;
gint index;
GimpActionSelectType select_type;
return_if_no_context (context, data);
select_type = (GimpActionSelectType) g_variant_get_int32 (value);
paint_mode = gimp_context_get_paint_mode (context);
modes = gimp_layer_mode_get_context_array (paint_mode,
GIMP_LAYER_MODE_CONTEXT_PAINT,
&n_modes);
index = context_paint_mode_index (paint_mode, modes, n_modes);
index = action_select_value ((GimpActionSelectType) value,
index = action_select_value (select_type,
index, 0, n_modes - 1, 0,
0.0, 1.0, 1.0, 0.0, FALSE);
paint_mode = modes[index];
@ -415,90 +462,116 @@ context_paint_mode_cmd_callback (GimpAction *action,
void
context_tool_select_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpContext *context;
GimpActionSelectType select_type;
return_if_no_context (context, data);
context_select_object ((GimpActionSelectType) value,
select_type = (GimpActionSelectType) g_variant_get_int32 (value);
context_select_object (select_type,
context, context->gimp->tool_info_list);
}
void
context_brush_select_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpContext *context;
GimpActionSelectType select_type;
return_if_no_context (context, data);
context_select_object ((GimpActionSelectType) value,
context, gimp_data_factory_get_container (context->gimp->brush_factory));
select_type = (GimpActionSelectType) g_variant_get_int32 (value);
context_select_object (select_type,
context,
gimp_data_factory_get_container (context->gimp->brush_factory));
}
void
context_pattern_select_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpContext *context;
GimpActionSelectType select_type;
return_if_no_context (context, data);
context_select_object ((GimpActionSelectType) value,
context, gimp_data_factory_get_container (context->gimp->pattern_factory));
select_type = (GimpActionSelectType) g_variant_get_int32 (value);
context_select_object (select_type,
context,
gimp_data_factory_get_container (context->gimp->pattern_factory));
}
void
context_palette_select_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpContext *context;
GimpActionSelectType select_type;
return_if_no_context (context, data);
context_select_object ((GimpActionSelectType) value,
context, gimp_data_factory_get_container (context->gimp->palette_factory));
select_type = (GimpActionSelectType) g_variant_get_int32 (value);
context_select_object (select_type,
context,
gimp_data_factory_get_container (context->gimp->palette_factory));
}
void
context_gradient_select_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpContext *context;
GimpActionSelectType select_type;
return_if_no_context (context, data);
context_select_object ((GimpActionSelectType) value,
context, gimp_data_factory_get_container (context->gimp->gradient_factory));
select_type = (GimpActionSelectType) g_variant_get_int32 (value);
context_select_object (select_type,
context,
gimp_data_factory_get_container (context->gimp->gradient_factory));
}
void
context_font_select_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpContext *context;
GimpActionSelectType select_type;
return_if_no_context (context, data);
context_select_object ((GimpActionSelectType) value,
context, gimp_data_factory_get_container (context->gimp->font_factory));
select_type = (GimpActionSelectType) g_variant_get_int32 (value);
context_select_object (select_type,
context,
gimp_data_factory_get_container (context->gimp->font_factory));
}
void
context_brush_spacing_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpContext *context;
GimpBrush *brush;
GimpActionSelectType select_type;
return_if_no_context (context, data);
select_type = (GimpActionSelectType) g_variant_get_int32 (value);
brush = gimp_context_get_brush (context);
if (GIMP_IS_BRUSH (brush) && gimp_data_is_writable (GIMP_DATA (brush)))
{
action_select_property ((GimpActionSelectType) value,
action_select_property (select_type,
action_data_get_display (data),
G_OBJECT (brush),
"spacing",
@ -508,13 +581,16 @@ context_brush_spacing_cmd_callback (GimpAction *action,
void
context_brush_shape_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpContext *context;
GimpBrush *brush;
GimpBrushGeneratedShape shape;
return_if_no_context (context, data);
shape = (GimpBrushGeneratedShape) g_variant_get_int32 (value);
brush = gimp_context_get_brush (context);
if (GIMP_IS_BRUSH_GENERATED (brush) &&
@ -524,10 +600,9 @@ context_brush_shape_cmd_callback (GimpAction *action,
GimpDisplay *display;
const char *value_desc;
gimp_brush_generated_set_shape (generated,
(GimpBrushGeneratedShape) value);
gimp_brush_generated_set_shape (generated, shape);
gimp_enum_get_value (GIMP_TYPE_BRUSH_GENERATED_SHAPE, value,
gimp_enum_get_value (GIMP_TYPE_BRUSH_GENERATED_SHAPE, shape,
NULL, NULL, &value_desc, NULL);
display = action_data_get_display (data);
@ -541,13 +616,16 @@ context_brush_shape_cmd_callback (GimpAction *action,
void
context_brush_radius_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpContext *context;
GimpBrush *brush;
GimpActionSelectType select_type;
return_if_no_context (context, data);
select_type = (GimpActionSelectType) g_variant_get_int32 (value);
brush = gimp_context_get_brush (context);
if (GIMP_IS_BRUSH_GENERATED (brush) &&
@ -566,7 +644,7 @@ context_brush_radius_cmd_callback (GimpAction *action,
* is less than 1.0 px. This prevents irritating 0.1, 1.1, 2.1 etc
* radius sequences when 1.0 px steps are used.
*/
switch ((GimpActionSelectType) value)
switch (select_type)
{
case GIMP_ACTION_SELECT_SMALL_PREVIOUS:
case GIMP_ACTION_SELECT_SMALL_NEXT:
@ -583,7 +661,7 @@ context_brush_radius_cmd_callback (GimpAction *action,
break;
}
radius = action_select_value ((GimpActionSelectType) value,
radius = action_select_value (select_type,
radius,
min_radius, 4000.0, min_radius,
0.1, 1.0, 10.0, 0.05, FALSE);
@ -601,19 +679,22 @@ context_brush_radius_cmd_callback (GimpAction *action,
void
context_brush_spikes_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpContext *context;
GimpBrush *brush;
GimpActionSelectType select_type;
return_if_no_context (context, data);
select_type = (GimpActionSelectType) g_variant_get_int32 (value);
brush = gimp_context_get_brush (context);
if (GIMP_IS_BRUSH_GENERATED (brush) &&
gimp_data_is_writable (GIMP_DATA (brush)))
{
action_select_property ((GimpActionSelectType) value,
action_select_property (select_type,
action_data_get_display (data),
G_OBJECT (brush),
"spikes",
@ -623,19 +704,22 @@ context_brush_spikes_cmd_callback (GimpAction *action,
void
context_brush_hardness_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpContext *context;
GimpBrush *brush;
GimpActionSelectType select_type;
return_if_no_context (context, data);
select_type = (GimpActionSelectType) g_variant_get_int32 (value);
brush = gimp_context_get_brush (context);
if (GIMP_IS_BRUSH_GENERATED (brush) &&
gimp_data_is_writable (GIMP_DATA (brush)))
{
action_select_property ((GimpActionSelectType) value,
action_select_property (select_type,
action_data_get_display (data),
G_OBJECT (brush),
"hardness",
@ -645,19 +729,22 @@ context_brush_hardness_cmd_callback (GimpAction *action,
void
context_brush_aspect_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpContext *context;
GimpBrush *brush;
GimpActionSelectType select_type;
return_if_no_context (context, data);
select_type = (GimpActionSelectType) g_variant_get_int32 (value);
brush = gimp_context_get_brush (context);
if (GIMP_IS_BRUSH_GENERATED (brush) &&
gimp_data_is_writable (GIMP_DATA (brush)))
{
action_select_property ((GimpActionSelectType) value,
action_select_property (select_type,
action_data_get_display (data),
G_OBJECT (brush),
"aspect-ratio",
@ -667,13 +754,16 @@ context_brush_aspect_cmd_callback (GimpAction *action,
void
context_brush_angle_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpContext *context;
GimpBrush *brush;
GimpActionSelectType select_type;
return_if_no_context (context, data);
select_type = (GimpActionSelectType) g_variant_get_int32 (value);
brush = gimp_context_get_brush (context);
if (GIMP_IS_BRUSH_GENERATED (brush) &&
@ -685,12 +775,12 @@ context_brush_angle_cmd_callback (GimpAction *action,
angle = gimp_brush_generated_get_angle (generated);
if (value == GIMP_ACTION_SELECT_FIRST)
if (select_type == GIMP_ACTION_SELECT_FIRST)
angle = 0.0;
else if (value == GIMP_ACTION_SELECT_LAST)
else if (select_type == GIMP_ACTION_SELECT_LAST)
angle = 90.0;
else
angle = action_select_value ((GimpActionSelectType) value,
angle = action_select_value (select_type,
angle,
0.0, 180.0, 0.0,
0.1, 1.0, 15.0, 0.1, TRUE);
@ -717,14 +807,16 @@ context_select_object (GimpActionSelectType select_type,
{
GimpObject *current;
current = gimp_context_get_by_type (context,
current =
gimp_context_get_by_type (context,
gimp_container_get_children_type (container));
current = action_select_object (select_type, container, current);
if (current)
gimp_context_set_by_type (context,
gimp_container_get_children_type (container), current);
gimp_container_get_children_type (container),
current);
}
static gint

View file

@ -21,117 +21,119 @@
void context_colors_default_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void context_colors_swap_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void context_palette_foreground_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void context_palette_background_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void context_colormap_foreground_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void context_colormap_background_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void context_swatch_foreground_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void context_swatch_background_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void context_foreground_red_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void context_foreground_green_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void context_foreground_blue_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void context_background_red_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void context_background_green_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void context_background_blue_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void context_foreground_hue_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void context_foreground_saturation_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void context_foreground_value_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void context_background_hue_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void context_background_saturation_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void context_background_value_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void context_opacity_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void context_paint_mode_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void context_tool_select_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void context_brush_select_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void context_pattern_select_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void context_palette_select_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void context_gradient_select_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void context_font_select_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void context_brush_spacing_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void context_brush_shape_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void context_brush_radius_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void context_brush_spikes_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void context_brush_hardness_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void context_brush_aspect_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void context_brush_angle_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);

View file

@ -47,7 +47,7 @@ static const GimpToggleActionEntry cursor_info_toggle_actions[] =
{ "cursor-info-sample-merged", NULL,
NC_("cursor-info-action", "_Sample Merged"), "",
NC_("cursor-info-action", "Use the composite color of all visible layers"),
G_CALLBACK (cursor_info_sample_merged_cmd_callback),
cursor_info_sample_merged_cmd_callback,
TRUE,
GIMP_HELP_POINTER_INFO_SAMPLE_MERGED }
};

View file

@ -22,8 +22,6 @@
#include "actions-types.h"
#include "widgets/gimptoggleaction.h"
#include "display/gimpcursorview.h"
#include "cursor-info-commands.h"
@ -33,12 +31,11 @@
void
cursor_info_sample_merged_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpCursorView *view = GIMP_CURSOR_VIEW (data);
gboolean active;
active = gimp_toggle_action_get_active (GIMP_TOGGLE_ACTION (action));
gboolean active = g_variant_get_boolean (value);
gimp_cursor_view_set_sample_merged (view, active);
}

View file

@ -20,6 +20,7 @@
void cursor_info_sample_merged_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);

View file

@ -50,25 +50,25 @@ static const GimpActionEntry dashboard_actions[] =
{ "dashboard-log-record", GIMP_ICON_RECORD,
NC_("dashboard-action", "_Start/Stop Recording..."), NULL,
NC_("dashboard-action", "Start/stop recording performance log"),
G_CALLBACK (dashboard_log_record_cmd_callback),
dashboard_log_record_cmd_callback,
GIMP_HELP_DASHBOARD_LOG_RECORD },
{ "dashboard-log-add-marker", GIMP_ICON_MARKER,
NC_("dashboard-action", "_Add Marker..."), NULL,
NC_("dashboard-action", "Add an event marker "
"to the performance log"),
G_CALLBACK (dashboard_log_add_marker_cmd_callback),
dashboard_log_add_marker_cmd_callback,
GIMP_HELP_DASHBOARD_LOG_ADD_MARKER },
{ "dashboard-log-add-empty-marker", GIMP_ICON_MARKER,
NC_("dashboard-action", "Add _Empty Marker"), NULL,
NC_("dashboard-action", "Add an empty event marker "
"to the performance log"),
G_CALLBACK (dashboard_log_add_empty_marker_cmd_callback),
dashboard_log_add_empty_marker_cmd_callback,
GIMP_HELP_DASHBOARD_LOG_ADD_EMPTY_MARKER },
{ "dashboard-reset", GIMP_ICON_RESET,
NC_("dashboard-action", "_Reset"), NULL,
NC_("dashboard-action", "Reset cumulative data"),
G_CALLBACK (dashboard_reset_cmd_callback),
dashboard_reset_cmd_callback,
GIMP_HELP_DASHBOARD_RESET },
};
@ -78,7 +78,7 @@ static const GimpToggleActionEntry dashboard_toggle_actions[] =
NC_("dashboard-action", "_Low Swap Space Warning"), NULL,
NC_("dashboard-action", "Raise the dashboard when "
"the swap size approaches its limit"),
G_CALLBACK (dashboard_low_swap_space_warning_cmd_callback),
dashboard_low_swap_space_warning_cmd_callback,
FALSE,
GIMP_HELP_DASHBOARD_LOW_SWAP_SPACE_WARNING }
};
@ -156,14 +156,14 @@ dashboard_actions_setup (GimpActionGroup *group)
G_N_ELEMENTS (dashboard_update_interval_actions),
NULL,
0,
G_CALLBACK (dashboard_update_interval_cmd_callback));
dashboard_update_interval_cmd_callback);
gimp_action_group_add_radio_actions (group, "dashboard-history-duration",
dashboard_history_duration_actions,
G_N_ELEMENTS (dashboard_history_duration_actions),
NULL,
0,
G_CALLBACK (dashboard_history_duration_cmd_callback));
dashboard_history_duration_cmd_callback);
}
void

View file

@ -28,8 +28,6 @@
#include "widgets/gimpdashboard.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpradioaction.h"
#include "widgets/gimptoggleaction.h"
#include "widgets/gimpuimanager.h"
#include "dialogs/dialogs.h"
@ -55,34 +53,33 @@ static void dashboard_log_add_marker_response (GtkWidget *dialog,
void
dashboard_update_interval_cmd_callback (GimpAction *action,
GimpAction *current,
GVariant *value,
gpointer data)
{
GimpDashboard *dashboard = GIMP_DASHBOARD (data);
GimpDashboardUpdateInteval update_interval;
update_interval =
gimp_radio_action_get_current_value (GIMP_RADIO_ACTION (action));
update_interval = g_variant_get_int32 (value);
gimp_dashboard_set_update_interval (dashboard, update_interval);
}
void
dashboard_history_duration_cmd_callback (GimpAction *action,
GimpAction *current,
GVariant *value,
gpointer data)
{
GimpDashboard *dashboard = GIMP_DASHBOARD (data);
GimpDashboardHistoryDuration history_duration;
history_duration =
gimp_radio_action_get_current_value (GIMP_RADIO_ACTION (action));
history_duration = g_variant_get_int32 (value);
gimp_dashboard_set_history_duration (dashboard, history_duration);
}
void
dashboard_log_record_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpDashboard *dashboard = GIMP_DASHBOARD (data);
@ -186,6 +183,7 @@ dashboard_log_record_cmd_callback (GimpAction *action,
void
dashboard_log_add_marker_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpDashboard *dashboard = GIMP_DASHBOARD (data);
@ -216,6 +214,7 @@ dashboard_log_add_marker_cmd_callback (GimpAction *action,
void
dashboard_log_add_empty_marker_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpDashboard *dashboard = GIMP_DASHBOARD (data);
@ -225,6 +224,7 @@ dashboard_log_add_empty_marker_cmd_callback (GimpAction *action,
void
dashboard_reset_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpDashboard *dashboard = GIMP_DASHBOARD (data);
@ -234,13 +234,11 @@ dashboard_reset_cmd_callback (GimpAction *action,
void
dashboard_low_swap_space_warning_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpDashboard *dashboard = GIMP_DASHBOARD (data);
gboolean low_swap_space_warning;
low_swap_space_warning =
gimp_toggle_action_get_active (GIMP_TOGGLE_ACTION (action));
gboolean low_swap_space_warning = g_variant_get_boolean (value);
gimp_dashboard_set_low_swap_space_warning (dashboard, low_swap_space_warning);
}
@ -248,7 +246,6 @@ dashboard_low_swap_space_warning_cmd_callback (GimpAction *action,
/* private functions */
static void
dashboard_log_record_response (GtkWidget *dialog,
int response_id,

View file

@ -20,23 +20,28 @@
void dashboard_update_interval_cmd_callback (GimpAction *action,
GimpAction *current,
GVariant *value,
gpointer data);
void dashboard_history_duration_cmd_callback (GimpAction *action,
GimpAction *current,
GVariant *value,
gpointer data);
void dashboard_log_record_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void dashboard_log_add_marker_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void dashboard_log_add_empty_marker_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void dashboard_reset_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void dashboard_low_swap_space_warning_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);

View file

@ -56,6 +56,7 @@
void
data_open_as_image_cmd_callback (GimpAction *action,
GVariant *value,
gpointer user_data)
{
GimpDataFactoryView *view = GIMP_DATA_FACTORY_VIEW (user_data);
@ -95,6 +96,7 @@ data_open_as_image_cmd_callback (GimpAction *action,
void
data_new_cmd_callback (GimpAction *action,
GVariant *value,
gpointer user_data)
{
GimpDataFactoryView *view = GIMP_DATA_FACTORY_VIEW (user_data);
@ -125,6 +127,7 @@ data_new_cmd_callback (GimpAction *action,
void
data_duplicate_cmd_callback (GimpAction *action,
GVariant *value,
gpointer user_data)
{
GimpDataFactoryView *view = GIMP_DATA_FACTORY_VIEW (user_data);
@ -156,6 +159,7 @@ data_duplicate_cmd_callback (GimpAction *action,
void
data_copy_location_cmd_callback (GimpAction *action,
GVariant *value,
gpointer user_data)
{
GimpDataFactoryView *view = GIMP_DATA_FACTORY_VIEW (user_data);
@ -184,6 +188,7 @@ data_copy_location_cmd_callback (GimpAction *action,
void
data_show_in_file_manager_cmd_callback (GimpAction *action,
GVariant *value,
gpointer user_data)
{
GimpDataFactoryView *view = GIMP_DATA_FACTORY_VIEW (user_data);
@ -218,6 +223,7 @@ data_show_in_file_manager_cmd_callback (GimpAction *action,
void
data_delete_cmd_callback (GimpAction *action,
GVariant *value,
gpointer user_data)
{
GimpDataFactoryView *view = GIMP_DATA_FACTORY_VIEW (user_data);
@ -248,6 +254,7 @@ data_delete_cmd_callback (GimpAction *action,
void
data_refresh_cmd_callback (GimpAction *action,
GVariant *value,
gpointer user_data)
{
GimpDataFactoryView *view = GIMP_DATA_FACTORY_VIEW (user_data);
@ -262,7 +269,7 @@ data_refresh_cmd_callback (GimpAction *action,
void
data_edit_cmd_callback (GimpAction *action,
const gchar *value,
GVariant *value,
gpointer user_data)
{
GimpDataFactoryView *view = GIMP_DATA_FACTORY_VIEW (user_data);
@ -285,7 +292,8 @@ data_edit_cmd_callback (GimpAction *action,
context->gimp,
gimp_dialog_factory_get_singleton (),
monitor,
value);
g_variant_get_string (value,
NULL));
gimp_data_editor_set_data (GIMP_DATA_EDITOR (gtk_bin_get_child (GTK_BIN (dockable))),
data);

View file

@ -20,21 +20,28 @@
void data_open_as_image_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void data_new_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void data_duplicate_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void data_copy_location_cmd_callback (GimpAction *action,
gpointer user_data);
GVariant *value,
gpointer data);
void data_show_in_file_manager_cmd_callback (GimpAction *action,
gpointer user_data);
GVariant *value,
gpointer data);
void data_delete_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void data_refresh_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void data_edit_cmd_callback (GimpAction *action,
const gchar *value,
GVariant *value,
gpointer data);

View file

@ -23,7 +23,6 @@
#include "actions-types.h"
#include "widgets/gimpdataeditor.h"
#include "widgets/gimptoggleaction.h"
#include "data-editor-commands.h"
@ -32,12 +31,13 @@
void
data_editor_edit_active_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpDataEditor *editor = GIMP_DATA_EDITOR (data);
gboolean edit_active;
edit_active = gimp_toggle_action_get_active (GIMP_TOGGLE_ACTION (action));
edit_active = g_variant_get_boolean (value);
gimp_data_editor_set_edit_active (editor, edit_active);
}

View file

@ -20,6 +20,7 @@
void data_editor_edit_active_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);

View file

@ -38,12 +38,12 @@ static const GimpActionEntry debug_actions[] =
{ "debug-gtk-inspector", NULL,
"Start _GtkInspector", NULL, NULL,
G_CALLBACK (debug_gtk_inspector_cmd_callback),
debug_gtk_inspector_cmd_callback,
NULL },
{ "debug-mem-profile", NULL,
"_Memory Profile", NULL, NULL,
G_CALLBACK (debug_mem_profile_cmd_callback),
debug_mem_profile_cmd_callback,
NULL },
{ "debug-benchmark-projection", NULL,
@ -51,33 +51,33 @@ static const GimpActionEntry debug_actions[] =
"Invalidates the entire projection, measures the time it takes to "
"validate (render) the part that is visible in the active display, "
"and print the result to stdout.",
G_CALLBACK (debug_benchmark_projection_cmd_callback),
debug_benchmark_projection_cmd_callback,
NULL },
{ "debug-show-image-graph", NULL,
"Show Image _Graph", NULL,
"Creates a new image showing the GEGL graph of this image",
G_CALLBACK (debug_show_image_graph_cmd_callback),
debug_show_image_graph_cmd_callback,
NULL },
{ "debug-dump-items", NULL,
"_Dump Items", NULL, NULL,
G_CALLBACK (debug_dump_menus_cmd_callback),
debug_dump_menus_cmd_callback,
NULL },
{ "debug-dump-managers", NULL,
"Dump _UI Managers", NULL, NULL,
G_CALLBACK (debug_dump_managers_cmd_callback),
debug_dump_managers_cmd_callback,
NULL },
{ "debug-dump-keyboard-shortcuts", NULL,
"Dump _Keyboard Shortcuts", NULL, NULL,
G_CALLBACK (debug_dump_keyboard_shortcuts_cmd_callback),
debug_dump_keyboard_shortcuts_cmd_callback,
NULL },
{ "debug-dump-attached-data", NULL,
"Dump Attached Data", NULL, NULL,
G_CALLBACK (debug_dump_attached_data_cmd_callback),
debug_dump_attached_data_cmd_callback,
NULL }
};

View file

@ -73,6 +73,7 @@ static gboolean debug_accel_find_func (GtkAccelKey *key,
void
debug_gtk_inspector_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
gtk_window_set_interactive_debugging (TRUE);
@ -80,6 +81,7 @@ debug_gtk_inspector_cmd_callback (GimpAction *action,
void
debug_mem_profile_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
extern gboolean gimp_debug_memsize;
@ -95,6 +97,7 @@ debug_mem_profile_cmd_callback (GimpAction *action,
void
debug_benchmark_projection_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpDisplay *display;
@ -105,6 +108,7 @@ debug_benchmark_projection_cmd_callback (GimpAction *action,
void
debug_show_image_graph_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *source_image = NULL;
@ -115,6 +119,7 @@ debug_show_image_graph_cmd_callback (GimpAction *action,
void
debug_dump_menus_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GList *list;
@ -156,6 +161,7 @@ debug_dump_menus_cmd_callback (GimpAction *action,
void
debug_dump_managers_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GList *list;
@ -184,6 +190,7 @@ debug_dump_managers_cmd_callback (GimpAction *action,
void
debug_dump_keyboard_shortcuts_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpDisplay *display;
@ -273,6 +280,7 @@ debug_dump_keyboard_shortcuts_cmd_callback (GimpAction *action,
void
debug_dump_attached_data_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
Gimp *gimp = action_data_get_gimp (data);

View file

@ -20,22 +20,29 @@
void debug_gtk_inspector_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void debug_mem_profile_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void debug_benchmark_projection_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void debug_show_image_graph_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void debug_dump_menus_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void debug_dump_managers_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void debug_dump_keyboard_shortcuts_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void debug_dump_attached_data_cmd_callback (GimpAction *action,
gpointer data);
void debug_benchmark_projection_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
#endif /* __DEBUG_COMMANDS_H__ */

View file

@ -342,12 +342,12 @@ dialogs_actions_setup (GimpActionGroup *group)
gimp_action_group_add_string_actions (group, "dialogs-action",
dialogs_dockable_actions,
G_N_ELEMENTS (dialogs_dockable_actions),
G_CALLBACK (dialogs_create_dockable_cmd_callback));
dialogs_create_dockable_cmd_callback);
gimp_action_group_add_string_actions (group, "dialogs-action",
dialogs_toplevel_actions,
G_N_ELEMENTS (dialogs_toplevel_actions),
G_CALLBACK (dialogs_create_toplevel_cmd_callback));
dialogs_create_toplevel_cmd_callback);
}
void

View file

@ -38,34 +38,40 @@
void
dialogs_create_toplevel_cmd_callback (GimpAction *action,
const gchar *value,
GVariant *value,
gpointer data)
{
GtkWidget *widget;
const gchar *identifier;
return_if_no_widget (widget, data);
if (value)
identifier = g_variant_get_string (value, NULL);
if (identifier)
gimp_dialog_factory_dialog_new (gimp_dialog_factory_get_singleton (),
gimp_widget_get_monitor (widget),
NULL /*ui_manager*/,
widget,
value, -1, TRUE);
identifier, -1, TRUE);
}
void
dialogs_create_dockable_cmd_callback (GimpAction *action,
const gchar *value,
GVariant *value,
gpointer data)
{
Gimp *gimp;
GtkWidget *widget;
const gchar *identifier;
return_if_no_gimp (gimp, data);
return_if_no_widget (widget, data);
if (value)
identifier = g_variant_get_string (value, NULL);
if (identifier)
gimp_window_strategy_show_dockable_dialog (GIMP_WINDOW_STRATEGY (gimp_get_window_strategy (gimp)),
gimp,
gimp_dialog_factory_get_singleton (),
gimp_widget_get_monitor (widget),
value);
identifier);
}

View file

@ -20,10 +20,10 @@
void dialogs_create_toplevel_cmd_callback (GimpAction *action,
const gchar *value,
GVariant *value,
gpointer data);
void dialogs_create_dockable_cmd_callback (GimpAction *action,
const gchar *value,
GVariant *value,
gpointer data);

View file

@ -48,13 +48,13 @@ static const GimpActionEntry dock_actions[] =
{ "dock-close", GIMP_ICON_WINDOW_CLOSE,
NC_("dock-action", "Close Dock"), "", NULL,
G_CALLBACK (window_close_cmd_callback),
window_close_cmd_callback,
GIMP_HELP_DOCK_CLOSE },
{ "dock-open-display", NULL,
NC_("dock-action", "_Open Display..."), NULL,
NC_("dock-action", "Connect to another display"),
G_CALLBACK (window_open_display_cmd_callback),
window_open_display_cmd_callback,
NULL }
};
@ -62,13 +62,13 @@ static const GimpToggleActionEntry dock_toggle_actions[] =
{
{ "dock-show-image-menu", NULL,
NC_("dock-action", "_Show Image Selection"), NULL, NULL,
G_CALLBACK (dock_toggle_image_menu_cmd_callback),
dock_toggle_image_menu_cmd_callback,
TRUE,
GIMP_HELP_DOCK_IMAGE_MENU },
{ "dock-auto-follow-active", NULL,
NC_("dock-action", "Auto _Follow Active Image"), NULL, NULL,
G_CALLBACK (dock_toggle_auto_cmd_callback),
dock_toggle_auto_cmd_callback,
TRUE,
GIMP_HELP_DOCK_AUTO_BUTTON }
};

View file

@ -26,7 +26,6 @@
#include "widgets/gimpdockwindow.h"
#include "widgets/gimpdockwindow.h"
#include "widgets/gimptoggleaction.h"
#include "actions.h"
#include "dock-commands.h"
@ -49,6 +48,7 @@ dock_commands_get_dock_window_from_widget (GtkWidget *widget)
void
dock_toggle_image_menu_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GtkWidget *widget = NULL;
@ -59,8 +59,7 @@ dock_toggle_image_menu_cmd_callback (GimpAction *action,
if (dock_window)
{
gboolean active =
gimp_toggle_action_get_active (GIMP_TOGGLE_ACTION (action));
gboolean active = g_variant_get_boolean (value);
gimp_dock_window_set_show_image_menu (dock_window, active);
}
@ -68,6 +67,7 @@ dock_toggle_image_menu_cmd_callback (GimpAction *action,
void
dock_toggle_auto_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GtkWidget *widget = NULL;
@ -78,8 +78,7 @@ dock_toggle_auto_cmd_callback (GimpAction *action,
if (dock_window)
{
gboolean active =
gimp_toggle_action_get_active (GIMP_TOGGLE_ACTION (action));
gboolean active = g_variant_get_boolean (value);
gimp_dock_window_set_auto_follow_active (dock_window, active);
}

View file

@ -20,8 +20,10 @@
void dock_toggle_image_menu_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void dock_toggle_auto_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);

View file

@ -59,12 +59,12 @@ static const GimpActionEntry dockable_actions[] =
{ "dockable-close-tab", "window-close",
NC_("dockable-action", "_Close Tab"), "", NULL,
G_CALLBACK (dockable_close_tab_cmd_callback),
dockable_close_tab_cmd_callback,
GIMP_HELP_DOCK_TAB_CLOSE },
{ "dockable-detach-tab", GIMP_ICON_DETACH,
NC_("dockable-action", "_Detach Tab"), "", NULL,
G_CALLBACK (dockable_detach_tab_cmd_callback),
dockable_detach_tab_cmd_callback,
GIMP_HELP_DOCK_TAB_DETACH }
};
@ -125,13 +125,13 @@ static const GimpToggleActionEntry dockable_toggle_actions[] =
NC_("dockable-action", "Loc_k Tab to Dock"), NULL,
NC_("dockable-action",
"Protect this tab from being dragged with the mouse pointer"),
G_CALLBACK (dockable_lock_tab_cmd_callback),
dockable_lock_tab_cmd_callback,
FALSE,
GIMP_HELP_DOCK_TAB_LOCK },
{ "dockable-show-button-bar", NULL,
NC_("dockable-action", "Show _Button Bar"), NULL, NULL,
G_CALLBACK (dockable_show_button_bar_cmd_callback),
dockable_show_button_bar_cmd_callback,
TRUE,
GIMP_HELP_DOCK_SHOW_BUTTON_BAR }
};
@ -164,28 +164,28 @@ dockable_actions_setup (GimpActionGroup *group)
gimp_action_group_add_string_actions (group, "dialogs-action",
dialogs_dockable_actions,
n_dialogs_dockable_actions,
G_CALLBACK (dockable_add_tab_cmd_callback));
dockable_add_tab_cmd_callback);
gimp_action_group_add_radio_actions (group, "preview-size",
dockable_view_size_actions,
G_N_ELEMENTS (dockable_view_size_actions),
NULL,
GIMP_VIEW_SIZE_MEDIUM,
G_CALLBACK (dockable_view_size_cmd_callback));
dockable_view_size_cmd_callback);
gimp_action_group_add_radio_actions (group, "tab-style",
dockable_tab_style_actions,
G_N_ELEMENTS (dockable_tab_style_actions),
NULL,
GIMP_TAB_STYLE_PREVIEW,
G_CALLBACK (dockable_tab_style_cmd_callback));
dockable_tab_style_cmd_callback);
gimp_action_group_add_radio_actions (group, "dockable-action",
dockable_view_type_actions,
G_N_ELEMENTS (dockable_view_type_actions),
NULL,
GIMP_VIEW_TYPE_LIST,
G_CALLBACK (dockable_toggle_view_cmd_callback));
dockable_toggle_view_cmd_callback);
}
void

View file

@ -33,9 +33,7 @@
#include "widgets/gimpdockable.h"
#include "widgets/gimpdockbook.h"
#include "widgets/gimpdocked.h"
#include "widgets/gimpradioaction.h"
#include "widgets/gimpsessioninfo.h"
#include "widgets/gimptoggleaction.h"
#include "dockable-commands.h"
@ -47,16 +45,18 @@ static GimpDockable * dockable_get_current (GimpDockbook *dockbook);
void
dockable_add_tab_cmd_callback (GimpAction *action,
const gchar *value,
GVariant *value,
gpointer data)
{
GimpDockbook *dockbook = GIMP_DOCKBOOK (data);
gimp_dockbook_add_from_dialog_factory (dockbook, value);
gimp_dockbook_add_from_dialog_factory (dockbook,
g_variant_get_string (value, NULL));
}
void
dockable_close_tab_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpDockbook *dockbook = GIMP_DOCKBOOK (data);
@ -69,6 +69,7 @@ dockable_close_tab_cmd_callback (GimpAction *action,
void
dockable_detach_tab_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpDockbook *dockbook = GIMP_DOCKBOOK (data);
@ -80,6 +81,7 @@ dockable_detach_tab_cmd_callback (GimpAction *action,
void
dockable_lock_tab_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpDockbook *dockbook = GIMP_DOCKBOOK (data);
@ -87,8 +89,7 @@ dockable_lock_tab_cmd_callback (GimpAction *action,
if (dockable)
{
gboolean lock =
gimp_toggle_action_get_active (GIMP_TOGGLE_ACTION (action));
gboolean lock = g_variant_get_boolean (value);
gimp_dockable_set_locked (dockable, lock);
}
@ -96,7 +97,7 @@ dockable_lock_tab_cmd_callback (GimpAction *action,
void
dockable_toggle_view_cmd_callback (GimpAction *action,
GimpAction *current,
GVariant *value,
gpointer data)
{
GimpDockbook *dockbook = GIMP_DOCKBOOK (data);
@ -104,8 +105,7 @@ dockable_toggle_view_cmd_callback (GimpAction *action,
GimpViewType view_type;
gint page_num;
view_type = (GimpViewType)
gimp_radio_action_get_current_value (GIMP_RADIO_ACTION (action));
view_type = (GimpViewType) g_variant_get_int32 (value);
page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (dockbook));
@ -209,14 +209,14 @@ dockable_toggle_view_cmd_callback (GimpAction *action,
void
dockable_view_size_cmd_callback (GimpAction *action,
GimpAction *current,
GVariant *value,
gpointer data)
{
GimpDockbook *dockbook = GIMP_DOCKBOOK (data);
GimpDockable *dockable = dockable_get_current (dockbook);
gint view_size;
view_size = gimp_radio_action_get_current_value (GIMP_RADIO_ACTION (action));
view_size = g_variant_get_int32 (value);
if (dockable)
{
@ -237,15 +237,14 @@ dockable_view_size_cmd_callback (GimpAction *action,
void
dockable_tab_style_cmd_callback (GimpAction *action,
GimpAction *current,
GVariant *value,
gpointer data)
{
GimpDockbook *dockbook = GIMP_DOCKBOOK (data);
GimpDockable *dockable = dockable_get_current (dockbook);
GimpTabStyle tab_style;
tab_style = (GimpTabStyle)
gimp_radio_action_get_current_value (GIMP_RADIO_ACTION (action));
tab_style = (GimpTabStyle) g_variant_get_int32 (value);
if (dockable && gimp_dockable_get_tab_style (dockable) != tab_style)
{
@ -263,6 +262,7 @@ dockable_tab_style_cmd_callback (GimpAction *action,
void
dockable_show_button_bar_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpDockbook *dockbook = GIMP_DOCKBOOK (data);
@ -274,7 +274,7 @@ dockable_show_button_bar_cmd_callback (GimpAction *action,
gboolean show;
docked = GIMP_DOCKED (gtk_bin_get_child (GTK_BIN (dockable)));
show = gimp_toggle_action_get_active (GIMP_TOGGLE_ACTION (action));
show = g_variant_get_boolean (value);
gimp_docked_set_show_button_bar (docked, show);
}

View file

@ -20,25 +20,29 @@
void dockable_add_tab_cmd_callback (GimpAction *action,
const gchar *value,
GVariant *value,
gpointer data);
void dockable_close_tab_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void dockable_detach_tab_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void dockable_lock_tab_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void dockable_toggle_view_cmd_callback (GimpAction *action,
GimpAction *current,
GVariant *value,
gpointer data);
void dockable_view_size_cmd_callback (GimpAction *action,
GimpAction *current,
GVariant *value,
gpointer data);
void dockable_tab_style_cmd_callback (GimpAction *action,
GimpAction *current,
GVariant *value,
gpointer data);
void dockable_show_button_bar_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);

View file

@ -45,62 +45,62 @@ static const GimpActionEntry documents_actions[] =
{ "documents-open", GIMP_ICON_DOCUMENT_OPEN,
NC_("documents-action", "_Open Image"), NULL,
NC_("documents-action", "Open the selected entry"),
G_CALLBACK (documents_open_cmd_callback),
documents_open_cmd_callback,
GIMP_HELP_DOCUMENT_OPEN },
{ "documents-raise-or-open", NULL,
NC_("documents-action", "_Raise or Open Image"), NULL,
NC_("documents-action", "Raise window if already open"),
G_CALLBACK (documents_raise_or_open_cmd_callback),
documents_raise_or_open_cmd_callback,
GIMP_HELP_DOCUMENT_OPEN },
{ "documents-file-open-dialog", NULL,
NC_("documents-action", "File Open _Dialog"), NULL,
NC_("documents-action", "Open image dialog"),
G_CALLBACK (documents_file_open_dialog_cmd_callback),
documents_file_open_dialog_cmd_callback,
GIMP_HELP_DOCUMENT_OPEN },
{ "documents-copy-location", GIMP_ICON_EDIT_COPY,
NC_("documents-action", "Copy Image _Location"), NULL,
NC_("documents-action", "Copy image location to clipboard"),
G_CALLBACK (documents_copy_location_cmd_callback),
documents_copy_location_cmd_callback,
GIMP_HELP_DOCUMENT_COPY_LOCATION },
{ "documents-show-in-file-manager", GIMP_ICON_FILE_MANAGER,
NC_("documents-action", "Show in _File Manager"), NULL,
NC_("documents-action", "Show image location in the file manager"),
G_CALLBACK (documents_show_in_file_manager_cmd_callback),
documents_show_in_file_manager_cmd_callback,
GIMP_HELP_DOCUMENT_SHOW_IN_FILE_MANAGER },
{ "documents-remove", GIMP_ICON_LIST_REMOVE,
NC_("documents-action", "Remove _Entry"), NULL,
NC_("documents-action", "Remove the selected entry"),
G_CALLBACK (documents_remove_cmd_callback),
documents_remove_cmd_callback,
GIMP_HELP_DOCUMENT_REMOVE },
{ "documents-clear", GIMP_ICON_SHRED,
NC_("documents-action", "_Clear History"), NULL,
NC_("documents-action", "Clear the entire document history"),
G_CALLBACK (documents_clear_cmd_callback),
documents_clear_cmd_callback,
GIMP_HELP_DOCUMENT_CLEAR },
{ "documents-recreate-preview", GIMP_ICON_VIEW_REFRESH,
NC_("documents-action", "Recreate _Preview"), NULL,
NC_("documents-action", "Recreate preview"),
G_CALLBACK (documents_recreate_preview_cmd_callback),
documents_recreate_preview_cmd_callback,
GIMP_HELP_DOCUMENT_REFRESH },
{ "documents-reload-previews", NULL,
NC_("documents-action", "Reload _all Previews"), NULL,
NC_("documents-action", "Reload all previews"),
G_CALLBACK (documents_reload_previews_cmd_callback),
documents_reload_previews_cmd_callback,
GIMP_HELP_DOCUMENT_REFRESH },
{ "documents-remove-dangling", NULL,
NC_("documents-action", "Remove Dangling E_ntries"), NULL,
NC_("documents-action",
"Remove entries for which the corresponding file is not available"),
G_CALLBACK (documents_remove_dangling_cmd_callback),
documents_remove_dangling_cmd_callback,
GIMP_HELP_DOCUMENT_REFRESH }
};

View file

@ -76,6 +76,7 @@ static void documents_raise_display (GimpDisplay *display,
void
documents_open_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
@ -100,6 +101,7 @@ documents_open_cmd_callback (GimpAction *action,
void
documents_raise_or_open_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
@ -130,6 +132,7 @@ documents_raise_or_open_cmd_callback (GimpAction *action,
void
documents_file_open_dialog_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
@ -152,6 +155,7 @@ documents_file_open_dialog_cmd_callback (GimpAction *action,
void
documents_copy_location_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
@ -168,6 +172,7 @@ documents_copy_location_cmd_callback (GimpAction *action,
void
documents_show_in_file_manager_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
@ -197,6 +202,7 @@ documents_show_in_file_manager_cmd_callback (GimpAction *action,
void
documents_remove_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
@ -213,6 +219,7 @@ documents_remove_cmd_callback (GimpAction *action,
void
documents_clear_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
@ -283,6 +290,7 @@ documents_clear_cmd_callback (GimpAction *action,
void
documents_recreate_preview_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
@ -314,6 +322,7 @@ documents_recreate_preview_cmd_callback (GimpAction *action,
void
documents_reload_previews_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
@ -345,6 +354,7 @@ documents_remove_dangling_foreach (GimpImagefile *imagefile,
void
documents_remove_dangling_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);

View file

@ -20,24 +20,34 @@
void documents_open_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void documents_raise_or_open_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void documents_file_open_dialog_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void documents_copy_location_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void documents_show_in_file_manager_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void documents_remove_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void documents_clear_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void documents_recreate_preview_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void documents_reload_previews_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void documents_remove_dangling_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);

View file

@ -44,13 +44,13 @@ static const GimpActionEntry drawable_actions[] =
{ "drawable-equalize", NULL,
NC_("drawable-action", "_Equalize"), NULL,
NC_("drawable-action", "Automatic contrast enhancement"),
G_CALLBACK (drawable_equalize_cmd_callback),
drawable_equalize_cmd_callback,
GIMP_HELP_LAYER_EQUALIZE },
{ "drawable-levels-stretch", NULL,
NC_("drawable-action", "_White Balance"), NULL,
NC_("drawable-action", "Automatic white balance correction"),
G_CALLBACK (drawable_levels_stretch_cmd_callback),
drawable_levels_stretch_cmd_callback,
GIMP_HELP_LAYER_WHITE_BALANCE }
};
@ -58,13 +58,13 @@ static const GimpToggleActionEntry drawable_toggle_actions[] =
{
{ "drawable-visible", GIMP_ICON_VISIBLE,
NC_("drawable-action", "Toggle Drawable _Visibility"), NULL, NULL,
G_CALLBACK (drawable_visible_cmd_callback),
drawable_visible_cmd_callback,
FALSE,
GIMP_HELP_LAYER_VISIBLE },
{ "drawable-linked", GIMP_ICON_LINKED,
NC_("drawable-action", "Toggle Drawable _Linked State"), NULL, NULL,
G_CALLBACK (drawable_linked_cmd_callback),
drawable_linked_cmd_callback,
FALSE,
GIMP_HELP_LAYER_LINKED },
@ -72,7 +72,7 @@ static const GimpToggleActionEntry drawable_toggle_actions[] =
NC_("drawable-action", "L_ock Pixels of Drawable"), NULL,
NC_("drawable-action",
"Keep the pixels on this drawable from being modified"),
G_CALLBACK (drawable_lock_content_cmd_callback),
drawable_lock_content_cmd_callback,
FALSE,
GIMP_HELP_LAYER_LOCK_PIXELS },
@ -80,7 +80,7 @@ static const GimpToggleActionEntry drawable_toggle_actions[] =
NC_("drawable-action", "L_ock Position of Drawable"), NULL,
NC_("drawable-action",
"Keep the position on this drawable from being modified"),
G_CALLBACK (drawable_lock_position_cmd_callback),
drawable_lock_position_cmd_callback,
FALSE,
GIMP_HELP_LAYER_LOCK_POSITION },
};
@ -136,12 +136,12 @@ drawable_actions_setup (GimpActionGroup *group)
gimp_action_group_add_enum_actions (group, "drawable-action",
drawable_flip_actions,
G_N_ELEMENTS (drawable_flip_actions),
G_CALLBACK (drawable_flip_cmd_callback));
drawable_flip_cmd_callback);
gimp_action_group_add_enum_actions (group, "drawable-action",
drawable_rotate_actions,
G_N_ELEMENTS (drawable_rotate_actions),
G_CALLBACK (drawable_rotate_cmd_callback));
drawable_rotate_cmd_callback);
#define SET_ALWAYS_SHOW_IMAGE(action,show) \
gimp_action_group_set_action_always_show_image (group, action, show)

View file

@ -35,8 +35,6 @@
#include "core/gimplayermask.h"
#include "core/gimpprogress.h"
#include "widgets/gimptoggleaction.h"
#include "dialogs/dialogs.h"
#include "actions.h"
@ -49,6 +47,7 @@
void
drawable_equalize_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -61,6 +60,7 @@ drawable_equalize_cmd_callback (GimpAction *action,
void
drawable_levels_stretch_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -86,6 +86,7 @@ drawable_levels_stretch_cmd_callback (GimpAction *action,
void
drawable_linked_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -93,7 +94,7 @@ drawable_linked_cmd_callback (GimpAction *action,
gboolean linked;
return_if_no_drawable (image, drawable, data);
linked = gimp_toggle_action_get_active (GIMP_TOGGLE_ACTION (action));
linked = g_variant_get_boolean (value);
if (GIMP_IS_LAYER_MASK (drawable))
drawable =
@ -117,6 +118,7 @@ drawable_linked_cmd_callback (GimpAction *action,
void
drawable_visible_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -124,7 +126,7 @@ drawable_visible_cmd_callback (GimpAction *action,
gboolean visible;
return_if_no_drawable (image, drawable, data);
visible = gimp_toggle_action_get_active (GIMP_TOGGLE_ACTION (action));
visible = g_variant_get_boolean (value);
if (GIMP_IS_LAYER_MASK (drawable))
drawable =
@ -148,6 +150,7 @@ drawable_visible_cmd_callback (GimpAction *action,
void
drawable_lock_content_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -155,7 +158,7 @@ drawable_lock_content_cmd_callback (GimpAction *action,
gboolean locked;
return_if_no_drawable (image, drawable, data);
locked = gimp_toggle_action_get_active (GIMP_TOGGLE_ACTION (action));
locked = g_variant_get_boolean (value);
if (GIMP_IS_LAYER_MASK (drawable))
drawable =
@ -183,6 +186,7 @@ drawable_lock_content_cmd_callback (GimpAction *action,
void
drawable_lock_position_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -190,7 +194,7 @@ drawable_lock_position_cmd_callback (GimpAction *action,
gboolean locked;
return_if_no_drawable (image, drawable, data);
locked = gimp_toggle_action_get_active (GIMP_TOGGLE_ACTION (action));
locked = g_variant_get_boolean (value);
if (GIMP_IS_LAYER_MASK (drawable))
drawable =
@ -214,7 +218,7 @@ drawable_lock_position_cmd_callback (GimpAction *action,
void
drawable_flip_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -223,14 +227,17 @@ drawable_flip_cmd_callback (GimpAction *action,
GimpContext *context;
gint off_x, off_y;
gdouble axis = 0.0;
GimpOrientationType orientation;
return_if_no_drawable (image, drawable, data);
return_if_no_context (context, data);
orientation = (GimpOrientationType) g_variant_get_int32 (value);
item = GIMP_ITEM (drawable);
gimp_item_get_offset (item, &off_x, &off_y);
switch ((GimpOrientationType) value)
switch (orientation)
{
case GIMP_ORIENTATION_HORIZONTAL:
axis = ((gdouble) off_x + (gdouble) gimp_item_get_width (item) / 2.0);
@ -246,13 +253,11 @@ drawable_flip_cmd_callback (GimpAction *action,
if (gimp_item_get_linked (item))
{
gimp_item_linked_flip (item, context,
(GimpOrientationType) value, axis, FALSE);
gimp_item_linked_flip (item, context, orientation, axis, FALSE);
}
else
{
gimp_item_flip (item, context,
(GimpOrientationType) value, axis, FALSE);
gimp_item_flip (item, context, orientation, axis, FALSE);
}
gimp_image_flush (image);
@ -260,7 +265,7 @@ drawable_flip_cmd_callback (GimpAction *action,
void
drawable_rotate_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -270,9 +275,12 @@ drawable_rotate_cmd_callback (GimpAction *action,
gint off_x, off_y;
gdouble center_x, center_y;
gboolean clip_result = FALSE;
GimpRotationType rotation_type;
return_if_no_drawable (image, drawable, data);
return_if_no_context (context, data);
rotation_type = (GimpRotationType) g_variant_get_int32 (value);
item = GIMP_ITEM (drawable);
gimp_item_get_offset (item, &off_x, &off_y);
@ -285,12 +293,12 @@ drawable_rotate_cmd_callback (GimpAction *action,
if (gimp_item_get_linked (item))
{
gimp_item_linked_rotate (item, context, (GimpRotationType) value,
gimp_item_linked_rotate (item, context, rotation_type,
center_x, center_y, FALSE);
}
else
{
gimp_item_rotate (item, context, (GimpRotationType) value,
gimp_item_rotate (item, context, rotation_type,
center_x, center_y, clip_result);
}

View file

@ -20,24 +20,30 @@
void drawable_equalize_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void drawable_levels_stretch_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void drawable_linked_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void drawable_visible_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void drawable_lock_content_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void drawable_lock_position_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void drawable_flip_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void drawable_rotate_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);

View file

@ -46,37 +46,37 @@ static const GimpActionEntry dynamics_actions[] =
{ "dynamics-new", GIMP_ICON_DOCUMENT_NEW,
NC_("dynamics-action", "_New Dynamics"), NULL,
NC_("dynamics-action", "Create a new dynamics"),
G_CALLBACK (data_new_cmd_callback),
data_new_cmd_callback,
GIMP_HELP_DYNAMICS_NEW },
{ "dynamics-duplicate", GIMP_ICON_OBJECT_DUPLICATE,
NC_("dynamics-action", "D_uplicate Dynamics"), NULL,
NC_("dynamics-action", "Duplicate this dynamics"),
G_CALLBACK (data_duplicate_cmd_callback),
data_duplicate_cmd_callback,
GIMP_HELP_DYNAMICS_DUPLICATE },
{ "dynamics-copy-location", GIMP_ICON_EDIT_COPY,
NC_("dynamics-action", "Copy Dynamics _Location"), NULL,
NC_("dynamics-action", "Copy dynamics file location to clipboard"),
G_CALLBACK (data_copy_location_cmd_callback),
data_copy_location_cmd_callback,
GIMP_HELP_DYNAMICS_COPY_LOCATION },
{ "dynamics-show-in-file-manager", GIMP_ICON_FILE_MANAGER,
NC_("dynamics-action", "Show in _File Manager"), NULL,
NC_("dynamics-action", "Show dynamics file location in the file manager"),
G_CALLBACK (data_show_in_file_manager_cmd_callback),
data_show_in_file_manager_cmd_callback,
GIMP_HELP_DYNAMICS_SHOW_IN_FILE_MANAGER },
{ "dynamics-delete", GIMP_ICON_EDIT_DELETE,
NC_("dynamics-action", "_Delete Dynamics"), NULL,
NC_("dynamics-action", "Delete this dynamics"),
G_CALLBACK (data_delete_cmd_callback),
data_delete_cmd_callback,
GIMP_HELP_DYNAMICS_DELETE },
{ "dynamics-refresh", GIMP_ICON_VIEW_REFRESH,
NC_("dynamics-action", "_Refresh Dynamics"), NULL,
NC_("dynamics-action", "Refresh dynamics"),
G_CALLBACK (data_refresh_cmd_callback),
data_refresh_cmd_callback,
GIMP_HELP_DYNAMICS_REFRESH }
};
@ -100,7 +100,7 @@ dynamics_actions_setup (GimpActionGroup *group)
gimp_action_group_add_string_actions (group, "dynamics-action",
dynamics_edit_actions,
G_N_ELEMENTS (dynamics_edit_actions),
G_CALLBACK (data_edit_cmd_callback));
data_edit_cmd_callback);
}
void

View file

@ -49,7 +49,7 @@ static const GimpToggleActionEntry dynamics_editor_toggle_actions[] =
{
{ "dynamics-editor-edit-active", GIMP_ICON_LINKED,
NC_("dynamics-editor-action", "Edit Active Dynamics"), NULL, NULL,
G_CALLBACK (data_editor_edit_active_cmd_callback),
data_editor_edit_active_cmd_callback,
FALSE,
GIMP_HELP_BRUSH_EDITOR_EDIT_ACTIVE }
};

View file

@ -73,93 +73,93 @@ static const GimpActionEntry edit_actions[] =
{ "edit-undo", GIMP_ICON_EDIT_UNDO,
NC_("edit-action", "_Undo"), "<primary>Z",
NC_("edit-action", "Undo the last operation"),
G_CALLBACK (edit_undo_cmd_callback),
edit_undo_cmd_callback,
GIMP_HELP_EDIT_UNDO },
{ "edit-redo", GIMP_ICON_EDIT_REDO,
NC_("edit-action", "_Redo"), "<primary>Y",
NC_("edit-action", "Redo the last operation that was undone"),
G_CALLBACK (edit_redo_cmd_callback),
edit_redo_cmd_callback,
GIMP_HELP_EDIT_REDO },
{ "edit-strong-undo", GIMP_ICON_EDIT_UNDO,
NC_("edit-action", "Strong Undo"), "<primary><shift>Z",
NC_("edit-action", "Undo the last operation, skipping visibility changes"),
G_CALLBACK (edit_strong_undo_cmd_callback),
edit_strong_undo_cmd_callback,
GIMP_HELP_EDIT_STRONG_UNDO },
{ "edit-strong-redo", GIMP_ICON_EDIT_REDO,
NC_("edit-action", "Strong Redo"), "<primary><shift>Y",
NC_("edit-action",
"Redo the last operation that was undone, skipping visibility changes"),
G_CALLBACK (edit_strong_redo_cmd_callback),
edit_strong_redo_cmd_callback,
GIMP_HELP_EDIT_STRONG_REDO },
{ "edit-undo-clear", GIMP_ICON_SHRED,
NC_("edit-action", "_Clear Undo History"), NULL,
NC_("edit-action", "Remove all operations from the undo history"),
G_CALLBACK (edit_undo_clear_cmd_callback),
edit_undo_clear_cmd_callback,
GIMP_HELP_EDIT_UNDO_CLEAR },
{ "edit-cut", GIMP_ICON_EDIT_CUT,
NC_("edit-action", "Cu_t"), "<primary>X",
NC_("edit-action", "Move the selected pixels to the clipboard"),
G_CALLBACK (edit_cut_cmd_callback),
edit_cut_cmd_callback,
GIMP_HELP_EDIT_CUT },
{ "edit-copy", GIMP_ICON_EDIT_COPY,
NC_("edit-action", "_Copy"), "<primary>C",
NC_("edit-action", "Copy the selected pixels to the clipboard"),
G_CALLBACK (edit_copy_cmd_callback),
edit_copy_cmd_callback,
GIMP_HELP_EDIT_COPY },
{ "edit-copy-visible", NULL, /* GIMP_ICON_COPY_VISIBLE, */
NC_("edit-action", "Copy _Visible"), "<primary><shift>C",
NC_("edit-action", "Copy what is visible in the selected region"),
G_CALLBACK (edit_copy_visible_cmd_callback),
edit_copy_visible_cmd_callback,
GIMP_HELP_EDIT_COPY_VISIBLE },
{ "edit-paste-as-new-image", GIMP_ICON_EDIT_PASTE_AS_NEW,
NC_("edit-action", "From _Clipboard"), "<primary><shift>V",
NC_("edit-action", "Create a new image from the content of the clipboard"),
G_CALLBACK (edit_paste_as_new_image_cmd_callback),
edit_paste_as_new_image_cmd_callback,
GIMP_HELP_EDIT_PASTE_AS_NEW_IMAGE },
{ "edit-paste-as-new-image-short", GIMP_ICON_EDIT_PASTE_AS_NEW,
NC_("edit-action", "_New Image"), NULL,
NC_("edit-action", "Create a new image from the content of the clipboard"),
G_CALLBACK (edit_paste_as_new_image_cmd_callback),
edit_paste_as_new_image_cmd_callback,
GIMP_HELP_EDIT_PASTE_AS_NEW_IMAGE },
{ "edit-named-cut", GIMP_ICON_EDIT_CUT,
NC_("edit-action", "Cu_t Named..."), NULL,
NC_("edit-action", "Move the selected pixels to a named buffer"),
G_CALLBACK (edit_named_cut_cmd_callback),
edit_named_cut_cmd_callback,
GIMP_HELP_BUFFER_CUT },
{ "edit-named-copy", GIMP_ICON_EDIT_COPY,
NC_("edit-action", "_Copy Named..."), NULL,
NC_("edit-action", "Copy the selected pixels to a named buffer"),
G_CALLBACK (edit_named_copy_cmd_callback),
edit_named_copy_cmd_callback,
GIMP_HELP_BUFFER_COPY },
{ "edit-named-copy-visible", NULL, /* GIMP_ICON_COPY_VISIBLE, */
NC_("edit-action", "Copy _Visible Named..."), "",
NC_("edit-action",
"Copy what is visible in the selected region to a named buffer"),
G_CALLBACK (edit_named_copy_visible_cmd_callback),
edit_named_copy_visible_cmd_callback,
GIMP_HELP_BUFFER_COPY },
{ "edit-named-paste", GIMP_ICON_EDIT_PASTE,
NC_("edit-action", "_Paste Named..."), NULL,
NC_("edit-action", "Paste the content of a named buffer"),
G_CALLBACK (edit_named_paste_cmd_callback),
edit_named_paste_cmd_callback,
GIMP_HELP_BUFFER_PASTE },
{ "edit-clear", GIMP_ICON_EDIT_CLEAR,
NC_("edit-action", "Cl_ear"), "Delete",
NC_("edit-action", "Clear the selected pixels"),
G_CALLBACK (edit_clear_cmd_callback),
edit_clear_cmd_callback,
GIMP_HELP_EDIT_CLEAR }
};
@ -245,12 +245,12 @@ edit_actions_setup (GimpActionGroup *group)
gimp_action_group_add_enum_actions (group, "edit-action",
edit_paste_actions,
G_N_ELEMENTS (edit_paste_actions),
G_CALLBACK (edit_paste_cmd_callback));
edit_paste_cmd_callback);
gimp_action_group_add_enum_actions (group, "edit-action",
edit_fill_actions,
G_N_ELEMENTS (edit_fill_actions),
G_CALLBACK (edit_fill_cmd_callback));
edit_fill_cmd_callback);
action = gimp_action_group_get_action (group,
"edit-paste-as-new-image-short");

View file

@ -84,6 +84,7 @@ static void copy_named_visible_buffer_callback (GtkWidget *widget,
void
edit_undo_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -100,6 +101,7 @@ edit_undo_cmd_callback (GimpAction *action,
void
edit_redo_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -116,6 +118,7 @@ edit_redo_cmd_callback (GimpAction *action,
void
edit_strong_undo_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -127,6 +130,7 @@ edit_strong_undo_cmd_callback (GimpAction *action,
void
edit_strong_redo_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -138,6 +142,7 @@ edit_strong_redo_cmd_callback (GimpAction *action,
void
edit_undo_clear_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -207,6 +212,7 @@ edit_undo_clear_cmd_callback (GimpAction *action,
void
edit_cut_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -246,6 +252,7 @@ edit_cut_cmd_callback (GimpAction *action,
void
edit_copy_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -282,6 +289,7 @@ edit_copy_cmd_callback (GimpAction *action,
void
edit_copy_visible_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -311,17 +319,17 @@ edit_copy_visible_cmd_callback (GimpAction *action,
void
edit_paste_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpDisplay *display = action_data_get_display (data);
GimpPasteType paste_type = (GimpPasteType) value;
GimpPasteType paste_type = (GimpPasteType) g_variant_get_int32 (value);
if (paste_type == GIMP_PASTE_TYPE_FLOATING)
{
if (! display || ! gimp_display_get_image (display))
{
edit_paste_as_new_image_cmd_callback (action, data);
edit_paste_as_new_image_cmd_callback (action, value, data);
return;
}
}
@ -347,6 +355,7 @@ edit_paste_cmd_callback (GimpAction *action,
void
edit_paste_as_new_image_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
Gimp *gimp;
@ -380,6 +389,7 @@ edit_paste_as_new_image_cmd_callback (GimpAction *action,
void
edit_named_cut_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -400,6 +410,7 @@ edit_named_cut_cmd_callback (GimpAction *action,
void
edit_named_copy_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -420,6 +431,7 @@ edit_named_copy_cmd_callback (GimpAction *action,
void
edit_named_copy_visible_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -440,6 +452,7 @@ edit_named_copy_visible_cmd_callback (GimpAction *action,
void
edit_named_paste_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
Gimp *gimp;
@ -456,6 +469,7 @@ edit_named_paste_cmd_callback (GimpAction *action,
void
edit_clear_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -471,7 +485,7 @@ edit_clear_cmd_callback (GimpAction *action,
void
edit_fill_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -481,7 +495,7 @@ edit_fill_cmd_callback (GimpAction *action,
GError *error = NULL;
return_if_no_drawable (image, drawable, data);
fill_type = (GimpFillType) value;
fill_type = (GimpFillType) g_variant_get_int32 (value);
options = gimp_fill_options_new (action_data_get_gimp (data), NULL, FALSE);

View file

@ -20,42 +20,56 @@
void edit_undo_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void edit_redo_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void edit_strong_undo_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void edit_strong_redo_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void edit_undo_clear_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void edit_cut_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void edit_copy_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void edit_copy_visible_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void edit_paste_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void edit_paste_as_new_image_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void edit_named_cut_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void edit_named_copy_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void edit_named_copy_visible_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void edit_named_paste_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void edit_clear_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void edit_fill_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);

View file

@ -43,13 +43,13 @@ static const GimpActionEntry error_console_actions[] =
{ "error-console-clear", GIMP_ICON_EDIT_CLEAR,
NC_("error-console-action", "_Clear"), NULL,
NC_("error-console-action", "Clear error console"),
G_CALLBACK (error_console_clear_cmd_callback),
error_console_clear_cmd_callback,
GIMP_HELP_ERRORS_CLEAR },
{ "error-console-select-all", NULL,
NC_("error-console-action", "Select _All"), "",
NC_("error-console-action", "Select all error messages"),
G_CALLBACK (error_console_select_all_cmd_callback),
error_console_select_all_cmd_callback,
GIMP_HELP_ERRORS_SELECT_ALL },
{ "error-console-highlight", NULL,
@ -77,21 +77,21 @@ static const GimpToggleActionEntry error_console_highlight_actions[] =
{ "error-console-highlight-error", NULL,
NC_("error-console-action", "_Errors"), NULL,
NC_("error-console-action", "Highlight error console on errors"),
G_CALLBACK (error_console_highlight_error_cmd_callback),
error_console_highlight_error_cmd_callback,
FALSE,
GIMP_HELP_ERRORS_HIGHLIGHT },
{ "error-console-highlight-warning", NULL,
NC_("error-console-action", "_Warnings"), NULL,
NC_("error-console-action", "Highlight error console on warnings"),
G_CALLBACK (error_console_highlight_warning_cmd_callback),
error_console_highlight_warning_cmd_callback,
FALSE,
GIMP_HELP_ERRORS_HIGHLIGHT },
{ "error-console-highlight-info", NULL,
NC_("error-console-action", "_Messages"), NULL,
NC_("error-console-action", "Highlight error console on messages"),
G_CALLBACK (error_console_highlight_info_cmd_callback),
error_console_highlight_info_cmd_callback,
FALSE,
GIMP_HELP_ERRORS_HIGHLIGHT }
};
@ -107,7 +107,7 @@ error_console_actions_setup (GimpActionGroup *group)
gimp_action_group_add_enum_actions (group, "error-console-action",
error_console_save_actions,
G_N_ELEMENTS (error_console_save_actions),
G_CALLBACK (error_console_save_cmd_callback));
error_console_save_cmd_callback);
gimp_action_group_add_toggle_actions (group, "error-console-action",
error_console_highlight_actions,

View file

@ -30,7 +30,6 @@
#include "widgets/gimperrorconsole.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimptextbuffer.h"
#include "widgets/gimptoggleaction.h"
#include "error-console-commands.h"
@ -48,6 +47,7 @@ static void error_console_save_response (GtkWidget *dialog,
void
error_console_clear_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpErrorConsole *console = GIMP_ERROR_CONSOLE (data);
@ -60,6 +60,7 @@ error_console_clear_cmd_callback (GimpAction *action,
void
error_console_select_all_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpErrorConsole *console = GIMP_ERROR_CONSOLE (data);
@ -72,12 +73,14 @@ error_console_select_all_cmd_callback (GimpAction *action,
void
error_console_save_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpErrorConsole *console = GIMP_ERROR_CONSOLE (data);
gboolean selection = (gboolean) g_variant_get_int32 (value);
if (value && ! gtk_text_buffer_get_selection_bounds (console->text_buffer,
if (selection &&
! gtk_text_buffer_get_selection_bounds (console->text_buffer,
NULL, NULL))
{
gimp_message_literal (console->gimp,
@ -105,7 +108,7 @@ error_console_save_cmd_callback (GimpAction *action,
GTK_RESPONSE_CANCEL,
-1);
console->save_selection = value;
console->save_selection = selection;
g_object_add_weak_pointer (G_OBJECT (dialog),
(gpointer) &console->file_dialog);
@ -134,36 +137,33 @@ error_console_save_cmd_callback (GimpAction *action,
void
error_console_highlight_error_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpErrorConsole *console = GIMP_ERROR_CONSOLE (data);
gboolean active;
active = gimp_toggle_action_get_active (GIMP_TOGGLE_ACTION (action));
gboolean active = g_variant_get_boolean (value);
console->highlight[GIMP_MESSAGE_ERROR] = active;
}
void
error_console_highlight_warning_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpErrorConsole *console = GIMP_ERROR_CONSOLE (data);
gboolean active;
active = gimp_toggle_action_get_active (GIMP_TOGGLE_ACTION (action));
gboolean active = g_variant_get_boolean (value);
console->highlight[GIMP_MESSAGE_WARNING] = active;
}
void
error_console_highlight_info_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpErrorConsole *console = GIMP_ERROR_CONSOLE (data);
gboolean active;
active = gimp_toggle_action_get_active (GIMP_TOGGLE_ACTION (action));
gboolean active = g_variant_get_boolean (value);
console->highlight[GIMP_MESSAGE_INFO] = active;
}

View file

@ -20,18 +20,23 @@
void error_console_clear_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void error_console_select_all_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void error_console_save_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void error_console_highlight_error_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void error_console_highlight_warning_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void error_console_highlight_info_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);

View file

@ -76,55 +76,55 @@ static const GimpActionEntry file_actions[] =
{ "file-open", GIMP_ICON_IMAGE_OPEN,
NC_("file-action", "_Open..."), "<primary>O",
NC_("file-action", "Open an image file"),
G_CALLBACK (file_open_cmd_callback),
file_open_cmd_callback,
GIMP_HELP_FILE_OPEN },
{ "file-open-as-layers", GIMP_ICON_LAYER,
NC_("file-action", "Op_en as Layers..."), "<primary><alt>O",
NC_("file-action", "Open an image file as layers"),
G_CALLBACK (file_open_as_layers_cmd_callback),
file_open_as_layers_cmd_callback,
GIMP_HELP_FILE_OPEN_AS_LAYER },
{ "file-open-location", GIMP_ICON_WEB,
NC_("file-action", "Open _Location..."), NULL,
NC_("file-action", "Open an image file from a specified location"),
G_CALLBACK (file_open_location_cmd_callback),
file_open_location_cmd_callback,
GIMP_HELP_FILE_OPEN_LOCATION },
{ "file-create-template", NULL,
NC_("file-action", "Create Template..."), NULL,
NC_("file-action", "Create a new template from this image"),
G_CALLBACK (file_create_template_cmd_callback),
file_create_template_cmd_callback,
GIMP_HELP_FILE_CREATE_TEMPLATE },
{ "file-revert", GIMP_ICON_IMAGE_RELOAD,
NC_("file-action", "Re_vert"), NULL,
NC_("file-action", "Reload the image file from disk"),
G_CALLBACK (file_revert_cmd_callback),
file_revert_cmd_callback,
GIMP_HELP_FILE_REVERT },
{ "file-close-all", GIMP_ICON_CLOSE_ALL,
NC_("file-action", "Close all"), "<primary><shift>W",
NC_("file-action", "Close all opened images"),
G_CALLBACK (file_close_all_cmd_callback),
file_close_all_cmd_callback,
GIMP_HELP_FILE_CLOSE_ALL },
{ "file-copy-location", GIMP_ICON_EDIT_COPY,
NC_("file-action", "Copy _Image Location"), NULL,
NC_("file-action", "Copy image file location to clipboard"),
G_CALLBACK (file_copy_location_cmd_callback),
file_copy_location_cmd_callback,
GIMP_HELP_FILE_COPY_LOCATION },
{ "file-show-in-file-manager", GIMP_ICON_FILE_MANAGER,
NC_("file-action", "Show in _File Manager"), "<primary><alt>F",
NC_("file-action", "Show image file location in the file manager"),
G_CALLBACK (file_show_in_file_manager_cmd_callback),
file_show_in_file_manager_cmd_callback,
GIMP_HELP_FILE_SHOW_IN_FILE_MANAGER },
{ "file-quit", GIMP_ICON_APPLICATION_EXIT,
NC_("file-action", "_Quit"), "<primary>Q",
NC_("file-action", "Quit the GNU Image Manipulation Program"),
G_CALLBACK (file_quit_cmd_callback),
file_quit_cmd_callback,
GIMP_HELP_FILE_QUIT }
};
@ -189,7 +189,7 @@ file_actions_setup (GimpActionGroup *group)
gimp_action_group_add_enum_actions (group, "file-action",
file_save_actions,
G_N_ELEMENTS (file_save_actions),
G_CALLBACK (file_save_cmd_callback));
file_save_cmd_callback);
n_entries = GIMP_GUI_CONFIG (group->gimp->config)->last_opened_size;
@ -214,7 +214,7 @@ file_actions_setup (GimpActionGroup *group)
}
gimp_action_group_add_enum_actions (group, NULL, entries, n_entries,
G_CALLBACK (file_open_recent_cmd_callback));
file_open_recent_cmd_callback);
for (i = 0; i < n_entries; i++)
{

View file

@ -104,6 +104,7 @@ static void file_revert_confirm_response (GtkWidget *dialog,
void
file_open_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
Gimp *gimp;
@ -121,6 +122,7 @@ file_open_cmd_callback (GimpAction *action,
void
file_open_as_layers_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
Gimp *gimp;
@ -142,6 +144,7 @@ file_open_as_layers_cmd_callback (GimpAction *action,
void
file_open_location_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GtkWidget *widget;
@ -156,21 +159,24 @@ file_open_location_cmd_callback (GimpAction *action,
void
file_open_recent_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
Gimp *gimp;
GimpImagefile *imagefile;
gint index;
gint num_entries;
return_if_no_gimp (gimp, data);
index = g_variant_get_int32 (value);
num_entries = gimp_container_get_n_children (gimp->documents);
if (value >= num_entries)
if (index >= num_entries)
return;
imagefile = (GimpImagefile *)
gimp_container_get_child_by_index (gimp->documents, value);
gimp_container_get_child_by_index (gimp->documents, index);
if (imagefile)
{
@ -213,7 +219,7 @@ file_open_recent_cmd_callback (GimpAction *action,
void
file_save_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
Gimp *gimp;
@ -229,7 +235,7 @@ file_save_cmd_callback (GimpAction *action,
image = gimp_display_get_image (display);
save_mode = (GimpSaveMode) value;
save_mode = (GimpSaveMode) g_variant_get_int32 (value);
if (! gimp_image_get_active_drawable (image))
return;
@ -354,6 +360,7 @@ file_save_cmd_callback (GimpAction *action,
void
file_create_template_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpDisplay *display;
@ -376,6 +383,7 @@ file_create_template_cmd_callback (GimpAction *action,
void
file_revert_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpDisplay *display;
@ -448,6 +456,7 @@ file_revert_cmd_callback (GimpAction *action,
void
file_close_all_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
Gimp *gimp;
@ -471,6 +480,7 @@ file_close_all_cmd_callback (GimpAction *action,
void
file_copy_location_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
Gimp *gimp;
@ -495,6 +505,7 @@ file_copy_location_cmd_callback (GimpAction *action,
void
file_show_in_file_manager_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
Gimp *gimp;
@ -524,6 +535,7 @@ file_show_in_file_manager_cmd_callback (GimpAction *action,
void
file_quit_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
Gimp *gimp;

View file

@ -20,30 +20,39 @@
void file_open_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void file_open_as_layers_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void file_open_location_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void file_open_recent_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void file_save_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void file_create_template_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void file_revert_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void file_close_all_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void file_copy_location_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void file_show_in_file_manager_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void file_quit_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void file_file_open_dialog (Gimp *gimp,

View file

@ -766,28 +766,28 @@ filters_actions_setup (GimpActionGroup *group)
gimp_action_group_add_string_actions (group, "filters-action",
filters_actions,
G_N_ELEMENTS (filters_actions),
G_CALLBACK (filters_apply_cmd_callback));
filters_apply_cmd_callback);
filters_actions_set_tooltips (group, filters_actions,
G_N_ELEMENTS (filters_actions));
gimp_action_group_add_string_actions (group, "filters-action",
filters_settings_actions,
G_N_ELEMENTS (filters_settings_actions),
G_CALLBACK (filters_apply_cmd_callback));
filters_apply_cmd_callback);
filters_actions_set_tooltips (group, filters_settings_actions,
G_N_ELEMENTS (filters_settings_actions));
gimp_action_group_add_string_actions (group, "filters-action",
filters_interactive_actions,
G_N_ELEMENTS (filters_interactive_actions),
G_CALLBACK (filters_apply_interactive_cmd_callback));
filters_apply_interactive_cmd_callback);
filters_actions_set_tooltips (group, filters_interactive_actions,
G_N_ELEMENTS (filters_interactive_actions));
gimp_action_group_add_enum_actions (group, "filters-action",
filters_repeat_actions,
G_N_ELEMENTS (filters_repeat_actions),
G_CALLBACK (filters_repeat_cmd_callback));
filters_repeat_cmd_callback);
n_entries = gimp_filter_history_size (group->gimp);
@ -805,7 +805,7 @@ filters_actions_setup (GimpActionGroup *group)
}
gimp_action_group_add_procedure_actions (group, entries, n_entries,
G_CALLBACK (filters_history_cmd_callback));
filters_history_cmd_callback);
for (i = 0; i < n_entries; i++)
{

View file

@ -61,7 +61,7 @@ static void filters_run_procedure (Gimp *gimp,
void
filters_apply_cmd_callback (GimpAction *action,
const gchar *operation_str,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -72,7 +72,7 @@ filters_apply_cmd_callback (GimpAction *action,
return_if_no_drawable (image, drawable, data);
operation = filters_parse_operation (image->gimp,
operation_str,
g_variant_get_string (value, NULL),
gimp_action_get_icon_name (action),
&settings);
@ -91,14 +91,16 @@ filters_apply_cmd_callback (GimpAction *action,
g_object_unref (settings);
gimp_filter_history_add (image->gimp, procedure);
filters_history_cmd_callback (NULL, procedure, data);
filters_history_cmd_callback (NULL,
g_variant_new_uint64 (GPOINTER_TO_SIZE (procedure)),
data);
g_object_unref (procedure);
}
void
filters_apply_interactive_cmd_callback (GimpAction *action,
const gchar *operation,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -108,7 +110,7 @@ filters_apply_interactive_cmd_callback (GimpAction *action,
procedure = gimp_gegl_procedure_new (image->gimp,
GIMP_RUN_INTERACTIVE, NULL,
operation,
g_variant_get_string (value, NULL),
gimp_action_get_name (action),
gimp_action_get_label (action),
gimp_action_get_tooltip (action),
@ -116,40 +118,50 @@ filters_apply_interactive_cmd_callback (GimpAction *action,
gimp_action_get_help_id (action));
gimp_filter_history_add (image->gimp, procedure);
filters_history_cmd_callback (NULL, procedure, data);
filters_history_cmd_callback (NULL,
g_variant_new_uint64 (GPOINTER_TO_SIZE (procedure)),
data);
g_object_unref (procedure);
}
void
filters_repeat_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpImage *image;
GimpDrawable *drawable;
GimpDisplay *display;
GimpProcedure *procedure;
GimpRunMode run_mode;
return_if_no_drawable (image, drawable, data);
return_if_no_display (display, data);
run_mode = (GimpRunMode) g_variant_get_int32 (value);
procedure = gimp_filter_history_nth (image->gimp, 0);
if (procedure)
filters_run_procedure (image->gimp, display, procedure,
(GimpRunMode) value);
filters_run_procedure (image->gimp, display, procedure, run_mode);
}
void
filters_history_cmd_callback (GimpAction *action,
GimpProcedure *procedure,
GVariant *value,
gpointer data)
{
Gimp *gimp;
GimpDisplay *display;
GimpProcedure *procedure;
gsize hack;
return_if_no_gimp (gimp, data);
return_if_no_display (display, data);
hack = g_variant_get_uint64 (value);
procedure = GSIZE_TO_POINTER (hack);
filters_run_procedure (gimp, display, procedure, GIMP_RUN_INTERACTIVE);
}

View file

@ -20,17 +20,17 @@
void filters_apply_cmd_callback (GimpAction *action,
const gchar *operation,
GVariant *value,
gpointer data);
void filters_apply_interactive_cmd_callback (GimpAction *action,
const gchar *operation,
GVariant *value,
gpointer data);
void filters_repeat_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void filters_history_cmd_callback (GimpAction *action,
GimpProcedure *procedure,
GVariant *value,
gpointer data);

View file

@ -47,7 +47,7 @@ static const GimpActionEntry fonts_actions[] =
{ "fonts-refresh", GIMP_ICON_VIEW_REFRESH,
NC_("fonts-action", "_Rescan Font List"), NULL,
NC_("fonts-action", "Rescan the installed fonts"),
G_CALLBACK (data_refresh_cmd_callback),
data_refresh_cmd_callback,
GIMP_HELP_FONT_REFRESH }
};

View file

@ -65,57 +65,57 @@ static const GimpActionEntry gradient_editor_actions[] =
{ "gradient-editor-left-color", NULL,
NC_("gradient-editor-action", "L_eft Endpoint's Color..."), NULL, NULL,
G_CALLBACK (gradient_editor_left_color_cmd_callback),
gradient_editor_left_color_cmd_callback,
GIMP_HELP_GRADIENT_EDITOR_LEFT_COLOR },
{ "gradient-editor-right-color", NULL,
NC_("gradient-editor-action", "R_ight Endpoint's Color..."), NULL, NULL,
G_CALLBACK (gradient_editor_right_color_cmd_callback),
gradient_editor_right_color_cmd_callback,
GIMP_HELP_GRADIENT_EDITOR_RIGHT_COLOR },
{ "gradient-editor-flip", GIMP_ICON_OBJECT_FLIP_HORIZONTAL,
"flip", NULL, NULL,
G_CALLBACK (gradient_editor_flip_cmd_callback),
gradient_editor_flip_cmd_callback,
GIMP_HELP_GRADIENT_EDITOR_FLIP },
{ "gradient-editor-replicate", GIMP_ICON_OBJECT_DUPLICATE,
"replicate", NULL, NULL,
G_CALLBACK (gradient_editor_replicate_cmd_callback),
gradient_editor_replicate_cmd_callback,
GIMP_HELP_GRADIENT_EDITOR_FLIP },
{ "gradient-editor-split-midpoint", NULL,
"splitmidpoint", NULL, NULL,
G_CALLBACK (gradient_editor_split_midpoint_cmd_callback),
gradient_editor_split_midpoint_cmd_callback,
GIMP_HELP_GRADIENT_EDITOR_SPLIT_MIDPOINT },
{ "gradient-editor-split-uniform", NULL,
"splituniform", NULL, NULL,
G_CALLBACK (gradient_editor_split_uniformly_cmd_callback),
gradient_editor_split_uniformly_cmd_callback,
GIMP_HELP_GRADIENT_EDITOR_SPLIT_UNIFORM },
{ "gradient-editor-delete", GIMP_ICON_EDIT_DELETE,
"delete", "", NULL,
G_CALLBACK (gradient_editor_delete_cmd_callback),
gradient_editor_delete_cmd_callback,
GIMP_HELP_GRADIENT_EDITOR_DELETE },
{ "gradient-editor-recenter", NULL,
"recenter", NULL, NULL,
G_CALLBACK (gradient_editor_recenter_cmd_callback),
gradient_editor_recenter_cmd_callback,
GIMP_HELP_GRADIENT_EDITOR_RECENTER },
{ "gradient-editor-redistribute", NULL,
"redistribute", NULL, NULL,
G_CALLBACK (gradient_editor_redistribute_cmd_callback),
gradient_editor_redistribute_cmd_callback,
GIMP_HELP_GRADIENT_EDITOR_REDISTRIBUTE },
{ "gradient-editor-blend-color", NULL,
NC_("gradient-editor-action", "Ble_nd Endpoints' Colors"), NULL, NULL,
G_CALLBACK (gradient_editor_blend_color_cmd_callback),
gradient_editor_blend_color_cmd_callback,
GIMP_HELP_GRADIENT_EDITOR_BLEND_COLOR },
{ "gradient-editor-blend-opacity", NULL,
NC_("gradient-editor-action", "Blend Endpoints' Opacit_y"), NULL, NULL,
G_CALLBACK (gradient_editor_blend_opacity_cmd_callback),
gradient_editor_blend_opacity_cmd_callback,
GIMP_HELP_GRADIENT_EDITOR_BLEND_OPACITY }
};
@ -123,7 +123,7 @@ static const GimpToggleActionEntry gradient_editor_toggle_actions[] =
{
{ "gradient-editor-edit-active", GIMP_ICON_LINKED,
NC_("gradient-editor-action", "Edit Active Gradient"), NULL, NULL,
G_CALLBACK (data_editor_edit_active_cmd_callback),
data_editor_edit_active_cmd_callback,
FALSE,
GIMP_HELP_GRADIENT_EDITOR_EDIT_ACTIVE }
};
@ -409,56 +409,56 @@ gradient_editor_actions_setup (GimpActionGroup *group)
gimp_action_group_add_enum_actions (group, "gradient-editor-action",
gradient_editor_load_left_actions,
G_N_ELEMENTS (gradient_editor_load_left_actions),
G_CALLBACK (gradient_editor_load_left_cmd_callback));
gradient_editor_load_left_cmd_callback);
gimp_action_group_add_enum_actions (group, "gradient-editor-action",
gradient_editor_save_left_actions,
G_N_ELEMENTS (gradient_editor_save_left_actions),
G_CALLBACK (gradient_editor_save_left_cmd_callback));
gradient_editor_save_left_cmd_callback);
gimp_action_group_add_enum_actions (group, "gradient-editor-action",
gradient_editor_load_right_actions,
G_N_ELEMENTS (gradient_editor_load_right_actions),
G_CALLBACK (gradient_editor_load_right_cmd_callback));
gradient_editor_load_right_cmd_callback);
gimp_action_group_add_enum_actions (group, "gradient-editor-action",
gradient_editor_save_right_actions,
G_N_ELEMENTS (gradient_editor_save_right_actions),
G_CALLBACK (gradient_editor_save_right_cmd_callback));
gradient_editor_save_right_cmd_callback);
gimp_action_group_add_radio_actions (group, "gradient-editor-color-type",
gradient_editor_left_color_type_actions,
G_N_ELEMENTS (gradient_editor_left_color_type_actions),
NULL,
0,
G_CALLBACK (gradient_editor_left_color_type_cmd_callback));
gradient_editor_left_color_type_cmd_callback);
gimp_action_group_add_radio_actions (group, "gradient-editor-color-type",
gradient_editor_right_color_type_actions,
G_N_ELEMENTS (gradient_editor_right_color_type_actions),
NULL,
0,
G_CALLBACK (gradient_editor_right_color_type_cmd_callback));
gradient_editor_right_color_type_cmd_callback);
gimp_action_group_add_radio_actions (group, "gradient-editor-blending",
gradient_editor_blending_actions,
G_N_ELEMENTS (gradient_editor_blending_actions),
NULL,
0,
G_CALLBACK (gradient_editor_blending_func_cmd_callback));
gradient_editor_blending_func_cmd_callback);
gimp_action_group_add_radio_actions (group, "gradient-editor-coloring",
gradient_editor_coloring_actions,
G_N_ELEMENTS (gradient_editor_coloring_actions),
NULL,
0,
G_CALLBACK (gradient_editor_coloring_type_cmd_callback));
gradient_editor_coloring_type_cmd_callback);
gimp_action_group_add_enum_actions (group, NULL,
gradient_editor_zoom_actions,
G_N_ELEMENTS (gradient_editor_zoom_actions),
G_CALLBACK (gradient_editor_zoom_cmd_callback));
gradient_editor_zoom_cmd_callback);
}
void

View file

@ -31,7 +31,6 @@
#include "widgets/gimpgradienteditor.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpradioaction.h"
#include "widgets/gimpuimanager.h"
#include "widgets/gimpviewabledialog.h"
@ -54,6 +53,7 @@ static void gradient_editor_replicate_response (GtkWidget *widge
void
gradient_editor_left_color_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpGradientEditor *editor = GIMP_GRADIENT_EDITOR (data);
@ -63,7 +63,7 @@ gradient_editor_left_color_cmd_callback (GimpAction *action,
void
gradient_editor_left_color_type_cmd_callback (GimpAction *action,
GimpAction *current,
GVariant *value,
gpointer data)
{
GimpGradientEditor *editor = GIMP_GRADIENT_EDITOR (data);
@ -71,9 +71,9 @@ gradient_editor_left_color_type_cmd_callback (GimpAction *action,
GimpGradientSegment *left;
GimpGradientColor color_type;
gimp_gradient_editor_get_selection (editor, &gradient, &left, NULL);
color_type = (GimpGradientColor) g_variant_get_int32 (value);
color_type = gimp_radio_action_get_current_value (GIMP_RADIO_ACTION (action));
gimp_gradient_editor_get_selection (editor, &gradient, &left, NULL);
if (gradient &&
color_type >= 0 &&
@ -99,7 +99,7 @@ gradient_editor_left_color_type_cmd_callback (GimpAction *action,
void
gradient_editor_load_left_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpGradientEditor *editor = GIMP_GRADIENT_EDITOR (data);
@ -110,10 +110,11 @@ gradient_editor_load_left_cmd_callback (GimpAction *action,
GimpGradientSegment *seg;
GimpRGB color;
GimpGradientColor color_type = GIMP_GRADIENT_COLOR_FIXED;
gint index = g_variant_get_int32 (value);
gimp_gradient_editor_get_selection (editor, &gradient, &left, &right);
switch (value)
switch (index)
{
case GRADIENT_EDITOR_COLOR_NEIGHBOR_ENDPOINT:
if (left->prev != NULL)
@ -139,7 +140,7 @@ gradient_editor_load_left_cmd_callback (GimpAction *action,
break;
default: /* Load a color */
color = editor->saved_colors[value - GRADIENT_EDITOR_COLOR_FIRST_CUSTOM];
color = editor->saved_colors[index - GRADIENT_EDITOR_COLOR_FIRST_CUSTOM];
break;
}
@ -156,21 +157,23 @@ gradient_editor_load_left_cmd_callback (GimpAction *action,
void
gradient_editor_save_left_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpGradientEditor *editor = GIMP_GRADIENT_EDITOR (data);
GimpGradient *gradient;
GimpGradientSegment *left;
gint index = g_variant_get_int32 (value);
gimp_gradient_editor_get_selection (editor, &gradient, &left, NULL);
gimp_gradient_segment_get_left_color (gradient, left,
&editor->saved_colors[value]);
&editor->saved_colors[index]);
}
void
gradient_editor_right_color_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpGradientEditor *editor = GIMP_GRADIENT_EDITOR (data);
@ -180,7 +183,7 @@ gradient_editor_right_color_cmd_callback (GimpAction *action,
void
gradient_editor_right_color_type_cmd_callback (GimpAction *action,
GimpAction *current,
GVariant *value,
gpointer data)
{
GimpGradientEditor *editor = GIMP_GRADIENT_EDITOR (data);
@ -188,9 +191,9 @@ gradient_editor_right_color_type_cmd_callback (GimpAction *action,
GimpGradientSegment *right;
GimpGradientColor color_type;
gimp_gradient_editor_get_selection (editor, &gradient, NULL, &right);
color_type = (GimpGradientColor) g_variant_get_int32 (value);
color_type = gimp_radio_action_get_current_value (GIMP_RADIO_ACTION (action));
gimp_gradient_editor_get_selection (editor, &gradient, NULL, &right);
if (gradient &&
color_type >= 0 &&
@ -216,7 +219,7 @@ gradient_editor_right_color_type_cmd_callback (GimpAction *action,
void
gradient_editor_load_right_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpGradientEditor *editor = GIMP_GRADIENT_EDITOR (data);
@ -227,10 +230,11 @@ gradient_editor_load_right_cmd_callback (GimpAction *action,
GimpGradientSegment *seg;
GimpRGB color;
GimpGradientColor color_type = GIMP_GRADIENT_COLOR_FIXED;
gint index = g_variant_get_int32 (value);
gimp_gradient_editor_get_selection (editor, &gradient, &left, &right);
switch (value)
switch (index)
{
case GRADIENT_EDITOR_COLOR_NEIGHBOR_ENDPOINT:
if (right->next != NULL)
@ -256,7 +260,7 @@ gradient_editor_load_right_cmd_callback (GimpAction *action,
break;
default: /* Load a color */
color = editor->saved_colors[value - GRADIENT_EDITOR_COLOR_FIRST_CUSTOM];
color = editor->saved_colors[index - GRADIENT_EDITOR_COLOR_FIRST_CUSTOM];
break;
}
@ -273,22 +277,23 @@ gradient_editor_load_right_cmd_callback (GimpAction *action,
void
gradient_editor_save_right_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpGradientEditor *editor = GIMP_GRADIENT_EDITOR (data);
GimpGradient *gradient;
GimpGradientSegment *right;
gint index = g_variant_get_int32 (value);
gimp_gradient_editor_get_selection (editor, &gradient, NULL, &right);
gimp_gradient_segment_get_right_color (gradient, right,
&editor->saved_colors[value]);
&editor->saved_colors[index]);
}
void
gradient_editor_blending_func_cmd_callback (GimpAction *action,
GimpAction *current,
GVariant *value,
gpointer data)
{
GimpGradientEditor *editor = GIMP_GRADIENT_EDITOR (data);
@ -298,9 +303,9 @@ gradient_editor_blending_func_cmd_callback (GimpAction *action,
GEnumClass *enum_class = NULL;
GimpGradientSegmentType type;
gimp_gradient_editor_get_selection (editor, &gradient, &left, &right);
type = (GimpGradientSegmentType) g_variant_get_int32 (value);
type = gimp_radio_action_get_current_value (GIMP_RADIO_ACTION (action));
gimp_gradient_editor_get_selection (editor, &gradient, &left, &right);
enum_class = g_type_class_ref (GIMP_TYPE_GRADIENT_SEGMENT_TYPE);
@ -316,7 +321,7 @@ gradient_editor_blending_func_cmd_callback (GimpAction *action,
void
gradient_editor_coloring_type_cmd_callback (GimpAction *action,
GimpAction *current,
GVariant *value,
gpointer data)
{
GimpGradientEditor *editor = GIMP_GRADIENT_EDITOR (data);
@ -326,9 +331,9 @@ gradient_editor_coloring_type_cmd_callback (GimpAction *action,
GEnumClass *enum_class = NULL;
GimpGradientSegmentColor color;
gimp_gradient_editor_get_selection (editor, &gradient, &left, &right);
color = (GimpGradientSegmentColor) g_variant_get_int32 (value);
color = gimp_radio_action_get_current_value (GIMP_RADIO_ACTION (action));
gimp_gradient_editor_get_selection (editor, &gradient, &left, &right);
enum_class = g_type_class_ref (GIMP_TYPE_GRADIENT_SEGMENT_COLOR);
@ -344,6 +349,7 @@ gradient_editor_coloring_type_cmd_callback (GimpAction *action,
void
gradient_editor_flip_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpGradientEditor *editor = GIMP_GRADIENT_EDITOR (data);
@ -362,6 +368,7 @@ gradient_editor_flip_cmd_callback (GimpAction *action,
void
gradient_editor_replicate_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpGradientEditor *editor = GIMP_GRADIENT_EDITOR (data);
@ -450,6 +457,7 @@ gradient_editor_replicate_cmd_callback (GimpAction *action,
void
gradient_editor_split_midpoint_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpGradientEditor *editor = GIMP_GRADIENT_EDITOR (data);
@ -471,6 +479,7 @@ gradient_editor_split_midpoint_cmd_callback (GimpAction *action,
void
gradient_editor_split_uniformly_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpGradientEditor *editor = GIMP_GRADIENT_EDITOR (data);
@ -560,6 +569,7 @@ gradient_editor_split_uniformly_cmd_callback (GimpAction *action,
void
gradient_editor_delete_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpGradientEditor *editor = GIMP_GRADIENT_EDITOR (data);
@ -578,6 +588,7 @@ gradient_editor_delete_cmd_callback (GimpAction *action,
void
gradient_editor_recenter_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpGradientEditor *editor = GIMP_GRADIENT_EDITOR (data);
@ -592,6 +603,7 @@ gradient_editor_recenter_cmd_callback (GimpAction *action,
void
gradient_editor_redistribute_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpGradientEditor *editor = GIMP_GRADIENT_EDITOR (data);
@ -606,6 +618,7 @@ gradient_editor_redistribute_cmd_callback (GimpAction *action,
void
gradient_editor_blend_color_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpGradientEditor *editor = GIMP_GRADIENT_EDITOR (data);
@ -623,6 +636,7 @@ gradient_editor_blend_color_cmd_callback (GimpAction *action,
void
gradient_editor_blend_opacity_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpGradientEditor *editor = GIMP_GRADIENT_EDITOR (data);
@ -640,12 +654,13 @@ gradient_editor_blend_opacity_cmd_callback (GimpAction *action,
void
gradient_editor_zoom_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpGradientEditor *editor = GIMP_GRADIENT_EDITOR (data);
GimpZoomType zoom_type = (GimpZoomType) g_variant_get_int32 (value);
gimp_gradient_editor_zoom (editor, (GimpZoomType) value, 1.0);
gimp_gradient_editor_zoom (editor, zoom_type, 1.0);
}

View file

@ -30,58 +30,69 @@ enum
void gradient_editor_left_color_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void gradient_editor_left_color_type_cmd_callback (GimpAction *action,
GimpAction *current,
GVariant *value,
gpointer data);
void gradient_editor_load_left_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void gradient_editor_save_left_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void gradient_editor_right_color_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void gradient_editor_right_color_type_cmd_callback (GimpAction *action,
GimpAction *current,
GVariant *value,
gpointer data);
void gradient_editor_load_right_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void gradient_editor_save_right_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void gradient_editor_blending_func_cmd_callback (GimpAction *action,
GimpAction *current,
GVariant *value,
gpointer data);
void gradient_editor_coloring_type_cmd_callback (GimpAction *action,
GimpAction *current,
GVariant *value,
gpointer data);
void gradient_editor_flip_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void gradient_editor_replicate_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void gradient_editor_split_midpoint_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void gradient_editor_split_uniformly_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void gradient_editor_delete_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void gradient_editor_recenter_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void gradient_editor_redistribute_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void gradient_editor_blend_color_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void gradient_editor_blend_opacity_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void gradient_editor_zoom_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);

View file

@ -47,43 +47,43 @@ static const GimpActionEntry gradients_actions[] =
{ "gradients-new", GIMP_ICON_DOCUMENT_NEW,
NC_("gradients-action", "_New Gradient"), NULL,
NC_("gradients-action", "Create a new gradient"),
G_CALLBACK (data_new_cmd_callback),
data_new_cmd_callback,
GIMP_HELP_GRADIENT_NEW },
{ "gradients-duplicate", GIMP_ICON_OBJECT_DUPLICATE,
NC_("gradients-action", "D_uplicate Gradient"), NULL,
NC_("gradients-action", "Duplicate this gradient"),
G_CALLBACK (data_duplicate_cmd_callback),
data_duplicate_cmd_callback,
GIMP_HELP_GRADIENT_DUPLICATE },
{ "gradients-copy-location", GIMP_ICON_EDIT_COPY,
NC_("gradients-action", "Copy Gradient _Location"), NULL,
NC_("gradients-action", "Copy gradient file location to clipboard"),
G_CALLBACK (data_copy_location_cmd_callback),
data_copy_location_cmd_callback,
GIMP_HELP_GRADIENT_COPY_LOCATION },
{ "gradients-show-in-file-manager", GIMP_ICON_FILE_MANAGER,
NC_("gradients-action", "Show in _File Manager"), NULL,
NC_("gradients-action", "Show gradient file location in the file manager"),
G_CALLBACK (data_show_in_file_manager_cmd_callback),
data_show_in_file_manager_cmd_callback,
GIMP_HELP_GRADIENT_SHOW_IN_FILE_MANAGER },
{ "gradients-save-as-pov", GIMP_ICON_DOCUMENT_SAVE_AS,
NC_("gradients-action", "Save as _POV-Ray..."), NULL,
NC_("gradients-action", "Save gradient as POV-Ray"),
G_CALLBACK (gradients_save_as_pov_ray_cmd_callback),
gradients_save_as_pov_ray_cmd_callback,
GIMP_HELP_GRADIENT_SAVE_AS_POV },
{ "gradients-delete", GIMP_ICON_EDIT_DELETE,
NC_("gradients-action", "_Delete Gradient"), NULL,
NC_("gradients-action", "Delete this gradient"),
G_CALLBACK (data_delete_cmd_callback),
data_delete_cmd_callback,
GIMP_HELP_GRADIENT_DELETE },
{ "gradients-refresh", GIMP_ICON_VIEW_REFRESH,
NC_("gradients-action", "_Refresh Gradients"), NULL,
NC_("gradients-action", "Refresh gradients"),
G_CALLBACK (data_refresh_cmd_callback),
data_refresh_cmd_callback,
GIMP_HELP_GRADIENT_REFRESH }
};
@ -107,7 +107,7 @@ gradients_actions_setup (GimpActionGroup *group)
gimp_action_group_add_string_actions (group, "gradients-action",
gradients_edit_actions,
G_N_ELEMENTS (gradients_edit_actions),
G_CALLBACK (data_edit_cmd_callback));
data_edit_cmd_callback);
}
void

View file

@ -50,6 +50,7 @@ static void gradients_save_as_pov_ray_response (GtkWidget *dialog,
void
gradients_save_as_pov_ray_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);

View file

@ -20,6 +20,7 @@
void gradients_save_as_pov_ray_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);

View file

@ -40,13 +40,13 @@ static const GimpActionEntry help_actions[] =
{ "help-help", "gimp-prefs-help-system",
NC_("help-action", "_Help"), "F1",
NC_("help-action", "Open the GIMP user manual"),
G_CALLBACK (help_help_cmd_callback),
help_help_cmd_callback,
GIMP_HELP_HELP },
{ "help-context-help", "gimp-prefs-help-system",
NC_("help-action", "_Context Help"), "<shift>F1",
NC_("help-action", "Show the help for a specific user interface item"),
G_CALLBACK (help_context_help_cmd_callback),
help_context_help_cmd_callback,
GIMP_HELP_HELP_CONTEXT }
};

View file

@ -34,6 +34,7 @@
void
help_help_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
Gimp *gimp;
@ -46,6 +47,7 @@ help_help_cmd_callback (GimpAction *action,
void
help_context_help_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GtkWidget *widget;

View file

@ -20,8 +20,10 @@
void help_help_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void help_context_help_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);

View file

@ -75,103 +75,103 @@ static const GimpActionEntry image_actions[] =
{ "image-new", GIMP_ICON_DOCUMENT_NEW,
NC_("image-action", "_New..."), "<primary>N",
NC_("image-action", "Create a new image"),
G_CALLBACK (image_new_cmd_callback),
image_new_cmd_callback,
GIMP_HELP_FILE_NEW },
{ "image-duplicate", GIMP_ICON_OBJECT_DUPLICATE,
NC_("image-action", "_Duplicate"), "<primary>D",
NC_("image-action", "Create a duplicate of this image"),
G_CALLBACK (image_duplicate_cmd_callback),
image_duplicate_cmd_callback,
GIMP_HELP_IMAGE_DUPLICATE },
{ "image-color-profile-assign", NULL,
NC_("image-action", "_Assign Color Profile..."), NULL,
NC_("image-action", "Set a color profile on the image"),
G_CALLBACK (image_color_profile_assign_cmd_callback),
image_color_profile_assign_cmd_callback,
GIMP_HELP_IMAGE_COLOR_PROFILE_ASSIGN },
{ "image-color-profile-convert", NULL,
NC_("image-action", "_Convert to Color Profile..."), NULL,
NC_("image-action", "Apply a color profile to the image"),
G_CALLBACK (image_color_profile_convert_cmd_callback),
image_color_profile_convert_cmd_callback,
GIMP_HELP_IMAGE_COLOR_PROFILE_CONVERT },
{ "image-color-profile-discard", NULL,
NC_("image-action", "_Discard Color Profile"), NULL,
NC_("image-action", "Remove the image's color profile"),
G_CALLBACK (image_color_profile_discard_cmd_callback),
image_color_profile_discard_cmd_callback,
GIMP_HELP_IMAGE_COLOR_PROFILE_DISCARD },
{ "image-color-profile-save", NULL,
NC_("image-action", "_Save Color Profile to File..."), NULL,
NC_("image-action", "Save the image's color profile to an ICC file"),
G_CALLBACK (image_color_profile_save_cmd_callback),
image_color_profile_save_cmd_callback,
GIMP_HELP_IMAGE_COLOR_PROFILE_SAVE },
{ "image-resize", GIMP_ICON_OBJECT_RESIZE,
NC_("image-action", "Can_vas Size..."), NULL,
NC_("image-action", "Adjust the image dimensions"),
G_CALLBACK (image_resize_cmd_callback),
image_resize_cmd_callback,
GIMP_HELP_IMAGE_RESIZE },
{ "image-resize-to-layers", NULL,
NC_("image-action", "Fit Canvas to L_ayers"), NULL,
NC_("image-action", "Resize the image to enclose all layers"),
G_CALLBACK (image_resize_to_layers_cmd_callback),
image_resize_to_layers_cmd_callback,
GIMP_HELP_IMAGE_RESIZE_TO_LAYERS },
{ "image-resize-to-selection", NULL,
NC_("image-action", "F_it Canvas to Selection"), NULL,
NC_("image-action", "Resize the image to the extents of the selection"),
G_CALLBACK (image_resize_to_selection_cmd_callback),
image_resize_to_selection_cmd_callback,
GIMP_HELP_IMAGE_RESIZE_TO_SELECTION },
{ "image-print-size", GIMP_ICON_DOCUMENT_PRINT_RESOLUTION,
NC_("image-action", "_Print Size..."), NULL,
NC_("image-action", "Adjust the print resolution"),
G_CALLBACK (image_print_size_cmd_callback),
image_print_size_cmd_callback,
GIMP_HELP_IMAGE_PRINT_SIZE },
{ "image-scale", GIMP_ICON_OBJECT_SCALE,
NC_("image-action", "_Scale Image..."), NULL,
NC_("image-action", "Change the size of the image content"),
G_CALLBACK (image_scale_cmd_callback),
image_scale_cmd_callback,
GIMP_HELP_IMAGE_SCALE },
{ "image-crop-to-selection", GIMP_ICON_TOOL_CROP,
NC_("image-action", "_Crop to Selection"), NULL,
NC_("image-action", "Crop the image to the extents of the selection"),
G_CALLBACK (image_crop_to_selection_cmd_callback),
image_crop_to_selection_cmd_callback,
GIMP_HELP_IMAGE_CROP },
{ "image-crop-to-content", GIMP_ICON_TOOL_CROP,
NC_("image-action", "Crop to C_ontent"), NULL,
NC_("image-action", "Crop the image to the extents of its content (remove empty borders from the image)"),
G_CALLBACK (image_crop_to_content_cmd_callback),
image_crop_to_content_cmd_callback,
GIMP_HELP_IMAGE_CROP },
{ "image-merge-layers", NULL,
NC_("image-action", "Merge Visible _Layers..."), "<primary>M",
NC_("image-action", "Merge all visible layers into one layer"),
G_CALLBACK (image_merge_layers_cmd_callback),
image_merge_layers_cmd_callback,
GIMP_HELP_IMAGE_MERGE_LAYERS },
{ "image-flatten", NULL,
NC_("image-action", "_Flatten Image"), NULL,
NC_("image-action", "Merge all layers into one and remove transparency"),
G_CALLBACK (image_flatten_image_cmd_callback),
image_flatten_image_cmd_callback,
GIMP_HELP_IMAGE_FLATTEN },
{ "image-configure-grid", GIMP_ICON_GRID,
NC_("image-action", "Configure G_rid..."), NULL,
NC_("image-action", "Configure the grid for this image"),
G_CALLBACK (image_configure_grid_cmd_callback),
image_configure_grid_cmd_callback,
GIMP_HELP_IMAGE_GRID },
{ "image-properties", "dialog-information",
NC_("image-action", "Image Pr_operties"), "<alt>Return",
NC_("image-action", "Display information about this image"),
G_CALLBACK (image_properties_cmd_callback),
image_properties_cmd_callback,
GIMP_HELP_IMAGE_PROPERTIES }
};
@ -182,7 +182,7 @@ static const GimpToggleActionEntry image_toggle_actions[] =
NC_("image-action", "Temporarily use an sRGB profile for the image. "
"This is the same as discarding the image's color profile, but "
"allows to easily restore the profile."),
G_CALLBACK (image_color_profile_use_srgb_cmd_callback),
image_color_profile_use_srgb_cmd_callback,
TRUE,
GIMP_HELP_IMAGE_COLOR_PROFILE_USE_SRGB }
};
@ -317,29 +317,29 @@ image_actions_setup (GimpActionGroup *group)
image_convert_base_type_actions,
G_N_ELEMENTS (image_convert_base_type_actions),
NULL, 0,
G_CALLBACK (image_convert_base_type_cmd_callback));
image_convert_base_type_cmd_callback);
gimp_action_group_add_radio_actions (group, "image-convert-action",
image_convert_precision_actions,
G_N_ELEMENTS (image_convert_precision_actions),
NULL, 0,
G_CALLBACK (image_convert_precision_cmd_callback));
image_convert_precision_cmd_callback);
gimp_action_group_add_radio_actions (group, "image-convert-action",
image_convert_trc_actions,
G_N_ELEMENTS (image_convert_trc_actions),
NULL, 0,
G_CALLBACK (image_convert_trc_cmd_callback));
image_convert_trc_cmd_callback);
gimp_action_group_add_enum_actions (group, "image-action",
image_flip_actions,
G_N_ELEMENTS (image_flip_actions),
G_CALLBACK (image_flip_cmd_callback));
image_flip_cmd_callback);
gimp_action_group_add_enum_actions (group, "image-action",
image_rotate_actions,
G_N_ELEMENTS (image_rotate_actions),
G_CALLBACK (image_rotate_cmd_callback));
image_rotate_cmd_callback);
#define SET_ALWAYS_SHOW_IMAGE(action,show) \
gimp_action_group_set_action_always_show_image (group, action, show)

View file

@ -54,8 +54,6 @@
#include "widgets/gimpdialogfactory.h"
#include "widgets/gimpdock.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpradioaction.h"
#include "widgets/gimptoggleaction.h"
#include "widgets/gimpwidgets-utils.h"
#include "display/gimpdisplay.h"
@ -184,6 +182,7 @@ static GimpPalette *image_convert_indexed_custom_palette = NULL;
void
image_new_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GtkWidget *widget;
@ -208,6 +207,7 @@ image_new_cmd_callback (GimpAction *action,
void
image_duplicate_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpDisplay *display;
@ -230,7 +230,7 @@ image_duplicate_cmd_callback (GimpAction *action,
void
image_convert_base_type_cmd_callback (GimpAction *action,
GimpAction *current,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -238,15 +238,15 @@ image_convert_base_type_cmd_callback (GimpAction *action,
GtkWidget *widget;
GimpDialogConfig *config;
GtkWidget *dialog;
GimpImageBaseType value;
GimpImageBaseType base_type;
GError *error = NULL;
return_if_no_image (image, data);
return_if_no_display (display, data);
return_if_no_widget (widget, data);
value = gimp_radio_action_get_current_value (GIMP_RADIO_ACTION (action));
base_type = (GimpImageBaseType) g_variant_get_int32 (value);
if (value == gimp_image_get_base_type (image))
if (base_type == gimp_image_get_base_type (image))
return;
#define CONVERT_TYPE_DIALOG_KEY "gimp-convert-type-dialog"
@ -261,7 +261,7 @@ image_convert_base_type_cmd_callback (GimpAction *action,
config = GIMP_DIALOG_CONFIG (image->gimp->config);
switch (value)
switch (base_type)
{
case GIMP_RGB:
case GIMP_GRAY:
@ -278,7 +278,7 @@ image_convert_base_type_cmd_callback (GimpAction *action,
trc = gimp_babl_trc (gimp_image_get_precision (image));
if (value == GIMP_RGB)
if (base_type == GIMP_RGB)
{
dialog_type = COLOR_PROFILE_DIALOG_CONVERT_TO_RGB;
callback = image_convert_rgb_callback;
@ -305,7 +305,7 @@ image_convert_base_type_cmd_callback (GimpAction *action,
callback,
display);
}
else if (! gimp_image_convert_type (image, value, NULL, NULL, &error))
else if (! gimp_image_convert_type (image, base_type, NULL, NULL, &error))
{
gimp_message_literal (image->gimp,
G_OBJECT (widget), GIMP_MESSAGE_WARNING,
@ -345,7 +345,7 @@ image_convert_base_type_cmd_callback (GimpAction *action,
void
image_convert_precision_cmd_callback (GimpAction *action,
GimpAction *current,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -353,14 +353,14 @@ image_convert_precision_cmd_callback (GimpAction *action,
GtkWidget *widget;
GimpDialogConfig *config;
GtkWidget *dialog;
GimpComponentType value;
GimpComponentType component_type;
return_if_no_image (image, data);
return_if_no_display (display, data);
return_if_no_widget (widget, data);
value = gimp_radio_action_get_current_value (GIMP_RADIO_ACTION (action));
component_type = (GimpComponentType) g_variant_get_int32 (value);
if (value == gimp_image_get_component_type (image))
if (component_type == gimp_image_get_component_type (image))
return;
#define CONVERT_PRECISION_DIALOG_KEY "gimp-convert-precision-dialog"
@ -378,7 +378,7 @@ image_convert_precision_cmd_callback (GimpAction *action,
dialog = convert_precision_dialog_new (image,
action_data_get_context (data),
widget,
value,
component_type,
config->image_convert_precision_layer_dither_method,
config->image_convert_precision_text_layer_dither_method,
config->image_convert_precision_channel_dither_method,
@ -396,24 +396,24 @@ image_convert_precision_cmd_callback (GimpAction *action,
void
image_convert_trc_cmd_callback (GimpAction *action,
GimpAction *current,
GVariant *value,
gpointer data)
{
GimpImage *image;
GimpDisplay *display;
GimpTRCType value;
GimpTRCType trc_type;
GimpPrecision precision;
return_if_no_image (image, data);
return_if_no_display (display, data);
value = gimp_radio_action_get_current_value (GIMP_RADIO_ACTION (action));
trc_type = (GimpTRCType) g_variant_get_int32 (value);
if (value == gimp_babl_format_get_trc (gimp_image_get_layer_format (image,
if (trc_type == gimp_babl_format_get_trc (gimp_image_get_layer_format (image,
FALSE)))
return;
precision = gimp_babl_precision (gimp_image_get_component_type (image),
value);
trc_type);
gimp_image_convert_precision (image, precision,
GEGL_DITHER_NONE,
@ -425,13 +425,14 @@ image_convert_trc_cmd_callback (GimpAction *action,
void
image_color_profile_use_srgb_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
gboolean use_srgb;
return_if_no_image (image, data);
use_srgb = gimp_toggle_action_get_active (GIMP_TOGGLE_ACTION (action));
use_srgb = g_variant_get_boolean (value);
if (use_srgb != gimp_image_get_use_srgb_profile (image, NULL))
{
@ -442,6 +443,7 @@ image_color_profile_use_srgb_cmd_callback (GimpAction *action,
void
image_color_profile_assign_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -483,6 +485,7 @@ image_color_profile_assign_cmd_callback (GimpAction *action,
void
image_color_profile_convert_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -526,6 +529,7 @@ image_color_profile_convert_cmd_callback (GimpAction *action,
void
image_color_profile_discard_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -571,6 +575,7 @@ image_profile_save_dialog_response (GtkWidget *dialog,
void
image_color_profile_save_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -620,6 +625,7 @@ image_color_profile_save_cmd_callback (GimpAction *action,
void
image_resize_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -663,6 +669,7 @@ image_resize_cmd_callback (GimpAction *action,
void
image_resize_to_layers_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpDisplay *display;
@ -687,6 +694,7 @@ image_resize_to_layers_cmd_callback (GimpAction *action,
void
image_resize_to_selection_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpDisplay *display;
@ -711,6 +719,7 @@ image_resize_to_selection_cmd_callback (GimpAction *action,
void
image_print_size_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpDisplay *display;
@ -746,6 +755,7 @@ image_print_size_cmd_callback (GimpAction *action,
void
image_scale_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpDisplay *display;
@ -785,21 +795,24 @@ image_scale_cmd_callback (GimpAction *action,
void
image_flip_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpDisplay *display;
GimpImage *image;
GimpProgress *progress;
GimpOrientationType orientation;
return_if_no_display (display, data);
orientation = (GimpOrientationType) g_variant_get_int32 (value);
image = gimp_display_get_image (display);
progress = gimp_progress_start (GIMP_PROGRESS (display), FALSE,
_("Flipping"));
gimp_image_flip (image, action_data_get_context (data),
(GimpOrientationType) value, progress);
orientation, progress);
if (progress)
gimp_progress_end (progress);
@ -809,21 +822,24 @@ image_flip_cmd_callback (GimpAction *action,
void
image_rotate_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpDisplay *display;
GimpImage *image;
GimpProgress *progress;
GimpRotationType rotation;
return_if_no_display (display, data);
rotation = (GimpRotationType) g_variant_get_int32 (value);
image = gimp_display_get_image (display);
progress = gimp_progress_start (GIMP_PROGRESS (display), FALSE,
_("Rotating"));
gimp_image_rotate (image, action_data_get_context (data),
(GimpRotationType) value, progress);
rotation, progress);
if (progress)
gimp_progress_end (progress);
@ -833,6 +849,7 @@ image_rotate_cmd_callback (GimpAction *action,
void
image_crop_to_selection_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -860,6 +877,7 @@ image_crop_to_selection_cmd_callback (GimpAction *action,
void
image_crop_to_content_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -899,6 +917,7 @@ image_crop_to_content_cmd_callback (GimpAction *action,
void
image_merge_layers_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GtkWidget *dialog;
@ -934,6 +953,7 @@ image_merge_layers_cmd_callback (GimpAction *action,
void
image_flatten_image_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -959,6 +979,7 @@ image_flatten_image_cmd_callback (GimpAction *action,
void
image_configure_grid_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpDisplay *display;
@ -988,6 +1009,7 @@ image_configure_grid_cmd_callback (GimpAction *action,
void
image_properties_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpDisplay *display;

View file

@ -20,60 +20,78 @@
void image_new_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void image_duplicate_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void image_convert_base_type_cmd_callback (GimpAction *action,
GimpAction *current,
GVariant *value,
gpointer data);
void image_convert_precision_cmd_callback (GimpAction *action,
GimpAction *current,
GVariant *value,
gpointer data);
void image_convert_trc_cmd_callback (GimpAction *action,
GimpAction *current,
GVariant *value,
gpointer data);
void image_color_profile_use_srgb_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void image_color_profile_assign_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void image_color_profile_convert_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void image_color_profile_discard_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void image_color_profile_save_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void image_resize_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void image_resize_to_layers_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void image_resize_to_selection_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void image_print_size_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void image_scale_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void image_flip_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void image_rotate_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void image_crop_to_selection_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void image_crop_to_content_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void image_merge_layers_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void image_flatten_image_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void image_configure_grid_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void image_properties_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);

View file

@ -46,19 +46,19 @@ static const GimpActionEntry images_actions[] =
{ "images-raise-views", GIMP_ICON_GO_TOP,
NC_("images-action", "_Raise Views"), NULL,
NC_("images-action", "Raise this image's displays"),
G_CALLBACK (images_raise_views_cmd_callback),
images_raise_views_cmd_callback,
NULL },
{ "images-new-view", GIMP_ICON_DOCUMENT_NEW,
NC_("images-action", "_New View"), NULL,
NC_("images-action", "Create a new display for this image"),
G_CALLBACK (images_new_view_cmd_callback),
images_new_view_cmd_callback,
NULL },
{ "images-delete", GIMP_ICON_EDIT_DELETE,
NC_("images-action", "_Delete Image"), NULL,
NC_("images-action", "Delete this image"),
G_CALLBACK (images_delete_image_cmd_callback),
images_delete_image_cmd_callback,
NULL }
};

View file

@ -42,6 +42,7 @@
void
images_raise_views_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
@ -72,6 +73,7 @@ images_raise_views_cmd_callback (GimpAction *action,
void
images_new_view_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
@ -93,6 +95,7 @@ images_new_view_cmd_callback (GimpAction *action,
void
images_delete_image_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);

View file

@ -20,10 +20,13 @@
void images_raise_views_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void images_new_view_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void images_delete_image_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);

View file

@ -33,8 +33,6 @@
#include "core/gimpitem.h"
#include "core/gimpitemundo.h"
#include "widgets/gimptoggleaction.h"
#include "dialogs/dialogs.h"
#include "dialogs/fill-dialog.h"
#include "dialogs/stroke-dialog.h"
@ -65,12 +63,11 @@ static void items_stroke_callback (GtkWidget *dialog,
void
items_visible_cmd_callback (GimpAction *action,
GVariant *value,
GimpImage *image,
GimpItem *item)
{
gboolean visible;
visible = gimp_toggle_action_get_active (GIMP_TOGGLE_ACTION (action));
gboolean visible = g_variant_get_boolean (value);
if (visible != gimp_item_get_visible (item))
{
@ -90,12 +87,11 @@ items_visible_cmd_callback (GimpAction *action,
void
items_linked_cmd_callback (GimpAction *action,
GVariant *value,
GimpImage *image,
GimpItem *item)
{
gboolean linked;
linked = gimp_toggle_action_get_active (GIMP_TOGGLE_ACTION (action));
gboolean linked = g_variant_get_boolean (value);
if (linked != gimp_item_get_linked (item))
{
@ -115,12 +111,11 @@ items_linked_cmd_callback (GimpAction *action,
void
items_lock_content_cmd_callback (GimpAction *action,
GVariant *value,
GimpImage *image,
GimpItem *item)
{
gboolean locked;
locked = gimp_toggle_action_get_active (GIMP_TOGGLE_ACTION (action));
gboolean locked = g_variant_get_boolean (value);
if (locked != gimp_item_get_lock_content (item))
{
@ -140,12 +135,11 @@ items_lock_content_cmd_callback (GimpAction *action,
void
items_lock_position_cmd_callback (GimpAction *action,
GVariant *value,
GimpImage *image,
GimpItem *item)
{
gboolean locked;
locked = gimp_toggle_action_get_active (GIMP_TOGGLE_ACTION (action));
gboolean locked = g_variant_get_boolean (value);
if (locked != gimp_item_get_lock_position (item))
{

View file

@ -20,15 +20,19 @@
void items_visible_cmd_callback (GimpAction *action,
GVariant *value,
GimpImage *image,
GimpItem *item);
void items_linked_cmd_callback (GimpAction *action,
GVariant *value,
GimpImage *image,
GimpItem *item);
void items_lock_content_cmd_callback (GimpAction *action,
GVariant *value,
GimpImage *image,
GimpItem *item);
void items_lock_position_cmd_callback (GimpAction *action,
GVariant *value,
GimpImage *image,
GimpItem *item);

View file

@ -88,166 +88,166 @@ static const GimpActionEntry layers_actions[] =
{ "layers-edit", GIMP_ICON_EDIT,
NC_("layers-action", "Default Edit Action"), NULL,
NC_("layers-action", "Activate the default edit action for this type of layer"),
G_CALLBACK (layers_edit_cmd_callback),
layers_edit_cmd_callback,
GIMP_HELP_LAYER_EDIT },
{ "layers-edit-text", GIMP_ICON_EDIT,
NC_("layers-action", "Edit Te_xt on canvas"), NULL,
NC_("layers-action", "Edit this text layer content on canvas"),
G_CALLBACK (layers_edit_text_cmd_callback),
layers_edit_text_cmd_callback,
GIMP_HELP_LAYER_EDIT },
{ "layers-edit-attributes", GIMP_ICON_EDIT,
NC_("layers-action", "_Edit Layer Attributes..."), NULL,
NC_("layers-action", "Edit the layer's name"),
G_CALLBACK (layers_edit_attributes_cmd_callback),
layers_edit_attributes_cmd_callback,
GIMP_HELP_LAYER_EDIT },
{ "layers-new", GIMP_ICON_DOCUMENT_NEW,
NC_("layers-action", "_New Layer..."), "<primary><shift>N",
NC_("layers-action", "Create a new layer and add it to the image"),
G_CALLBACK (layers_new_cmd_callback),
layers_new_cmd_callback,
GIMP_HELP_LAYER_NEW },
{ "layers-new-last-values", GIMP_ICON_DOCUMENT_NEW,
NC_("layers-action", "_New Layer"), NULL,
NC_("layers-action", "Create a new layer with last used values"),
G_CALLBACK (layers_new_last_vals_cmd_callback),
layers_new_last_vals_cmd_callback,
GIMP_HELP_LAYER_NEW },
{ "layers-new-from-visible", NULL,
NC_("layers-action", "New from _Visible"), NULL,
NC_("layers-action",
"Create a new layer from what is visible in this image"),
G_CALLBACK (layers_new_from_visible_cmd_callback),
layers_new_from_visible_cmd_callback,
GIMP_HELP_LAYER_NEW_FROM_VISIBLE },
{ "layers-new-group", GIMP_ICON_FOLDER_NEW,
NC_("layers-action", "New Layer _Group"), NULL,
NC_("layers-action", "Create a new layer group and add it to the image"),
G_CALLBACK (layers_new_group_cmd_callback),
layers_new_group_cmd_callback,
GIMP_HELP_LAYER_NEW },
{ "layers-duplicate", GIMP_ICON_OBJECT_DUPLICATE,
NC_("layers-action", "D_uplicate Layer"), "<primary><shift>D",
NC_("layers-action",
"Create a duplicate of the layer and add it to the image"),
G_CALLBACK (layers_duplicate_cmd_callback),
layers_duplicate_cmd_callback,
GIMP_HELP_LAYER_DUPLICATE },
{ "layers-delete", GIMP_ICON_EDIT_DELETE,
NC_("layers-action", "_Delete Layer"), NULL,
NC_("layers-action", "Delete this layer"),
G_CALLBACK (layers_delete_cmd_callback),
layers_delete_cmd_callback,
GIMP_HELP_LAYER_DELETE },
{ "layers-raise", GIMP_ICON_GO_UP,
NC_("layers-action", "_Raise Layer"), NULL,
NC_("layers-action", "Raise this layer one step in the layer stack"),
G_CALLBACK (layers_raise_cmd_callback),
layers_raise_cmd_callback,
GIMP_HELP_LAYER_RAISE },
{ "layers-raise-to-top", GIMP_ICON_GO_TOP,
NC_("layers-action", "Layer to _Top"), NULL,
NC_("layers-action", "Move this layer to the top of the layer stack"),
G_CALLBACK (layers_raise_to_top_cmd_callback),
layers_raise_to_top_cmd_callback,
GIMP_HELP_LAYER_RAISE_TO_TOP },
{ "layers-lower", GIMP_ICON_GO_DOWN,
NC_("layers-action", "_Lower Layer"), NULL,
NC_("layers-action", "Lower this layer one step in the layer stack"),
G_CALLBACK (layers_lower_cmd_callback),
layers_lower_cmd_callback,
GIMP_HELP_LAYER_LOWER },
{ "layers-lower-to-bottom", GIMP_ICON_GO_BOTTOM,
NC_("layers-action", "Layer to _Bottom"), NULL,
NC_("layers-action", "Move this layer to the bottom of the layer stack"),
G_CALLBACK (layers_lower_to_bottom_cmd_callback),
layers_lower_to_bottom_cmd_callback,
GIMP_HELP_LAYER_LOWER_TO_BOTTOM },
{ "layers-anchor", GIMP_ICON_LAYER_ANCHOR,
NC_("layers-action", "_Anchor Layer"), "<primary>H",
NC_("layers-action", "Anchor the floating layer"),
G_CALLBACK (layers_anchor_cmd_callback),
layers_anchor_cmd_callback,
GIMP_HELP_LAYER_ANCHOR },
{ "layers-merge-down", GIMP_ICON_LAYER_MERGE_DOWN,
NC_("layers-action", "Merge Do_wn"), NULL,
NC_("layers-action", "Merge this layer with the first visible layer below it"),
G_CALLBACK (layers_merge_down_cmd_callback),
layers_merge_down_cmd_callback,
GIMP_HELP_LAYER_MERGE_DOWN },
{ "layers-merge-group", NULL,
NC_("layers-action", "Merge Layer Group"), NULL,
NC_("layers-action", "Merge the layer group's layers into one normal layer"),
G_CALLBACK (layers_merge_group_cmd_callback),
layers_merge_group_cmd_callback,
GIMP_HELP_LAYER_MERGE_GROUP },
{ "layers-merge-layers", NULL,
NC_("layers-action", "Merge _Visible Layers..."), NULL,
NC_("layers-action", "Merge all visible layers into one layer"),
G_CALLBACK (image_merge_layers_cmd_callback),
image_merge_layers_cmd_callback,
GIMP_HELP_IMAGE_MERGE_LAYERS },
{ "layers-flatten-image", NULL,
NC_("layers-action", "_Flatten Image"), NULL,
NC_("layers-action", "Merge all layers into one and remove transparency"),
G_CALLBACK (image_flatten_image_cmd_callback),
image_flatten_image_cmd_callback,
GIMP_HELP_IMAGE_FLATTEN },
{ "layers-text-discard", GIMP_ICON_TOOL_TEXT,
NC_("layers-action", "_Discard Text Information"), NULL,
NC_("layers-action", "Turn this text layer into a normal layer"),
G_CALLBACK (layers_text_discard_cmd_callback),
layers_text_discard_cmd_callback,
GIMP_HELP_LAYER_TEXT_DISCARD },
{ "layers-text-to-vectors", GIMP_ICON_TOOL_TEXT,
NC_("layers-action", "Text to _Path"), NULL,
NC_("layers-action", "Create a path from this text layer"),
G_CALLBACK (layers_text_to_vectors_cmd_callback),
layers_text_to_vectors_cmd_callback,
GIMP_HELP_LAYER_TEXT_TO_PATH },
{ "layers-text-along-vectors", GIMP_ICON_TOOL_TEXT,
NC_("layers-action", "Text alon_g Path"), NULL,
NC_("layers-action", "Warp this layer's text along the current path"),
G_CALLBACK (layers_text_along_vectors_cmd_callback),
layers_text_along_vectors_cmd_callback,
GIMP_HELP_LAYER_TEXT_ALONG_PATH },
{ "layers-resize", GIMP_ICON_OBJECT_RESIZE,
NC_("layers-action", "Layer B_oundary Size..."), NULL,
NC_("layers-action", "Adjust the layer dimensions"),
G_CALLBACK (layers_resize_cmd_callback),
layers_resize_cmd_callback,
GIMP_HELP_LAYER_RESIZE },
{ "layers-resize-to-image", GIMP_ICON_LAYER_TO_IMAGESIZE,
NC_("layers-action", "Layer to _Image Size"), NULL,
NC_("layers-action", "Resize the layer to the size of the image"),
G_CALLBACK (layers_resize_to_image_cmd_callback),
layers_resize_to_image_cmd_callback,
GIMP_HELP_LAYER_RESIZE_TO_IMAGE },
{ "layers-scale", GIMP_ICON_OBJECT_SCALE,
NC_("layers-action", "_Scale Layer..."), NULL,
NC_("layers-action", "Change the size of the layer content"),
G_CALLBACK (layers_scale_cmd_callback),
layers_scale_cmd_callback,
GIMP_HELP_LAYER_SCALE },
{ "layers-crop-to-selection", GIMP_ICON_TOOL_CROP,
NC_("layers-action", "_Crop to Selection"), NULL,
NC_("layers-action", "Crop the layer to the extents of the selection"),
G_CALLBACK (layers_crop_to_selection_cmd_callback),
layers_crop_to_selection_cmd_callback,
GIMP_HELP_LAYER_CROP },
{ "layers-crop-to-content", GIMP_ICON_TOOL_CROP,
NC_("layers-action", "Crop to C_ontent"), NULL,
NC_("layers-action", "Crop the layer to the extents of its content (remove empty borders from the layer)"),
G_CALLBACK (layers_crop_to_content_cmd_callback),
layers_crop_to_content_cmd_callback,
GIMP_HELP_LAYER_CROP },
{ "layers-mask-add", GIMP_ICON_LAYER_MASK,
NC_("layers-action", "Add La_yer Mask..."), NULL,
NC_("layers-action",
"Add a mask that allows non-destructive editing of transparency"),
G_CALLBACK (layers_mask_add_cmd_callback),
layers_mask_add_cmd_callback,
GIMP_HELP_LAYER_MASK_ADD },
/* this is the same as layers-mask-add, except it's sensitive even if
@ -257,26 +257,26 @@ static const GimpActionEntry layers_actions[] =
NC_("layers-action", "Add La_yer Mask..."), NULL,
NC_("layers-action",
"Add a mask that allows non-destructive editing of transparency"),
G_CALLBACK (layers_mask_add_cmd_callback),
layers_mask_add_cmd_callback,
GIMP_HELP_LAYER_MASK_ADD },
{ "layers-mask-add-last-values", GIMP_ICON_LAYER_MASK,
NC_("layers-action", "Add La_yer Mask"), NULL,
NC_("layers-action",
"Add a mask with last used values"),
G_CALLBACK (layers_mask_add_last_vals_cmd_callback),
layers_mask_add_last_vals_cmd_callback,
GIMP_HELP_LAYER_MASK_ADD },
{ "layers-alpha-add", GIMP_ICON_TRANSPARENCY,
NC_("layers-action", "Add Alpha C_hannel"), NULL,
NC_("layers-action", "Add transparency information to the layer"),
G_CALLBACK (layers_alpha_add_cmd_callback),
layers_alpha_add_cmd_callback,
GIMP_HELP_LAYER_ALPHA_ADD },
{ "layers-alpha-remove", NULL,
NC_("layers-action", "_Remove Alpha Channel"), NULL,
NC_("layers-action", "Remove transparency information from the layer"),
G_CALLBACK (layers_alpha_remove_cmd_callback),
layers_alpha_remove_cmd_callback,
GIMP_HELP_LAYER_ALPHA_REMOVE }
};
@ -285,44 +285,44 @@ static const GimpToggleActionEntry layers_toggle_actions[] =
{ "layers-mask-edit", GIMP_ICON_EDIT,
NC_("layers-action", "_Edit Layer Mask"), NULL,
NC_("layers-action", "Work on the layer mask"),
G_CALLBACK (layers_mask_edit_cmd_callback),
layers_mask_edit_cmd_callback,
FALSE,
GIMP_HELP_LAYER_MASK_EDIT },
{ "layers-mask-show", GIMP_ICON_VISIBLE,
NC_("layers-action", "S_how Layer Mask"), NULL, NULL,
G_CALLBACK (layers_mask_show_cmd_callback),
layers_mask_show_cmd_callback,
FALSE,
GIMP_HELP_LAYER_MASK_SHOW },
{ "layers-mask-disable", NULL,
NC_("layers-action", "_Disable Layer Mask"), NULL,
NC_("layers-action", "Dismiss the effect of the layer mask"),
G_CALLBACK (layers_mask_disable_cmd_callback),
layers_mask_disable_cmd_callback,
FALSE,
GIMP_HELP_LAYER_MASK_DISABLE },
{ "layers-visible", GIMP_ICON_VISIBLE,
NC_("layers-action", "Toggle Layer _Visibility"), NULL, NULL,
G_CALLBACK (layers_visible_cmd_callback),
layers_visible_cmd_callback,
FALSE,
GIMP_HELP_LAYER_VISIBLE },
{ "layers-linked", GIMP_ICON_LINKED,
NC_("layers-action", "Toggle Layer _Linked State"), NULL, NULL,
G_CALLBACK (layers_linked_cmd_callback),
layers_linked_cmd_callback,
FALSE,
GIMP_HELP_LAYER_LINKED },
{ "layers-lock-content", NULL /* GIMP_ICON_LOCK */,
NC_("layers-action", "L_ock Pixels of Layer"), NULL, NULL,
G_CALLBACK (layers_lock_content_cmd_callback),
layers_lock_content_cmd_callback,
FALSE,
GIMP_HELP_LAYER_LOCK_PIXELS },
{ "layers-lock-position", GIMP_ICON_TOOL_MOVE,
NC_("layers-action", "L_ock Position of Layer"), NULL, NULL,
G_CALLBACK (layers_lock_position_cmd_callback),
layers_lock_position_cmd_callback,
FALSE,
GIMP_HELP_LAYER_LOCK_POSITION },
@ -330,7 +330,7 @@ static const GimpToggleActionEntry layers_toggle_actions[] =
NC_("layers-action", "Lock Alph_a Channel"), NULL,
NC_("layers-action",
"Keep transparency information on this layer from being modified"),
G_CALLBACK (layers_lock_alpha_cmd_callback),
layers_lock_alpha_cmd_callback,
FALSE,
GIMP_HELP_LAYER_LOCK_ALPHA },
};
@ -681,39 +681,39 @@ layers_actions_setup (GimpActionGroup *group)
layers_blend_space_actions,
G_N_ELEMENTS (layers_blend_space_actions),
NULL, 0,
G_CALLBACK (layers_blend_space_cmd_callback));
layers_blend_space_cmd_callback);
gimp_action_group_add_radio_actions (group, "layers-action",
layers_composite_space_actions,
G_N_ELEMENTS (layers_composite_space_actions),
NULL, 0,
G_CALLBACK (layers_composite_space_cmd_callback));
layers_composite_space_cmd_callback);
gimp_action_group_add_radio_actions (group, "layers-action",
layers_composite_mode_actions,
G_N_ELEMENTS (layers_composite_mode_actions),
NULL, 0,
G_CALLBACK (layers_composite_mode_cmd_callback));
layers_composite_mode_cmd_callback);
gimp_action_group_add_enum_actions (group, "layers-action",
layers_color_tag_actions,
G_N_ELEMENTS (layers_color_tag_actions),
G_CALLBACK (layers_color_tag_cmd_callback));
layers_color_tag_cmd_callback);
gimp_action_group_add_enum_actions (group, "layers-action",
layers_mask_apply_actions,
G_N_ELEMENTS (layers_mask_apply_actions),
G_CALLBACK (layers_mask_apply_cmd_callback));
layers_mask_apply_cmd_callback);
gimp_action_group_add_enum_actions (group, "layers-action",
layers_mask_to_selection_actions,
G_N_ELEMENTS (layers_mask_to_selection_actions),
G_CALLBACK (layers_mask_to_selection_cmd_callback));
layers_mask_to_selection_cmd_callback);
gimp_action_group_add_enum_actions (group, "layers-action",
layers_alpha_to_selection_actions,
G_N_ELEMENTS (layers_alpha_to_selection_actions),
G_CALLBACK (layers_alpha_to_selection_cmd_callback));
layers_alpha_to_selection_cmd_callback);
layers_actions_fix_tooltip (group, "layers-alpha-selection-replace",
GDK_MOD1_MASK);
@ -727,17 +727,17 @@ layers_actions_setup (GimpActionGroup *group)
gimp_action_group_add_enum_actions (group, "layers-action",
layers_select_actions,
G_N_ELEMENTS (layers_select_actions),
G_CALLBACK (layers_select_cmd_callback));
layers_select_cmd_callback);
gimp_action_group_add_enum_actions (group, "layers-action",
layers_opacity_actions,
G_N_ELEMENTS (layers_opacity_actions),
G_CALLBACK (layers_opacity_cmd_callback));
layers_opacity_cmd_callback);
gimp_action_group_add_enum_actions (group, "layers-action",
layers_mode_actions,
G_N_ELEMENTS (layers_mode_actions),
G_CALLBACK (layers_mode_cmd_callback));
layers_mode_cmd_callback);
items_actions_setup (group, "layers");
}

View file

@ -65,8 +65,6 @@
#include "widgets/gimpdock.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpprogressdialog.h"
#include "widgets/gimpradioaction.h"
#include "widgets/gimptoggleaction.h"
#include "display/gimpdisplay.h"
#include "display/gimpdisplayshell.h"
@ -181,6 +179,7 @@ static GimpInterpolationType layer_scale_interp = -1;
void
layers_edit_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -191,16 +190,17 @@ layers_edit_cmd_callback (GimpAction *action,
if (gimp_item_is_text_layer (GIMP_ITEM (layer)))
{
layers_edit_text_cmd_callback (action, data);
layers_edit_text_cmd_callback (action, value, data);
}
else
{
layers_edit_attributes_cmd_callback (action, data);
layers_edit_attributes_cmd_callback (action, value, data);
}
}
void
layers_edit_text_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -240,6 +240,7 @@ layers_edit_text_cmd_callback (GimpAction *action,
void
layers_edit_attributes_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -290,6 +291,7 @@ layers_edit_attributes_cmd_callback (GimpAction *action,
void
layers_new_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -366,6 +368,7 @@ layers_new_cmd_callback (GimpAction *action,
void
layers_new_last_vals_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -384,7 +387,7 @@ layers_new_last_vals_cmd_callback (GimpAction *action,
*/
if (gimp_image_get_floating_selection (image))
{
layers_new_cmd_callback (action, data);
layers_new_cmd_callback (action, value, data);
return;
}
@ -420,6 +423,7 @@ layers_new_last_vals_cmd_callback (GimpAction *action,
void
layers_new_from_visible_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -449,6 +453,7 @@ layers_new_from_visible_cmd_callback (GimpAction *action,
void
layers_new_group_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -463,15 +468,18 @@ layers_new_group_cmd_callback (GimpAction *action,
void
layers_select_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpImage *image;
GimpLayer *layer;
GimpContainer *container;
GimpLayer *new_layer;
GimpActionSelectType select_type;
return_if_no_image (image, data);
select_type = (GimpActionSelectType) g_variant_get_int32 (value);
layer = gimp_image_get_active_layer (image);
if (layer)
@ -479,7 +487,7 @@ layers_select_cmd_callback (GimpAction *action,
else
container = gimp_image_get_layers (image);
new_layer = (GimpLayer *) action_select_object ((GimpActionSelectType) value,
new_layer = (GimpLayer *) action_select_object (select_type,
container,
(GimpObject *) layer);
@ -492,6 +500,7 @@ layers_select_cmd_callback (GimpAction *action,
void
layers_raise_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -504,6 +513,7 @@ layers_raise_cmd_callback (GimpAction *action,
void
layers_raise_to_top_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -516,6 +526,7 @@ layers_raise_to_top_cmd_callback (GimpAction *action,
void
layers_lower_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -528,6 +539,7 @@ layers_lower_cmd_callback (GimpAction *action,
void
layers_lower_to_bottom_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -540,6 +552,7 @@ layers_lower_to_bottom_cmd_callback (GimpAction *action,
void
layers_duplicate_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -562,6 +575,7 @@ layers_duplicate_cmd_callback (GimpAction *action,
void
layers_anchor_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -577,6 +591,7 @@ layers_anchor_cmd_callback (GimpAction *action,
void
layers_merge_down_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -593,6 +608,7 @@ layers_merge_down_cmd_callback (GimpAction *action,
void
layers_merge_group_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -605,6 +621,7 @@ layers_merge_group_cmd_callback (GimpAction *action,
void
layers_delete_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -617,6 +634,7 @@ layers_delete_cmd_callback (GimpAction *action,
void
layers_text_discard_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -629,6 +647,7 @@ layers_text_discard_cmd_callback (GimpAction *action,
void
layers_text_to_vectors_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -653,6 +672,7 @@ layers_text_to_vectors_cmd_callback (GimpAction *action,
void
layers_text_along_vectors_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -710,6 +730,7 @@ layers_text_along_vectors_cmd_callback (GimpAction *action,
void
layers_resize_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -756,6 +777,7 @@ layers_resize_cmd_callback (GimpAction *action,
void
layers_resize_to_image_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -770,6 +792,7 @@ layers_resize_to_image_cmd_callback (GimpAction *action,
void
layers_scale_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -814,6 +837,7 @@ layers_scale_cmd_callback (GimpAction *action,
void
layers_crop_to_selection_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -852,6 +876,7 @@ layers_crop_to_selection_cmd_callback (GimpAction *action,
void
layers_crop_to_content_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -898,6 +923,7 @@ layers_crop_to_content_cmd_callback (GimpAction *action,
void
layers_mask_add_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -933,6 +959,7 @@ layers_mask_add_cmd_callback (GimpAction *action,
void
layers_mask_add_last_vals_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -962,7 +989,7 @@ layers_mask_add_last_vals_cmd_callback (GimpAction *action,
if (! channel)
{
layers_mask_add_cmd_callback (action, data);
layers_mask_add_cmd_callback (action, value, data);
return;
}
}
@ -980,7 +1007,7 @@ layers_mask_add_last_vals_cmd_callback (GimpAction *action,
void
layers_mask_apply_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -989,7 +1016,7 @@ layers_mask_apply_cmd_callback (GimpAction *action,
if (gimp_layer_get_mask (layer))
{
GimpMaskApplyMode mode = (GimpMaskApplyMode) value;
GimpMaskApplyMode mode = (GimpMaskApplyMode) g_variant_get_int32 (value);
gimp_layer_apply_mask (layer, mode, TRUE);
gimp_image_flush (image);
@ -998,6 +1025,7 @@ layers_mask_apply_cmd_callback (GimpAction *action,
void
layers_mask_edit_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -1006,9 +1034,7 @@ layers_mask_edit_cmd_callback (GimpAction *action,
if (gimp_layer_get_mask (layer))
{
gboolean active;
active = gimp_toggle_action_get_active (GIMP_TOGGLE_ACTION (action));
gboolean active = g_variant_get_boolean (value);
gimp_layer_set_edit_mask (layer, active);
gimp_image_flush (image);
@ -1017,6 +1043,7 @@ layers_mask_edit_cmd_callback (GimpAction *action,
void
layers_mask_show_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -1025,9 +1052,7 @@ layers_mask_show_cmd_callback (GimpAction *action,
if (gimp_layer_get_mask (layer))
{
gboolean active;
active = gimp_toggle_action_get_active (GIMP_TOGGLE_ACTION (action));
gboolean active = g_variant_get_boolean (value);
gimp_layer_set_show_mask (layer, active, TRUE);
gimp_image_flush (image);
@ -1036,6 +1061,7 @@ layers_mask_show_cmd_callback (GimpAction *action,
void
layers_mask_disable_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -1044,9 +1070,7 @@ layers_mask_disable_cmd_callback (GimpAction *action,
if (gimp_layer_get_mask (layer))
{
gboolean active;
active = gimp_toggle_action_get_active (GIMP_TOGGLE_ACTION (action));
gboolean active = g_variant_get_boolean (value);
gimp_layer_set_apply_mask (layer, ! active, TRUE);
gimp_image_flush (image);
@ -1055,7 +1079,7 @@ layers_mask_disable_cmd_callback (GimpAction *action,
void
layers_mask_to_selection_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -1067,8 +1091,9 @@ layers_mask_to_selection_cmd_callback (GimpAction *action,
if (mask)
{
gimp_item_to_selection (GIMP_ITEM (mask),
(GimpChannelOps) value,
GimpChannelOps operation = (GimpChannelOps) g_variant_get_int32 (value);
gimp_item_to_selection (GIMP_ITEM (mask), operation,
TRUE, FALSE, 0.0, 0.0);
gimp_image_flush (image);
}
@ -1076,6 +1101,7 @@ layers_mask_to_selection_cmd_callback (GimpAction *action,
void
layers_alpha_add_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -1091,6 +1117,7 @@ layers_alpha_add_cmd_callback (GimpAction *action,
void
layers_alpha_remove_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -1106,22 +1133,24 @@ layers_alpha_remove_cmd_callback (GimpAction *action,
void
layers_alpha_to_selection_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpImage *image;
GimpLayer *layer;
GimpChannelOps operation;
return_if_no_layer (image, layer, data);
gimp_item_to_selection (GIMP_ITEM (layer),
(GimpChannelOps) value,
operation = (GimpChannelOps) g_variant_get_int32 (value);
gimp_item_to_selection (GIMP_ITEM (layer), operation,
TRUE, FALSE, 0.0, 0.0);
gimp_image_flush (image);
}
void
layers_opacity_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -1147,7 +1176,7 @@ layers_opacity_cmd_callback (GimpAction *action,
void
layers_mode_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -1184,7 +1213,7 @@ layers_mode_cmd_callback (GimpAction *action,
void
layers_blend_space_cmd_callback (GimpAction *action,
GimpAction *current,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -1192,7 +1221,7 @@ layers_blend_space_cmd_callback (GimpAction *action,
GimpLayerColorSpace blend_space;
return_if_no_layer (image, layer, data);
blend_space = gimp_radio_action_get_current_value (GIMP_RADIO_ACTION (action));
blend_space = (GimpLayerColorSpace) g_variant_get_int32 (value);
if (blend_space != gimp_layer_get_blend_space (layer))
{
@ -1212,7 +1241,7 @@ layers_blend_space_cmd_callback (GimpAction *action,
void
layers_composite_space_cmd_callback (GimpAction *action,
GimpAction *current,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -1220,7 +1249,7 @@ layers_composite_space_cmd_callback (GimpAction *action,
GimpLayerColorSpace composite_space;
return_if_no_layer (image, layer, data);
composite_space = gimp_radio_action_get_current_value (GIMP_RADIO_ACTION (action));
composite_space = (GimpLayerColorSpace) g_variant_get_int32 (value);
if (composite_space != gimp_layer_get_composite_space (layer))
{
@ -1240,7 +1269,7 @@ layers_composite_space_cmd_callback (GimpAction *action,
void
layers_composite_mode_cmd_callback (GimpAction *action,
GimpAction *current,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -1248,7 +1277,7 @@ layers_composite_mode_cmd_callback (GimpAction *action,
GimpLayerCompositeMode composite_mode;
return_if_no_layer (image, layer, data);
composite_mode = gimp_radio_action_get_current_value (GIMP_RADIO_ACTION (action));
composite_mode = (GimpLayerCompositeMode) g_variant_get_int32 (value);
if (composite_mode != gimp_layer_get_composite_mode (layer))
{
@ -1268,50 +1297,55 @@ layers_composite_mode_cmd_callback (GimpAction *action,
void
layers_visible_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
GimpLayer *layer;
return_if_no_layer (image, layer, data);
items_visible_cmd_callback (action, image, GIMP_ITEM (layer));
items_visible_cmd_callback (action, value, image, GIMP_ITEM (layer));
}
void
layers_linked_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
GimpLayer *layer;
return_if_no_layer (image, layer, data);
items_linked_cmd_callback (action, image, GIMP_ITEM (layer));
items_linked_cmd_callback (action, value, image, GIMP_ITEM (layer));
}
void
layers_lock_content_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
GimpLayer *layer;
return_if_no_layer (image, layer, data);
items_lock_content_cmd_callback (action, image, GIMP_ITEM (layer));
items_lock_content_cmd_callback (action, value, image, GIMP_ITEM (layer));
}
void
layers_lock_position_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
GimpLayer *layer;
return_if_no_layer (image, layer, data);
items_lock_position_cmd_callback (action, image, GIMP_ITEM (layer));
items_lock_position_cmd_callback (action, value, image, GIMP_ITEM (layer));
}
void
layers_lock_alpha_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -1319,7 +1353,7 @@ layers_lock_alpha_cmd_callback (GimpAction *action,
gboolean lock_alpha;
return_if_no_layer (image, layer, data);
lock_alpha = gimp_toggle_action_get_active (GIMP_TOGGLE_ACTION (action));
lock_alpha = g_variant_get_boolean (value);
if (lock_alpha != gimp_layer_get_lock_alpha (layer))
{
@ -1339,15 +1373,18 @@ layers_lock_alpha_cmd_callback (GimpAction *action,
void
layers_color_tag_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpImage *image;
GimpLayer *layer;
GimpColorTag color_tag;
return_if_no_layer (image, layer, data);
color_tag = (GimpColorTag) g_variant_get_int32 (value);
items_color_tag_cmd_callback (action, image, GIMP_ITEM (layer),
(GimpColorTag) value);
color_tag);
}

View file

@ -20,117 +20,153 @@
void layers_edit_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void layers_edit_text_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void layers_edit_attributes_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void layers_new_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void layers_new_last_vals_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void layers_new_from_visible_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void layers_new_group_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void layers_select_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void layers_raise_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void layers_raise_to_top_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void layers_lower_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void layers_lower_to_bottom_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void layers_duplicate_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void layers_anchor_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void layers_merge_down_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void layers_merge_group_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void layers_delete_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void layers_text_discard_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void layers_text_to_vectors_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void layers_text_along_vectors_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void layers_resize_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void layers_resize_to_image_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void layers_scale_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void layers_crop_to_selection_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void layers_crop_to_content_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void layers_mask_add_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void layers_mask_add_last_vals_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void layers_mask_apply_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void layers_mask_edit_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void layers_mask_show_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void layers_mask_disable_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void layers_mask_to_selection_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void layers_alpha_add_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void layers_alpha_remove_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void layers_alpha_to_selection_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void layers_opacity_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void layers_mode_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void layers_blend_space_cmd_callback (GimpAction *action,
GimpAction *current,
GVariant *value,
gpointer data);
void layers_composite_space_cmd_callback (GimpAction *action,
GimpAction *current,
GVariant *value,
gpointer data);
void layers_composite_mode_cmd_callback (GimpAction *action,
GimpAction *current,
GVariant *value,
gpointer data);
void layers_visible_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void layers_linked_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void layers_lock_content_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void layers_lock_position_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void layers_lock_alpha_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void layers_color_tag_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);

View file

@ -46,37 +46,37 @@ static const GimpActionEntry mypaint_brushes_actions[] =
{ "mypaint-brushes-new", GIMP_ICON_DOCUMENT_NEW,
NC_("mypaint-brushes-action", "_New MyPaint Brush"), NULL,
NC_("mypaint-brushes-action", "Create a new MyPaint brush"),
G_CALLBACK (data_new_cmd_callback),
data_new_cmd_callback,
GIMP_HELP_MYPAINT_BRUSH_NEW },
{ "mypaint-brushes-duplicate", GIMP_ICON_OBJECT_DUPLICATE,
NC_("mypaint-brushes-action", "D_uplicate MyPaint Brush"), NULL,
NC_("mypaint-brushes-action", "Duplicate this MyPaint brush"),
G_CALLBACK (data_duplicate_cmd_callback),
data_duplicate_cmd_callback,
GIMP_HELP_MYPAINT_BRUSH_DUPLICATE },
{ "mypaint-brushes-copy-location", GIMP_ICON_EDIT_COPY,
NC_("mypaint-brushes-action", "Copy MyPaint Brush _Location"), NULL,
NC_("mypaint-brushes-action", "Copy MyPaint brush file location to clipboard"),
G_CALLBACK (data_copy_location_cmd_callback),
data_copy_location_cmd_callback,
GIMP_HELP_MYPAINT_BRUSH_COPY_LOCATION },
{ "mypaint-brushes-show-in-file-manager", GIMP_ICON_FILE_MANAGER,
NC_("mypaint-brushes-action", "Show in _File Manager"), NULL,
NC_("mypaint-brushes-action", "Show MyPaint brush file location in the file manager"),
G_CALLBACK (data_show_in_file_manager_cmd_callback),
data_show_in_file_manager_cmd_callback,
GIMP_HELP_MYPAINT_BRUSH_SHOW_IN_FILE_MANAGER },
{ "mypaint-brushes-delete", GIMP_ICON_EDIT_DELETE,
NC_("mypaint-brushes-action", "_Delete MyPaint Brush"), NULL,
NC_("mypaint-brushes-action", "Delete this MyPaint brush"),
G_CALLBACK (data_delete_cmd_callback),
data_delete_cmd_callback,
GIMP_HELP_MYPAINT_BRUSH_DELETE },
{ "mypaint-brushes-refresh", GIMP_ICON_VIEW_REFRESH,
NC_("mypaint-brushes-action", "_Refresh MyPaint Brushes"), NULL,
NC_("mypaint-brushes-action", "Refresh MyPaint brushes"),
G_CALLBACK (data_refresh_cmd_callback),
data_refresh_cmd_callback,
GIMP_HELP_MYPAINT_BRUSH_REFRESH }
};
@ -100,7 +100,7 @@ mypaint_brushes_actions_setup (GimpActionGroup *group)
gimp_action_group_add_string_actions (group, "mypaint-brushes-action",
mypaint_brushes_edit_actions,
G_N_ELEMENTS (mypaint_brushes_edit_actions),
G_CALLBACK (data_edit_cmd_callback));
data_edit_cmd_callback);
}
void

View file

@ -47,13 +47,13 @@ static const GimpActionEntry palette_editor_actions[] =
{ "palette-editor-edit-color", GIMP_ICON_EDIT,
NC_("palette-editor-action", "_Edit Color..."), NULL,
NC_("palette-editor-action", "Edit this entry"),
G_CALLBACK (palette_editor_edit_color_cmd_callback),
palette_editor_edit_color_cmd_callback,
GIMP_HELP_PALETTE_EDITOR_EDIT },
{ "palette-editor-delete-color", GIMP_ICON_EDIT_DELETE,
NC_("palette-editor-action", "_Delete Color"), NULL,
NC_("palette-editor-action", "Delete this entry"),
G_CALLBACK (palette_editor_delete_color_cmd_callback),
palette_editor_delete_color_cmd_callback,
GIMP_HELP_PALETTE_EDITOR_DELETE }
};
@ -61,7 +61,7 @@ static const GimpToggleActionEntry palette_editor_toggle_actions[] =
{
{ "palette-editor-edit-active", GIMP_ICON_LINKED,
NC_("palette-editor-action", "Edit Active Palette"), NULL, NULL,
G_CALLBACK (data_editor_edit_active_cmd_callback),
data_editor_edit_active_cmd_callback,
FALSE,
GIMP_HELP_PALETTE_EDITOR_EDIT_ACTIVE }
};
@ -119,12 +119,12 @@ palette_editor_actions_setup (GimpActionGroup *group)
gimp_action_group_add_enum_actions (group, "palette-editor-action",
palette_editor_new_actions,
G_N_ELEMENTS (palette_editor_new_actions),
G_CALLBACK (palette_editor_new_color_cmd_callback));
palette_editor_new_color_cmd_callback);
gimp_action_group_add_enum_actions (group, NULL,
palette_editor_zoom_actions,
G_N_ELEMENTS (palette_editor_zoom_actions),
G_CALLBACK (palette_editor_zoom_cmd_callback));
palette_editor_zoom_cmd_callback);
}
void

View file

@ -35,6 +35,7 @@
void
palette_editor_edit_color_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpPaletteEditor *editor = GIMP_PALETTE_EDITOR (data);
@ -44,11 +45,12 @@ palette_editor_edit_color_cmd_callback (GimpAction *action,
void
palette_editor_new_color_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpPaletteEditor *editor = GIMP_PALETTE_EDITOR (data);
GimpDataEditor *data_editor = GIMP_DATA_EDITOR (data);
gboolean background = (gboolean) g_variant_get_int32 (value);
if (data_editor->data_editable)
{
@ -56,7 +58,7 @@ palette_editor_new_color_cmd_callback (GimpAction *action,
GimpPaletteEntry *entry;
GimpRGB color;
if (value)
if (background)
gimp_context_get_background (data_editor->context, &color);
else
gimp_context_get_foreground (data_editor->context, &color);
@ -68,6 +70,7 @@ palette_editor_new_color_cmd_callback (GimpAction *action,
void
palette_editor_delete_color_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpPaletteEditor *editor = GIMP_PALETTE_EDITOR (data);
@ -83,10 +86,11 @@ palette_editor_delete_color_cmd_callback (GimpAction *action,
void
palette_editor_zoom_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data)
{
GimpPaletteEditor *editor = GIMP_PALETTE_EDITOR (data);
GimpZoomType zoom_type = (GimpZoomType) g_variant_get_int32 (value);
gimp_palette_editor_zoom (editor, (GimpZoomType) value);
gimp_palette_editor_zoom (editor, zoom_type);
}

View file

@ -20,15 +20,17 @@
void palette_editor_edit_color_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void palette_editor_new_color_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);
void palette_editor_delete_color_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void palette_editor_zoom_cmd_callback (GimpAction *action,
gint value,
GVariant *value,
gpointer data);

View file

@ -47,49 +47,49 @@ static const GimpActionEntry palettes_actions[] =
{ "palettes-new", GIMP_ICON_DOCUMENT_NEW,
NC_("palettes-action", "_New Palette"), NULL,
NC_("palettes-action", "Create a new palette"),
G_CALLBACK (data_new_cmd_callback),
data_new_cmd_callback,
GIMP_HELP_PALETTE_NEW },
{ "palettes-import", "gtk-convert",
NC_("palettes-action", "_Import Palette..."), NULL,
NC_("palettes-action", "Import palette"),
G_CALLBACK (palettes_import_cmd_callback),
palettes_import_cmd_callback,
GIMP_HELP_PALETTE_IMPORT },
{ "palettes-duplicate", GIMP_ICON_OBJECT_DUPLICATE,
NC_("palettes-action", "D_uplicate Palette"), NULL,
NC_("palettes-action", "Duplicate this palette"),
G_CALLBACK (data_duplicate_cmd_callback),
data_duplicate_cmd_callback,
GIMP_HELP_PALETTE_DUPLICATE },
{ "palettes-merge", NULL,
NC_("palettes-action", "_Merge Palettes..."), NULL,
NC_("palettes-action", "Merge palettes"),
G_CALLBACK (palettes_merge_cmd_callback),
palettes_merge_cmd_callback,
GIMP_HELP_PALETTE_MERGE },
{ "palettes-copy-location", GIMP_ICON_EDIT_COPY,
NC_("palettes-action", "Copy Palette _Location"), NULL,
NC_("palettes-action", "Copy palette file location to clipboard"),
G_CALLBACK (data_copy_location_cmd_callback),
data_copy_location_cmd_callback,
GIMP_HELP_PALETTE_COPY_LOCATION },
{ "palettes-show-in-file-manager", GIMP_ICON_FILE_MANAGER,
NC_("palettes-action", "Show in _File Manager"), NULL,
NC_("palettes-action", "Show palette file location in the file manager"),
G_CALLBACK (data_show_in_file_manager_cmd_callback),
data_show_in_file_manager_cmd_callback,
GIMP_HELP_PALETTE_SHOW_IN_FILE_MANAGER },
{ "palettes-delete", GIMP_ICON_EDIT_DELETE,
NC_("palettes-action", "_Delete Palette"), NULL,
NC_("palettes-action", "Delete this palette"),
G_CALLBACK (data_delete_cmd_callback),
data_delete_cmd_callback,
GIMP_HELP_PALETTE_DELETE },
{ "palettes-refresh", GIMP_ICON_VIEW_REFRESH,
NC_("palettes-action", "_Refresh Palettes"), NULL,
NC_("palettes-action", "Refresh palettes"),
G_CALLBACK (data_refresh_cmd_callback),
data_refresh_cmd_callback,
GIMP_HELP_PALETTE_REFRESH }
};
@ -113,7 +113,7 @@ palettes_actions_setup (GimpActionGroup *group)
gimp_action_group_add_string_actions (group, "palettes-action",
palettes_edit_actions,
G_N_ELEMENTS (palettes_edit_actions),
G_CALLBACK (data_edit_cmd_callback));
data_edit_cmd_callback);
}
void

View file

@ -55,6 +55,7 @@ static void palettes_merge_callback (GtkWidget *widget,
void
palettes_import_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GtkWidget *widget;
@ -69,6 +70,7 @@ palettes_import_cmd_callback (GimpAction *action,
void
palettes_merge_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);

View file

@ -20,8 +20,10 @@
void palettes_import_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void palettes_merge_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);

View file

@ -46,43 +46,43 @@ static const GimpActionEntry patterns_actions[] =
{ "patterns-open-as-image", GIMP_ICON_DOCUMENT_OPEN,
NC_("patterns-action", "_Open Pattern as Image"), NULL,
NC_("patterns-action", "Open this pattern as an image"),
G_CALLBACK (data_open_as_image_cmd_callback),
data_open_as_image_cmd_callback,
GIMP_HELP_PATTERN_OPEN_AS_IMAGE },
{ "patterns-new", GIMP_ICON_DOCUMENT_NEW,
NC_("patterns-action", "_New Pattern"), NULL,
NC_("patterns-action", "Create a new pattern"),
G_CALLBACK (data_new_cmd_callback),
data_new_cmd_callback,
GIMP_HELP_PATTERN_NEW },
{ "patterns-duplicate", GIMP_ICON_OBJECT_DUPLICATE,
NC_("patterns-action", "D_uplicate Pattern"), NULL,
NC_("patterns-action", "Duplicate this pattern"),
G_CALLBACK (data_duplicate_cmd_callback),
data_duplicate_cmd_callback,
GIMP_HELP_PATTERN_DUPLICATE },
{ "patterns-copy-location", GIMP_ICON_EDIT_COPY,
NC_("patterns-action", "Copy Pattern _Location"), NULL,
NC_("patterns-action", "Copy pattern file location to clipboard"),
G_CALLBACK (data_copy_location_cmd_callback),
data_copy_location_cmd_callback,
GIMP_HELP_PATTERN_COPY_LOCATION },
{ "patterns-show-in-file-manager", GIMP_ICON_FILE_MANAGER,
NC_("patterns-action", "Show in _File Manager"), NULL,
NC_("patterns-action", "Show pattern file location in the file manager"),
G_CALLBACK (data_show_in_file_manager_cmd_callback),
data_show_in_file_manager_cmd_callback,
GIMP_HELP_PATTERN_SHOW_IN_FILE_MANAGER },
{ "patterns-delete", GIMP_ICON_EDIT_DELETE,
NC_("patterns-action", "_Delete Pattern"), NULL,
NC_("patterns-action", "Delete this pattern"),
G_CALLBACK (data_delete_cmd_callback),
data_delete_cmd_callback,
GIMP_HELP_PATTERN_DELETE },
{ "patterns-refresh", GIMP_ICON_VIEW_REFRESH,
NC_("patterns-action", "_Refresh Patterns"), NULL,
NC_("patterns-action", "Refresh patterns"),
G_CALLBACK (data_refresh_cmd_callback),
data_refresh_cmd_callback,
GIMP_HELP_PATTERN_REFRESH }
};
@ -106,7 +106,7 @@ patterns_actions_setup (GimpActionGroup *group)
gimp_action_group_add_string_actions (group, "patterns-action",
patterns_edit_actions,
G_N_ELEMENTS (patterns_edit_actions),
G_CALLBACK (data_edit_cmd_callback));
data_edit_cmd_callback);
}
void

View file

@ -83,7 +83,7 @@ static const GimpActionEntry plug_in_actions[] =
{ "plug-in-reset-all", GIMP_ICON_RESET,
NC_("plug-in-action", "Reset all _Filters"), NULL,
NC_("plug-in-action", "Reset all plug-ins to their default settings"),
G_CALLBACK (plug_in_reset_all_cmd_callback),
plug_in_reset_all_cmd_callback,
GIMP_HELP_FILTER_RESET_ALL }
};
@ -313,7 +313,7 @@ plug_in_actions_add_proc (GimpActionGroup *group,
entry.help_id = gimp_procedure_get_help_id (GIMP_PROCEDURE (proc));
gimp_action_group_add_procedure_actions (group, &entry, 1,
G_CALLBACK (plug_in_run_cmd_callback));
plug_in_run_cmd_callback);
for (list = proc->menu_paths; list; list = g_list_next (list))
{

View file

@ -68,14 +68,20 @@ static void plug_in_reset_all_response (GtkWidget *dialog,
void
plug_in_run_cmd_callback (GimpAction *action,
GimpProcedure *procedure,
GVariant *value,
gpointer data)
{
Gimp *gimp;
GimpValueArray *args = NULL;
GimpDisplay *display = NULL;
GimpProcedure *procedure;
gsize hack;
return_if_no_gimp (gimp, data);
hack = g_variant_get_uint64 (value);
procedure = GSIZE_TO_POINTER (hack);
switch (procedure->proc_type)
{
case GIMP_EXTENSION:
@ -158,6 +164,7 @@ plug_in_run_cmd_callback (GimpAction *action,
void
plug_in_reset_all_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
Gimp *gimp;

View file

@ -20,10 +20,11 @@
void plug_in_run_cmd_callback (GimpAction *action,
GimpProcedure *proc,
GVariant *value,
gpointer data);
void plug_in_reset_all_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);

View file

@ -45,7 +45,7 @@ static const GimpActionEntry quick_mask_actions[] =
{ "quick-mask-configure", NULL,
NC_("quick-mask-action", "_Configure Color and Opacity..."), NULL, NULL,
G_CALLBACK (quick_mask_configure_cmd_callback),
quick_mask_configure_cmd_callback,
GIMP_HELP_QUICK_MASK_EDIT }
};
@ -54,7 +54,7 @@ static const GimpToggleActionEntry quick_mask_toggle_actions[] =
{ "quick-mask-toggle", GIMP_ICON_QUICK_MASK_ON,
NC_("quick-mask-action", "Toggle _Quick Mask"), "<shift>Q",
NC_("quick-mask-action", "Toggle Quick Mask on/off"),
G_CALLBACK (quick_mask_toggle_cmd_callback),
quick_mask_toggle_cmd_callback,
FALSE,
GIMP_HELP_QUICK_MASK_TOGGLE }
};
@ -89,7 +89,7 @@ quick_mask_actions_setup (GimpActionGroup *group)
G_N_ELEMENTS (quick_mask_invert_actions),
NULL,
FALSE,
G_CALLBACK (quick_mask_invert_cmd_callback));
quick_mask_invert_cmd_callback);
}
void

View file

@ -31,8 +31,6 @@
#include "core/gimpimage-quick-mask.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpradioaction.h"
#include "widgets/gimptoggleaction.h"
#include "dialogs/dialogs.h"
#include "dialogs/channel-options-dialog.h"
@ -68,13 +66,14 @@ static void quick_mask_configure_callback (GtkWidget *dialog,
void
quick_mask_toggle_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
gboolean active;
return_if_no_image (image, data);
active = gimp_toggle_action_get_active (GIMP_TOGGLE_ACTION (action));
active = g_variant_get_boolean (value);
if (active != gimp_image_get_quick_mask_state (image))
{
@ -85,16 +84,16 @@ quick_mask_toggle_cmd_callback (GimpAction *action,
void
quick_mask_invert_cmd_callback (GimpAction *action,
GimpAction *current,
GVariant *value,
gpointer data)
{
GimpImage *image;
gint value;
gboolean inverted;
return_if_no_image (image, data);
value = gimp_radio_action_get_current_value (GIMP_RADIO_ACTION (action));
inverted = (gboolean) g_variant_get_int32 (value);
if (value != gimp_image_get_quick_mask_inverted (image))
if (inverted != gimp_image_get_quick_mask_inverted (image))
{
gimp_image_quick_mask_invert (image);
gimp_image_flush (image);
@ -103,6 +102,7 @@ quick_mask_invert_cmd_callback (GimpAction *action,
void
quick_mask_configure_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;

View file

@ -20,11 +20,13 @@
void quick_mask_toggle_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void quick_mask_invert_cmd_callback (GimpAction *action,
GimpAction *current,
GVariant *value,
gpointer data);
void quick_mask_configure_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);

View file

@ -47,7 +47,7 @@ static const GimpToggleActionEntry sample_points_toggle_actions[] =
NC_("sample-points-action", "_Sample Merged"), "",
NC_("sample-points-action",
"Use the composite color of all visible layers"),
G_CALLBACK (sample_points_sample_merged_cmd_callback),
sample_points_sample_merged_cmd_callback,
TRUE,
GIMP_HELP_SAMPLE_POINT_SAMPLE_MERGED }
};

View file

@ -23,7 +23,6 @@
#include "actions-types.h"
#include "widgets/gimpsamplepointeditor.h"
#include "widgets/gimptoggleaction.h"
#include "sample-points-commands.h"
@ -32,12 +31,11 @@
void
sample_points_sample_merged_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpSamplePointEditor *editor = GIMP_SAMPLE_POINT_EDITOR (data);
gboolean active;
active = gimp_toggle_action_get_active (GIMP_TOGGLE_ACTION (action));
gboolean active = g_variant_get_boolean (value);
gimp_sample_point_editor_set_sample_merged (editor, active);
}

View file

@ -20,6 +20,7 @@
void sample_points_sample_merged_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);

View file

@ -49,92 +49,92 @@ static const GimpActionEntry select_actions[] =
{ "select-all", GIMP_ICON_SELECTION_ALL,
NC_("select-action", "_All"), "<primary>A",
NC_("select-action", "Select everything"),
G_CALLBACK (select_all_cmd_callback),
select_all_cmd_callback,
GIMP_HELP_SELECTION_ALL },
{ "select-none", GIMP_ICON_SELECTION_NONE,
NC_("select-action", "_None"), "<primary><shift>A",
NC_("select-action", "Dismiss the selection"),
G_CALLBACK (select_none_cmd_callback),
select_none_cmd_callback,
GIMP_HELP_SELECTION_NONE },
{ "select-invert", GIMP_ICON_INVERT,
NC_("select-action", "_Invert"), "<primary>I",
NC_("select-action", "Invert the selection"),
G_CALLBACK (select_invert_cmd_callback),
select_invert_cmd_callback,
GIMP_HELP_SELECTION_INVERT },
{ "select-float", GIMP_ICON_LAYER_FLOATING_SELECTION,
NC_("select-action", "_Float"), "<primary><shift>L",
NC_("select-action", "Create a floating selection"),
G_CALLBACK (select_float_cmd_callback),
select_float_cmd_callback,
GIMP_HELP_SELECTION_FLOAT },
{ "select-feather", NULL,
NC_("select-action", "Fea_ther..."), NULL,
NC_("select-action",
"Blur the selection border so that it fades out smoothly"),
G_CALLBACK (select_feather_cmd_callback),
select_feather_cmd_callback,
GIMP_HELP_SELECTION_FEATHER },
{ "select-sharpen", NULL,
NC_("select-action", "_Sharpen"), NULL,
NC_("select-action", "Remove fuzziness from the selection"),
G_CALLBACK (select_sharpen_cmd_callback),
select_sharpen_cmd_callback,
GIMP_HELP_SELECTION_SHARPEN },
{ "select-shrink", GIMP_ICON_SELECTION_SHRINK,
NC_("select-action", "S_hrink..."), NULL,
NC_("select-action", "Contract the selection"),
G_CALLBACK (select_shrink_cmd_callback),
select_shrink_cmd_callback,
GIMP_HELP_SELECTION_SHRINK },
{ "select-grow", GIMP_ICON_SELECTION_GROW,
NC_("select-action", "_Grow..."), NULL,
NC_("select-action", "Enlarge the selection"),
G_CALLBACK (select_grow_cmd_callback),
select_grow_cmd_callback,
GIMP_HELP_SELECTION_GROW },
{ "select-border", GIMP_ICON_SELECTION_BORDER,
NC_("select-action", "Bo_rder..."), NULL,
NC_("select-action", "Replace the selection by its border"),
G_CALLBACK (select_border_cmd_callback),
select_border_cmd_callback,
GIMP_HELP_SELECTION_BORDER },
{ "select-flood", NULL,
NC_("select-action", "Re_move Holes"), NULL,
NC_("select-action", "Remove holes from the selection"),
G_CALLBACK (select_flood_cmd_callback),
select_flood_cmd_callback,
GIMP_HELP_SELECTION_FLOOD },
{ "select-save", GIMP_ICON_SELECTION_TO_CHANNEL,
NC_("select-action", "Save to _Channel"), NULL,
NC_("select-action", "Save the selection to a channel"),
G_CALLBACK (select_save_cmd_callback),
select_save_cmd_callback,
GIMP_HELP_SELECTION_TO_CHANNEL },
{ "select-fill", GIMP_ICON_TOOL_BUCKET_FILL,
NC_("select-action", "_Fill Selection Outline..."), NULL,
NC_("select-action", "Fill the selection outline"),
G_CALLBACK (select_fill_cmd_callback),
select_fill_cmd_callback,
GIMP_HELP_SELECTION_FILL },
{ "select-fill-last-values", GIMP_ICON_TOOL_BUCKET_FILL,
NC_("select-action", "_Fill Selection Outline"), NULL,
NC_("select-action", "Fill the selection outline with last used values"),
G_CALLBACK (select_fill_last_vals_cmd_callback),
select_fill_last_vals_cmd_callback,
GIMP_HELP_SELECTION_FILL },
{ "select-stroke", GIMP_ICON_SELECTION_STROKE,
NC_("select-action", "_Stroke Selection..."), NULL,
NC_("select-action", "Paint along the selection outline"),
G_CALLBACK (select_stroke_cmd_callback),
select_stroke_cmd_callback,
GIMP_HELP_SELECTION_STROKE },
{ "select-stroke-last-values", GIMP_ICON_SELECTION_STROKE,
NC_("select-action", "_Stroke Selection"), NULL,
NC_("select-action", "Stroke the selection with last used values"),
G_CALLBACK (select_stroke_last_vals_cmd_callback),
select_stroke_last_vals_cmd_callback,
GIMP_HELP_SELECTION_STROKE }
};

View file

@ -73,6 +73,7 @@ static void select_shrink_callback (GtkWidget *widget,
void
select_all_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -84,6 +85,7 @@ select_all_cmd_callback (GimpAction *action,
void
select_none_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -95,6 +97,7 @@ select_none_cmd_callback (GimpAction *action,
void
select_invert_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -106,6 +109,7 @@ select_invert_cmd_callback (GimpAction *action,
void
select_float_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -132,6 +136,7 @@ select_float_cmd_callback (GimpAction *action,
void
select_feather_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpDisplay *display;
@ -187,6 +192,7 @@ select_feather_cmd_callback (GimpAction *action,
void
select_sharpen_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -198,6 +204,7 @@ select_sharpen_cmd_callback (GimpAction *action,
void
select_shrink_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpDisplay *display;
@ -261,6 +268,7 @@ select_shrink_cmd_callback (GimpAction *action,
void
select_grow_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpDisplay *display;
@ -310,6 +318,7 @@ select_grow_cmd_callback (GimpAction *action,
void
select_border_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpDisplay *display;
@ -387,6 +396,7 @@ select_border_cmd_callback (GimpAction *action,
void
select_flood_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -398,6 +408,7 @@ select_flood_cmd_callback (GimpAction *action,
void
select_save_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -425,6 +436,7 @@ select_save_cmd_callback (GimpAction *action,
void
select_fill_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -441,6 +453,7 @@ select_fill_cmd_callback (GimpAction *action,
void
select_fill_last_vals_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -454,6 +467,7 @@ select_fill_last_vals_cmd_callback (GimpAction *action,
void
select_stroke_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
@ -470,6 +484,7 @@ select_stroke_cmd_callback (GimpAction *action,
void
select_stroke_last_vals_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;

View file

@ -20,35 +20,50 @@
void select_all_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void select_none_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void select_invert_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void select_float_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void select_feather_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void select_sharpen_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void select_shrink_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void select_grow_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void select_border_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void select_flood_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void select_save_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void select_fill_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void select_fill_last_vals_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void select_stroke_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void select_stroke_last_vals_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);

View file

@ -45,31 +45,31 @@ static const GimpActionEntry templates_actions[] =
{ "templates-create-image", GIMP_ICON_IMAGE,
NC_("templates-action", "_Create Image from Template"), "",
NC_("templates-action", "Create a new image from the selected template"),
G_CALLBACK (templates_create_image_cmd_callback),
templates_create_image_cmd_callback,
GIMP_HELP_TEMPLATE_IMAGE_NEW },
{ "templates-new", GIMP_ICON_DOCUMENT_NEW,
NC_("templates-action", "_New Template..."), NULL,
NC_("templates-action", "Create a new template"),
G_CALLBACK (templates_new_cmd_callback),
templates_new_cmd_callback,
GIMP_HELP_TEMPLATE_NEW },
{ "templates-duplicate", GIMP_ICON_OBJECT_DUPLICATE,
NC_("templates-action", "D_uplicate Template..."), "",
NC_("templates-action", "Duplicate this template"),
G_CALLBACK (templates_duplicate_cmd_callback),
templates_duplicate_cmd_callback,
GIMP_HELP_TEMPLATE_DUPLICATE },
{ "templates-edit", GIMP_ICON_EDIT,
NC_("templates-action", "_Edit Template..."), NULL,
NC_("templates-action", "Edit this template"),
G_CALLBACK (templates_edit_cmd_callback),
templates_edit_cmd_callback,
GIMP_HELP_TEMPLATE_EDIT },
{ "templates-delete", GIMP_ICON_EDIT_DELETE,
NC_("templates-action", "_Delete Template"), NULL,
NC_("templates-action", "Delete this template"),
G_CALLBACK (templates_delete_cmd_callback),
templates_delete_cmd_callback,
GIMP_HELP_TEMPLATE_DELETE }
};

View file

@ -81,6 +81,7 @@ static void templates_delete_data_free (TemplateDeleteData *delete_data);
void
templates_create_image_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
Gimp *gimp;
@ -111,6 +112,7 @@ templates_create_image_cmd_callback (GimpAction *action,
void
templates_new_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
@ -143,6 +145,7 @@ templates_new_cmd_callback (GimpAction *action,
void
templates_duplicate_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
@ -167,12 +170,13 @@ templates_duplicate_cmd_callback (GimpAction *action,
GIMP_OBJECT (new_template));
g_object_unref (new_template);
templates_edit_cmd_callback (action, data);
templates_edit_cmd_callback (action, value, data);
}
}
void
templates_edit_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
@ -214,6 +218,7 @@ templates_edit_cmd_callback (GimpAction *action,
void
templates_delete_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);

View file

@ -20,14 +20,19 @@
void templates_create_image_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void templates_new_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void templates_duplicate_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void templates_edit_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void templates_delete_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);

Some files were not shown because too many files have changed in this diff Show more