mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-04 09:53:25 +00:00
added GimpContext parameters to GimpActivateItemFunc, GimpNewItemFunc and
2004-05-25 Michael Natterer <mitch@gimp.org> * app/widgets/gimpitemtreeview.h: added GimpContext parameters to GimpActivateItemFunc, GimpNewItemFunc and GimpEditItemFunc. * app/widgets/gimpdrawabletreeview.c * app/widgets/gimpitemtreeview.c: pass the view's context to the functions. * app/actions/actions.c (action_data_get_context): return gimp_get_user_context() if "data" is a Gimp. * app/actions/channels-commands.[ch] * app/actions/layers-commands.[ch] * app/actions/vectors-commands.[ch]: added GimpContext parameters to the resp. activate, new and edit functions and use the passed context instead of gimp_get_user_context(). * app/actions/layers-commands.[ch]: removed the merge and flatten callbacks. * app/actions/image-commands.[ch]: made public layer merge utility function private and cleaned the whole file up a lot. * app/actions/layers-actions.c: use the callbacks from image-commands.c for merge and flatten. * app/actions/edit-commands.c * app/actions/file-commands.c * app/actions/select-commands.c: use action_data_get_context() instead of gimp_get_user_context(). * app/actions/edit-actions.c: some cleanup.
This commit is contained in:
parent
f39cbb8483
commit
18d2d499b5
18 changed files with 718 additions and 756 deletions
34
ChangeLog
34
ChangeLog
|
@ -1,3 +1,37 @@
|
||||||
|
2004-05-25 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
|
* app/widgets/gimpitemtreeview.h: added GimpContext parameters
|
||||||
|
to GimpActivateItemFunc, GimpNewItemFunc and GimpEditItemFunc.
|
||||||
|
|
||||||
|
* app/widgets/gimpdrawabletreeview.c
|
||||||
|
* app/widgets/gimpitemtreeview.c: pass the view's context to
|
||||||
|
the functions.
|
||||||
|
|
||||||
|
* app/actions/actions.c (action_data_get_context): return
|
||||||
|
gimp_get_user_context() if "data" is a Gimp.
|
||||||
|
|
||||||
|
* app/actions/channels-commands.[ch]
|
||||||
|
* app/actions/layers-commands.[ch]
|
||||||
|
* app/actions/vectors-commands.[ch]: added GimpContext parameters
|
||||||
|
to the resp. activate, new and edit functions and use the passed
|
||||||
|
context instead of gimp_get_user_context().
|
||||||
|
|
||||||
|
* app/actions/layers-commands.[ch]: removed the merge and flatten
|
||||||
|
callbacks.
|
||||||
|
|
||||||
|
* app/actions/image-commands.[ch]: made public layer merge utility
|
||||||
|
function private and cleaned the whole file up a lot.
|
||||||
|
|
||||||
|
* app/actions/layers-actions.c: use the callbacks from
|
||||||
|
image-commands.c for merge and flatten.
|
||||||
|
|
||||||
|
* app/actions/edit-commands.c
|
||||||
|
* app/actions/file-commands.c
|
||||||
|
* app/actions/select-commands.c: use action_data_get_context()
|
||||||
|
instead of gimp_get_user_context().
|
||||||
|
|
||||||
|
* app/actions/edit-actions.c: some cleanup.
|
||||||
|
|
||||||
2004-05-25 Sven Neumann <sven@gimp.org>
|
2004-05-25 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
* plug-ins/common/plugindetails.c
|
* plug-ins/common/plugindetails.c
|
||||||
|
|
|
@ -255,6 +255,8 @@ action_data_get_context (gpointer data)
|
||||||
return gimp_container_view_get_context (((GimpContainerEditor *) data)->view);
|
return gimp_container_view_get_context (((GimpContainerEditor *) data)->view);
|
||||||
else if (GIMP_IS_IMAGE_EDITOR (data))
|
else if (GIMP_IS_IMAGE_EDITOR (data))
|
||||||
return ((GimpImageEditor *) data)->context;
|
return ((GimpImageEditor *) data)->context;
|
||||||
|
else if (GIMP_IS_GIMP (data))
|
||||||
|
return gimp_get_user_context (data);
|
||||||
else if (GIMP_IS_DOCK (data))
|
else if (GIMP_IS_DOCK (data))
|
||||||
return ((GimpDock *) data)->context;
|
return ((GimpDock *) data)->context;
|
||||||
|
|
||||||
|
|
|
@ -27,9 +27,9 @@
|
||||||
|
|
||||||
#include "actions-types.h"
|
#include "actions-types.h"
|
||||||
|
|
||||||
#include "core/gimp.h"
|
|
||||||
#include "core/gimpchannel.h"
|
#include "core/gimpchannel.h"
|
||||||
#include "core/gimpchannel-select.h"
|
#include "core/gimpchannel-select.h"
|
||||||
|
#include "core/gimpcontext.h"
|
||||||
#include "core/gimpimage.h"
|
#include "core/gimpimage.h"
|
||||||
#include "core/gimpimage-undo.h"
|
#include "core/gimpimage-undo.h"
|
||||||
|
|
||||||
|
@ -55,6 +55,20 @@ static void channels_color_changed (GimpColorButton *button,
|
||||||
|
|
||||||
/* public functions */
|
/* public functions */
|
||||||
|
|
||||||
|
void
|
||||||
|
channels_edit_attributes_cmd_callback (GtkAction *action,
|
||||||
|
gpointer data)
|
||||||
|
{
|
||||||
|
GimpImage *gimage;
|
||||||
|
GimpChannel *channel;
|
||||||
|
GtkWidget *widget;
|
||||||
|
return_if_no_channel (gimage, channel, data);
|
||||||
|
return_if_no_widget (widget, data);
|
||||||
|
|
||||||
|
channels_edit_channel_query (channel, action_data_get_context (data),
|
||||||
|
widget);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
channels_new_cmd_callback (GtkAction *action,
|
channels_new_cmd_callback (GtkAction *action,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
|
@ -64,7 +78,8 @@ channels_new_cmd_callback (GtkAction *action,
|
||||||
return_if_no_image (gimage, data);
|
return_if_no_image (gimage, data);
|
||||||
return_if_no_widget (widget, data);
|
return_if_no_widget (widget, data);
|
||||||
|
|
||||||
channels_new_channel_query (gimage, NULL, TRUE, widget);
|
channels_new_channel_query (gimage, action_data_get_context (data),
|
||||||
|
NULL, TRUE, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -72,10 +87,10 @@ channels_raise_cmd_callback (GtkAction *action,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpImage *gimage;
|
GimpImage *gimage;
|
||||||
GimpChannel *active_channel;
|
GimpChannel *channel;
|
||||||
return_if_no_channel (gimage, active_channel, data);
|
return_if_no_channel (gimage, channel, data);
|
||||||
|
|
||||||
gimp_image_raise_channel (gimage, active_channel);
|
gimp_image_raise_channel (gimage, channel);
|
||||||
gimp_image_flush (gimage);
|
gimp_image_flush (gimage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,10 +99,10 @@ channels_raise_to_top_cmd_callback (GtkAction *action,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpImage *gimage;
|
GimpImage *gimage;
|
||||||
GimpChannel *active_channel;
|
GimpChannel *channel;
|
||||||
return_if_no_channel (gimage, active_channel, data);
|
return_if_no_channel (gimage, channel, data);
|
||||||
|
|
||||||
gimp_image_raise_channel_to_top (gimage, active_channel);
|
gimp_image_raise_channel_to_top (gimage, channel);
|
||||||
gimp_image_flush (gimage);
|
gimp_image_flush (gimage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,10 +111,10 @@ channels_lower_cmd_callback (GtkAction *action,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpImage *gimage;
|
GimpImage *gimage;
|
||||||
GimpChannel *active_channel;
|
GimpChannel *channel;
|
||||||
return_if_no_channel (gimage, active_channel, data);
|
return_if_no_channel (gimage, channel, data);
|
||||||
|
|
||||||
gimp_image_lower_channel (gimage, active_channel);
|
gimp_image_lower_channel (gimage, channel);
|
||||||
gimp_image_flush (gimage);
|
gimp_image_flush (gimage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,10 +123,10 @@ channels_lower_to_bottom_cmd_callback (GtkAction *action,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpImage *gimage;
|
GimpImage *gimage;
|
||||||
GimpChannel *active_channel;
|
GimpChannel *channel;
|
||||||
return_if_no_channel (gimage, active_channel, data);
|
return_if_no_channel (gimage, channel, data);
|
||||||
|
|
||||||
gimp_image_lower_channel_to_bottom (gimage, active_channel);
|
gimp_image_lower_channel_to_bottom (gimage, channel);
|
||||||
gimp_image_flush (gimage);
|
gimp_image_flush (gimage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -154,12 +169,12 @@ channels_duplicate_cmd_callback (GtkAction *action,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GimpChannel *active_channel;
|
GimpChannel *channel;
|
||||||
return_if_no_channel (gimage, active_channel, data);
|
return_if_no_channel (gimage, channel, data);
|
||||||
|
|
||||||
new_channel =
|
new_channel =
|
||||||
GIMP_CHANNEL (gimp_item_duplicate (GIMP_ITEM (active_channel),
|
GIMP_CHANNEL (gimp_item_duplicate (GIMP_ITEM (channel),
|
||||||
G_TYPE_FROM_INSTANCE (active_channel),
|
G_TYPE_FROM_INSTANCE (channel),
|
||||||
TRUE));
|
TRUE));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -172,10 +187,10 @@ channels_delete_cmd_callback (GtkAction *action,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpImage *gimage;
|
GimpImage *gimage;
|
||||||
GimpChannel *active_channel;
|
GimpChannel *channel;
|
||||||
return_if_no_channel (gimage, active_channel, data);
|
return_if_no_channel (gimage, channel, data);
|
||||||
|
|
||||||
gimp_image_remove_channel (gimage, active_channel);
|
gimp_image_remove_channel (gimage, channel);
|
||||||
gimp_image_flush (gimage);
|
gimp_image_flush (gimage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -213,19 +228,6 @@ channels_to_selection_cmd_callback (GtkAction *action,
|
||||||
gimp_image_flush (gimage);
|
gimp_image_flush (gimage);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
channels_edit_attributes_cmd_callback (GtkAction *action,
|
|
||||||
gpointer data)
|
|
||||||
{
|
|
||||||
GimpImage *gimage;
|
|
||||||
GimpChannel *active_channel;
|
|
||||||
GtkWidget *widget;
|
|
||||||
return_if_no_channel (gimage, active_channel, data);
|
|
||||||
return_if_no_widget (widget, data);
|
|
||||||
|
|
||||||
channels_edit_channel_query (active_channel, widget);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**********************************/
|
/**********************************/
|
||||||
/* The new channel query dialog */
|
/* The new channel query dialog */
|
||||||
|
@ -235,11 +237,12 @@ typedef struct _NewChannelOptions NewChannelOptions;
|
||||||
|
|
||||||
struct _NewChannelOptions
|
struct _NewChannelOptions
|
||||||
{
|
{
|
||||||
GtkWidget *query_box;
|
GtkWidget *query_box;
|
||||||
GtkWidget *name_entry;
|
GtkWidget *name_entry;
|
||||||
GtkWidget *color_panel;
|
GtkWidget *color_panel;
|
||||||
|
|
||||||
GimpImage *gimage;
|
GimpContext *context;
|
||||||
|
GimpImage *gimage;
|
||||||
};
|
};
|
||||||
|
|
||||||
static gchar *channel_name = NULL;
|
static gchar *channel_name = NULL;
|
||||||
|
@ -254,28 +257,27 @@ new_channel_query_response (GtkWidget *widget,
|
||||||
if (response_id == GTK_RESPONSE_OK)
|
if (response_id == GTK_RESPONSE_OK)
|
||||||
{
|
{
|
||||||
GimpChannel *new_channel;
|
GimpChannel *new_channel;
|
||||||
GimpImage *gimage;
|
|
||||||
|
|
||||||
if (channel_name)
|
if (channel_name)
|
||||||
g_free (channel_name);
|
g_free (channel_name);
|
||||||
channel_name =
|
channel_name =
|
||||||
g_strdup (gtk_entry_get_text (GTK_ENTRY (options->name_entry)));
|
g_strdup (gtk_entry_get_text (GTK_ENTRY (options->name_entry)));
|
||||||
|
|
||||||
if ((gimage = options->gimage))
|
gimp_color_button_get_color (GIMP_COLOR_BUTTON (options->color_panel),
|
||||||
{
|
&channel_color);
|
||||||
gimp_color_button_get_color (GIMP_COLOR_BUTTON (options->color_panel),
|
|
||||||
&channel_color);
|
|
||||||
new_channel = gimp_channel_new (gimage, gimage->width, gimage->height,
|
|
||||||
channel_name,
|
|
||||||
&channel_color);
|
|
||||||
|
|
||||||
gimp_drawable_fill_by_type (GIMP_DRAWABLE (new_channel),
|
new_channel = gimp_channel_new (options->gimage,
|
||||||
gimp_get_user_context (gimage->gimp),
|
options->gimage->width,
|
||||||
GIMP_TRANSPARENT_FILL);
|
options->gimage->height,
|
||||||
|
channel_name,
|
||||||
|
&channel_color);
|
||||||
|
|
||||||
gimp_image_add_channel (gimage, new_channel, -1);
|
gimp_drawable_fill_by_type (GIMP_DRAWABLE (new_channel),
|
||||||
gimp_image_flush (gimage);
|
options->context,
|
||||||
}
|
GIMP_TRANSPARENT_FILL);
|
||||||
|
|
||||||
|
gimp_image_add_channel (options->gimage, new_channel, -1);
|
||||||
|
gimp_image_flush (options->gimage);
|
||||||
}
|
}
|
||||||
|
|
||||||
gtk_widget_destroy (options->query_box);
|
gtk_widget_destroy (options->query_box);
|
||||||
|
@ -283,6 +285,7 @@ new_channel_query_response (GtkWidget *widget,
|
||||||
|
|
||||||
void
|
void
|
||||||
channels_new_channel_query (GimpImage *gimage,
|
channels_new_channel_query (GimpImage *gimage,
|
||||||
|
GimpContext *context,
|
||||||
GimpChannel *template,
|
GimpChannel *template,
|
||||||
gboolean interactive,
|
gboolean interactive,
|
||||||
GtkWidget *parent)
|
GtkWidget *parent)
|
||||||
|
@ -294,6 +297,7 @@ channels_new_channel_query (GimpImage *gimage,
|
||||||
GtkObject *opacity_scale_data;
|
GtkObject *opacity_scale_data;
|
||||||
|
|
||||||
g_return_if_fail (GIMP_IS_IMAGE (gimage));
|
g_return_if_fail (GIMP_IS_IMAGE (gimage));
|
||||||
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
||||||
g_return_if_fail (! template || GIMP_IS_CHANNEL (template));
|
g_return_if_fail (! template || GIMP_IS_CHANNEL (template));
|
||||||
|
|
||||||
if (template || ! interactive)
|
if (template || ! interactive)
|
||||||
|
@ -318,13 +322,10 @@ channels_new_channel_query (GimpImage *gimage,
|
||||||
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_EDIT_PASTE,
|
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_EDIT_PASTE,
|
||||||
_("New Channel"));
|
_("New Channel"));
|
||||||
|
|
||||||
new_channel = gimp_channel_new (gimage,
|
new_channel = gimp_channel_new (gimage, width, height,
|
||||||
width, height,
|
_("Empty Channel"), &color);
|
||||||
_("Empty Channel"),
|
|
||||||
&color);
|
|
||||||
|
|
||||||
gimp_drawable_fill_by_type (GIMP_DRAWABLE (new_channel),
|
gimp_drawable_fill_by_type (GIMP_DRAWABLE (new_channel), context,
|
||||||
gimp_get_user_context (gimage->gimp),
|
|
||||||
GIMP_TRANSPARENT_FILL);
|
GIMP_TRANSPARENT_FILL);
|
||||||
|
|
||||||
gimp_image_add_channel (gimage, new_channel, -1);
|
gimp_image_add_channel (gimage, new_channel, -1);
|
||||||
|
@ -336,14 +337,14 @@ channels_new_channel_query (GimpImage *gimage,
|
||||||
/* the new options structure */
|
/* the new options structure */
|
||||||
options = g_new (NewChannelOptions, 1);
|
options = g_new (NewChannelOptions, 1);
|
||||||
options->gimage = gimage;
|
options->gimage = gimage;
|
||||||
|
options->context = context;
|
||||||
options->color_panel = gimp_color_panel_new (_("New Channel Color"),
|
options->color_panel = gimp_color_panel_new (_("New Channel Color"),
|
||||||
&channel_color,
|
&channel_color,
|
||||||
GIMP_COLOR_AREA_LARGE_CHECKS,
|
GIMP_COLOR_AREA_LARGE_CHECKS,
|
||||||
48, 64);
|
48, 64);
|
||||||
gimp_color_panel_set_context (GIMP_COLOR_PANEL (options->color_panel),
|
gimp_color_panel_set_context (GIMP_COLOR_PANEL (options->color_panel),
|
||||||
gimp_get_user_context (gimage->gimp));
|
context);
|
||||||
|
|
||||||
/* The dialog */
|
|
||||||
options->query_box =
|
options->query_box =
|
||||||
gimp_viewable_dialog_new (GIMP_VIEWABLE (gimage),
|
gimp_viewable_dialog_new (GIMP_VIEWABLE (gimage),
|
||||||
_("New Channel"), "gimp-channel-new",
|
_("New Channel"), "gimp-channel-new",
|
||||||
|
@ -366,23 +367,22 @@ channels_new_channel_query (GimpImage *gimage,
|
||||||
G_CALLBACK (new_channel_query_response),
|
G_CALLBACK (new_channel_query_response),
|
||||||
options);
|
options);
|
||||||
|
|
||||||
/* The main hbox */
|
|
||||||
hbox = gtk_hbox_new (FALSE, 6);
|
hbox = gtk_hbox_new (FALSE, 6);
|
||||||
gtk_container_set_border_width (GTK_CONTAINER (hbox), 12);
|
gtk_container_set_border_width (GTK_CONTAINER (hbox), 12);
|
||||||
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (options->query_box)->vbox),
|
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (options->query_box)->vbox),
|
||||||
hbox);
|
hbox);
|
||||||
|
gtk_widget_show (hbox);
|
||||||
|
|
||||||
/* The vbox */
|
|
||||||
vbox = gtk_vbox_new (FALSE, 2);
|
vbox = gtk_vbox_new (FALSE, 2);
|
||||||
gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
|
gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
|
||||||
|
gtk_widget_show (vbox);
|
||||||
|
|
||||||
/* The table */
|
|
||||||
table = gtk_table_new (2, 3, FALSE);
|
table = gtk_table_new (2, 3, FALSE);
|
||||||
gtk_table_set_col_spacings (GTK_TABLE (table), 2);
|
gtk_table_set_col_spacings (GTK_TABLE (table), 2);
|
||||||
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
|
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
|
||||||
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
|
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
|
||||||
|
gtk_widget_show (table);
|
||||||
|
|
||||||
/* The name entry */
|
|
||||||
options->name_entry = gtk_entry_new ();
|
options->name_entry = gtk_entry_new ();
|
||||||
gtk_entry_set_text (GTK_ENTRY (options->name_entry),
|
gtk_entry_set_text (GTK_ENTRY (options->name_entry),
|
||||||
(channel_name ? channel_name : _("New Channel")));
|
(channel_name ? channel_name : _("New Channel")));
|
||||||
|
@ -390,7 +390,6 @@ channels_new_channel_query (GimpImage *gimage,
|
||||||
_("Channel Name:"), 0.0, 0.5,
|
_("Channel Name:"), 0.0, 0.5,
|
||||||
options->name_entry, 2, FALSE);
|
options->name_entry, 2, FALSE);
|
||||||
|
|
||||||
/* The opacity scale */
|
|
||||||
opacity_scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
opacity_scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
||||||
_("Fill Opacity:"), 100, -1,
|
_("Fill Opacity:"), 100, -1,
|
||||||
channel_color.a * 100.0,
|
channel_color.a * 100.0,
|
||||||
|
@ -402,7 +401,6 @@ channels_new_channel_query (GimpImage *gimage,
|
||||||
G_CALLBACK (channels_opacity_update),
|
G_CALLBACK (channels_opacity_update),
|
||||||
options->color_panel);
|
options->color_panel);
|
||||||
|
|
||||||
/* The color panel */
|
|
||||||
gtk_box_pack_start (GTK_BOX (hbox), options->color_panel,
|
gtk_box_pack_start (GTK_BOX (hbox), options->color_panel,
|
||||||
TRUE, TRUE, 0);
|
TRUE, TRUE, 0);
|
||||||
gtk_widget_show (options->color_panel);
|
gtk_widget_show (options->color_panel);
|
||||||
|
@ -411,9 +409,6 @@ channels_new_channel_query (GimpImage *gimage,
|
||||||
G_CALLBACK (channels_color_changed),
|
G_CALLBACK (channels_color_changed),
|
||||||
opacity_scale_data);
|
opacity_scale_data);
|
||||||
|
|
||||||
gtk_widget_show (table);
|
|
||||||
gtk_widget_show (vbox);
|
|
||||||
gtk_widget_show (hbox);
|
|
||||||
gtk_widget_show (options->query_box);
|
gtk_widget_show (options->query_box);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -425,12 +420,12 @@ typedef struct _EditChannelOptions EditChannelOptions;
|
||||||
|
|
||||||
struct _EditChannelOptions
|
struct _EditChannelOptions
|
||||||
{
|
{
|
||||||
GtkWidget *query_box;
|
GtkWidget *query_box;
|
||||||
GtkWidget *name_entry;
|
GtkWidget *name_entry;
|
||||||
GtkWidget *color_panel;
|
GtkWidget *color_panel;
|
||||||
|
|
||||||
GimpChannel *channel;
|
GimpChannel *channel;
|
||||||
GimpImage *gimage;
|
GimpImage *gimage;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -441,42 +436,38 @@ edit_channel_query_response (GtkWidget *widget,
|
||||||
if (response_id == GTK_RESPONSE_OK)
|
if (response_id == GTK_RESPONSE_OK)
|
||||||
{
|
{
|
||||||
GimpChannel *channel = options->channel;
|
GimpChannel *channel = options->channel;
|
||||||
|
const gchar *new_name;
|
||||||
|
GimpRGB color;
|
||||||
|
gboolean name_changed = FALSE;
|
||||||
|
gboolean color_changed = FALSE;
|
||||||
|
|
||||||
if (options->gimage)
|
new_name = gtk_entry_get_text (GTK_ENTRY (options->name_entry));
|
||||||
{
|
|
||||||
const gchar *new_name;
|
|
||||||
GimpRGB color;
|
|
||||||
gboolean name_changed = FALSE;
|
|
||||||
gboolean color_changed = FALSE;
|
|
||||||
|
|
||||||
new_name = gtk_entry_get_text (GTK_ENTRY (options->name_entry));
|
gimp_color_button_get_color (GIMP_COLOR_BUTTON (options->color_panel),
|
||||||
|
&color);
|
||||||
|
|
||||||
gimp_color_button_get_color (GIMP_COLOR_BUTTON (options->color_panel),
|
if (strcmp (new_name, gimp_object_get_name (GIMP_OBJECT (channel))))
|
||||||
&color);
|
name_changed = TRUE;
|
||||||
|
|
||||||
if (strcmp (new_name, gimp_object_get_name (GIMP_OBJECT (channel))))
|
if (gimp_rgba_distance (&color, &channel->color) > 0.0001)
|
||||||
name_changed = TRUE;
|
color_changed = TRUE;
|
||||||
|
|
||||||
if (gimp_rgba_distance (&color, &channel->color) > 0.0001)
|
if (name_changed && color_changed)
|
||||||
color_changed = TRUE;
|
gimp_image_undo_group_start (options->gimage,
|
||||||
|
GIMP_UNDO_GROUP_ITEM_PROPERTIES,
|
||||||
|
_("Channel Attributes"));
|
||||||
|
|
||||||
if (name_changed && color_changed)
|
if (name_changed)
|
||||||
gimp_image_undo_group_start (options->gimage,
|
gimp_item_rename (GIMP_ITEM (channel), new_name);
|
||||||
GIMP_UNDO_GROUP_ITEM_PROPERTIES,
|
|
||||||
_("Channel Attributes"));
|
|
||||||
|
|
||||||
if (name_changed)
|
if (color_changed)
|
||||||
gimp_item_rename (GIMP_ITEM (channel), new_name);
|
gimp_channel_set_color (channel, &color, TRUE);
|
||||||
|
|
||||||
if (color_changed)
|
if (name_changed && color_changed)
|
||||||
gimp_channel_set_color (channel, &color, TRUE);
|
gimp_image_undo_group_end (options->gimage);
|
||||||
|
|
||||||
if (name_changed && color_changed)
|
if (name_changed || color_changed)
|
||||||
gimp_image_undo_group_end (options->gimage);
|
gimp_image_flush (options->gimage);
|
||||||
|
|
||||||
if (name_changed || color_changed)
|
|
||||||
gimp_image_flush (options->gimage);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gtk_widget_destroy (options->query_box);
|
gtk_widget_destroy (options->query_box);
|
||||||
|
@ -484,6 +475,7 @@ edit_channel_query_response (GtkWidget *widget,
|
||||||
|
|
||||||
void
|
void
|
||||||
channels_edit_channel_query (GimpChannel *channel,
|
channels_edit_channel_query (GimpChannel *channel,
|
||||||
|
GimpContext *context,
|
||||||
GtkWidget *parent)
|
GtkWidget *parent)
|
||||||
{
|
{
|
||||||
EditChannelOptions *options;
|
EditChannelOptions *options;
|
||||||
|
@ -492,6 +484,9 @@ channels_edit_channel_query (GimpChannel *channel,
|
||||||
GtkWidget *table;
|
GtkWidget *table;
|
||||||
GtkObject *opacity_scale_data;
|
GtkObject *opacity_scale_data;
|
||||||
|
|
||||||
|
g_return_if_fail (GIMP_IS_CHANNEL (channel));
|
||||||
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
||||||
|
|
||||||
options = g_new0 (EditChannelOptions, 1);
|
options = g_new0 (EditChannelOptions, 1);
|
||||||
|
|
||||||
options->channel = channel;
|
options->channel = channel;
|
||||||
|
@ -504,7 +499,7 @@ channels_edit_channel_query (GimpChannel *channel,
|
||||||
GIMP_COLOR_AREA_LARGE_CHECKS,
|
GIMP_COLOR_AREA_LARGE_CHECKS,
|
||||||
48, 64);
|
48, 64);
|
||||||
gimp_color_panel_set_context (GIMP_COLOR_PANEL (options->color_panel),
|
gimp_color_panel_set_context (GIMP_COLOR_PANEL (options->color_panel),
|
||||||
gimp_get_user_context (options->gimage->gimp));
|
context);
|
||||||
|
|
||||||
/* The dialog */
|
/* The dialog */
|
||||||
options->query_box =
|
options->query_box =
|
||||||
|
@ -529,23 +524,22 @@ channels_edit_channel_query (GimpChannel *channel,
|
||||||
G_CALLBACK (edit_channel_query_response),
|
G_CALLBACK (edit_channel_query_response),
|
||||||
options);
|
options);
|
||||||
|
|
||||||
/* The main hbox */
|
|
||||||
hbox = gtk_hbox_new (FALSE, 6);
|
hbox = gtk_hbox_new (FALSE, 6);
|
||||||
gtk_container_set_border_width (GTK_CONTAINER (hbox), 12);
|
gtk_container_set_border_width (GTK_CONTAINER (hbox), 12);
|
||||||
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (options->query_box)->vbox),
|
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (options->query_box)->vbox),
|
||||||
hbox);
|
hbox);
|
||||||
|
gtk_widget_show (hbox);
|
||||||
|
|
||||||
/* The vbox */
|
|
||||||
vbox = gtk_vbox_new (FALSE, 2);
|
vbox = gtk_vbox_new (FALSE, 2);
|
||||||
gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
|
gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
|
||||||
|
gtk_widget_show (vbox);
|
||||||
|
|
||||||
/* The table */
|
|
||||||
table = gtk_table_new (2, 3, FALSE);
|
table = gtk_table_new (2, 3, FALSE);
|
||||||
gtk_table_set_col_spacings (GTK_TABLE (table), 2);
|
gtk_table_set_col_spacings (GTK_TABLE (table), 2);
|
||||||
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
|
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
|
||||||
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
|
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
|
||||||
|
gtk_widget_show (table);
|
||||||
|
|
||||||
/* The name entry */
|
|
||||||
options->name_entry = gtk_entry_new ();
|
options->name_entry = gtk_entry_new ();
|
||||||
gtk_entry_set_text (GTK_ENTRY (options->name_entry),
|
gtk_entry_set_text (GTK_ENTRY (options->name_entry),
|
||||||
gimp_object_get_name (GIMP_OBJECT (channel)));
|
gimp_object_get_name (GIMP_OBJECT (channel)));
|
||||||
|
@ -553,7 +547,6 @@ channels_edit_channel_query (GimpChannel *channel,
|
||||||
_("Channel Name:"), 0.0, 0.5,
|
_("Channel Name:"), 0.0, 0.5,
|
||||||
options->name_entry, 2, FALSE);
|
options->name_entry, 2, FALSE);
|
||||||
|
|
||||||
/* The opacity scale */
|
|
||||||
opacity_scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
opacity_scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
||||||
_("Fill Opacity:"), 100, -1,
|
_("Fill Opacity:"), 100, -1,
|
||||||
channel_color.a * 100.0,
|
channel_color.a * 100.0,
|
||||||
|
@ -565,7 +558,6 @@ channels_edit_channel_query (GimpChannel *channel,
|
||||||
G_CALLBACK (channels_opacity_update),
|
G_CALLBACK (channels_opacity_update),
|
||||||
options->color_panel);
|
options->color_panel);
|
||||||
|
|
||||||
/* The color panel */
|
|
||||||
gtk_box_pack_start (GTK_BOX (hbox), options->color_panel,
|
gtk_box_pack_start (GTK_BOX (hbox), options->color_panel,
|
||||||
TRUE, TRUE, 0);
|
TRUE, TRUE, 0);
|
||||||
gtk_widget_show (options->color_panel);
|
gtk_widget_show (options->color_panel);
|
||||||
|
@ -574,9 +566,6 @@ channels_edit_channel_query (GimpChannel *channel,
|
||||||
G_CALLBACK (channels_color_changed),
|
G_CALLBACK (channels_color_changed),
|
||||||
opacity_scale_data);
|
opacity_scale_data);
|
||||||
|
|
||||||
gtk_widget_show (table);
|
|
||||||
gtk_widget_show (vbox);
|
|
||||||
gtk_widget_show (hbox);
|
|
||||||
gtk_widget_show (options->query_box);
|
gtk_widget_show (options->query_box);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -604,4 +593,3 @@ channels_color_changed (GimpColorButton *button,
|
||||||
gimp_color_button_get_color (button, &color);
|
gimp_color_button_get_color (button, &color);
|
||||||
gtk_adjustment_set_value (adj, color.a * 100.0);
|
gtk_adjustment_set_value (adj, color.a * 100.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,8 +20,11 @@
|
||||||
#define __CHANNELS_COMMANDS_H__
|
#define __CHANNELS_COMMANDS_H__
|
||||||
|
|
||||||
|
|
||||||
|
void channels_edit_attributes_cmd_callback (GtkAction *action,
|
||||||
|
gpointer data);
|
||||||
void channels_new_cmd_callback (GtkAction *action,
|
void channels_new_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
|
|
||||||
void channels_raise_cmd_callback (GtkAction *action,
|
void channels_raise_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
void channels_raise_to_top_cmd_callback (GtkAction *action,
|
void channels_raise_to_top_cmd_callback (GtkAction *action,
|
||||||
|
@ -30,6 +33,7 @@ void channels_lower_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
void channels_lower_to_bottom_cmd_callback (GtkAction *action,
|
void channels_lower_to_bottom_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
|
|
||||||
void channels_duplicate_cmd_callback (GtkAction *action,
|
void channels_duplicate_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
void channels_delete_cmd_callback (GtkAction *action,
|
void channels_delete_cmd_callback (GtkAction *action,
|
||||||
|
@ -37,14 +41,14 @@ void channels_delete_cmd_callback (GtkAction *action,
|
||||||
void channels_to_selection_cmd_callback (GtkAction *action,
|
void channels_to_selection_cmd_callback (GtkAction *action,
|
||||||
gint value,
|
gint value,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
void channels_edit_attributes_cmd_callback (GtkAction *action,
|
|
||||||
gpointer data);
|
|
||||||
|
|
||||||
void channels_new_channel_query (GimpImage *gimage,
|
void channels_new_channel_query (GimpImage *gimage,
|
||||||
|
GimpContext *context,
|
||||||
GimpChannel *template,
|
GimpChannel *template,
|
||||||
gboolean interactive,
|
gboolean interactive,
|
||||||
GtkWidget *parent);
|
GtkWidget *parent);
|
||||||
void channels_edit_channel_query (GimpChannel *channel,
|
void channels_edit_channel_query (GimpChannel *channel,
|
||||||
|
GimpContext *context,
|
||||||
GtkWidget *parent);
|
GtkWidget *parent);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -149,7 +149,7 @@ static GimpEnumActionEntry edit_fill_actions[] =
|
||||||
void
|
void
|
||||||
edit_actions_setup (GimpActionGroup *group)
|
edit_actions_setup (GimpActionGroup *group)
|
||||||
{
|
{
|
||||||
GimpContext *user_context;
|
GimpContext *context = gimp_get_user_context (group->gimp);
|
||||||
GimpRGB color;
|
GimpRGB color;
|
||||||
GimpPattern *pattern;
|
GimpPattern *pattern;
|
||||||
|
|
||||||
|
@ -167,26 +167,24 @@ edit_actions_setup (GimpActionGroup *group)
|
||||||
group, 0);
|
group, 0);
|
||||||
edit_actions_buffer_changed (group->gimp, group);
|
edit_actions_buffer_changed (group->gimp, group);
|
||||||
|
|
||||||
user_context = gimp_get_user_context (group->gimp);
|
g_signal_connect_object (context, "foreground_changed",
|
||||||
|
|
||||||
g_signal_connect_object (user_context, "foreground_changed",
|
|
||||||
G_CALLBACK (edit_actions_foreground_changed),
|
G_CALLBACK (edit_actions_foreground_changed),
|
||||||
group, 0);
|
group, 0);
|
||||||
g_signal_connect_object (user_context, "background_changed",
|
g_signal_connect_object (context, "background_changed",
|
||||||
G_CALLBACK (edit_actions_background_changed),
|
G_CALLBACK (edit_actions_background_changed),
|
||||||
group, 0);
|
group, 0);
|
||||||
g_signal_connect_object (user_context, "pattern_changed",
|
g_signal_connect_object (context, "pattern_changed",
|
||||||
G_CALLBACK (edit_actions_pattern_changed),
|
G_CALLBACK (edit_actions_pattern_changed),
|
||||||
group, 0);
|
group, 0);
|
||||||
|
|
||||||
gimp_context_get_foreground (user_context, &color);
|
gimp_context_get_foreground (context, &color);
|
||||||
edit_actions_foreground_changed (user_context, &color, group);
|
edit_actions_foreground_changed (context, &color, group);
|
||||||
|
|
||||||
gimp_context_get_background (user_context, &color);
|
gimp_context_get_background (context, &color);
|
||||||
edit_actions_background_changed (user_context, &color, group);
|
edit_actions_background_changed (context, &color, group);
|
||||||
|
|
||||||
pattern = gimp_context_get_pattern (user_context);
|
pattern = gimp_context_get_pattern (context);
|
||||||
edit_actions_pattern_changed (user_context, pattern, group);
|
edit_actions_pattern_changed (context, pattern, group);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -129,7 +129,7 @@ edit_cut_cmd_callback (GtkAction *action,
|
||||||
GimpDrawable *drawable;
|
GimpDrawable *drawable;
|
||||||
return_if_no_drawable (gimage, drawable, data);
|
return_if_no_drawable (gimage, drawable, data);
|
||||||
|
|
||||||
if (gimp_edit_cut (gimage, drawable, gimp_get_user_context (gimage->gimp)))
|
if (gimp_edit_cut (gimage, drawable, action_data_get_context (data)))
|
||||||
gimp_image_flush (gimage);
|
gimp_image_flush (gimage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,7 +141,7 @@ edit_copy_cmd_callback (GtkAction *action,
|
||||||
GimpDrawable *drawable;
|
GimpDrawable *drawable;
|
||||||
return_if_no_drawable (gimage, drawable, data);
|
return_if_no_drawable (gimage, drawable, data);
|
||||||
|
|
||||||
if (gimp_edit_copy (gimage, drawable, gimp_get_user_context (gimage->gimp)))
|
if (gimp_edit_copy (gimage, drawable, action_data_get_context (data)))
|
||||||
gimp_image_flush (gimage);
|
gimp_image_flush (gimage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -260,7 +260,7 @@ edit_clear_cmd_callback (GtkAction *action,
|
||||||
GimpDrawable *drawable;
|
GimpDrawable *drawable;
|
||||||
return_if_no_drawable (gimage, drawable, data);
|
return_if_no_drawable (gimage, drawable, data);
|
||||||
|
|
||||||
gimp_edit_clear (gimage, drawable, gimp_get_user_context (gimage->gimp));
|
gimp_edit_clear (gimage, drawable, action_data_get_context (data));
|
||||||
gimp_image_flush (gimage);
|
gimp_image_flush (gimage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -276,7 +276,7 @@ edit_fill_cmd_callback (GtkAction *action,
|
||||||
|
|
||||||
fill_type = (GimpFillType) value;
|
fill_type = (GimpFillType) value;
|
||||||
|
|
||||||
gimp_edit_fill (gimage, drawable, gimp_get_user_context (gimage->gimp),
|
gimp_edit_fill (gimage, drawable, action_data_get_context (data),
|
||||||
fill_type);
|
fill_type);
|
||||||
gimp_image_flush (gimage);
|
gimp_image_flush (gimage);
|
||||||
}
|
}
|
||||||
|
@ -291,17 +291,17 @@ cut_named_buffer_callback (GtkWidget *widget,
|
||||||
{
|
{
|
||||||
GimpImage *gimage = GIMP_IMAGE (data);
|
GimpImage *gimage = GIMP_IMAGE (data);
|
||||||
const GimpBuffer *cut_buffer;
|
const GimpBuffer *cut_buffer;
|
||||||
GimpDrawable *active_drawable;
|
GimpDrawable *drawable;
|
||||||
|
|
||||||
active_drawable = gimp_image_active_drawable (gimage);
|
drawable = gimp_image_active_drawable (gimage);
|
||||||
|
|
||||||
if (! active_drawable)
|
if (! drawable)
|
||||||
{
|
{
|
||||||
g_message (_("There is no active layer or channel to cut from."));
|
g_message (_("There is no active layer or channel to cut from."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
cut_buffer = gimp_edit_cut (gimage, active_drawable,
|
cut_buffer = gimp_edit_cut (gimage, drawable,
|
||||||
gimp_get_user_context (gimage->gimp));
|
gimp_get_user_context (gimage->gimp));
|
||||||
|
|
||||||
if (cut_buffer)
|
if (cut_buffer)
|
||||||
|
@ -328,17 +328,17 @@ copy_named_buffer_callback (GtkWidget *widget,
|
||||||
{
|
{
|
||||||
GimpImage *gimage = GIMP_IMAGE (data);
|
GimpImage *gimage = GIMP_IMAGE (data);
|
||||||
const GimpBuffer *copy_buffer;
|
const GimpBuffer *copy_buffer;
|
||||||
GimpDrawable *active_drawable;
|
GimpDrawable *drawable;
|
||||||
|
|
||||||
active_drawable = gimp_image_active_drawable (gimage);
|
drawable = gimp_image_active_drawable (gimage);
|
||||||
|
|
||||||
if (! active_drawable)
|
if (! drawable)
|
||||||
{
|
{
|
||||||
g_message (_("There is no active layer or channel to copy from."));
|
g_message (_("There is no active layer or channel to copy from."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
copy_buffer = gimp_edit_copy (gimage, active_drawable,
|
copy_buffer = gimp_edit_copy (gimage, drawable,
|
||||||
gimp_get_user_context (gimage->gimp));
|
gimp_get_user_context (gimage->gimp));
|
||||||
|
|
||||||
if (copy_buffer)
|
if (copy_buffer)
|
||||||
|
|
|
@ -118,7 +118,7 @@ file_last_opened_cmd_callback (GtkAction *action,
|
||||||
GimpPDBStatusType status;
|
GimpPDBStatusType status;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
gimage = file_open_with_display (gimp, gimp_get_user_context (gimp),
|
gimage = file_open_with_display (gimp, action_data_get_context (data),
|
||||||
GIMP_OBJECT (imagefile)->name,
|
GIMP_OBJECT (imagefile)->name,
|
||||||
&status, &error);
|
&status, &error);
|
||||||
|
|
||||||
|
@ -164,8 +164,7 @@ file_save_cmd_callback (GtkAction *action,
|
||||||
GimpPDBStatusType status;
|
GimpPDBStatusType status;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
status = file_save (gdisp->gimage,
|
status = file_save (gdisp->gimage, action_data_get_context (data),
|
||||||
gimp_get_user_context (gdisp->gimage->gimp),
|
|
||||||
GIMP_RUN_WITH_LAST_VALS, &error);
|
GIMP_RUN_WITH_LAST_VALS, &error);
|
||||||
|
|
||||||
if (status != GIMP_PDB_SUCCESS &&
|
if (status != GIMP_PDB_SUCCESS &&
|
||||||
|
|
|
@ -63,27 +63,46 @@
|
||||||
#include "gimp-intl.h"
|
#include "gimp-intl.h"
|
||||||
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct _ImageResizeOptions ImageResizeOptions;
|
||||||
|
|
||||||
|
struct _ImageResizeOptions
|
||||||
{
|
{
|
||||||
ResizeDialog *dialog;
|
ResizeDialog *dialog;
|
||||||
|
|
||||||
|
GimpContext *context;
|
||||||
GimpDisplay *gdisp;
|
GimpDisplay *gdisp;
|
||||||
GimpImage *gimage;
|
GimpImage *gimage;
|
||||||
} ImageResize;
|
};
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct _LayerMergeOptions LayerMergeOptions;
|
||||||
|
|
||||||
|
struct _LayerMergeOptions
|
||||||
|
{
|
||||||
|
GtkWidget *query_box;
|
||||||
|
|
||||||
|
GimpContext *context;
|
||||||
|
GimpImage *gimage;
|
||||||
|
GimpMergeType merge_type;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/* local function prototypes */
|
/* local function prototypes */
|
||||||
|
|
||||||
static void image_resize_callback (GtkWidget *widget,
|
static void image_resize_callback (GtkWidget *widget,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
static void image_scale_callback (GtkWidget *widget,
|
static void image_scale_callback (GtkWidget *widget,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
static void image_scale_warn (ImageResize *image_scale,
|
static void image_scale_warn (ImageResizeOptions *options,
|
||||||
const gchar *warning_title,
|
const gchar *warning_title,
|
||||||
const gchar *warning_message);
|
const gchar *warning_message);
|
||||||
static void image_scale_warn_callback (GtkWidget *widget,
|
static void image_scale_warn_callback (GtkWidget *widget,
|
||||||
gboolean do_scale,
|
gboolean do_scale,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
static void image_scale_implement (ImageResize *image_scale);
|
static void image_scale_implement (ImageResizeOptions *options);
|
||||||
|
static void image_merge_layers_response (GtkWidget *widget,
|
||||||
|
gint response_id,
|
||||||
|
LayerMergeOptions *options);
|
||||||
|
|
||||||
|
|
||||||
/* public functions */
|
/* public functions */
|
||||||
|
@ -162,19 +181,20 @@ void
|
||||||
image_resize_cmd_callback (GtkAction *action,
|
image_resize_cmd_callback (GtkAction *action,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpDisplay *gdisp;
|
ImageResizeOptions *options;
|
||||||
GimpImage *gimage;
|
GimpDisplay *gdisp;
|
||||||
ImageResize *image_resize;
|
GimpImage *gimage;
|
||||||
return_if_no_display (gdisp, data);
|
return_if_no_display (gdisp, data);
|
||||||
|
|
||||||
gimage = gdisp->gimage;
|
gimage = gdisp->gimage;
|
||||||
|
|
||||||
image_resize = g_new0 (ImageResize, 1);
|
options = g_new0 (ImageResizeOptions, 1);
|
||||||
|
|
||||||
image_resize->gdisp = gdisp;
|
options->context = action_data_get_context (data);
|
||||||
image_resize->gimage = gimage;
|
options->gdisp = gdisp;
|
||||||
|
options->gimage = gimage;
|
||||||
|
|
||||||
image_resize->dialog =
|
options->dialog =
|
||||||
resize_dialog_new (GIMP_VIEWABLE (gimage), gdisp->shell,
|
resize_dialog_new (GIMP_VIEWABLE (gimage), gdisp->shell,
|
||||||
RESIZE_DIALOG,
|
RESIZE_DIALOG,
|
||||||
gimage->width,
|
gimage->width,
|
||||||
|
@ -184,37 +204,38 @@ image_resize_cmd_callback (GtkAction *action,
|
||||||
gimage->unit,
|
gimage->unit,
|
||||||
GIMP_DISPLAY_SHELL (gdisp->shell)->dot_for_dot,
|
GIMP_DISPLAY_SHELL (gdisp->shell)->dot_for_dot,
|
||||||
G_CALLBACK (image_resize_callback),
|
G_CALLBACK (image_resize_callback),
|
||||||
image_resize);
|
options);
|
||||||
|
|
||||||
g_signal_connect_object (gdisp, "disconnect",
|
g_signal_connect_object (gdisp, "disconnect",
|
||||||
G_CALLBACK (gtk_widget_destroy),
|
G_CALLBACK (gtk_widget_destroy),
|
||||||
image_resize->dialog->shell,
|
options->dialog->shell,
|
||||||
G_CONNECT_SWAPPED);
|
G_CONNECT_SWAPPED);
|
||||||
|
|
||||||
g_object_weak_ref (G_OBJECT (image_resize->dialog->shell),
|
g_object_weak_ref (G_OBJECT (options->dialog->shell),
|
||||||
(GWeakNotify) g_free,
|
(GWeakNotify) g_free,
|
||||||
image_resize);
|
options);
|
||||||
|
|
||||||
gtk_widget_show (image_resize->dialog->shell);
|
gtk_widget_show (options->dialog->shell);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
image_scale_cmd_callback (GtkAction *action,
|
image_scale_cmd_callback (GtkAction *action,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpDisplay *gdisp;
|
ImageResizeOptions *options;
|
||||||
GimpImage *gimage;
|
GimpDisplay *gdisp;
|
||||||
ImageResize *image_scale;
|
GimpImage *gimage;
|
||||||
return_if_no_display (gdisp, data);
|
return_if_no_display (gdisp, data);
|
||||||
|
|
||||||
gimage = gdisp->gimage;
|
gimage = gdisp->gimage;
|
||||||
|
|
||||||
image_scale = g_new0 (ImageResize, 1);
|
options = g_new0 (ImageResizeOptions, 1);
|
||||||
|
|
||||||
image_scale->gdisp = gdisp;
|
options->context = action_data_get_context (data);
|
||||||
image_scale->gimage = gimage;
|
options->gdisp = gdisp;
|
||||||
|
options->gimage = gimage;
|
||||||
|
|
||||||
image_scale->dialog =
|
options->dialog =
|
||||||
resize_dialog_new (GIMP_VIEWABLE (gimage), gdisp->shell,
|
resize_dialog_new (GIMP_VIEWABLE (gimage), gdisp->shell,
|
||||||
SCALE_DIALOG,
|
SCALE_DIALOG,
|
||||||
gimage->width,
|
gimage->width,
|
||||||
|
@ -224,18 +245,18 @@ image_scale_cmd_callback (GtkAction *action,
|
||||||
gimage->unit,
|
gimage->unit,
|
||||||
GIMP_DISPLAY_SHELL (gdisp->shell)->dot_for_dot,
|
GIMP_DISPLAY_SHELL (gdisp->shell)->dot_for_dot,
|
||||||
G_CALLBACK (image_scale_callback),
|
G_CALLBACK (image_scale_callback),
|
||||||
image_scale);
|
options);
|
||||||
|
|
||||||
g_signal_connect_object (gdisp, "disconnect",
|
g_signal_connect_object (gdisp, "disconnect",
|
||||||
G_CALLBACK (gtk_widget_destroy),
|
G_CALLBACK (gtk_widget_destroy),
|
||||||
image_scale->dialog->shell,
|
options->dialog->shell,
|
||||||
G_CONNECT_SWAPPED);
|
G_CONNECT_SWAPPED);
|
||||||
|
|
||||||
g_object_weak_ref (G_OBJECT (image_scale->dialog->shell),
|
g_object_weak_ref (G_OBJECT (options->dialog->shell),
|
||||||
(GWeakNotify) g_free,
|
(GWeakNotify) g_free,
|
||||||
image_scale);
|
options);
|
||||||
|
|
||||||
gtk_widget_show (image_scale->dialog->shell);
|
gtk_widget_show (options->dialog->shell);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -249,7 +270,7 @@ image_flip_cmd_callback (GtkAction *action,
|
||||||
|
|
||||||
progress = gimp_progress_start (gdisp, _("Flipping..."), TRUE, NULL, NULL);
|
progress = gimp_progress_start (gdisp, _("Flipping..."), TRUE, NULL, NULL);
|
||||||
|
|
||||||
gimp_image_flip (gdisp->gimage, gimp_get_user_context (gdisp->gimage->gimp),
|
gimp_image_flip (gdisp->gimage, action_data_get_context (data),
|
||||||
(GimpOrientationType) value,
|
(GimpOrientationType) value,
|
||||||
gimp_progress_update_and_flush, progress);
|
gimp_progress_update_and_flush, progress);
|
||||||
|
|
||||||
|
@ -269,7 +290,7 @@ image_rotate_cmd_callback (GtkAction *action,
|
||||||
|
|
||||||
progress = gimp_progress_start (gdisp, _("Rotating..."), TRUE, NULL, NULL);
|
progress = gimp_progress_start (gdisp, _("Rotating..."), TRUE, NULL, NULL);
|
||||||
|
|
||||||
gimp_image_rotate (gdisp->gimage, gimp_get_user_context (gdisp->gimage->gimp),
|
gimp_image_rotate (gdisp->gimage, action_data_get_context (data),
|
||||||
(GimpRotationType) value,
|
(GimpRotationType) value,
|
||||||
gimp_progress_update_and_flush, progress);
|
gimp_progress_update_and_flush, progress);
|
||||||
|
|
||||||
|
@ -293,7 +314,7 @@ image_crop_cmd_callback (GtkAction *action,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
gimp_image_crop (gimage, gimp_get_user_context (gimage->gimp),
|
gimp_image_crop (gimage, action_data_get_context (data),
|
||||||
x1, y1, x2, y2, FALSE, TRUE);
|
x1, y1, x2, y2, FALSE, TRUE);
|
||||||
gimp_image_flush (gimage);
|
gimp_image_flush (gimage);
|
||||||
}
|
}
|
||||||
|
@ -307,9 +328,7 @@ image_duplicate_cmd_callback (GtkAction *action,
|
||||||
return_if_no_image (gimage, data);
|
return_if_no_image (gimage, data);
|
||||||
|
|
||||||
new_gimage = gimp_image_duplicate (gimage);
|
new_gimage = gimp_image_duplicate (gimage);
|
||||||
|
|
||||||
gimp_create_display (new_gimage->gimp, new_gimage, 1.0);
|
gimp_create_display (new_gimage->gimp, new_gimage, 1.0);
|
||||||
|
|
||||||
g_object_unref (new_gimage);
|
g_object_unref (new_gimage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -317,12 +336,62 @@ void
|
||||||
image_merge_layers_cmd_callback (GtkAction *action,
|
image_merge_layers_cmd_callback (GtkAction *action,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpImage *gimage;
|
LayerMergeOptions *options;
|
||||||
GtkWidget *widget;
|
GimpImage *gimage;
|
||||||
|
GtkWidget *widget;
|
||||||
|
GtkWidget *frame;
|
||||||
return_if_no_image (gimage, data);
|
return_if_no_image (gimage, data);
|
||||||
return_if_no_widget (widget, data);
|
return_if_no_widget (widget, data);
|
||||||
|
|
||||||
image_layers_merge_query (gimage, TRUE, widget);
|
options = g_new0 (LayerMergeOptions, 1);
|
||||||
|
|
||||||
|
options->context = action_data_get_context (data);
|
||||||
|
options->gimage = gimage;
|
||||||
|
options->merge_type = GIMP_EXPAND_AS_NECESSARY;
|
||||||
|
|
||||||
|
options->query_box =
|
||||||
|
gimp_viewable_dialog_new (GIMP_VIEWABLE (gimage),
|
||||||
|
_("Merge Layers"), "gimp-image-merge-layers",
|
||||||
|
GIMP_STOCK_MERGE_DOWN,
|
||||||
|
_("Layers Merge Options"),
|
||||||
|
widget,
|
||||||
|
gimp_standard_help_func,
|
||||||
|
GIMP_HELP_IMAGE_MERGE_LAYERS,
|
||||||
|
|
||||||
|
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
|
||||||
|
GTK_STOCK_OK, GTK_RESPONSE_OK,
|
||||||
|
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
g_signal_connect (options->query_box, "response",
|
||||||
|
G_CALLBACK (image_merge_layers_response),
|
||||||
|
options);
|
||||||
|
|
||||||
|
g_object_weak_ref (G_OBJECT (options->query_box),
|
||||||
|
(GWeakNotify) g_free,
|
||||||
|
options);
|
||||||
|
|
||||||
|
frame = gimp_int_radio_group_new (TRUE, _("Final, Merged Layer should be:"),
|
||||||
|
G_CALLBACK (gimp_radio_button_update),
|
||||||
|
&options->merge_type, options->merge_type,
|
||||||
|
|
||||||
|
_("Expanded as necessary"),
|
||||||
|
GIMP_EXPAND_AS_NECESSARY, NULL,
|
||||||
|
|
||||||
|
_("Clipped to image"),
|
||||||
|
GIMP_CLIP_TO_IMAGE, NULL,
|
||||||
|
|
||||||
|
_("Clipped to bottom layer"),
|
||||||
|
GIMP_CLIP_TO_BOTTOM_LAYER, NULL,
|
||||||
|
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
gtk_container_set_border_width (GTK_CONTAINER (frame), 12);
|
||||||
|
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (options->query_box)->vbox),
|
||||||
|
frame);
|
||||||
|
gtk_widget_show (frame);
|
||||||
|
|
||||||
|
gtk_widget_show (options->query_box);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -332,7 +401,7 @@ image_flatten_image_cmd_callback (GtkAction *action,
|
||||||
GimpImage *gimage;
|
GimpImage *gimage;
|
||||||
return_if_no_image (gimage, data);
|
return_if_no_image (gimage, data);
|
||||||
|
|
||||||
gimp_image_flatten (gimage, gimp_get_user_context (gimage->gimp));
|
gimp_image_flatten (gimage, action_data_get_context (data));
|
||||||
gimp_image_flush (gimage);
|
gimp_image_flush (gimage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -365,142 +434,36 @@ image_configure_grid_cmd_callback (GtkAction *action,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/****************************/
|
|
||||||
/* The layer merge dialog */
|
|
||||||
/****************************/
|
|
||||||
|
|
||||||
typedef struct _LayerMergeOptions LayerMergeOptions;
|
|
||||||
|
|
||||||
struct _LayerMergeOptions
|
|
||||||
{
|
|
||||||
GtkWidget *query_box;
|
|
||||||
GimpImage *gimage;
|
|
||||||
gboolean merge_visible;
|
|
||||||
GimpMergeType merge_type;
|
|
||||||
};
|
|
||||||
|
|
||||||
static void
|
|
||||||
image_layers_merge_query_response (GtkWidget *widget,
|
|
||||||
gint response_id,
|
|
||||||
LayerMergeOptions *options)
|
|
||||||
{
|
|
||||||
GimpImage *gimage = options->gimage;
|
|
||||||
|
|
||||||
if (! gimage)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (response_id == GTK_RESPONSE_OK)
|
|
||||||
{
|
|
||||||
if (options->merge_visible)
|
|
||||||
gimp_image_merge_visible_layers (gimage,
|
|
||||||
gimp_get_user_context (gimage->gimp),
|
|
||||||
options->merge_type);
|
|
||||||
|
|
||||||
gimp_image_flush (gimage);
|
|
||||||
}
|
|
||||||
|
|
||||||
gtk_widget_destroy (options->query_box);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
image_layers_merge_query (GimpImage *gimage,
|
|
||||||
/* if FALSE, anchor active layer */
|
|
||||||
gboolean merge_visible,
|
|
||||||
GtkWidget *parent)
|
|
||||||
{
|
|
||||||
LayerMergeOptions *options;
|
|
||||||
GtkWidget *frame;
|
|
||||||
|
|
||||||
/* The new options structure */
|
|
||||||
options = g_new (LayerMergeOptions, 1);
|
|
||||||
options->gimage = gimage;
|
|
||||||
options->merge_visible = merge_visible;
|
|
||||||
options->merge_type = GIMP_EXPAND_AS_NECESSARY;
|
|
||||||
|
|
||||||
/* The dialog */
|
|
||||||
options->query_box =
|
|
||||||
gimp_viewable_dialog_new (GIMP_VIEWABLE (gimage),
|
|
||||||
_("Merge Layers"), "gimp-image-merge-layers",
|
|
||||||
GIMP_STOCK_MERGE_DOWN,
|
|
||||||
_("Layers Merge Options"),
|
|
||||||
parent,
|
|
||||||
gimp_standard_help_func,
|
|
||||||
GIMP_HELP_IMAGE_MERGE_LAYERS,
|
|
||||||
|
|
||||||
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
|
|
||||||
GTK_STOCK_OK, GTK_RESPONSE_OK,
|
|
||||||
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
g_signal_connect (options->query_box, "response",
|
|
||||||
G_CALLBACK (image_layers_merge_query_response),
|
|
||||||
options);
|
|
||||||
|
|
||||||
g_object_weak_ref (G_OBJECT (options->query_box),
|
|
||||||
(GWeakNotify) g_free,
|
|
||||||
options);
|
|
||||||
|
|
||||||
frame =
|
|
||||||
gimp_int_radio_group_new (TRUE,
|
|
||||||
merge_visible ?
|
|
||||||
_("Final, Merged Layer should be:") :
|
|
||||||
_("Final, Anchored Layer should be:"),
|
|
||||||
G_CALLBACK (gimp_radio_button_update),
|
|
||||||
&options->merge_type, options->merge_type,
|
|
||||||
|
|
||||||
_("Expanded as necessary"),
|
|
||||||
GIMP_EXPAND_AS_NECESSARY, NULL,
|
|
||||||
|
|
||||||
_("Clipped to image"),
|
|
||||||
GIMP_CLIP_TO_IMAGE, NULL,
|
|
||||||
|
|
||||||
_("Clipped to bottom layer"),
|
|
||||||
GIMP_CLIP_TO_BOTTOM_LAYER, NULL,
|
|
||||||
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
gtk_container_set_border_width (GTK_CONTAINER (frame), 12);
|
|
||||||
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (options->query_box)->vbox),
|
|
||||||
frame);
|
|
||||||
gtk_widget_show (frame);
|
|
||||||
|
|
||||||
gtk_widget_show (options->query_box);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* private functions */
|
/* private functions */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
image_resize_callback (GtkWidget *widget,
|
image_resize_callback (GtkWidget *widget,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
ImageResize *image_resize = data;
|
ImageResizeOptions *options = data;
|
||||||
|
|
||||||
g_assert (image_resize != NULL);
|
gtk_widget_set_sensitive (options->dialog->shell, FALSE);
|
||||||
g_assert (image_resize->gimage != NULL);
|
|
||||||
|
|
||||||
gtk_widget_set_sensitive (image_resize->dialog->shell, FALSE);
|
if (options->dialog->width > 0 &&
|
||||||
|
options->dialog->height > 0)
|
||||||
if (image_resize->dialog->width > 0 &&
|
|
||||||
image_resize->dialog->height > 0)
|
|
||||||
{
|
{
|
||||||
GimpProgress *progress;
|
GimpProgress *progress;
|
||||||
|
|
||||||
progress = gimp_progress_start (image_resize->gdisp,
|
progress = gimp_progress_start (options->gdisp,
|
||||||
_("Resizing..."),
|
_("Resizing..."),
|
||||||
TRUE, NULL, NULL);
|
TRUE, NULL, NULL);
|
||||||
|
|
||||||
gimp_image_resize (image_resize->gimage,
|
gimp_image_resize (options->gimage,
|
||||||
gimp_get_user_context (image_resize->gimage->gimp),
|
options->context,
|
||||||
image_resize->dialog->width,
|
options->dialog->width,
|
||||||
image_resize->dialog->height,
|
options->dialog->height,
|
||||||
image_resize->dialog->offset_x,
|
options->dialog->offset_x,
|
||||||
image_resize->dialog->offset_y,
|
options->dialog->offset_y,
|
||||||
gimp_progress_update_and_flush, progress);
|
gimp_progress_update_and_flush, progress);
|
||||||
|
|
||||||
gimp_progress_end (progress);
|
gimp_progress_end (progress);
|
||||||
|
|
||||||
gimp_image_flush (image_resize->gimage);
|
gimp_image_flush (options->gimage);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -508,26 +471,22 @@ image_resize_callback (GtkWidget *widget,
|
||||||
"greater than zero."));
|
"greater than zero."));
|
||||||
}
|
}
|
||||||
|
|
||||||
gtk_widget_destroy (image_resize->dialog->shell);
|
gtk_widget_destroy (options->dialog->shell);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
image_scale_callback (GtkWidget *widget,
|
image_scale_callback (GtkWidget *widget,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
ImageResize *image_scale = data;
|
ImageResizeOptions *options = data;
|
||||||
GimpImageScaleCheckType scale_check;
|
GimpImageScaleCheckType scale_check;
|
||||||
gint64 new_memsize;
|
gint64 new_memsize;
|
||||||
gchar *warning_message;
|
|
||||||
|
|
||||||
g_assert (image_scale != NULL);
|
gtk_widget_set_sensitive (options->dialog->shell, FALSE);
|
||||||
g_assert (image_scale->gimage != NULL);
|
|
||||||
|
|
||||||
gtk_widget_set_sensitive (image_scale->dialog->shell, FALSE);
|
scale_check = gimp_image_scale_check (options->gimage,
|
||||||
|
options->dialog->width,
|
||||||
scale_check = gimp_image_scale_check (image_scale->gimage,
|
options->dialog->height,
|
||||||
image_scale->dialog->width,
|
|
||||||
image_scale->dialog->height,
|
|
||||||
&new_memsize);
|
&new_memsize);
|
||||||
switch (scale_check)
|
switch (scale_check)
|
||||||
{
|
{
|
||||||
|
@ -535,10 +494,11 @@ image_scale_callback (GtkWidget *widget,
|
||||||
{
|
{
|
||||||
gchar *size_str;
|
gchar *size_str;
|
||||||
gchar *max_size_str;
|
gchar *max_size_str;
|
||||||
|
gchar *warning_message;
|
||||||
|
|
||||||
size_str = gimp_memsize_to_string (new_memsize);
|
size_str = gimp_memsize_to_string (new_memsize);
|
||||||
max_size_str = gimp_memsize_to_string
|
max_size_str = gimp_memsize_to_string
|
||||||
(GIMP_GUI_CONFIG (image_scale->gimage->gimp->config)->max_new_image_size);
|
(GIMP_GUI_CONFIG (options->gimage->gimp->config)->max_new_image_size);
|
||||||
|
|
||||||
warning_message = g_strdup_printf
|
warning_message = g_strdup_printf
|
||||||
(_("You are trying to create an image with a size of %s.\n\n"
|
(_("You are trying to create an image with a size of %s.\n\n"
|
||||||
|
@ -553,7 +513,7 @@ image_scale_callback (GtkWidget *widget,
|
||||||
g_free (size_str);
|
g_free (size_str);
|
||||||
g_free (max_size_str);
|
g_free (max_size_str);
|
||||||
|
|
||||||
image_scale_warn (image_scale, _("Image exceeds maximum image size"),
|
image_scale_warn (options, _("Image exceeds maximum image size"),
|
||||||
warning_message);
|
warning_message);
|
||||||
|
|
||||||
g_free (warning_message);
|
g_free (warning_message);
|
||||||
|
@ -561,40 +521,37 @@ image_scale_callback (GtkWidget *widget,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GIMP_IMAGE_SCALE_TOO_SMALL:
|
case GIMP_IMAGE_SCALE_TOO_SMALL:
|
||||||
warning_message = _("The chosen image size will shrink "
|
image_scale_warn (options, _("Layer Too Small"),
|
||||||
"some layers completely away. "
|
_("The chosen image size will shrink some layers "
|
||||||
"Is this what you want?");
|
"completely away. Is this what you want?"));
|
||||||
|
|
||||||
image_scale_warn (image_scale, _("Layer Too Small"),
|
|
||||||
warning_message);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GIMP_IMAGE_SCALE_OK:
|
case GIMP_IMAGE_SCALE_OK:
|
||||||
/* If all is well, return directly after scaling image. */
|
/* If all is well, return directly after scaling image. */
|
||||||
image_scale_implement (image_scale);
|
image_scale_implement (options);
|
||||||
gtk_widget_destroy (image_scale->dialog->shell);
|
gtk_widget_destroy (options->dialog->shell);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
image_scale_warn (ImageResize *image_scale,
|
image_scale_warn (ImageResizeOptions *options,
|
||||||
const gchar *warning_title,
|
const gchar *warning_title,
|
||||||
const gchar *warning_message)
|
const gchar *warning_message)
|
||||||
{
|
{
|
||||||
GtkWidget *dialog;
|
GtkWidget *dialog;
|
||||||
|
|
||||||
dialog = gimp_query_boolean_box (warning_title,
|
dialog = gimp_query_boolean_box (warning_title,
|
||||||
image_scale->dialog->shell,
|
options->dialog->shell,
|
||||||
gimp_standard_help_func,
|
gimp_standard_help_func,
|
||||||
GIMP_HELP_IMAGE_SCALE_WARNING,
|
GIMP_HELP_IMAGE_SCALE_WARNING,
|
||||||
GTK_STOCK_DIALOG_QUESTION,
|
GTK_STOCK_DIALOG_QUESTION,
|
||||||
warning_message,
|
warning_message,
|
||||||
GTK_STOCK_OK, GTK_STOCK_CANCEL,
|
GTK_STOCK_OK, GTK_STOCK_CANCEL,
|
||||||
G_OBJECT (image_scale->dialog->shell),
|
G_OBJECT (options->dialog->shell),
|
||||||
"destroy",
|
"destroy",
|
||||||
image_scale_warn_callback,
|
image_scale_warn_callback,
|
||||||
image_scale);
|
options);
|
||||||
gtk_widget_show (dialog);
|
gtk_widget_show (dialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -603,61 +560,55 @@ image_scale_warn_callback (GtkWidget *widget,
|
||||||
gboolean do_scale,
|
gboolean do_scale,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
ImageResize *image_scale = data;
|
ImageResizeOptions *options = data;
|
||||||
|
|
||||||
if (do_scale) /* User doesn't mind losing layers or
|
if (do_scale)
|
||||||
* creating huge image... */
|
|
||||||
{
|
{
|
||||||
image_scale_implement (image_scale);
|
image_scale_implement (options);
|
||||||
gtk_widget_destroy (image_scale->dialog->shell);
|
gtk_widget_destroy (options->dialog->shell);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gtk_widget_set_sensitive (image_scale->dialog->shell, TRUE);
|
gtk_widget_set_sensitive (options->dialog->shell, TRUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
image_scale_implement (ImageResize *image_scale)
|
image_scale_implement (ImageResizeOptions *options)
|
||||||
{
|
{
|
||||||
GimpImage *gimage;
|
GimpImage *gimage = options->gimage;
|
||||||
|
|
||||||
g_assert (image_scale != NULL);
|
if (options->dialog->resolution_x == gimage->xresolution &&
|
||||||
g_assert (image_scale->gimage != NULL);
|
options->dialog->resolution_y == gimage->yresolution &&
|
||||||
|
options->dialog->unit == gimage->unit &&
|
||||||
gimage = image_scale->gimage;
|
options->dialog->width == gimage->width &&
|
||||||
|
options->dialog->height == gimage->height)
|
||||||
if (image_scale->dialog->resolution_x == gimage->xresolution &&
|
|
||||||
image_scale->dialog->resolution_y == gimage->yresolution &&
|
|
||||||
image_scale->dialog->unit == gimage->unit &&
|
|
||||||
image_scale->dialog->width == gimage->width &&
|
|
||||||
image_scale->dialog->height == gimage->height)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_IMAGE_SCALE,
|
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_IMAGE_SCALE,
|
||||||
_("Scale Image"));
|
_("Scale Image"));
|
||||||
|
|
||||||
gimp_image_set_resolution (gimage,
|
gimp_image_set_resolution (gimage,
|
||||||
image_scale->dialog->resolution_x,
|
options->dialog->resolution_x,
|
||||||
image_scale->dialog->resolution_y);
|
options->dialog->resolution_y);
|
||||||
gimp_image_set_unit (gimage, image_scale->dialog->unit);
|
gimp_image_set_unit (gimage, options->dialog->unit);
|
||||||
|
|
||||||
if (image_scale->dialog->width != gimage->width ||
|
if (options->dialog->width != gimage->width ||
|
||||||
image_scale->dialog->height != gimage->height)
|
options->dialog->height != gimage->height)
|
||||||
{
|
{
|
||||||
if (image_scale->dialog->width > 0 &&
|
if (options->dialog->width > 0 &&
|
||||||
image_scale->dialog->height > 0)
|
options->dialog->height > 0)
|
||||||
{
|
{
|
||||||
GimpProgress *progress;
|
GimpProgress *progress;
|
||||||
|
|
||||||
progress = gimp_progress_start (image_scale->gdisp,
|
progress = gimp_progress_start (options->gdisp,
|
||||||
_("Scaling..."),
|
_("Scaling..."),
|
||||||
TRUE, NULL, NULL);
|
TRUE, NULL, NULL);
|
||||||
|
|
||||||
gimp_image_scale (gimage,
|
gimp_image_scale (gimage,
|
||||||
image_scale->dialog->width,
|
options->dialog->width,
|
||||||
image_scale->dialog->height,
|
options->dialog->height,
|
||||||
image_scale->dialog->interpolation,
|
options->dialog->interpolation,
|
||||||
gimp_progress_update_and_flush, progress);
|
gimp_progress_update_and_flush, progress);
|
||||||
|
|
||||||
gimp_progress_end (progress);
|
gimp_progress_end (progress);
|
||||||
|
@ -674,3 +625,19 @@ image_scale_implement (ImageResize *image_scale)
|
||||||
|
|
||||||
gimp_image_flush (gimage);
|
gimp_image_flush (gimage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
image_merge_layers_response (GtkWidget *widget,
|
||||||
|
gint response_id,
|
||||||
|
LayerMergeOptions *options)
|
||||||
|
{
|
||||||
|
if (response_id == GTK_RESPONSE_OK)
|
||||||
|
{
|
||||||
|
gimp_image_merge_visible_layers (options->gimage,
|
||||||
|
options->context,
|
||||||
|
options->merge_type);
|
||||||
|
gimp_image_flush (options->gimage);
|
||||||
|
}
|
||||||
|
|
||||||
|
gtk_widget_destroy (options->query_box);
|
||||||
|
}
|
||||||
|
|
|
@ -20,44 +20,41 @@
|
||||||
#define __IMAGE_COMMANDS_H__
|
#define __IMAGE_COMMANDS_H__
|
||||||
|
|
||||||
|
|
||||||
void image_new_cmd_callback (GtkAction *action,
|
void image_new_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
void image_new_from_image_cmd_callback (GtkAction *action,
|
void image_new_from_image_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
|
|
||||||
void image_convert_rgb_cmd_callback (GtkAction *action,
|
void image_convert_rgb_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
void image_convert_grayscale_cmd_callback (GtkAction *action,
|
void image_convert_grayscale_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
void image_convert_indexed_cmd_callback (GtkAction *action,
|
void image_convert_indexed_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
|
|
||||||
void image_resize_cmd_callback (GtkAction *action,
|
void image_resize_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
void image_scale_cmd_callback (GtkAction *action,
|
void image_scale_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
void image_flip_cmd_callback (GtkAction *action,
|
void image_flip_cmd_callback (GtkAction *action,
|
||||||
gint value,
|
gint value,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
void image_rotate_cmd_callback (GtkAction *action,
|
void image_rotate_cmd_callback (GtkAction *action,
|
||||||
gint value,
|
gint value,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
void image_crop_cmd_callback (GtkAction *action,
|
void image_crop_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
|
|
||||||
void image_duplicate_cmd_callback (GtkAction *action,
|
void image_duplicate_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
|
|
||||||
void image_merge_layers_cmd_callback (GtkAction *action,
|
void image_merge_layers_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
void image_flatten_image_cmd_callback (GtkAction *action,
|
void image_flatten_image_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
|
|
||||||
void image_layers_merge_query (GimpImage *gimage,
|
void image_configure_grid_cmd_callback (GtkAction *action,
|
||||||
gboolean merge_visible,
|
gpointer data);
|
||||||
GtkWidget *parent);
|
|
||||||
|
|
||||||
void image_configure_grid_cmd_callback (GtkAction *action,
|
|
||||||
gpointer data);
|
|
||||||
|
|
||||||
#endif /* __IMAGE_COMMANDS_H__ */
|
#endif /* __IMAGE_COMMANDS_H__ */
|
||||||
|
|
|
@ -34,6 +34,7 @@
|
||||||
#include "widgets/gimpactiongroup.h"
|
#include "widgets/gimpactiongroup.h"
|
||||||
|
|
||||||
#include "actions.h"
|
#include "actions.h"
|
||||||
|
#include "image-commands.h"
|
||||||
#include "layers-actions.h"
|
#include "layers-actions.h"
|
||||||
#include "layers-commands.h"
|
#include "layers-commands.h"
|
||||||
|
|
||||||
|
@ -131,12 +132,12 @@ static GimpActionEntry layers_actions[] =
|
||||||
|
|
||||||
{ "layers-merge-layers", NULL,
|
{ "layers-merge-layers", NULL,
|
||||||
N_("Merge _Visible Layers..."), NULL, NULL,
|
N_("Merge _Visible Layers..."), NULL, NULL,
|
||||||
G_CALLBACK (layers_merge_layers_cmd_callback),
|
G_CALLBACK (image_merge_layers_cmd_callback),
|
||||||
GIMP_HELP_IMAGE_MERGE_LAYERS },
|
GIMP_HELP_IMAGE_MERGE_LAYERS },
|
||||||
|
|
||||||
{ "layers-flatten-image", NULL,
|
{ "layers-flatten-image", NULL,
|
||||||
N_("_Flatten Image"), NULL, NULL,
|
N_("_Flatten Image"), NULL, NULL,
|
||||||
G_CALLBACK (layers_flatten_image_cmd_callback),
|
G_CALLBACK (image_flatten_image_cmd_callback),
|
||||||
GIMP_HELP_IMAGE_FLATTEN },
|
GIMP_HELP_IMAGE_FLATTEN },
|
||||||
|
|
||||||
{ "layers-text-discard", GIMP_STOCK_TOOL_TEXT,
|
{ "layers-text-discard", GIMP_STOCK_TOOL_TEXT,
|
||||||
|
|
|
@ -62,26 +62,65 @@
|
||||||
|
|
||||||
#include "actions.h"
|
#include "actions.h"
|
||||||
#include "layers-commands.h"
|
#include "layers-commands.h"
|
||||||
#include "image-commands.h"
|
|
||||||
|
|
||||||
#include "gimp-intl.h"
|
#include "gimp-intl.h"
|
||||||
|
|
||||||
|
|
||||||
/* local function prototypes */
|
/* local function prototypes */
|
||||||
|
|
||||||
static void layers_add_mask_query (GimpLayer *layer,
|
static void layers_add_mask_query (GimpLayer *layer,
|
||||||
GtkWidget *parent);
|
GtkWidget *parent);
|
||||||
static void layers_scale_layer_query (GimpDisplay *gdisp,
|
static void layers_scale_layer_query (GimpDisplay *gdisp,
|
||||||
GimpImage *gimage,
|
GimpImage *gimage,
|
||||||
GimpLayer *layer,
|
GimpLayer *layer,
|
||||||
GtkWidget *parent);
|
GtkWidget *parent);
|
||||||
static void layers_resize_layer_query (GimpImage *gimage,
|
static void layers_resize_layer_query (GimpImage *gimage,
|
||||||
GimpLayer *layer,
|
GimpLayer *layer,
|
||||||
GtkWidget *parent);
|
GimpContext *context,
|
||||||
|
GtkWidget *parent);
|
||||||
|
|
||||||
|
|
||||||
/* public functions */
|
/* public functions */
|
||||||
|
|
||||||
|
void
|
||||||
|
layers_text_tool_cmd_callback (GtkAction *action,
|
||||||
|
gpointer data)
|
||||||
|
{
|
||||||
|
GimpImage *gimage;
|
||||||
|
GimpLayer *layer;
|
||||||
|
GtkWidget *widget;
|
||||||
|
return_if_no_layer (gimage, layer, data);
|
||||||
|
return_if_no_widget (widget, data);
|
||||||
|
|
||||||
|
layers_text_tool (layer, action_data_get_context (data), widget);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
layers_edit_attributes_cmd_callback (GtkAction *action,
|
||||||
|
gpointer data)
|
||||||
|
{
|
||||||
|
GimpImage *gimage;
|
||||||
|
GimpLayer *layer;
|
||||||
|
GtkWidget *widget;
|
||||||
|
return_if_no_layer (gimage, layer, data);
|
||||||
|
return_if_no_widget (widget, data);
|
||||||
|
|
||||||
|
layers_edit_layer_query (layer, action_data_get_context (data), widget);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
layers_new_cmd_callback (GtkAction *action,
|
||||||
|
gpointer data)
|
||||||
|
{
|
||||||
|
GimpImage *gimage;
|
||||||
|
GtkWidget *widget;
|
||||||
|
return_if_no_image (gimage, data);
|
||||||
|
return_if_no_widget (widget, data);
|
||||||
|
|
||||||
|
layers_new_layer_query (gimage, action_data_get_context (data),
|
||||||
|
NULL, TRUE, widget);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
layers_select_previous_cmd_callback (GtkAction *action,
|
layers_select_previous_cmd_callback (GtkAction *action,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
|
@ -220,18 +259,6 @@ layers_lower_to_bottom_cmd_callback (GtkAction *action,
|
||||||
gimp_image_flush (gimage);
|
gimp_image_flush (gimage);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
layers_new_cmd_callback (GtkAction *action,
|
|
||||||
gpointer data)
|
|
||||||
{
|
|
||||||
GimpImage *gimage;
|
|
||||||
GtkWidget *widget;
|
|
||||||
return_if_no_image (gimage, data);
|
|
||||||
return_if_no_widget (widget, data);
|
|
||||||
|
|
||||||
layers_new_layer_query (gimage, NULL, TRUE, widget);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
layers_duplicate_cmd_callback (GtkAction *action,
|
layers_duplicate_cmd_callback (GtkAction *action,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
|
@ -316,7 +343,8 @@ layers_resize_cmd_callback (GtkAction *action,
|
||||||
return_if_no_layer (gimage, layer, data);
|
return_if_no_layer (gimage, layer, data);
|
||||||
return_if_no_widget (widget, data);
|
return_if_no_widget (widget, data);
|
||||||
|
|
||||||
layers_resize_layer_query (gimage, layer, widget);
|
layers_resize_layer_query (gimage, layer, action_data_get_context (data),
|
||||||
|
widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -485,66 +513,19 @@ layers_alpha_to_selection_cmd_callback (GtkAction *action,
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
layers_merge_layers_cmd_callback (GtkAction *action,
|
layers_text_tool (GimpLayer *layer,
|
||||||
gpointer data)
|
GimpContext *context,
|
||||||
{
|
GtkWidget *parent)
|
||||||
GimpImage *gimage;
|
|
||||||
GtkWidget *widget;
|
|
||||||
return_if_no_image (gimage, data);
|
|
||||||
return_if_no_widget (widget, data);
|
|
||||||
|
|
||||||
image_layers_merge_query (gimage, TRUE, widget);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
layers_flatten_image_cmd_callback (GtkAction *action,
|
|
||||||
gpointer data)
|
|
||||||
{
|
|
||||||
GimpImage *gimage;
|
|
||||||
return_if_no_image (gimage, data);
|
|
||||||
|
|
||||||
gimp_image_flatten (gimage, action_data_get_context (data));
|
|
||||||
gimp_image_flush (gimage);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
layers_text_tool_cmd_callback (GtkAction *action,
|
|
||||||
gpointer data)
|
|
||||||
{
|
|
||||||
GimpImage *gimage;
|
|
||||||
GimpLayer *layer;
|
|
||||||
GtkWidget *widget;
|
|
||||||
return_if_no_layer (gimage, layer, data);
|
|
||||||
return_if_no_widget (widget, data);
|
|
||||||
|
|
||||||
layers_text_tool (layer, widget);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
layers_edit_attributes_cmd_callback (GtkAction *action,
|
|
||||||
gpointer data)
|
|
||||||
{
|
|
||||||
GimpImage *gimage;
|
|
||||||
GimpLayer *layer;
|
|
||||||
GtkWidget *widget;
|
|
||||||
return_if_no_layer (gimage, layer, data);
|
|
||||||
return_if_no_widget (widget, data);
|
|
||||||
|
|
||||||
layers_edit_layer_query (layer, widget);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
layers_text_tool (GimpLayer *layer,
|
|
||||||
GtkWidget *parent)
|
|
||||||
{
|
{
|
||||||
GimpImage *gimage;
|
GimpImage *gimage;
|
||||||
GimpTool *active_tool;
|
GimpTool *active_tool;
|
||||||
|
|
||||||
g_return_if_fail (GIMP_IS_LAYER (layer));
|
g_return_if_fail (GIMP_IS_LAYER (layer));
|
||||||
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
||||||
|
|
||||||
if (! gimp_drawable_is_text_layer (GIMP_DRAWABLE (layer)))
|
if (! gimp_drawable_is_text_layer (GIMP_DRAWABLE (layer)))
|
||||||
{
|
{
|
||||||
layers_edit_layer_query (layer, parent);
|
layers_edit_layer_query (layer, context, parent);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -563,9 +544,7 @@ layers_text_tool (GimpLayer *layer,
|
||||||
|
|
||||||
if (GIMP_IS_TOOL_INFO (tool_info))
|
if (GIMP_IS_TOOL_INFO (tool_info))
|
||||||
{
|
{
|
||||||
gimp_context_set_tool (gimp_get_user_context (gimage->gimp),
|
gimp_context_set_tool (context, tool_info);
|
||||||
tool_info);
|
|
||||||
|
|
||||||
active_tool = tool_manager_get_active (gimage->gimp);
|
active_tool = tool_manager_get_active (gimage->gimp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -591,6 +570,7 @@ struct _NewLayerOptions
|
||||||
gint xsize;
|
gint xsize;
|
||||||
gint ysize;
|
gint ysize;
|
||||||
|
|
||||||
|
GimpContext *context;
|
||||||
GimpImage *gimage;
|
GimpImage *gimage;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -605,7 +585,6 @@ new_layer_query_response (GtkWidget *widget,
|
||||||
if (response_id == GTK_RESPONSE_OK)
|
if (response_id == GTK_RESPONSE_OK)
|
||||||
{
|
{
|
||||||
GimpLayer *layer;
|
GimpLayer *layer;
|
||||||
GimpImage *gimage;
|
|
||||||
|
|
||||||
if (layer_name)
|
if (layer_name)
|
||||||
g_free (layer_name);
|
g_free (layer_name);
|
||||||
|
@ -621,28 +600,26 @@ new_layer_query_response (GtkWidget *widget,
|
||||||
|
|
||||||
fill_type = options->fill_type;
|
fill_type = options->fill_type;
|
||||||
|
|
||||||
if ((gimage = options->gimage))
|
layer = gimp_layer_new (options->gimage,
|
||||||
{
|
options->xsize,
|
||||||
layer = gimp_layer_new (gimage,
|
options->ysize,
|
||||||
options->xsize,
|
gimp_image_base_type_with_alpha (options->gimage),
|
||||||
options->ysize,
|
layer_name,
|
||||||
gimp_image_base_type_with_alpha (gimage),
|
GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE);
|
||||||
layer_name,
|
|
||||||
GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE);
|
|
||||||
if (layer)
|
|
||||||
{
|
|
||||||
gimp_drawable_fill_by_type (GIMP_DRAWABLE (layer),
|
|
||||||
gimp_get_user_context (gimage->gimp),
|
|
||||||
fill_type);
|
|
||||||
gimp_image_add_layer (gimage, layer, -1);
|
|
||||||
|
|
||||||
gimp_image_flush (gimage);
|
if (layer)
|
||||||
}
|
{
|
||||||
else
|
gimp_drawable_fill_by_type (GIMP_DRAWABLE (layer),
|
||||||
{
|
options->context,
|
||||||
g_message ("new_layer_query_response: "
|
fill_type);
|
||||||
"could not allocate new layer");
|
gimp_image_add_layer (options->gimage, layer, -1);
|
||||||
}
|
|
||||||
|
gimp_image_flush (options->gimage);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
g_message ("new_layer_query_response: "
|
||||||
|
"could not allocate new layer");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -650,10 +627,11 @@ new_layer_query_response (GtkWidget *widget,
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
layers_new_layer_query (GimpImage *gimage,
|
layers_new_layer_query (GimpImage *gimage,
|
||||||
GimpLayer *template,
|
GimpContext *context,
|
||||||
gboolean interactive,
|
GimpLayer *template,
|
||||||
GtkWidget *parent)
|
gboolean interactive,
|
||||||
|
GtkWidget *parent)
|
||||||
{
|
{
|
||||||
NewLayerOptions *options;
|
NewLayerOptions *options;
|
||||||
GimpLayer *floating_sel;
|
GimpLayer *floating_sel;
|
||||||
|
@ -666,6 +644,7 @@ layers_new_layer_query (GimpImage *gimage,
|
||||||
GtkWidget *button;
|
GtkWidget *button;
|
||||||
|
|
||||||
g_return_if_fail (GIMP_IS_IMAGE (gimage));
|
g_return_if_fail (GIMP_IS_IMAGE (gimage));
|
||||||
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
||||||
g_return_if_fail (template == NULL || GIMP_IS_LAYER (template));
|
g_return_if_fail (template == NULL || GIMP_IS_LAYER (template));
|
||||||
|
|
||||||
/* If there is a floating selection, the new command transforms
|
/* If there is a floating selection, the new command transforms
|
||||||
|
@ -707,16 +686,11 @@ layers_new_layer_query (GimpImage *gimage,
|
||||||
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_EDIT_PASTE,
|
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_EDIT_PASTE,
|
||||||
_("New Layer"));
|
_("New Layer"));
|
||||||
|
|
||||||
new_layer = gimp_layer_new (gimage,
|
new_layer = gimp_layer_new (gimage, width, height,
|
||||||
width,
|
|
||||||
height,
|
|
||||||
gimp_image_base_type_with_alpha (gimage),
|
gimp_image_base_type_with_alpha (gimage),
|
||||||
_("Empty Layer"),
|
_("Empty Layer"), opacity, mode);
|
||||||
opacity,
|
|
||||||
mode);
|
|
||||||
|
|
||||||
gimp_drawable_fill_by_type (GIMP_DRAWABLE (new_layer),
|
gimp_drawable_fill_by_type (GIMP_DRAWABLE (new_layer), context,
|
||||||
gimp_get_user_context (gimage->gimp),
|
|
||||||
GIMP_TRANSPARENT_FILL);
|
GIMP_TRANSPARENT_FILL);
|
||||||
gimp_item_translate (GIMP_ITEM (new_layer), off_x, off_y, FALSE);
|
gimp_item_translate (GIMP_ITEM (new_layer), off_x, off_y, FALSE);
|
||||||
|
|
||||||
|
@ -730,6 +704,7 @@ layers_new_layer_query (GimpImage *gimage,
|
||||||
|
|
||||||
options->fill_type = fill_type;
|
options->fill_type = fill_type;
|
||||||
options->gimage = gimage;
|
options->gimage = gimage;
|
||||||
|
options->context = context;
|
||||||
|
|
||||||
options->query_box =
|
options->query_box =
|
||||||
gimp_viewable_dialog_new (GIMP_VIEWABLE (gimage),
|
gimp_viewable_dialog_new (GIMP_VIEWABLE (gimage),
|
||||||
|
@ -753,16 +728,17 @@ layers_new_layer_query (GimpImage *gimage,
|
||||||
(GWeakNotify) g_free,
|
(GWeakNotify) g_free,
|
||||||
options);
|
options);
|
||||||
|
|
||||||
/* The main vbox */
|
|
||||||
vbox = gtk_vbox_new (FALSE, 12);
|
vbox = gtk_vbox_new (FALSE, 12);
|
||||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
|
gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
|
||||||
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (options->query_box)->vbox),
|
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (options->query_box)->vbox),
|
||||||
vbox);
|
vbox);
|
||||||
|
gtk_widget_show (vbox);
|
||||||
|
|
||||||
table = gtk_table_new (3, 2, FALSE);
|
table = gtk_table_new (3, 2, FALSE);
|
||||||
gtk_table_set_col_spacing (GTK_TABLE (table), 0, 4);
|
gtk_table_set_col_spacing (GTK_TABLE (table), 0, 4);
|
||||||
gtk_table_set_row_spacing (GTK_TABLE (table), 0, 4);
|
gtk_table_set_row_spacing (GTK_TABLE (table), 0, 4);
|
||||||
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
|
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
|
||||||
|
gtk_widget_show (table);
|
||||||
|
|
||||||
/* The name label and entry */
|
/* The name label and entry */
|
||||||
options->name_entry = gtk_entry_new ();
|
options->name_entry = gtk_entry_new ();
|
||||||
|
@ -832,8 +808,6 @@ layers_new_layer_query (GimpImage *gimage,
|
||||||
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (options->size_se), 1,
|
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (options->size_se), 1,
|
||||||
gimage->height);
|
gimage->height);
|
||||||
|
|
||||||
gtk_widget_show (table);
|
|
||||||
|
|
||||||
/* The radio frame */
|
/* The radio frame */
|
||||||
frame = gimp_enum_radio_frame_new_with_range (GIMP_TYPE_FILL_TYPE,
|
frame = gimp_enum_radio_frame_new_with_range (GIMP_TYPE_FILL_TYPE,
|
||||||
GIMP_FOREGROUND_FILL,
|
GIMP_FOREGROUND_FILL,
|
||||||
|
@ -845,14 +819,13 @@ layers_new_layer_query (GimpImage *gimage,
|
||||||
&button);
|
&button);
|
||||||
gimp_int_radio_group_set_active (GTK_RADIO_BUTTON (button),
|
gimp_int_radio_group_set_active (GTK_RADIO_BUTTON (button),
|
||||||
options->fill_type);
|
options->fill_type);
|
||||||
|
|
||||||
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
|
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
|
||||||
gtk_widget_show (frame);
|
gtk_widget_show (frame);
|
||||||
|
|
||||||
gtk_widget_show (vbox);
|
|
||||||
gtk_widget_show (options->query_box);
|
gtk_widget_show (options->query_box);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**************************************/
|
/**************************************/
|
||||||
/* The edit layer attributes dialog */
|
/* The edit layer attributes dialog */
|
||||||
/**************************************/
|
/**************************************/
|
||||||
|
@ -864,6 +837,7 @@ struct _EditLayerOptions
|
||||||
GtkWidget *query_box;
|
GtkWidget *query_box;
|
||||||
GtkWidget *name_entry;
|
GtkWidget *name_entry;
|
||||||
GtkWidget *toggle;
|
GtkWidget *toggle;
|
||||||
|
|
||||||
GimpLayer *layer;
|
GimpLayer *layer;
|
||||||
GimpImage *gimage;
|
GimpImage *gimage;
|
||||||
};
|
};
|
||||||
|
@ -875,28 +849,24 @@ edit_layer_query_response (GtkWidget *widget,
|
||||||
{
|
{
|
||||||
if (response_id == GTK_RESPONSE_OK)
|
if (response_id == GTK_RESPONSE_OK)
|
||||||
{
|
{
|
||||||
GimpLayer *layer = options->layer;
|
GimpLayer *layer = options->layer;
|
||||||
|
const gchar *new_name;
|
||||||
|
|
||||||
if (options->gimage)
|
new_name = gtk_entry_get_text (GTK_ENTRY (options->name_entry));
|
||||||
|
|
||||||
|
if (strcmp (new_name, gimp_object_get_name (GIMP_OBJECT (layer))))
|
||||||
{
|
{
|
||||||
const gchar *new_name;
|
gimp_item_rename (GIMP_ITEM (layer), new_name);
|
||||||
|
gimp_image_flush (options->gimage);
|
||||||
|
}
|
||||||
|
|
||||||
new_name = gtk_entry_get_text (GTK_ENTRY (options->name_entry));
|
if (options->toggle &&
|
||||||
|
gimp_drawable_is_text_layer (GIMP_DRAWABLE (layer)))
|
||||||
if (strcmp (new_name, gimp_object_get_name (GIMP_OBJECT (layer))))
|
{
|
||||||
{
|
g_object_set (layer,
|
||||||
gimp_item_rename (GIMP_ITEM (layer), new_name);
|
"auto-rename",
|
||||||
gimp_image_flush (options->gimage);
|
GTK_TOGGLE_BUTTON (options->toggle)->active,
|
||||||
}
|
NULL);
|
||||||
|
|
||||||
if (options->toggle &&
|
|
||||||
gimp_drawable_is_text_layer (GIMP_DRAWABLE (layer)))
|
|
||||||
{
|
|
||||||
g_object_set (layer,
|
|
||||||
"auto-rename",
|
|
||||||
GTK_TOGGLE_BUTTON (options->toggle)->active,
|
|
||||||
NULL);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -910,7 +880,6 @@ edit_layer_query_activate (GtkWidget *widget,
|
||||||
gtk_dialog_response (GTK_DIALOG (options->query_box), GTK_RESPONSE_OK);
|
gtk_dialog_response (GTK_DIALOG (options->query_box), GTK_RESPONSE_OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
edit_layer_toggle_rename (GtkWidget *widget,
|
edit_layer_toggle_rename (GtkWidget *widget,
|
||||||
EditLayerOptions *options)
|
EditLayerOptions *options)
|
||||||
|
@ -933,13 +902,17 @@ edit_layer_toggle_rename (GtkWidget *widget,
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
layers_edit_layer_query (GimpLayer *layer,
|
layers_edit_layer_query (GimpLayer *layer,
|
||||||
GtkWidget *parent)
|
GimpContext *context,
|
||||||
|
GtkWidget *parent)
|
||||||
{
|
{
|
||||||
EditLayerOptions *options;
|
EditLayerOptions *options;
|
||||||
GtkWidget *vbox;
|
GtkWidget *vbox;
|
||||||
GtkWidget *table;
|
GtkWidget *table;
|
||||||
|
|
||||||
|
g_return_if_fail (GIMP_IS_LAYER (layer));
|
||||||
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
||||||
|
|
||||||
options = g_new0 (EditLayerOptions, 1);
|
options = g_new0 (EditLayerOptions, 1);
|
||||||
|
|
||||||
options->layer = layer;
|
options->layer = layer;
|
||||||
|
@ -967,13 +940,12 @@ layers_edit_layer_query (GimpLayer *layer,
|
||||||
(GWeakNotify) g_free,
|
(GWeakNotify) g_free,
|
||||||
options);
|
options);
|
||||||
|
|
||||||
/* The main vbox */
|
|
||||||
vbox = gtk_vbox_new (FALSE, 12);
|
vbox = gtk_vbox_new (FALSE, 12);
|
||||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
|
gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
|
||||||
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (options->query_box)->vbox),
|
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (options->query_box)->vbox),
|
||||||
vbox);
|
vbox);
|
||||||
|
gtk_widget_show (vbox);
|
||||||
|
|
||||||
/* The name label and entry */
|
|
||||||
table = gtk_table_new (1, 2, FALSE);
|
table = gtk_table_new (1, 2, FALSE);
|
||||||
gtk_table_set_col_spacing (GTK_TABLE (table), 0, 4);
|
gtk_table_set_col_spacing (GTK_TABLE (table), 0, 4);
|
||||||
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
|
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
|
||||||
|
@ -1011,10 +983,10 @@ layers_edit_layer_query (GimpLayer *layer,
|
||||||
options);
|
options);
|
||||||
}
|
}
|
||||||
|
|
||||||
gtk_widget_show (vbox);
|
|
||||||
gtk_widget_show (options->query_box);
|
gtk_widget_show (options->query_box);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*******************************/
|
/*******************************/
|
||||||
/* The add mask query dialog */
|
/* The add mask query dialog */
|
||||||
/*******************************/
|
/*******************************/
|
||||||
|
@ -1216,6 +1188,7 @@ layers_scale_layer_query (GimpDisplay *gdisp,
|
||||||
gtk_widget_show (options->dialog->shell);
|
gtk_widget_show (options->dialog->shell);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*****************************/
|
/*****************************/
|
||||||
/* The resize layer dialog */
|
/* The resize layer dialog */
|
||||||
/*****************************/
|
/*****************************/
|
||||||
|
@ -1225,6 +1198,7 @@ typedef struct _ResizeLayerOptions ResizeLayerOptions;
|
||||||
struct _ResizeLayerOptions
|
struct _ResizeLayerOptions
|
||||||
{
|
{
|
||||||
GimpLayer *layer;
|
GimpLayer *layer;
|
||||||
|
GimpContext *context;
|
||||||
ResizeDialog *dialog;
|
ResizeDialog *dialog;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1243,7 +1217,7 @@ resize_layer_query_ok_callback (GtkWidget *widget,
|
||||||
gtk_widget_set_sensitive (options->dialog->shell, FALSE);
|
gtk_widget_set_sensitive (options->dialog->shell, FALSE);
|
||||||
|
|
||||||
gimp_item_resize (GIMP_ITEM (layer),
|
gimp_item_resize (GIMP_ITEM (layer),
|
||||||
gimp_get_user_context (gimage->gimp),
|
options->context,
|
||||||
options->dialog->width,
|
options->dialog->width,
|
||||||
options->dialog->height,
|
options->dialog->height,
|
||||||
options->dialog->offset_x,
|
options->dialog->offset_x,
|
||||||
|
@ -1260,15 +1234,17 @@ resize_layer_query_ok_callback (GtkWidget *widget,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
layers_resize_layer_query (GimpImage *gimage,
|
layers_resize_layer_query (GimpImage *gimage,
|
||||||
GimpLayer *layer,
|
GimpLayer *layer,
|
||||||
GtkWidget *parent)
|
GimpContext *context,
|
||||||
|
GtkWidget *parent)
|
||||||
{
|
{
|
||||||
ResizeLayerOptions *options;
|
ResizeLayerOptions *options;
|
||||||
|
|
||||||
options = g_new0 (ResizeLayerOptions, 1);
|
options = g_new0 (ResizeLayerOptions, 1);
|
||||||
|
|
||||||
options->layer = layer;
|
options->context = context;
|
||||||
|
options->layer = layer;
|
||||||
|
|
||||||
options->dialog =
|
options->dialog =
|
||||||
resize_dialog_new (GIMP_VIEWABLE (layer), parent,
|
resize_dialog_new (GIMP_VIEWABLE (layer), parent,
|
||||||
|
|
|
@ -20,6 +20,13 @@
|
||||||
#define __LAYERS_COMMANDS_H__
|
#define __LAYERS_COMMANDS_H__
|
||||||
|
|
||||||
|
|
||||||
|
void layers_text_tool_cmd_callback (GtkAction *action,
|
||||||
|
gpointer data);
|
||||||
|
void layers_edit_attributes_cmd_callback (GtkAction *action,
|
||||||
|
gpointer data);
|
||||||
|
void layers_new_cmd_callback (GtkAction *action,
|
||||||
|
gpointer data);
|
||||||
|
|
||||||
void layers_select_previous_cmd_callback (GtkAction *action,
|
void layers_select_previous_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
void layers_select_next_cmd_callback (GtkAction *action,
|
void layers_select_next_cmd_callback (GtkAction *action,
|
||||||
|
@ -29,71 +36,62 @@ void layers_select_top_cmd_callback (GtkAction *action,
|
||||||
void layers_select_bottom_cmd_callback (GtkAction *action,
|
void layers_select_bottom_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
|
|
||||||
void layers_raise_cmd_callback (GtkAction *action,
|
void layers_raise_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
void layers_lower_cmd_callback (GtkAction *action,
|
void layers_lower_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
void layers_raise_to_top_cmd_callback (GtkAction *action,
|
void layers_raise_to_top_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
void layers_lower_to_bottom_cmd_callback (GtkAction *action,
|
void layers_lower_to_bottom_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
|
|
||||||
void layers_new_cmd_callback (GtkAction *action,
|
void layers_duplicate_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
void layers_duplicate_cmd_callback (GtkAction *action,
|
void layers_anchor_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
void layers_anchor_cmd_callback (GtkAction *action,
|
void layers_merge_down_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
void layers_merge_down_cmd_callback (GtkAction *action,
|
void layers_delete_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
void layers_delete_cmd_callback (GtkAction *action,
|
void layers_text_discard_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
void layers_text_discard_cmd_callback (GtkAction *action,
|
|
||||||
gpointer data);
|
|
||||||
|
|
||||||
void layers_resize_cmd_callback (GtkAction *action,
|
void layers_resize_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
void layers_resize_to_image_cmd_callback (GtkAction *action,
|
void layers_resize_to_image_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
void layers_scale_cmd_callback (GtkAction *action,
|
void layers_scale_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
void layers_crop_cmd_callback (GtkAction *action,
|
void layers_crop_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
|
|
||||||
void layers_mask_add_cmd_callback (GtkAction *action,
|
void layers_mask_add_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
void layers_mask_apply_cmd_callback (GtkAction *action,
|
void layers_mask_apply_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
void layers_mask_delete_cmd_callback (GtkAction *action,
|
void layers_mask_delete_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
void layers_mask_to_selection_cmd_callback (GtkAction *action,
|
void layers_mask_to_selection_cmd_callback (GtkAction *action,
|
||||||
gint value,
|
gint value,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
|
|
||||||
void layers_alpha_add_cmd_callback (GtkAction *action,
|
void layers_alpha_add_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
void layers_alpha_to_selection_cmd_callback (GtkAction *action,
|
void layers_alpha_to_selection_cmd_callback (GtkAction *action,
|
||||||
gint value,
|
gint value,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
|
|
||||||
void layers_merge_layers_cmd_callback (GtkAction *action,
|
void layers_text_tool (GimpLayer *layer,
|
||||||
gpointer data);
|
GimpContext *context,
|
||||||
void layers_flatten_image_cmd_callback (GtkAction *action,
|
GtkWidget *parent);
|
||||||
gpointer data);
|
void layers_new_layer_query (GimpImage *gimage,
|
||||||
|
GimpContext *context,
|
||||||
void layers_text_tool_cmd_callback (GtkAction *action,
|
GimpLayer *template,
|
||||||
gpointer data);
|
gboolean interactive,
|
||||||
void layers_edit_attributes_cmd_callback (GtkAction *action,
|
GtkWidget *parent);
|
||||||
gpointer data);
|
void layers_edit_layer_query (GimpLayer *layer,
|
||||||
|
GimpContext *context,
|
||||||
void layers_text_tool (GimpLayer *layer,
|
GtkWidget *parent);
|
||||||
GtkWidget *parent);
|
|
||||||
void layers_new_layer_query (GimpImage *gimage,
|
|
||||||
GimpLayer *template,
|
|
||||||
gboolean interactive,
|
|
||||||
GtkWidget *parent);
|
|
||||||
void layers_edit_layer_query (GimpLayer *layer,
|
|
||||||
GtkWidget *parent);
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* __LAYERS_COMMANDS_H__ */
|
#endif /* __LAYERS_COMMANDS_H__ */
|
||||||
|
|
|
@ -25,7 +25,6 @@
|
||||||
|
|
||||||
#include "actions-types.h"
|
#include "actions-types.h"
|
||||||
|
|
||||||
#include "core/gimp.h"
|
|
||||||
#include "core/gimpchannel.h"
|
#include "core/gimpchannel.h"
|
||||||
#include "core/gimpchannel-select.h"
|
#include "core/gimpchannel-select.h"
|
||||||
#include "core/gimpimage.h"
|
#include "core/gimpimage.h"
|
||||||
|
@ -77,7 +76,7 @@ static gboolean selection_shrink_edge_lock = FALSE;
|
||||||
|
|
||||||
void
|
void
|
||||||
select_invert_cmd_callback (GtkAction *action,
|
select_invert_cmd_callback (GtkAction *action,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpImage *gimage;
|
GimpImage *gimage;
|
||||||
return_if_no_image (gimage, data);
|
return_if_no_image (gimage, data);
|
||||||
|
@ -88,7 +87,7 @@ select_invert_cmd_callback (GtkAction *action,
|
||||||
|
|
||||||
void
|
void
|
||||||
select_all_cmd_callback (GtkAction *action,
|
select_all_cmd_callback (GtkAction *action,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpImage *gimage;
|
GimpImage *gimage;
|
||||||
return_if_no_image (gimage, data);
|
return_if_no_image (gimage, data);
|
||||||
|
@ -99,7 +98,7 @@ select_all_cmd_callback (GtkAction *action,
|
||||||
|
|
||||||
void
|
void
|
||||||
select_none_cmd_callback (GtkAction *action,
|
select_none_cmd_callback (GtkAction *action,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpImage *gimage;
|
GimpImage *gimage;
|
||||||
return_if_no_image (gimage, data);
|
return_if_no_image (gimage, data);
|
||||||
|
@ -130,21 +129,21 @@ select_from_vectors_cmd_callback (GtkAction *action,
|
||||||
|
|
||||||
void
|
void
|
||||||
select_float_cmd_callback (GtkAction *action,
|
select_float_cmd_callback (GtkAction *action,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpImage *gimage;
|
GimpImage *gimage;
|
||||||
return_if_no_image (gimage, data);
|
return_if_no_image (gimage, data);
|
||||||
|
|
||||||
gimp_selection_float (gimp_image_get_mask (gimage),
|
gimp_selection_float (gimp_image_get_mask (gimage),
|
||||||
gimp_image_active_drawable (gimage),
|
gimp_image_active_drawable (gimage),
|
||||||
gimp_get_user_context (gimage->gimp),
|
action_data_get_context (data),
|
||||||
TRUE, 0, 0);
|
TRUE, 0, 0);
|
||||||
gimp_image_flush (gimage);
|
gimp_image_flush (gimage);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
select_feather_cmd_callback (GtkAction *action,
|
select_feather_cmd_callback (GtkAction *action,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpDisplay *gdisp;
|
GimpDisplay *gdisp;
|
||||||
GtkWidget *qbox;
|
GtkWidget *qbox;
|
||||||
|
@ -152,22 +151,22 @@ select_feather_cmd_callback (GtkAction *action,
|
||||||
|
|
||||||
qbox = gimp_query_size_box (_("Feather Selection"),
|
qbox = gimp_query_size_box (_("Feather Selection"),
|
||||||
gdisp->shell,
|
gdisp->shell,
|
||||||
gimp_standard_help_func,
|
gimp_standard_help_func,
|
||||||
GIMP_HELP_SELECTION_FEATHER,
|
GIMP_HELP_SELECTION_FEATHER,
|
||||||
_("Feather selection by"),
|
_("Feather selection by"),
|
||||||
selection_feather_radius, 0, 32767, 3,
|
selection_feather_radius, 0, 32767, 3,
|
||||||
gdisp->gimage->unit,
|
gdisp->gimage->unit,
|
||||||
MIN (gdisp->gimage->xresolution,
|
MIN (gdisp->gimage->xresolution,
|
||||||
gdisp->gimage->yresolution),
|
gdisp->gimage->yresolution),
|
||||||
GIMP_DISPLAY_SHELL (gdisp->shell)->dot_for_dot,
|
GIMP_DISPLAY_SHELL (gdisp->shell)->dot_for_dot,
|
||||||
G_OBJECT (gdisp->gimage), "disconnect",
|
G_OBJECT (gdisp->gimage), "disconnect",
|
||||||
gimp_image_mask_feather_callback, gdisp->gimage);
|
gimp_image_mask_feather_callback, gdisp->gimage);
|
||||||
gtk_widget_show (qbox);
|
gtk_widget_show (qbox);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
select_sharpen_cmd_callback (GtkAction *action,
|
select_sharpen_cmd_callback (GtkAction *action,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpImage *gimage;
|
GimpImage *gimage;
|
||||||
return_if_no_image (gimage, data);
|
return_if_no_image (gimage, data);
|
||||||
|
@ -178,7 +177,7 @@ select_sharpen_cmd_callback (GtkAction *action,
|
||||||
|
|
||||||
void
|
void
|
||||||
select_shrink_cmd_callback (GtkAction *action,
|
select_shrink_cmd_callback (GtkAction *action,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpDisplay *gdisp;
|
GimpDisplay *gdisp;
|
||||||
GtkWidget *shrink_dialog;
|
GtkWidget *shrink_dialog;
|
||||||
|
@ -206,7 +205,7 @@ select_shrink_cmd_callback (GtkAction *action,
|
||||||
|
|
||||||
g_object_set_data (G_OBJECT (shrink_dialog), "edge_lock_toggle", edge_lock);
|
g_object_set_data (G_OBJECT (shrink_dialog), "edge_lock_toggle", edge_lock);
|
||||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (edge_lock),
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (edge_lock),
|
||||||
! selection_shrink_edge_lock);
|
! selection_shrink_edge_lock);
|
||||||
gtk_widget_show (edge_lock);
|
gtk_widget_show (edge_lock);
|
||||||
|
|
||||||
gtk_widget_show (shrink_dialog);
|
gtk_widget_show (shrink_dialog);
|
||||||
|
@ -214,7 +213,7 @@ select_shrink_cmd_callback (GtkAction *action,
|
||||||
|
|
||||||
void
|
void
|
||||||
select_grow_cmd_callback (GtkAction *action,
|
select_grow_cmd_callback (GtkAction *action,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpDisplay *gdisp;
|
GimpDisplay *gdisp;
|
||||||
GtkWidget *qbox;
|
GtkWidget *qbox;
|
||||||
|
@ -237,7 +236,7 @@ select_grow_cmd_callback (GtkAction *action,
|
||||||
|
|
||||||
void
|
void
|
||||||
select_border_cmd_callback (GtkAction *action,
|
select_border_cmd_callback (GtkAction *action,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpDisplay *gdisp;
|
GimpDisplay *gdisp;
|
||||||
GtkWidget *qbox;
|
GtkWidget *qbox;
|
||||||
|
@ -260,7 +259,7 @@ select_border_cmd_callback (GtkAction *action,
|
||||||
|
|
||||||
void
|
void
|
||||||
select_save_cmd_callback (GtkAction *action,
|
select_save_cmd_callback (GtkAction *action,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpImage *gimage;
|
GimpImage *gimage;
|
||||||
GtkWidget *widget;
|
GtkWidget *widget;
|
||||||
|
@ -310,12 +309,10 @@ gimp_image_mask_feather_callback (GtkWidget *widget,
|
||||||
GimpUnit unit,
|
GimpUnit unit,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpImage *gimage;
|
GimpImage *gimage = GIMP_IMAGE (data);
|
||||||
gdouble radius_x;
|
gdouble radius_x;
|
||||||
gdouble radius_y;
|
gdouble radius_y;
|
||||||
|
|
||||||
gimage = GIMP_IMAGE (data);
|
|
||||||
|
|
||||||
selection_feather_radius = size;
|
selection_feather_radius = size;
|
||||||
|
|
||||||
radius_x = radius_y = selection_feather_radius;
|
radius_x = radius_y = selection_feather_radius;
|
||||||
|
@ -325,12 +322,12 @@ gimp_image_mask_feather_callback (GtkWidget *widget,
|
||||||
gdouble factor;
|
gdouble factor;
|
||||||
|
|
||||||
factor = (MAX (gimage->xresolution, gimage->yresolution) /
|
factor = (MAX (gimage->xresolution, gimage->yresolution) /
|
||||||
MIN (gimage->xresolution, gimage->yresolution));
|
MIN (gimage->xresolution, gimage->yresolution));
|
||||||
|
|
||||||
if (gimage->xresolution == MIN (gimage->xresolution, gimage->yresolution))
|
if (gimage->xresolution == MIN (gimage->xresolution, gimage->yresolution))
|
||||||
radius_y *= factor;
|
radius_y *= factor;
|
||||||
else
|
else
|
||||||
radius_x *= factor;
|
radius_x *= factor;
|
||||||
}
|
}
|
||||||
|
|
||||||
gimp_channel_feather (gimp_image_get_mask (gimage), radius_x, radius_y, TRUE);
|
gimp_channel_feather (gimp_image_get_mask (gimage), radius_x, radius_y, TRUE);
|
||||||
|
@ -343,12 +340,10 @@ gimp_image_mask_border_callback (GtkWidget *widget,
|
||||||
GimpUnit unit,
|
GimpUnit unit,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpImage *gimage;
|
GimpImage *gimage = GIMP_IMAGE (data);
|
||||||
gdouble radius_x;
|
gdouble radius_x;
|
||||||
gdouble radius_y;
|
gdouble radius_y;
|
||||||
|
|
||||||
gimage = GIMP_IMAGE (data);
|
|
||||||
|
|
||||||
selection_border_radius = ROUND (size);
|
selection_border_radius = ROUND (size);
|
||||||
|
|
||||||
radius_x = radius_y = selection_border_radius;
|
radius_x = radius_y = selection_border_radius;
|
||||||
|
@ -358,12 +353,12 @@ gimp_image_mask_border_callback (GtkWidget *widget,
|
||||||
gdouble factor;
|
gdouble factor;
|
||||||
|
|
||||||
factor = (MAX (gimage->xresolution, gimage->yresolution) /
|
factor = (MAX (gimage->xresolution, gimage->yresolution) /
|
||||||
MIN (gimage->xresolution, gimage->yresolution));
|
MIN (gimage->xresolution, gimage->yresolution));
|
||||||
|
|
||||||
if (gimage->xresolution == MIN (gimage->xresolution, gimage->yresolution))
|
if (gimage->xresolution == MIN (gimage->xresolution, gimage->yresolution))
|
||||||
radius_y *= factor;
|
radius_y *= factor;
|
||||||
else
|
else
|
||||||
radius_x *= factor;
|
radius_x *= factor;
|
||||||
}
|
}
|
||||||
|
|
||||||
gimp_channel_border (gimp_image_get_mask (gimage), radius_x, radius_y, TRUE);
|
gimp_channel_border (gimp_image_get_mask (gimage), radius_x, radius_y, TRUE);
|
||||||
|
@ -376,12 +371,10 @@ gimp_image_mask_grow_callback (GtkWidget *widget,
|
||||||
GimpUnit unit,
|
GimpUnit unit,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpImage *gimage;
|
GimpImage *gimage = GIMP_IMAGE (data);
|
||||||
gdouble radius_x;
|
gdouble radius_x;
|
||||||
gdouble radius_y;
|
gdouble radius_y;
|
||||||
|
|
||||||
gimage = GIMP_IMAGE (data);
|
|
||||||
|
|
||||||
selection_grow_pixels = ROUND (size);
|
selection_grow_pixels = ROUND (size);
|
||||||
|
|
||||||
radius_x = radius_y = selection_grow_pixels;
|
radius_x = radius_y = selection_grow_pixels;
|
||||||
|
@ -391,12 +384,12 @@ gimp_image_mask_grow_callback (GtkWidget *widget,
|
||||||
gdouble factor;
|
gdouble factor;
|
||||||
|
|
||||||
factor = (MAX (gimage->xresolution, gimage->yresolution) /
|
factor = (MAX (gimage->xresolution, gimage->yresolution) /
|
||||||
MIN (gimage->xresolution, gimage->yresolution));
|
MIN (gimage->xresolution, gimage->yresolution));
|
||||||
|
|
||||||
if (gimage->xresolution == MIN (gimage->xresolution, gimage->yresolution))
|
if (gimage->xresolution == MIN (gimage->xresolution, gimage->yresolution))
|
||||||
radius_y *= factor;
|
radius_y *= factor;
|
||||||
else
|
else
|
||||||
radius_x *= factor;
|
radius_x *= factor;
|
||||||
}
|
}
|
||||||
|
|
||||||
gimp_channel_grow (gimp_image_get_mask (gimage), radius_x, radius_y, TRUE);
|
gimp_channel_grow (gimp_image_get_mask (gimage), radius_x, radius_y, TRUE);
|
||||||
|
@ -409,31 +402,29 @@ gimp_image_mask_shrink_callback (GtkWidget *widget,
|
||||||
GimpUnit unit,
|
GimpUnit unit,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpImage *gimage;
|
GimpImage *gimage = GIMP_IMAGE (data);
|
||||||
gint radius_x;
|
gint radius_x;
|
||||||
gint radius_y;
|
gint radius_y;
|
||||||
|
|
||||||
gimage = GIMP_IMAGE (data);
|
|
||||||
|
|
||||||
selection_shrink_pixels = ROUND (size);
|
selection_shrink_pixels = ROUND (size);
|
||||||
|
|
||||||
radius_x = radius_y = selection_shrink_pixels;
|
radius_x = radius_y = selection_shrink_pixels;
|
||||||
|
|
||||||
selection_shrink_edge_lock =
|
selection_shrink_edge_lock =
|
||||||
! GTK_TOGGLE_BUTTON (g_object_get_data (G_OBJECT (widget),
|
! GTK_TOGGLE_BUTTON (g_object_get_data (G_OBJECT (widget),
|
||||||
"edge_lock_toggle"))->active;
|
"edge_lock_toggle"))->active;
|
||||||
|
|
||||||
if (unit != GIMP_UNIT_PIXEL)
|
if (unit != GIMP_UNIT_PIXEL)
|
||||||
{
|
{
|
||||||
gdouble factor;
|
gdouble factor;
|
||||||
|
|
||||||
factor = (MAX (gimage->xresolution, gimage->yresolution) /
|
factor = (MAX (gimage->xresolution, gimage->yresolution) /
|
||||||
MIN (gimage->xresolution, gimage->yresolution));
|
MIN (gimage->xresolution, gimage->yresolution));
|
||||||
|
|
||||||
if (gimage->xresolution == MIN (gimage->xresolution, gimage->yresolution))
|
if (gimage->xresolution == MIN (gimage->xresolution, gimage->yresolution))
|
||||||
radius_y *= factor;
|
radius_y *= factor;
|
||||||
else
|
else
|
||||||
radius_x *= factor;
|
radius_x *= factor;
|
||||||
}
|
}
|
||||||
|
|
||||||
gimp_channel_shrink (gimp_image_get_mask (gimage), radius_x, radius_y,
|
gimp_channel_shrink (gimp_image_get_mask (gimage), radius_x, radius_y,
|
||||||
|
|
|
@ -72,6 +72,32 @@ static void vectors_export_query (GimpImage *gimage,
|
||||||
|
|
||||||
/* public functions */
|
/* public functions */
|
||||||
|
|
||||||
|
void
|
||||||
|
vectors_vectors_tool_cmd_callback (GtkAction *action,
|
||||||
|
gpointer data)
|
||||||
|
{
|
||||||
|
GimpImage *gimage;
|
||||||
|
GimpVectors *vectors;
|
||||||
|
GtkWidget *widget;
|
||||||
|
return_if_no_vectors (gimage, vectors, data);
|
||||||
|
return_if_no_widget (widget, data);
|
||||||
|
|
||||||
|
vectors_vectors_tool (vectors, action_data_get_context (data), widget);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
vectors_edit_attributes_cmd_callback (GtkAction *action,
|
||||||
|
gpointer data)
|
||||||
|
{
|
||||||
|
GimpImage *gimage;
|
||||||
|
GimpVectors *vectors;
|
||||||
|
GtkWidget *widget;
|
||||||
|
return_if_no_vectors (gimage, vectors, data);
|
||||||
|
return_if_no_widget (widget, data);
|
||||||
|
|
||||||
|
vectors_edit_vectors_query (vectors, action_data_get_context (data), widget);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
vectors_new_cmd_callback (GtkAction *action,
|
vectors_new_cmd_callback (GtkAction *action,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
|
@ -81,7 +107,8 @@ vectors_new_cmd_callback (GtkAction *action,
|
||||||
return_if_no_image (gimage, data);
|
return_if_no_image (gimage, data);
|
||||||
return_if_no_widget (widget, data);
|
return_if_no_widget (widget, data);
|
||||||
|
|
||||||
vectors_new_vectors_query (gimage, NULL, TRUE, widget);
|
vectors_new_vectors_query (gimage, action_data_get_context (data),
|
||||||
|
NULL, TRUE, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -89,10 +116,10 @@ vectors_raise_to_top_cmd_callback (GtkAction *action,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpImage *gimage;
|
GimpImage *gimage;
|
||||||
GimpVectors *active_vectors;
|
GimpVectors *vectors;
|
||||||
return_if_no_vectors (gimage, active_vectors, data);
|
return_if_no_vectors (gimage, vectors, data);
|
||||||
|
|
||||||
gimp_image_raise_vectors_to_top (gimage, active_vectors);
|
gimp_image_raise_vectors_to_top (gimage, vectors);
|
||||||
gimp_image_flush (gimage);
|
gimp_image_flush (gimage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,10 +128,10 @@ vectors_raise_cmd_callback (GtkAction *action,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpImage *gimage;
|
GimpImage *gimage;
|
||||||
GimpVectors *active_vectors;
|
GimpVectors *vectors;
|
||||||
return_if_no_vectors (gimage, active_vectors, data);
|
return_if_no_vectors (gimage, vectors, data);
|
||||||
|
|
||||||
gimp_image_raise_vectors (gimage, active_vectors);
|
gimp_image_raise_vectors (gimage, vectors);
|
||||||
gimp_image_flush (gimage);
|
gimp_image_flush (gimage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,10 +140,10 @@ vectors_lower_cmd_callback (GtkAction *action,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpImage *gimage;
|
GimpImage *gimage;
|
||||||
GimpVectors *active_vectors;
|
GimpVectors *vectors;
|
||||||
return_if_no_vectors (gimage, active_vectors, data);
|
return_if_no_vectors (gimage, vectors, data);
|
||||||
|
|
||||||
gimp_image_lower_vectors (gimage, active_vectors);
|
gimp_image_lower_vectors (gimage, vectors);
|
||||||
gimp_image_flush (gimage);
|
gimp_image_flush (gimage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -125,10 +152,10 @@ vectors_lower_to_bottom_cmd_callback (GtkAction *action,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpImage *gimage;
|
GimpImage *gimage;
|
||||||
GimpVectors *active_vectors;
|
GimpVectors *vectors;
|
||||||
return_if_no_vectors (gimage, active_vectors, data);
|
return_if_no_vectors (gimage, vectors, data);
|
||||||
|
|
||||||
gimp_image_lower_vectors_to_bottom (gimage, active_vectors);
|
gimp_image_lower_vectors_to_bottom (gimage, vectors);
|
||||||
gimp_image_flush (gimage);
|
gimp_image_flush (gimage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -137,14 +164,13 @@ vectors_duplicate_cmd_callback (GtkAction *action,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpImage *gimage;
|
GimpImage *gimage;
|
||||||
GimpVectors *active_vectors;
|
GimpVectors *vectors;
|
||||||
GimpVectors *new_vectors;
|
GimpVectors *new_vectors;
|
||||||
return_if_no_vectors (gimage, active_vectors, data);
|
return_if_no_vectors (gimage, vectors, data);
|
||||||
|
|
||||||
new_vectors =
|
new_vectors =GIMP_VECTORS (gimp_item_duplicate (GIMP_ITEM (vectors),
|
||||||
GIMP_VECTORS (gimp_item_duplicate (GIMP_ITEM (active_vectors),
|
G_TYPE_FROM_INSTANCE (vectors),
|
||||||
G_TYPE_FROM_INSTANCE (active_vectors),
|
TRUE));
|
||||||
TRUE));
|
|
||||||
gimp_image_add_vectors (gimage, new_vectors, -1);
|
gimp_image_add_vectors (gimage, new_vectors, -1);
|
||||||
gimp_image_flush (gimage);
|
gimp_image_flush (gimage);
|
||||||
}
|
}
|
||||||
|
@ -154,10 +180,10 @@ vectors_delete_cmd_callback (GtkAction *action,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpImage *gimage;
|
GimpImage *gimage;
|
||||||
GimpVectors *active_vectors;
|
GimpVectors *vectors;
|
||||||
return_if_no_vectors (gimage, active_vectors, data);
|
return_if_no_vectors (gimage, vectors, data);
|
||||||
|
|
||||||
gimp_image_remove_vectors (gimage, active_vectors);
|
gimp_image_remove_vectors (gimage, vectors);
|
||||||
gimp_image_flush (gimage);
|
gimp_image_flush (gimage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -166,8 +192,8 @@ vectors_merge_visible_cmd_callback (GtkAction *action,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpImage *gimage;
|
GimpImage *gimage;
|
||||||
GimpVectors *active_vectors;
|
GimpVectors *vectors;
|
||||||
return_if_no_vectors (gimage, active_vectors, data);
|
return_if_no_vectors (gimage, vectors, data);
|
||||||
|
|
||||||
gimp_image_merge_visible_vectors (gimage);
|
gimp_image_merge_visible_vectors (gimage);
|
||||||
gimp_image_flush (gimage);
|
gimp_image_flush (gimage);
|
||||||
|
@ -180,14 +206,14 @@ vectors_to_selection_cmd_callback (GtkAction *action,
|
||||||
{
|
{
|
||||||
GimpChannelOps op;
|
GimpChannelOps op;
|
||||||
GimpImage *gimage;
|
GimpImage *gimage;
|
||||||
GimpVectors *active_vectors;
|
GimpVectors *vectors;
|
||||||
return_if_no_vectors (gimage, active_vectors, data);
|
return_if_no_vectors (gimage, vectors, data);
|
||||||
|
|
||||||
op = (GimpChannelOps) value;
|
op = (GimpChannelOps) value;
|
||||||
|
|
||||||
gimp_channel_select_vectors (gimp_image_get_mask (gimage),
|
gimp_channel_select_vectors (gimp_image_get_mask (gimage),
|
||||||
_("Path to Selection"),
|
_("Path to Selection"),
|
||||||
active_vectors,
|
vectors,
|
||||||
op, TRUE, FALSE, 0, 0);
|
op, TRUE, FALSE, 0, 0);
|
||||||
gimp_image_flush (gimage);
|
gimp_image_flush (gimage);
|
||||||
}
|
}
|
||||||
|
@ -216,7 +242,7 @@ vectors_selection_to_vectors_cmd_callback (GtkAction *action,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
gdisp = gimp_context_get_display (gimp_get_user_context (gimage->gimp));
|
gdisp = gimp_context_get_display (action_data_get_context (data));
|
||||||
|
|
||||||
/* plug-in arguments as if called by <Image>/Filters/... */
|
/* plug-in arguments as if called by <Image>/Filters/... */
|
||||||
args = g_new (Argument, 3);
|
args = g_new (Argument, 3);
|
||||||
|
@ -228,7 +254,7 @@ vectors_selection_to_vectors_cmd_callback (GtkAction *action,
|
||||||
args[2].arg_type = GIMP_PDB_DRAWABLE;
|
args[2].arg_type = GIMP_PDB_DRAWABLE;
|
||||||
args[2].value.pdb_int = -1; /* unused */
|
args[2].value.pdb_int = -1; /* unused */
|
||||||
|
|
||||||
plug_in_run (gimage->gimp, gimp_get_user_context (gimage->gimp),
|
plug_in_run (gimage->gimp, action_data_get_context (data),
|
||||||
proc_rec, args, 3, FALSE, TRUE,
|
proc_rec, args, 3, FALSE, TRUE,
|
||||||
gdisp ? gdisp->ID : 0);
|
gdisp ? gdisp->ID : 0);
|
||||||
|
|
||||||
|
@ -267,8 +293,8 @@ vectors_copy_cmd_callback (GtkAction *action,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpImage *gimage;
|
GimpImage *gimage;
|
||||||
GimpVectors *active_vectors;
|
GimpVectors *vectors;
|
||||||
return_if_no_vectors (gimage, active_vectors, data);
|
return_if_no_vectors (gimage, vectors, data);
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
#warning FIXME: need vectors clipboard
|
#warning FIXME: need vectors clipboard
|
||||||
|
@ -304,45 +330,24 @@ vectors_export_cmd_callback (GtkAction *action,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpImage *gimage;
|
GimpImage *gimage;
|
||||||
GimpVectors *active_vectors;
|
GimpVectors *vectors;
|
||||||
GtkWidget *widget;
|
GtkWidget *widget;
|
||||||
return_if_no_vectors (gimage, active_vectors, data);
|
return_if_no_vectors (gimage, vectors, data);
|
||||||
return_if_no_widget (widget, data);
|
return_if_no_widget (widget, data);
|
||||||
|
|
||||||
vectors_export_query (gimage, active_vectors, widget);
|
vectors_export_query (gimage, vectors, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
vectors_vectors_tool_cmd_callback (GtkAction *action,
|
vectors_vectors_tool (GimpVectors *vectors,
|
||||||
gpointer data)
|
GimpContext *context,
|
||||||
{
|
GtkWidget *parent)
|
||||||
GimpImage *gimage;
|
|
||||||
GimpVectors *active_vectors;
|
|
||||||
return_if_no_vectors (gimage, active_vectors, data);
|
|
||||||
|
|
||||||
vectors_vectors_tool (active_vectors);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
vectors_edit_attributes_cmd_callback (GtkAction *action,
|
|
||||||
gpointer data)
|
|
||||||
{
|
|
||||||
GimpImage *gimage;
|
|
||||||
GimpVectors *active_vectors;
|
|
||||||
GtkWidget *widget;
|
|
||||||
return_if_no_vectors (gimage, active_vectors, data);
|
|
||||||
return_if_no_widget (widget, data);
|
|
||||||
|
|
||||||
vectors_edit_vectors_query (active_vectors, widget);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
vectors_vectors_tool (GimpVectors *vectors)
|
|
||||||
{
|
{
|
||||||
GimpImage *gimage;
|
GimpImage *gimage;
|
||||||
GimpTool *active_tool;
|
GimpTool *active_tool;
|
||||||
|
|
||||||
g_return_if_fail (GIMP_IS_VECTORS (vectors));
|
g_return_if_fail (GIMP_IS_VECTORS (vectors));
|
||||||
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
||||||
|
|
||||||
gimage = gimp_item_get_image (GIMP_ITEM (vectors));
|
gimage = gimp_item_get_image (GIMP_ITEM (vectors));
|
||||||
|
|
||||||
|
@ -361,9 +366,7 @@ vectors_vectors_tool (GimpVectors *vectors)
|
||||||
|
|
||||||
if (GIMP_IS_TOOL_INFO (tool_info))
|
if (GIMP_IS_TOOL_INFO (tool_info))
|
||||||
{
|
{
|
||||||
gimp_context_set_tool (gimp_get_user_context (gimage->gimp),
|
gimp_context_set_tool (context, tool_info);
|
||||||
tool_info);
|
|
||||||
|
|
||||||
active_tool = tool_manager_get_active (gimage->gimp);
|
active_tool = tool_manager_get_active (gimage->gimp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -380,10 +383,10 @@ typedef struct _NewVectorsOptions NewVectorsOptions;
|
||||||
|
|
||||||
struct _NewVectorsOptions
|
struct _NewVectorsOptions
|
||||||
{
|
{
|
||||||
GtkWidget *query_box;
|
GtkWidget *query_box;
|
||||||
GtkWidget *name_entry;
|
GtkWidget *name_entry;
|
||||||
|
|
||||||
GimpImage *gimage;
|
GimpImage *gimage;
|
||||||
};
|
};
|
||||||
|
|
||||||
static gchar *vectors_name = NULL;
|
static gchar *vectors_name = NULL;
|
||||||
|
@ -397,21 +400,17 @@ new_vectors_query_response (GtkWidget *widget,
|
||||||
if (response_id == GTK_RESPONSE_OK)
|
if (response_id == GTK_RESPONSE_OK)
|
||||||
{
|
{
|
||||||
GimpVectors *new_vectors;
|
GimpVectors *new_vectors;
|
||||||
GimpImage *gimage;
|
|
||||||
|
|
||||||
if (vectors_name)
|
if (vectors_name)
|
||||||
g_free (vectors_name);
|
g_free (vectors_name);
|
||||||
vectors_name =
|
vectors_name =
|
||||||
g_strdup (gtk_entry_get_text (GTK_ENTRY (options->name_entry)));
|
g_strdup (gtk_entry_get_text (GTK_ENTRY (options->name_entry)));
|
||||||
|
|
||||||
if ((gimage = options->gimage))
|
new_vectors = gimp_vectors_new (options->gimage, vectors_name);
|
||||||
{
|
|
||||||
new_vectors = gimp_vectors_new (gimage, vectors_name);
|
|
||||||
|
|
||||||
gimp_image_add_vectors (gimage, new_vectors, -1);
|
gimp_image_add_vectors (options->gimage, new_vectors, -1);
|
||||||
|
|
||||||
gimp_image_flush (gimage);
|
gimp_image_flush (options->gimage);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gtk_widget_destroy (options->query_box);
|
gtk_widget_destroy (options->query_box);
|
||||||
|
@ -419,6 +418,7 @@ new_vectors_query_response (GtkWidget *widget,
|
||||||
|
|
||||||
void
|
void
|
||||||
vectors_new_vectors_query (GimpImage *gimage,
|
vectors_new_vectors_query (GimpImage *gimage,
|
||||||
|
GimpContext *context,
|
||||||
GimpVectors *template,
|
GimpVectors *template,
|
||||||
gboolean interactive,
|
gboolean interactive,
|
||||||
GtkWidget *parent)
|
GtkWidget *parent)
|
||||||
|
@ -430,6 +430,7 @@ vectors_new_vectors_query (GimpImage *gimage,
|
||||||
GtkWidget *label;
|
GtkWidget *label;
|
||||||
|
|
||||||
g_return_if_fail (GIMP_IS_IMAGE (gimage));
|
g_return_if_fail (GIMP_IS_IMAGE (gimage));
|
||||||
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
||||||
g_return_if_fail (! template || GIMP_IS_VECTORS (template));
|
g_return_if_fail (! template || GIMP_IS_VECTORS (template));
|
||||||
|
|
||||||
if (template || ! interactive)
|
if (template || ! interactive)
|
||||||
|
@ -470,21 +471,21 @@ vectors_new_vectors_query (GimpImage *gimage,
|
||||||
(GWeakNotify) g_free,
|
(GWeakNotify) g_free,
|
||||||
options);
|
options);
|
||||||
|
|
||||||
/* The main hbox */
|
|
||||||
hbox = gtk_hbox_new (FALSE, 6);
|
hbox = gtk_hbox_new (FALSE, 6);
|
||||||
gtk_container_set_border_width (GTK_CONTAINER (hbox), 12);
|
gtk_container_set_border_width (GTK_CONTAINER (hbox), 12);
|
||||||
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (options->query_box)->vbox),
|
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (options->query_box)->vbox),
|
||||||
hbox);
|
hbox);
|
||||||
|
gtk_widget_show (hbox);
|
||||||
|
|
||||||
/* The vbox */
|
|
||||||
vbox = gtk_vbox_new (FALSE, 2);
|
vbox = gtk_vbox_new (FALSE, 2);
|
||||||
gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
|
gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
|
||||||
|
gtk_widget_show (vbox);
|
||||||
|
|
||||||
/* The table */
|
|
||||||
table = gtk_table_new (2, 3, FALSE);
|
table = gtk_table_new (2, 3, FALSE);
|
||||||
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
||||||
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
|
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
|
||||||
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
|
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
|
||||||
|
gtk_widget_show (table);
|
||||||
|
|
||||||
/* The name entry hbox, label and entry */
|
/* The name entry hbox, label and entry */
|
||||||
label = gtk_label_new (_("Path name:"));
|
label = gtk_label_new (_("Path name:"));
|
||||||
|
@ -501,9 +502,6 @@ vectors_new_vectors_query (GimpImage *gimage,
|
||||||
(vectors_name ? vectors_name : _("New Path")));
|
(vectors_name ? vectors_name : _("New Path")));
|
||||||
gtk_widget_show (options->name_entry);
|
gtk_widget_show (options->name_entry);
|
||||||
|
|
||||||
gtk_widget_show (table);
|
|
||||||
gtk_widget_show (vbox);
|
|
||||||
gtk_widget_show (hbox);
|
|
||||||
gtk_widget_show (options->query_box);
|
gtk_widget_show (options->query_box);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -530,18 +528,14 @@ edit_vectors_query_response (GtkWidget *widget,
|
||||||
if (response_id == GTK_RESPONSE_OK)
|
if (response_id == GTK_RESPONSE_OK)
|
||||||
{
|
{
|
||||||
GimpVectors *vectors = options->vectors;
|
GimpVectors *vectors = options->vectors;
|
||||||
|
const gchar *new_name;
|
||||||
|
|
||||||
if (options->gimage)
|
new_name = gtk_entry_get_text (GTK_ENTRY (options->name_entry));
|
||||||
|
|
||||||
|
if (strcmp (new_name, gimp_object_get_name (GIMP_OBJECT (vectors))))
|
||||||
{
|
{
|
||||||
const gchar *new_name;
|
gimp_item_rename (GIMP_ITEM (vectors), new_name);
|
||||||
|
gimp_image_flush (options->gimage);
|
||||||
new_name = gtk_entry_get_text (GTK_ENTRY (options->name_entry));
|
|
||||||
|
|
||||||
if (strcmp (new_name, gimp_object_get_name (GIMP_OBJECT (vectors))))
|
|
||||||
{
|
|
||||||
gimp_item_rename (GIMP_ITEM (vectors), new_name);
|
|
||||||
gimp_image_flush (options->gimage);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -550,6 +544,7 @@ edit_vectors_query_response (GtkWidget *widget,
|
||||||
|
|
||||||
void
|
void
|
||||||
vectors_edit_vectors_query (GimpVectors *vectors,
|
vectors_edit_vectors_query (GimpVectors *vectors,
|
||||||
|
GimpContext *context,
|
||||||
GtkWidget *parent)
|
GtkWidget *parent)
|
||||||
{
|
{
|
||||||
EditVectorsOptions *options;
|
EditVectorsOptions *options;
|
||||||
|
@ -559,6 +554,7 @@ vectors_edit_vectors_query (GimpVectors *vectors,
|
||||||
GtkWidget *label;
|
GtkWidget *label;
|
||||||
|
|
||||||
g_return_if_fail (GIMP_IS_VECTORS (vectors));
|
g_return_if_fail (GIMP_IS_VECTORS (vectors));
|
||||||
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
||||||
|
|
||||||
options = g_new0 (EditVectorsOptions, 1);
|
options = g_new0 (EditVectorsOptions, 1);
|
||||||
|
|
||||||
|
@ -588,21 +584,21 @@ vectors_edit_vectors_query (GimpVectors *vectors,
|
||||||
(GWeakNotify) g_free,
|
(GWeakNotify) g_free,
|
||||||
options);
|
options);
|
||||||
|
|
||||||
/* The main hbox */
|
|
||||||
hbox = gtk_hbox_new (FALSE, 6);
|
hbox = gtk_hbox_new (FALSE, 6);
|
||||||
gtk_container_set_border_width (GTK_CONTAINER (hbox), 12);
|
gtk_container_set_border_width (GTK_CONTAINER (hbox), 12);
|
||||||
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (options->query_box)->vbox),
|
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (options->query_box)->vbox),
|
||||||
hbox);
|
hbox);
|
||||||
|
gtk_widget_show (hbox);
|
||||||
|
|
||||||
/* The vbox */
|
|
||||||
vbox = gtk_vbox_new (FALSE, 2);
|
vbox = gtk_vbox_new (FALSE, 2);
|
||||||
gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
|
gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
|
||||||
|
gtk_widget_show (vbox);
|
||||||
|
|
||||||
/* The table */
|
|
||||||
table = gtk_table_new (2, 3, FALSE);
|
table = gtk_table_new (2, 3, FALSE);
|
||||||
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
||||||
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
|
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
|
||||||
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
|
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
|
||||||
|
gtk_widget_show (table);
|
||||||
|
|
||||||
/* The name entry */
|
/* The name entry */
|
||||||
label = gtk_label_new (_("Path name:"));
|
label = gtk_label_new (_("Path name:"));
|
||||||
|
@ -619,9 +615,6 @@ vectors_edit_vectors_query (GimpVectors *vectors,
|
||||||
gimp_object_get_name (GIMP_OBJECT (vectors)));
|
gimp_object_get_name (GIMP_OBJECT (vectors)));
|
||||||
gtk_widget_show (options->name_entry);
|
gtk_widget_show (options->name_entry);
|
||||||
|
|
||||||
gtk_widget_show (table);
|
|
||||||
gtk_widget_show (vbox);
|
|
||||||
gtk_widget_show (hbox);
|
|
||||||
gtk_widget_show (options->query_box);
|
gtk_widget_show (options->query_box);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,8 +20,13 @@
|
||||||
#define __VECTORS_COMMANDS_H__
|
#define __VECTORS_COMMANDS_H__
|
||||||
|
|
||||||
|
|
||||||
|
void vectors_vectors_tool_cmd_callback (GtkAction *action,
|
||||||
|
gpointer data);
|
||||||
|
void vectors_edit_attributes_cmd_callback (GtkAction *action,
|
||||||
|
gpointer data);
|
||||||
void vectors_new_cmd_callback (GtkAction *action,
|
void vectors_new_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
|
|
||||||
void vectors_raise_cmd_callback (GtkAction *action,
|
void vectors_raise_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
void vectors_raise_to_top_cmd_callback (GtkAction *action,
|
void vectors_raise_to_top_cmd_callback (GtkAction *action,
|
||||||
|
@ -30,6 +35,7 @@ void vectors_lower_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
void vectors_lower_to_bottom_cmd_callback (GtkAction *action,
|
void vectors_lower_to_bottom_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
|
|
||||||
void vectors_duplicate_cmd_callback (GtkAction *action,
|
void vectors_duplicate_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
void vectors_delete_cmd_callback (GtkAction *action,
|
void vectors_delete_cmd_callback (GtkAction *action,
|
||||||
|
@ -44,6 +50,7 @@ void vectors_selection_to_vectors_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
void vectors_stroke_cmd_callback (GtkAction *action,
|
void vectors_stroke_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
|
|
||||||
void vectors_copy_cmd_callback (GtkAction *action,
|
void vectors_copy_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
void vectors_paste_cmd_callback (GtkAction *action,
|
void vectors_paste_cmd_callback (GtkAction *action,
|
||||||
|
@ -52,17 +59,17 @@ void vectors_import_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
void vectors_export_cmd_callback (GtkAction *action,
|
void vectors_export_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
void vectors_vectors_tool_cmd_callback (GtkAction *action,
|
|
||||||
gpointer data);
|
|
||||||
void vectors_edit_attributes_cmd_callback (GtkAction *action,
|
|
||||||
gpointer data);
|
|
||||||
|
|
||||||
void vectors_vectors_tool (GimpVectors *vectors);
|
void vectors_vectors_tool (GimpVectors *vectors,
|
||||||
|
GimpContext *context,
|
||||||
|
GtkWidget *parent);
|
||||||
void vectors_new_vectors_query (GimpImage *gimage,
|
void vectors_new_vectors_query (GimpImage *gimage,
|
||||||
|
GimpContext *context,
|
||||||
GimpVectors *template,
|
GimpVectors *template,
|
||||||
gboolean interactive,
|
gboolean interactive,
|
||||||
GtkWidget *parent);
|
GtkWidget *parent);
|
||||||
void vectors_edit_vectors_query (GimpVectors *vectors,
|
void vectors_edit_vectors_query (GimpVectors *vectors,
|
||||||
|
GimpContext *context,
|
||||||
GtkWidget *parent);
|
GtkWidget *parent);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -217,7 +217,8 @@ gimp_drawable_tree_view_new_dropped (GimpItemTreeView *view,
|
||||||
gimp_image_undo_group_start (view->gimage, GIMP_UNDO_GROUP_EDIT_PASTE,
|
gimp_image_undo_group_start (view->gimage, GIMP_UNDO_GROUP_EDIT_PASTE,
|
||||||
_("New Layer"));
|
_("New Layer"));
|
||||||
|
|
||||||
view->new_item_func (view->gimage, NULL, FALSE, GTK_WIDGET (view));
|
view->new_item_func (view->gimage, view->context,
|
||||||
|
NULL, FALSE, GTK_WIDGET (view));
|
||||||
|
|
||||||
drawable = gimp_image_active_drawable (view->gimage);
|
drawable = gimp_image_active_drawable (view->gimage);
|
||||||
|
|
||||||
|
|
|
@ -876,7 +876,8 @@ gimp_item_tree_view_activate_item (GimpContainerView *view,
|
||||||
if (parent_view_iface->activate_item)
|
if (parent_view_iface->activate_item)
|
||||||
parent_view_iface->activate_item (view, item, insert_data);
|
parent_view_iface->activate_item (view, item, insert_data);
|
||||||
|
|
||||||
item_view->activate_item_func (GIMP_ITEM (item), GTK_WIDGET (view));
|
item_view->activate_item_func (GIMP_ITEM (item), item_view->context,
|
||||||
|
GTK_WIDGET (view));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -985,7 +986,7 @@ gimp_item_tree_view_edit_clicked (GtkWidget *widget,
|
||||||
item = GIMP_ITEM_TREE_VIEW_GET_CLASS (view)->get_active_item (view->gimage);
|
item = GIMP_ITEM_TREE_VIEW_GET_CLASS (view)->get_active_item (view->gimage);
|
||||||
|
|
||||||
if (item)
|
if (item)
|
||||||
view->edit_item_func (item, GTK_WIDGET (view));
|
view->edit_item_func (item, view->context, GTK_WIDGET (view));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -995,7 +996,8 @@ static void
|
||||||
gimp_item_tree_view_new_clicked (GtkWidget *widget,
|
gimp_item_tree_view_new_clicked (GtkWidget *widget,
|
||||||
GimpItemTreeView *view)
|
GimpItemTreeView *view)
|
||||||
{
|
{
|
||||||
view->new_item_func (view->gimage, NULL, FALSE, GTK_WIDGET (view));
|
view->new_item_func (view->gimage, view->context,
|
||||||
|
NULL, FALSE, GTK_WIDGET (view));
|
||||||
gimp_image_flush (view->gimage);
|
gimp_image_flush (view->gimage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1004,7 +1006,8 @@ gimp_item_tree_view_new_extended_clicked (GtkWidget *widget,
|
||||||
guint state,
|
guint state,
|
||||||
GimpItemTreeView *view)
|
GimpItemTreeView *view)
|
||||||
{
|
{
|
||||||
view->new_item_func (view->gimage, NULL, TRUE, GTK_WIDGET (view));
|
view->new_item_func (view->gimage, view->context,
|
||||||
|
NULL, TRUE, GTK_WIDGET (view));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1019,8 +1022,8 @@ gimp_item_tree_view_new_dropped (GtkWidget *widget,
|
||||||
|
|
||||||
if (viewable && gimp_container_have (container, GIMP_OBJECT (viewable)))
|
if (viewable && gimp_container_have (container, GIMP_OBJECT (viewable)))
|
||||||
{
|
{
|
||||||
view->new_item_func (view->gimage, GIMP_ITEM (viewable), FALSE,
|
view->new_item_func (view->gimage, view->context,
|
||||||
GTK_WIDGET (view));
|
GIMP_ITEM (viewable), FALSE, GTK_WIDGET (view));
|
||||||
|
|
||||||
gimp_image_flush (view->gimage);
|
gimp_image_flush (view->gimage);
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,12 +42,15 @@ typedef void (* GimpRemoveItemFunc) (GimpImage *gimage,
|
||||||
GimpItem *item);
|
GimpItem *item);
|
||||||
|
|
||||||
typedef void (* GimpEditItemFunc) (GimpItem *item,
|
typedef void (* GimpEditItemFunc) (GimpItem *item,
|
||||||
|
GimpContext *context,
|
||||||
GtkWidget *parent);
|
GtkWidget *parent);
|
||||||
typedef void (* GimpNewItemFunc) (GimpImage *gimage,
|
typedef void (* GimpNewItemFunc) (GimpImage *gimage,
|
||||||
|
GimpContext *context,
|
||||||
GimpItem *template,
|
GimpItem *template,
|
||||||
gboolean interactive,
|
gboolean interactive,
|
||||||
GtkWidget *parent);
|
GtkWidget *parent);
|
||||||
typedef void (* GimpActivateItemFunc) (GimpItem *item,
|
typedef void (* GimpActivateItemFunc) (GimpItem *item,
|
||||||
|
GimpContext *context,
|
||||||
GtkWidget *parent);
|
GtkWidget *parent);
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue