mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-04 01:43:24 +00:00
Action code review and pre-release consistency cleanup:
2004-10-18 Michael Natterer <mitch@gimp.org> Action code review and pre-release consistency cleanup: * app/actions/*-actions.c: added some missing and resolved conflicting mnemonics, added missing help IDs. Cleaned up the *_actions_update() functions. * app/actions/channels-actions.c * app/actions/layers-actions.c * app/actions/vectors-actions.c (*_actions_update): simplified the code that figures the prev and next channel,layer,vectors. * app/actions/qmask-actions.c: use the same accelerator for "qmask-active" and "qmask-toggle". Fixed action sensitivity. * app/actions/channels-commands.c * app/actions/dockable-commands.c * app/actions/documents-commands.c * app/actions/gradients-commands.c * app/actions/layers-commands.c * app/actions/palettes-commands.c * app/actions/image-commands.c * app/actions/select-commands.c * app/actions/vectors-commands.c: folded tons of private utility functions into their only callers (they used to be public and called from outside before the switch to action based menus). Renamed functions and variables saying "query" or "qbox" to "dialog". Moved static functions to the end of the files. Misc minor cleanups. * app/actions/drawable-actions.c * app/actions/drawable-commands.c: made the "drawable-visible" and "drawable-linked" actions affect the layer if the active drawable is a layer mask. * app/actions/select-commands.c: added action to stroke with the last values used in an attempt to address bug #135746 but #if 0'ed it because the approach is too ugly. * app/tools/gimpiscissorstool.c: changed mnemonic from I to S. * menus/image-menu-xml.in: added more stuff to the (commented out) "context" menu.
This commit is contained in:
parent
c79b64e6c1
commit
c49df22eef
44 changed files with 831 additions and 806 deletions
45
ChangeLog
45
ChangeLog
|
@ -1,3 +1,48 @@
|
||||||
|
2004-10-18 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
|
Action code review and pre-release consistency cleanup:
|
||||||
|
|
||||||
|
* app/actions/*-actions.c: added some missing and resolved
|
||||||
|
conflicting mnemonics, added missing help IDs. Cleaned up the
|
||||||
|
*_actions_update() functions.
|
||||||
|
|
||||||
|
* app/actions/channels-actions.c
|
||||||
|
* app/actions/layers-actions.c
|
||||||
|
* app/actions/vectors-actions.c (*_actions_update): simplified
|
||||||
|
the code that figures the prev and next channel,layer,vectors.
|
||||||
|
|
||||||
|
* app/actions/qmask-actions.c: use the same accelerator for
|
||||||
|
"qmask-active" and "qmask-toggle". Fixed action sensitivity.
|
||||||
|
|
||||||
|
* app/actions/channels-commands.c
|
||||||
|
* app/actions/dockable-commands.c
|
||||||
|
* app/actions/documents-commands.c
|
||||||
|
* app/actions/gradients-commands.c
|
||||||
|
* app/actions/layers-commands.c
|
||||||
|
* app/actions/palettes-commands.c
|
||||||
|
* app/actions/image-commands.c
|
||||||
|
* app/actions/select-commands.c
|
||||||
|
* app/actions/vectors-commands.c: folded tons of private utility
|
||||||
|
functions into their only callers (they used to be public and
|
||||||
|
called from outside before the switch to action based menus).
|
||||||
|
Renamed functions and variables saying "query" or "qbox" to
|
||||||
|
"dialog". Moved static functions to the end of the files. Misc
|
||||||
|
minor cleanups.
|
||||||
|
|
||||||
|
* app/actions/drawable-actions.c
|
||||||
|
* app/actions/drawable-commands.c: made the "drawable-visible" and
|
||||||
|
"drawable-linked" actions affect the layer if the active drawable
|
||||||
|
is a layer mask.
|
||||||
|
|
||||||
|
* app/actions/select-commands.c: added action to stroke with the
|
||||||
|
last values used in an attempt to address bug #135746 but #if 0'ed
|
||||||
|
it because the approach is too ugly.
|
||||||
|
|
||||||
|
* app/tools/gimpiscissorstool.c: changed mnemonic from I to S.
|
||||||
|
|
||||||
|
* menus/image-menu-xml.in: added more stuff to the (commented out)
|
||||||
|
"context" menu.
|
||||||
|
|
||||||
2004-10-17 DindinX <dindinx@gimp.org>
|
2004-10-17 DindinX <dindinx@gimp.org>
|
||||||
|
|
||||||
* libgimp/gimppixelrgn.c: some more clues in the documentation
|
* libgimp/gimppixelrgn.c: some more clues in the documentation
|
||||||
|
|
|
@ -28,7 +28,6 @@
|
||||||
#include "core/gimpdata.h"
|
#include "core/gimpdata.h"
|
||||||
|
|
||||||
#include "widgets/gimpactiongroup.h"
|
#include "widgets/gimpactiongroup.h"
|
||||||
#include "widgets/gimpdatafactoryview.h"
|
|
||||||
#include "widgets/gimphelp-ids.h"
|
#include "widgets/gimphelp-ids.h"
|
||||||
|
|
||||||
#include "actions.h"
|
#include "actions.h"
|
||||||
|
@ -40,11 +39,12 @@
|
||||||
|
|
||||||
static GimpActionEntry brushes_actions[] =
|
static GimpActionEntry brushes_actions[] =
|
||||||
{
|
{
|
||||||
{ "brushes-popup", GIMP_STOCK_BRUSH, N_("Brushes Menu"), NULL, NULL, NULL,
|
{ "brushes-popup", GIMP_STOCK_BRUSH,
|
||||||
|
N_("Brushes Menu"), NULL, NULL, NULL,
|
||||||
GIMP_HELP_BRUSH_DIALOG },
|
GIMP_HELP_BRUSH_DIALOG },
|
||||||
|
|
||||||
{ "brushes-new", GTK_STOCK_NEW,
|
{ "brushes-new", GTK_STOCK_NEW,
|
||||||
N_("New Brush"), "",
|
N_("_New Brush"), "",
|
||||||
N_("New brush"),
|
N_("New brush"),
|
||||||
G_CALLBACK (data_new_data_cmd_callback),
|
G_CALLBACK (data_new_data_cmd_callback),
|
||||||
GIMP_HELP_BRUSH_NEW },
|
GIMP_HELP_BRUSH_NEW },
|
||||||
|
@ -95,11 +95,9 @@ void
|
||||||
brushes_actions_update (GimpActionGroup *group,
|
brushes_actions_update (GimpActionGroup *group,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
GimpContext *context;
|
GimpContext *context = action_data_get_context (user_data);
|
||||||
GimpBrush *brush = NULL;
|
GimpBrush *brush = NULL;
|
||||||
GimpData *data = NULL;
|
GimpData *data = NULL;
|
||||||
|
|
||||||
context = action_data_get_context (user_data);
|
|
||||||
|
|
||||||
if (context)
|
if (context)
|
||||||
{
|
{
|
||||||
|
|
|
@ -38,7 +38,8 @@
|
||||||
|
|
||||||
static GimpActionEntry buffers_actions[] =
|
static GimpActionEntry buffers_actions[] =
|
||||||
{
|
{
|
||||||
{ "buffers-popup", GIMP_STOCK_BUFFER, N_("Buffers Menu"), NULL, NULL, NULL,
|
{ "buffers-popup", GIMP_STOCK_BUFFER,
|
||||||
|
N_("Buffers Menu"), NULL, NULL, NULL,
|
||||||
GIMP_HELP_BUFFER_DIALOG },
|
GIMP_HELP_BUFFER_DIALOG },
|
||||||
|
|
||||||
{ "buffers-paste", GTK_STOCK_PASTE,
|
{ "buffers-paste", GTK_STOCK_PASTE,
|
||||||
|
@ -79,10 +80,8 @@ void
|
||||||
buffers_actions_update (GimpActionGroup *group,
|
buffers_actions_update (GimpActionGroup *group,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpContext *context;
|
GimpContext *context = action_data_get_context (data);
|
||||||
GimpBuffer *buffer = NULL;
|
GimpBuffer *buffer = NULL;
|
||||||
|
|
||||||
context = action_data_get_context (data);
|
|
||||||
|
|
||||||
if (context)
|
if (context)
|
||||||
buffer = gimp_context_get_buffer (context);
|
buffer = gimp_context_get_buffer (context);
|
||||||
|
|
|
@ -40,7 +40,8 @@
|
||||||
|
|
||||||
static GimpActionEntry channels_actions[] =
|
static GimpActionEntry channels_actions[] =
|
||||||
{
|
{
|
||||||
{ "channels-popup", GIMP_STOCK_CHANNELS, N_("Channels Menu"), NULL, NULL, NULL,
|
{ "channels-popup", GIMP_STOCK_CHANNELS,
|
||||||
|
N_("Channels Menu"), NULL, NULL, NULL,
|
||||||
GIMP_HELP_CHANNEL_DIALOG },
|
GIMP_HELP_CHANNEL_DIALOG },
|
||||||
|
|
||||||
{ "channels-edit-attributes", GIMP_STOCK_EDIT,
|
{ "channels-edit-attributes", GIMP_STOCK_EDIT,
|
||||||
|
@ -143,15 +144,13 @@ void
|
||||||
channels_actions_update (GimpActionGroup *group,
|
channels_actions_update (GimpActionGroup *group,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpImage *gimage;
|
GimpImage *gimage = action_data_get_image (data);
|
||||||
GimpChannel *channel = NULL;
|
GimpChannel *channel = NULL;
|
||||||
gboolean fs = FALSE;
|
gboolean fs = FALSE;
|
||||||
gboolean component = FALSE;
|
gboolean component = FALSE;
|
||||||
GList *next = NULL;
|
GList *next = NULL;
|
||||||
GList *prev = NULL;
|
GList *prev = NULL;
|
||||||
|
|
||||||
gimage = action_data_get_image (data);
|
|
||||||
|
|
||||||
if (gimage)
|
if (gimage)
|
||||||
{
|
{
|
||||||
fs = (gimp_image_floating_sel (gimage) != NULL);
|
fs = (gimp_image_floating_sel (gimage) != NULL);
|
||||||
|
@ -163,19 +162,18 @@ channels_actions_update (GimpActionGroup *group,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GList *list;
|
|
||||||
|
|
||||||
channel = gimp_image_get_active_channel (gimage);
|
channel = gimp_image_get_active_channel (gimage);
|
||||||
|
|
||||||
for (list = GIMP_LIST (gimage->channels)->list;
|
if (channel)
|
||||||
list;
|
|
||||||
list = g_list_next (list))
|
|
||||||
{
|
{
|
||||||
if (channel == (GimpChannel *) list->data)
|
GList *list;
|
||||||
|
|
||||||
|
list = g_list_find (GIMP_LIST (gimage->channels)->list, channel);
|
||||||
|
|
||||||
|
if (list)
|
||||||
{
|
{
|
||||||
prev = g_list_previous (list);
|
prev = g_list_previous (list);
|
||||||
next = g_list_next (list);
|
next = g_list_next (list);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,19 +62,13 @@ struct _ChannelOptions
|
||||||
|
|
||||||
/* local function prototypes */
|
/* local function prototypes */
|
||||||
|
|
||||||
static ChannelOptions * channels_query_new (GimpImage *gimage,
|
static ChannelOptions * channel_options_new (GimpImage *gimage,
|
||||||
GimpContext *context,
|
GimpContext *context,
|
||||||
GimpChannel *channel,
|
GimpChannel *channel,
|
||||||
GtkWidget *parent);
|
GtkWidget *parent);
|
||||||
static void channels_new_channel_query (GimpImage *gimage,
|
|
||||||
GimpContext *context,
|
|
||||||
GtkWidget *parent);
|
|
||||||
static void channels_new_channel_response (GtkWidget *widget,
|
static void channels_new_channel_response (GtkWidget *widget,
|
||||||
gint response_id,
|
gint response_id,
|
||||||
ChannelOptions *options);
|
ChannelOptions *options);
|
||||||
static void channels_edit_channel_query (GimpChannel *channel,
|
|
||||||
GimpContext *context,
|
|
||||||
GtkWidget *parent);
|
|
||||||
static void channels_edit_channel_response (GtkWidget *widget,
|
static void channels_edit_channel_response (GtkWidget *widget,
|
||||||
gint response_id,
|
gint response_id,
|
||||||
ChannelOptions *options);
|
ChannelOptions *options);
|
||||||
|
@ -96,26 +90,42 @@ void
|
||||||
channels_edit_attributes_cmd_callback (GtkAction *action,
|
channels_edit_attributes_cmd_callback (GtkAction *action,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpImage *gimage;
|
ChannelOptions *options;
|
||||||
GimpChannel *channel;
|
GimpImage *gimage;
|
||||||
GtkWidget *widget;
|
GimpChannel *channel;
|
||||||
|
GtkWidget *widget;
|
||||||
return_if_no_channel (gimage, channel, data);
|
return_if_no_channel (gimage, channel, data);
|
||||||
return_if_no_widget (widget, data);
|
return_if_no_widget (widget, data);
|
||||||
|
|
||||||
channels_edit_channel_query (channel, action_data_get_context (data),
|
options = channel_options_new (gimp_item_get_image (GIMP_ITEM (channel)),
|
||||||
widget);
|
action_data_get_context (data),
|
||||||
|
channel, widget);
|
||||||
|
|
||||||
|
g_signal_connect (options->query_box, "response",
|
||||||
|
G_CALLBACK (channels_edit_channel_response),
|
||||||
|
options);
|
||||||
|
|
||||||
|
gtk_widget_show (options->query_box);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
channels_new_cmd_callback (GtkAction *action,
|
channels_new_cmd_callback (GtkAction *action,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpImage *gimage;
|
ChannelOptions *options;
|
||||||
GtkWidget *widget;
|
GimpImage *gimage;
|
||||||
|
GtkWidget *widget;
|
||||||
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, action_data_get_context (data), widget);
|
options = channel_options_new (gimage, action_data_get_context (data),
|
||||||
|
NULL, widget);
|
||||||
|
|
||||||
|
g_signal_connect (options->query_box, "response",
|
||||||
|
G_CALLBACK (channels_new_channel_response),
|
||||||
|
options);
|
||||||
|
|
||||||
|
gtk_widget_show (options->query_box);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -310,10 +320,10 @@ channels_to_selection_cmd_callback (GtkAction *action,
|
||||||
/* private functions */
|
/* private functions */
|
||||||
|
|
||||||
static ChannelOptions *
|
static ChannelOptions *
|
||||||
channels_query_new (GimpImage *gimage,
|
channel_options_new (GimpImage *gimage,
|
||||||
GimpContext *context,
|
GimpContext *context,
|
||||||
GimpChannel *channel,
|
GimpChannel *channel,
|
||||||
GtkWidget *parent)
|
GtkWidget *parent)
|
||||||
{
|
{
|
||||||
ChannelOptions *options;
|
ChannelOptions *options;
|
||||||
GtkWidget *hbox;
|
GtkWidget *hbox;
|
||||||
|
@ -427,22 +437,6 @@ channels_query_new (GimpImage *gimage,
|
||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
channels_new_channel_query (GimpImage *gimage,
|
|
||||||
GimpContext *context,
|
|
||||||
GtkWidget *parent)
|
|
||||||
{
|
|
||||||
ChannelOptions *options;
|
|
||||||
|
|
||||||
options = channels_query_new (gimage, context, NULL, parent);
|
|
||||||
|
|
||||||
g_signal_connect (options->query_box, "response",
|
|
||||||
G_CALLBACK (channels_new_channel_response),
|
|
||||||
options);
|
|
||||||
|
|
||||||
gtk_widget_show (options->query_box);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
channels_new_channel_response (GtkWidget *widget,
|
channels_new_channel_response (GtkWidget *widget,
|
||||||
gint response_id,
|
gint response_id,
|
||||||
|
@ -477,26 +471,6 @@ channels_new_channel_response (GtkWidget *widget,
|
||||||
gtk_widget_destroy (options->query_box);
|
gtk_widget_destroy (options->query_box);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
channels_edit_channel_query (GimpChannel *channel,
|
|
||||||
GimpContext *context,
|
|
||||||
GtkWidget *parent)
|
|
||||||
{
|
|
||||||
ChannelOptions *options;
|
|
||||||
|
|
||||||
g_return_if_fail (GIMP_IS_CHANNEL (channel));
|
|
||||||
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
|
||||||
|
|
||||||
options = channels_query_new (gimp_item_get_image (GIMP_ITEM (channel)),
|
|
||||||
context, channel, parent);
|
|
||||||
|
|
||||||
g_signal_connect (options->query_box, "response",
|
|
||||||
G_CALLBACK (channels_edit_channel_response),
|
|
||||||
options);
|
|
||||||
|
|
||||||
gtk_widget_show (options->query_box);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
channels_edit_channel_response (GtkWidget *widget,
|
channels_edit_channel_response (GtkWidget *widget,
|
||||||
gint response_id,
|
gint response_id,
|
||||||
|
|
|
@ -82,16 +82,13 @@ void
|
||||||
colormap_editor_actions_update (GimpActionGroup *group,
|
colormap_editor_actions_update (GimpActionGroup *group,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpImage *gimage;
|
GimpImage *gimage = action_data_get_image (data);
|
||||||
GimpContext *context;
|
GimpContext *context = action_data_get_context (data);
|
||||||
gboolean indexed = FALSE;
|
gboolean indexed = FALSE;
|
||||||
gint num_colors = 0;
|
gint num_colors = 0;
|
||||||
GimpRGB fg;
|
GimpRGB fg;
|
||||||
GimpRGB bg;
|
GimpRGB bg;
|
||||||
|
|
||||||
gimage = action_data_get_image (data);
|
|
||||||
context = action_data_get_context (data);
|
|
||||||
|
|
||||||
if (gimage)
|
if (gimage)
|
||||||
{
|
{
|
||||||
indexed = gimp_image_base_type (gimage) == GIMP_INDEXED;
|
indexed = gimp_image_base_type (gimage) == GIMP_INDEXED;
|
||||||
|
|
|
@ -82,16 +82,13 @@ void
|
||||||
colormap_editor_actions_update (GimpActionGroup *group,
|
colormap_editor_actions_update (GimpActionGroup *group,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpImage *gimage;
|
GimpImage *gimage = action_data_get_image (data);
|
||||||
GimpContext *context;
|
GimpContext *context = action_data_get_context (data);
|
||||||
gboolean indexed = FALSE;
|
gboolean indexed = FALSE;
|
||||||
gint num_colors = 0;
|
gint num_colors = 0;
|
||||||
GimpRGB fg;
|
GimpRGB fg;
|
||||||
GimpRGB bg;
|
GimpRGB bg;
|
||||||
|
|
||||||
gimage = action_data_get_image (data);
|
|
||||||
context = action_data_get_context (data);
|
|
||||||
|
|
||||||
if (gimage)
|
if (gimage)
|
||||||
{
|
{
|
||||||
indexed = gimp_image_base_type (gimage) == GIMP_INDEXED;
|
indexed = gimp_image_base_type (gimage) == GIMP_INDEXED;
|
||||||
|
|
|
@ -47,6 +47,7 @@ static GimpActionEntry context_actions[] =
|
||||||
{ "context-colors-menu", GIMP_STOCK_DEFAULT_COLORS, N_("_Colors") },
|
{ "context-colors-menu", GIMP_STOCK_DEFAULT_COLORS, N_("_Colors") },
|
||||||
{ "context-opacity-menu", GIMP_STOCK_TRANSPARENCY, N_("_Opacity") },
|
{ "context-opacity-menu", GIMP_STOCK_TRANSPARENCY, N_("_Opacity") },
|
||||||
{ "context-paint-mode-menu", GIMP_STOCK_TOOL_PENCIL, N_("Paint _Mode") },
|
{ "context-paint-mode-menu", GIMP_STOCK_TOOL_PENCIL, N_("Paint _Mode") },
|
||||||
|
{ "context-tool-menu", GIMP_STOCK_TOOLS, N_("_Tool") },
|
||||||
{ "context-brush-menu", GIMP_STOCK_BRUSH, N_("_Brush") },
|
{ "context-brush-menu", GIMP_STOCK_BRUSH, N_("_Brush") },
|
||||||
{ "context-pattern-menu", GIMP_STOCK_PATTERN, N_("_Pattern") },
|
{ "context-pattern-menu", GIMP_STOCK_PATTERN, N_("_Pattern") },
|
||||||
{ "context-palette-menu", GIMP_STOCK_PALETTE, N_("_Palette") },
|
{ "context-palette-menu", GIMP_STOCK_PALETTE, N_("_Palette") },
|
||||||
|
@ -709,7 +710,7 @@ void
|
||||||
context_actions_update (GimpActionGroup *group,
|
context_actions_update (GimpActionGroup *group,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpContext *context;
|
GimpContext *context = action_data_get_context (data);
|
||||||
gboolean generated = FALSE;
|
gboolean generated = FALSE;
|
||||||
gdouble radius = 0.0;
|
gdouble radius = 0.0;
|
||||||
gint spikes = 0;
|
gint spikes = 0;
|
||||||
|
@ -717,8 +718,6 @@ context_actions_update (GimpActionGroup *group,
|
||||||
gdouble aspect = 0.0;
|
gdouble aspect = 0.0;
|
||||||
gdouble angle = 0.0;
|
gdouble angle = 0.0;
|
||||||
|
|
||||||
context = action_data_get_context (data);
|
|
||||||
|
|
||||||
if (context)
|
if (context)
|
||||||
{
|
{
|
||||||
GimpBrush *brush = gimp_context_get_brush (context);
|
GimpBrush *brush = gimp_context_get_brush (context);
|
||||||
|
|
|
@ -107,7 +107,7 @@ GimpStringActionEntry dialogs_dockable_actions[] =
|
||||||
GIMP_HELP_NAVIGATION_DIALOG },
|
GIMP_HELP_NAVIGATION_DIALOG },
|
||||||
|
|
||||||
{ "dialogs-undo-history", GIMP_STOCK_UNDO_HISTORY,
|
{ "dialogs-undo-history", GIMP_STOCK_UNDO_HISTORY,
|
||||||
N_("_Undo History"), NULL, NULL,
|
N_("Undo _History"), NULL, NULL,
|
||||||
"gimp-undo-history",
|
"gimp-undo-history",
|
||||||
GIMP_HELP_UNDO_DIALOG },
|
GIMP_HELP_UNDO_DIALOG },
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ GimpStringActionEntry dialogs_dockable_actions[] =
|
||||||
GIMP_HELP_COLOR_DIALOG },
|
GIMP_HELP_COLOR_DIALOG },
|
||||||
|
|
||||||
{ "dialogs-brushes", GIMP_STOCK_BRUSH,
|
{ "dialogs-brushes", GIMP_STOCK_BRUSH,
|
||||||
N_("Brus_hes"), "<control><shift>B", NULL,
|
N_("_Brushes"), "<control><shift>B", NULL,
|
||||||
"gimp-brush-grid|gimp-brush-list",
|
"gimp-brush-grid|gimp-brush-list",
|
||||||
GIMP_HELP_BRUSH_DIALOG },
|
GIMP_HELP_BRUSH_DIALOG },
|
||||||
|
|
||||||
|
@ -142,7 +142,7 @@ GimpStringActionEntry dialogs_dockable_actions[] =
|
||||||
GIMP_HELP_FONT_DIALOG },
|
GIMP_HELP_FONT_DIALOG },
|
||||||
|
|
||||||
{ "dialogs-buffers", GIMP_STOCK_BUFFER,
|
{ "dialogs-buffers", GIMP_STOCK_BUFFER,
|
||||||
N_("_Buffers"), "", NULL,
|
N_("B_uffers"), "", NULL,
|
||||||
"gimp-buffer-list|gimp-buffer-grid",
|
"gimp-buffer-list|gimp-buffer-grid",
|
||||||
GIMP_HELP_BUFFER_DIALOG },
|
GIMP_HELP_BUFFER_DIALOG },
|
||||||
|
|
||||||
|
|
|
@ -45,12 +45,13 @@
|
||||||
|
|
||||||
static GimpActionEntry dockable_actions[] =
|
static GimpActionEntry dockable_actions[] =
|
||||||
{
|
{
|
||||||
{ "dockable-popup", NULL, N_("Dialogs Menu"), NULL, NULL, NULL,
|
{ "dockable-popup", NULL,
|
||||||
|
N_("Dialogs Menu"), NULL, NULL, NULL,
|
||||||
GIMP_HELP_DOCK },
|
GIMP_HELP_DOCK },
|
||||||
|
|
||||||
{ "dockable-menu", GTK_STOCK_MISSING_IMAGE, "" },
|
{ "dockable-menu", GTK_STOCK_MISSING_IMAGE, "" },
|
||||||
{ "dockable-add-tab-menu", NULL, N_("_Add Tab") },
|
{ "dockable-add-tab-menu", NULL, N_("_Add Tab") },
|
||||||
{ "dockable-preview-size-menu", NULL, N_("Preview Si_ze") },
|
{ "dockable-preview-size-menu", NULL, N_("_Preview Size") },
|
||||||
{ "dockable-tab-style-menu", NULL, N_("_Tab Style") },
|
{ "dockable-tab-style-menu", NULL, N_("_Tab Style") },
|
||||||
|
|
||||||
{ "dockable-close-tab", GTK_STOCK_CLOSE,
|
{ "dockable-close-tab", GTK_STOCK_CLOSE,
|
||||||
|
@ -64,7 +65,7 @@ static GimpActionEntry dockable_actions[] =
|
||||||
GIMP_HELP_DOCK_TAB_DETACH },
|
GIMP_HELP_DOCK_TAB_DETACH },
|
||||||
|
|
||||||
{ "dockable-move-to-screen", GIMP_STOCK_MOVE_TO_SCREEN,
|
{ "dockable-move-to-screen", GIMP_STOCK_MOVE_TO_SCREEN,
|
||||||
N_("Move to Screen..."), NULL, NULL,
|
N_("M_ove to Screen..."), NULL, NULL,
|
||||||
G_CALLBACK (dockable_change_screen_cmd_callback),
|
G_CALLBACK (dockable_change_screen_cmd_callback),
|
||||||
GIMP_HELP_DOCK_CHANGE_SCREEN }
|
GIMP_HELP_DOCK_CHANGE_SCREEN }
|
||||||
};
|
};
|
||||||
|
@ -72,13 +73,13 @@ static GimpActionEntry dockable_actions[] =
|
||||||
static GimpToggleActionEntry dockable_toggle_actions[] =
|
static GimpToggleActionEntry dockable_toggle_actions[] =
|
||||||
{
|
{
|
||||||
{ "dockable-show-image-menu", NULL,
|
{ "dockable-show-image-menu", NULL,
|
||||||
N_("Show Image _Menu"), NULL, NULL,
|
N_("_Show Image Menu"), NULL, NULL,
|
||||||
G_CALLBACK (dockable_toggle_image_menu_cmd_callback),
|
G_CALLBACK (dockable_toggle_image_menu_cmd_callback),
|
||||||
TRUE,
|
TRUE,
|
||||||
GIMP_HELP_DOCK_IMAGE_MENU },
|
GIMP_HELP_DOCK_IMAGE_MENU },
|
||||||
|
|
||||||
{ "dockable-auto-follow-active", NULL,
|
{ "dockable-auto-follow-active", NULL,
|
||||||
N_("Auto Follow Active _Image"), NULL, NULL,
|
N_("Auto _Follow Active Image"), NULL, NULL,
|
||||||
G_CALLBACK (dockable_toggle_auto_cmd_callback),
|
G_CALLBACK (dockable_toggle_auto_cmd_callback),
|
||||||
TRUE,
|
TRUE,
|
||||||
GIMP_HELP_DOCK_AUTO_BUTTON }
|
GIMP_HELP_DOCK_AUTO_BUTTON }
|
||||||
|
|
|
@ -39,6 +39,15 @@
|
||||||
#include "dockable-commands.h"
|
#include "dockable-commands.h"
|
||||||
|
|
||||||
|
|
||||||
|
/* local function prototypes */
|
||||||
|
|
||||||
|
static void dockable_change_screen_confirm_callback (GtkWidget *query_box,
|
||||||
|
gint value,
|
||||||
|
gpointer data);
|
||||||
|
static void dockable_change_screen_destroy_callback (GtkWidget *query_box,
|
||||||
|
GtkWidget *dock);
|
||||||
|
|
||||||
|
|
||||||
/* public functions */
|
/* public functions */
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -295,27 +304,6 @@ dockable_toggle_auto_cmd_callback (GtkAction *action,
|
||||||
active);
|
active);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
dockable_change_screen_confirm_callback (GtkWidget *query_box,
|
|
||||||
gint value,
|
|
||||||
gpointer data)
|
|
||||||
{
|
|
||||||
GdkScreen *screen;
|
|
||||||
|
|
||||||
screen = gdk_display_get_screen (gtk_widget_get_display (GTK_WIDGET (data)),
|
|
||||||
value);
|
|
||||||
|
|
||||||
if (screen)
|
|
||||||
gtk_window_set_screen (GTK_WINDOW (data), screen);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
dockable_change_screen_destroy_callback (GtkWidget *query_box,
|
|
||||||
GtkWidget *dock)
|
|
||||||
{
|
|
||||||
g_object_set_data (G_OBJECT (dock), "gimp-change-screen-dialog", NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
dockable_change_screen_cmd_callback (GtkAction *action,
|
dockable_change_screen_cmd_callback (GtkAction *action,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
|
@ -361,3 +349,27 @@ dockable_change_screen_cmd_callback (GtkAction *action,
|
||||||
|
|
||||||
gtk_widget_show (qbox);
|
gtk_widget_show (qbox);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* private functions */
|
||||||
|
|
||||||
|
static void
|
||||||
|
dockable_change_screen_confirm_callback (GtkWidget *query_box,
|
||||||
|
gint value,
|
||||||
|
gpointer data)
|
||||||
|
{
|
||||||
|
GdkScreen *screen;
|
||||||
|
|
||||||
|
screen = gdk_display_get_screen (gtk_widget_get_display (GTK_WIDGET (data)),
|
||||||
|
value);
|
||||||
|
|
||||||
|
if (screen)
|
||||||
|
gtk_window_set_screen (GTK_WINDOW (data), screen);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
dockable_change_screen_destroy_callback (GtkWidget *query_box,
|
||||||
|
GtkWidget *dock)
|
||||||
|
{
|
||||||
|
g_object_set_data (G_OBJECT (dock), "gimp-change-screen-dialog", NULL);
|
||||||
|
}
|
||||||
|
|
|
@ -38,7 +38,8 @@
|
||||||
|
|
||||||
static GimpActionEntry documents_actions[] =
|
static GimpActionEntry documents_actions[] =
|
||||||
{
|
{
|
||||||
{ "documents-popup", GTK_STOCK_OPEN, N_("Documents Menu"), NULL, NULL, NULL,
|
{ "documents-popup", GTK_STOCK_OPEN,
|
||||||
|
N_("Documents Menu"), NULL, NULL, NULL,
|
||||||
GIMP_HELP_DOCUMENT_DIALOG },
|
GIMP_HELP_DOCUMENT_DIALOG },
|
||||||
|
|
||||||
{ "documents-open", GTK_STOCK_OPEN,
|
{ "documents-open", GTK_STOCK_OPEN,
|
||||||
|
|
|
@ -49,10 +49,21 @@
|
||||||
#include "gimp-intl.h"
|
#include "gimp-intl.h"
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct _RaiseClosure RaiseClosure;
|
||||||
|
|
||||||
|
struct _RaiseClosure
|
||||||
|
{
|
||||||
|
const gchar *name;
|
||||||
|
gboolean found;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/* local function prototypes */
|
/* local function prototypes */
|
||||||
|
|
||||||
static void documents_open_image (GimpContext *context,
|
static void documents_open_image (GimpContext *context,
|
||||||
GimpImagefile *imagefile);
|
GimpImagefile *imagefile);
|
||||||
|
static void documents_raise_display (gpointer data,
|
||||||
|
gpointer user_data);
|
||||||
|
|
||||||
|
|
||||||
/* public functions */
|
/* public functions */
|
||||||
|
@ -81,31 +92,6 @@ documents_open_document_cmd_callback (GtkAction *action,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct _RaiseClosure RaiseClosure;
|
|
||||||
|
|
||||||
struct _RaiseClosure
|
|
||||||
{
|
|
||||||
const gchar *name;
|
|
||||||
gboolean found;
|
|
||||||
};
|
|
||||||
|
|
||||||
static void
|
|
||||||
documents_raise_display (gpointer data,
|
|
||||||
gpointer user_data)
|
|
||||||
{
|
|
||||||
GimpDisplay *gdisp = (GimpDisplay *) data;
|
|
||||||
RaiseClosure *closure = (RaiseClosure *) user_data;
|
|
||||||
const gchar *uri;
|
|
||||||
|
|
||||||
uri = gimp_object_get_name (GIMP_OBJECT (gdisp->gimage));
|
|
||||||
|
|
||||||
if (uri && ! strcmp (closure->name, uri))
|
|
||||||
{
|
|
||||||
closure->found = TRUE;
|
|
||||||
gtk_window_present (GTK_WINDOW (gdisp->shell));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
documents_raise_or_open_document_cmd_callback (GtkAction *action,
|
documents_raise_or_open_document_cmd_callback (GtkAction *action,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
|
@ -276,3 +262,20 @@ documents_open_image (GimpContext *context,
|
||||||
g_free (filename);
|
g_free (filename);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
documents_raise_display (gpointer data,
|
||||||
|
gpointer user_data)
|
||||||
|
{
|
||||||
|
GimpDisplay *gdisp = data;
|
||||||
|
RaiseClosure *closure = user_data;
|
||||||
|
const gchar *uri;
|
||||||
|
|
||||||
|
uri = gimp_object_get_name (GIMP_OBJECT (gdisp->gimage));
|
||||||
|
|
||||||
|
if (uri && ! strcmp (closure->name, uri))
|
||||||
|
{
|
||||||
|
closure->found = TRUE;
|
||||||
|
gtk_window_present (GTK_WINDOW (gdisp->shell));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -25,10 +25,9 @@
|
||||||
#include "actions-types.h"
|
#include "actions-types.h"
|
||||||
|
|
||||||
#include "core/gimp.h"
|
#include "core/gimp.h"
|
||||||
#include "core/gimpchannel.h"
|
|
||||||
#include "core/gimpcontext.h"
|
#include "core/gimpcontext.h"
|
||||||
#include "core/gimpimage.h"
|
#include "core/gimpimage.h"
|
||||||
#include "core/gimplayer.h"
|
#include "core/gimplayermask.h"
|
||||||
|
|
||||||
#include "widgets/gimpactiongroup.h"
|
#include "widgets/gimpactiongroup.h"
|
||||||
#include "widgets/gimphelp-ids.h"
|
#include "widgets/gimphelp-ids.h"
|
||||||
|
@ -152,13 +151,18 @@ drawable_actions_update (GimpActionGroup *group,
|
||||||
|
|
||||||
if (drawable)
|
if (drawable)
|
||||||
{
|
{
|
||||||
GimpItem *item = GIMP_ITEM (drawable);
|
|
||||||
GimpImageType drawable_type = gimp_drawable_type (drawable);
|
GimpImageType drawable_type = gimp_drawable_type (drawable);
|
||||||
|
GimpItem *item;
|
||||||
|
|
||||||
is_rgb = GIMP_IMAGE_TYPE_IS_RGB (drawable_type);
|
is_rgb = GIMP_IMAGE_TYPE_IS_RGB (drawable_type);
|
||||||
is_gray = GIMP_IMAGE_TYPE_IS_GRAY (drawable_type);
|
is_gray = GIMP_IMAGE_TYPE_IS_GRAY (drawable_type);
|
||||||
is_indexed = GIMP_IMAGE_TYPE_IS_INDEXED (drawable_type);
|
is_indexed = GIMP_IMAGE_TYPE_IS_INDEXED (drawable_type);
|
||||||
|
|
||||||
|
if (GIMP_IS_LAYER_MASK (drawable))
|
||||||
|
item = GIMP_ITEM (gimp_layer_mask_get_layer (GIMP_LAYER_MASK (drawable)));
|
||||||
|
else
|
||||||
|
item = GIMP_ITEM (drawable);
|
||||||
|
|
||||||
visible = gimp_item_get_visible (item);
|
visible = gimp_item_get_visible (item);
|
||||||
linked = gimp_item_get_linked (item);
|
linked = gimp_item_get_linked (item);
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,6 @@
|
||||||
#include "actions-types.h"
|
#include "actions-types.h"
|
||||||
|
|
||||||
#include "core/gimp.h"
|
#include "core/gimp.h"
|
||||||
#include "core/gimpchannel.h"
|
|
||||||
#include "core/gimpdrawable-desaturate.h"
|
#include "core/gimpdrawable-desaturate.h"
|
||||||
#include "core/gimpdrawable-equalize.h"
|
#include "core/gimpdrawable-equalize.h"
|
||||||
#include "core/gimpdrawable-invert.h"
|
#include "core/gimpdrawable-invert.h"
|
||||||
|
@ -33,6 +32,7 @@
|
||||||
#include "core/gimpimage-undo.h"
|
#include "core/gimpimage-undo.h"
|
||||||
#include "core/gimpitem-linked.h"
|
#include "core/gimpitem-linked.h"
|
||||||
#include "core/gimpitemundo.h"
|
#include "core/gimpitemundo.h"
|
||||||
|
#include "core/gimplayermask.h"
|
||||||
|
|
||||||
#include "dialogs/offset-dialog.h"
|
#include "dialogs/offset-dialog.h"
|
||||||
|
|
||||||
|
@ -109,6 +109,10 @@ drawable_visible_cmd_callback (GtkAction *action,
|
||||||
|
|
||||||
visible = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
visible = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
||||||
|
|
||||||
|
if (GIMP_IS_LAYER_MASK (drawable))
|
||||||
|
drawable =
|
||||||
|
GIMP_DRAWABLE (gimp_layer_mask_get_layer (GIMP_LAYER_MASK (drawable)));
|
||||||
|
|
||||||
if (visible != gimp_item_get_visible (GIMP_ITEM (drawable)))
|
if (visible != gimp_item_get_visible (GIMP_ITEM (drawable)))
|
||||||
{
|
{
|
||||||
GimpUndo *undo;
|
GimpUndo *undo;
|
||||||
|
@ -136,6 +140,10 @@ drawable_linked_cmd_callback (GtkAction *action,
|
||||||
|
|
||||||
linked = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
linked = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
||||||
|
|
||||||
|
if (GIMP_IS_LAYER_MASK (drawable))
|
||||||
|
drawable =
|
||||||
|
GIMP_DRAWABLE (gimp_layer_mask_get_layer (GIMP_LAYER_MASK (drawable)));
|
||||||
|
|
||||||
if (linked != gimp_item_get_linked (GIMP_ITEM (drawable)))
|
if (linked != gimp_item_get_linked (GIMP_ITEM (drawable)))
|
||||||
{
|
{
|
||||||
GimpUndo *undo;
|
GimpUndo *undo;
|
||||||
|
|
|
@ -58,8 +58,8 @@ static void edit_actions_pattern_changed (GimpContext *context,
|
||||||
|
|
||||||
static GimpActionEntry edit_actions[] =
|
static GimpActionEntry edit_actions[] =
|
||||||
{
|
{
|
||||||
{ "edit-menu", NULL, N_("_Edit") },
|
{ "edit-menu", NULL, N_("_Edit") },
|
||||||
{ "edit-buffer-menu", NULL, N_("Buffer") },
|
{ "edit-buffer-menu", NULL, N_("_Buffer") },
|
||||||
|
|
||||||
{ "edit-undo", GTK_STOCK_UNDO,
|
{ "edit-undo", GTK_STOCK_UNDO,
|
||||||
N_("_Undo"), "<control>Z",
|
N_("_Undo"), "<control>Z",
|
||||||
|
|
|
@ -36,8 +36,8 @@
|
||||||
|
|
||||||
static GimpActionEntry error_console_actions[] =
|
static GimpActionEntry error_console_actions[] =
|
||||||
{
|
{
|
||||||
{ "error-console-popup", GIMP_STOCK_WARNING, N_("Error Console Menu"),
|
{ "error-console-popup", GIMP_STOCK_WARNING,
|
||||||
NULL, NULL, NULL,
|
N_("Error Console Menu"), NULL, NULL, NULL,
|
||||||
GIMP_HELP_ERRORS_DIALOG },
|
GIMP_HELP_ERRORS_DIALOG },
|
||||||
|
|
||||||
{ "error-console-clear", GTK_STOCK_CLEAR,
|
{ "error-console-clear", GTK_STOCK_CLEAR,
|
||||||
|
@ -69,11 +69,9 @@ void
|
||||||
error_console_actions_update (GimpActionGroup *group,
|
error_console_actions_update (GimpActionGroup *group,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpErrorConsole *console;
|
GimpErrorConsole *console = GIMP_ERROR_CONSOLE (data);
|
||||||
gboolean selection;
|
gboolean selection;
|
||||||
|
|
||||||
console = GIMP_ERROR_CONSOLE (data);
|
|
||||||
|
|
||||||
selection = gtk_text_buffer_get_selection_bounds (console->text_buffer,
|
selection = gtk_text_buffer_get_selection_bounds (console->text_buffer,
|
||||||
NULL, NULL);
|
NULL, NULL);
|
||||||
|
|
||||||
|
|
|
@ -189,11 +189,9 @@ void
|
||||||
file_actions_update (GimpActionGroup *group,
|
file_actions_update (GimpActionGroup *group,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpImage *gimage = NULL;
|
GimpImage *gimage = action_data_get_image (data);
|
||||||
GimpDrawable *drawable = NULL;
|
GimpDrawable *drawable = NULL;
|
||||||
|
|
||||||
gimage = action_data_get_image (data);
|
|
||||||
|
|
||||||
if (gimage)
|
if (gimage)
|
||||||
drawable = gimp_image_active_drawable (gimage);
|
drawable = gimp_image_active_drawable (gimage);
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,8 @@
|
||||||
|
|
||||||
static GimpActionEntry fonts_actions[] =
|
static GimpActionEntry fonts_actions[] =
|
||||||
{
|
{
|
||||||
{ "fonts-popup", GIMP_STOCK_FONT, N_("Fonts Menu"), NULL, NULL, NULL,
|
{ "fonts-popup", GIMP_STOCK_FONT,
|
||||||
|
N_("Fonts Menu"), NULL, NULL, NULL,
|
||||||
GIMP_HELP_FONT_DIALOG },
|
GIMP_HELP_FONT_DIALOG },
|
||||||
|
|
||||||
{ "fonts-refresh", GTK_STOCK_REFRESH,
|
{ "fonts-refresh", GTK_STOCK_REFRESH,
|
||||||
|
@ -63,10 +64,8 @@ void
|
||||||
fonts_actions_update (GimpActionGroup *group,
|
fonts_actions_update (GimpActionGroup *group,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpContext *context;
|
GimpContext *context = action_data_get_context (data);
|
||||||
GimpFont *font = NULL;
|
GimpFont *font = NULL;
|
||||||
|
|
||||||
context = action_data_get_context (data);
|
|
||||||
|
|
||||||
if (context)
|
if (context)
|
||||||
font = gimp_context_get_font (context);
|
font = gimp_context_get_font (context);
|
||||||
|
|
|
@ -42,8 +42,8 @@
|
||||||
|
|
||||||
static GimpActionEntry gradient_editor_actions[] =
|
static GimpActionEntry gradient_editor_actions[] =
|
||||||
{
|
{
|
||||||
{ "gradient-editor-popup", GIMP_STOCK_GRADIENT, N_("Gradient Editor Menu"),
|
{ "gradient-editor-popup", GIMP_STOCK_GRADIENT,
|
||||||
NULL, NULL, NULL,
|
N_("Gradient Editor Menu"), NULL, NULL, NULL,
|
||||||
GIMP_HELP_GRADIENT_EDITOR_DIALOG },
|
GIMP_HELP_GRADIENT_EDITOR_DIALOG },
|
||||||
|
|
||||||
{ "gradient-editor-load-left-color", GTK_STOCK_REVERT_TO_SAVED,
|
{ "gradient-editor-load-left-color", GTK_STOCK_REVERT_TO_SAVED,
|
||||||
|
@ -341,7 +341,7 @@ void
|
||||||
gradient_editor_actions_update (GimpActionGroup *group,
|
gradient_editor_actions_update (GimpActionGroup *group,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpGradientEditor *editor;
|
GimpGradientEditor *editor = GIMP_GRADIENT_EDITOR (data);
|
||||||
GimpContext *context;
|
GimpContext *context;
|
||||||
GimpGradientSegment *left_seg;
|
GimpGradientSegment *left_seg;
|
||||||
GimpGradientSegment *right_seg;
|
GimpGradientSegment *right_seg;
|
||||||
|
@ -352,8 +352,6 @@ gradient_editor_actions_update (GimpActionGroup *group,
|
||||||
gboolean selection;
|
gboolean selection;
|
||||||
gboolean delete;
|
gboolean delete;
|
||||||
|
|
||||||
editor = GIMP_GRADIENT_EDITOR (data);
|
|
||||||
|
|
||||||
context =
|
context =
|
||||||
gimp_get_user_context (GIMP_DATA_EDITOR (editor)->data_factory->gimp);
|
gimp_get_user_context (GIMP_DATA_EDITOR (editor)->data_factory->gimp);
|
||||||
|
|
||||||
|
@ -397,8 +395,8 @@ gradient_editor_actions_update (GimpActionGroup *group,
|
||||||
selection = (editor->control_sel_l != editor->control_sel_r);
|
selection = (editor->control_sel_l != editor->control_sel_r);
|
||||||
delete = (editor->control_sel_l->prev || editor->control_sel_r->next);
|
delete = (editor->control_sel_l->prev || editor->control_sel_r->next);
|
||||||
|
|
||||||
#define SET_ACTIVE(action,active) \
|
#define SET_ACTIVE(action,condition) \
|
||||||
gimp_action_group_set_action_active (group, action, (active))
|
gimp_action_group_set_action_active (group, action, (condition) != 0)
|
||||||
#define SET_COLOR(action,color,set_label) \
|
#define SET_COLOR(action,color,set_label) \
|
||||||
gimp_action_group_set_action_color (group, action, (color), (set_label))
|
gimp_action_group_set_action_color (group, action, (color), (set_label))
|
||||||
#define SET_LABEL(action,label) \
|
#define SET_LABEL(action,label) \
|
||||||
|
|
|
@ -40,8 +40,8 @@
|
||||||
|
|
||||||
static GimpActionEntry gradients_actions[] =
|
static GimpActionEntry gradients_actions[] =
|
||||||
{
|
{
|
||||||
{ "gradients-popup", GIMP_STOCK_GRADIENT, N_("Gradients Menu"),
|
{ "gradients-popup", GIMP_STOCK_GRADIENT,
|
||||||
NULL, NULL, NULL,
|
N_("Gradients Menu"), NULL, NULL, NULL,
|
||||||
GIMP_HELP_GRADIENT_DIALOG },
|
GIMP_HELP_GRADIENT_DIALOG },
|
||||||
|
|
||||||
{ "gradients-new", GTK_STOCK_NEW,
|
{ "gradients-new", GTK_STOCK_NEW,
|
||||||
|
@ -102,12 +102,10 @@ void
|
||||||
gradients_actions_update (GimpActionGroup *group,
|
gradients_actions_update (GimpActionGroup *group,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
GimpContext *context;
|
GimpContext *context = action_data_get_context (user_data);
|
||||||
GimpGradient *gradient = NULL;
|
GimpGradient *gradient = NULL;
|
||||||
GimpData *data = NULL;
|
GimpData *data = NULL;
|
||||||
|
|
||||||
context = action_data_get_context (user_data);
|
|
||||||
|
|
||||||
if (context)
|
if (context)
|
||||||
{
|
{
|
||||||
gradient = gimp_context_get_gradient (context);
|
gradient = gimp_context_get_gradient (context);
|
||||||
|
|
|
@ -38,10 +38,9 @@
|
||||||
|
|
||||||
/* local function prototypes */
|
/* local function prototypes */
|
||||||
|
|
||||||
static void gradients_save_as_pov_query (GimpContainerEditor *editor);
|
static void gradients_save_as_pov_ray_response (GtkWidget *dialog,
|
||||||
static void gradients_save_as_pov_response (GtkWidget *dialog,
|
gint response_id,
|
||||||
gint response_id,
|
GimpGradient *gradient);
|
||||||
GimpGradient *gradient);
|
|
||||||
|
|
||||||
|
|
||||||
/* public functions */
|
/* public functions */
|
||||||
|
@ -51,20 +50,10 @@ gradients_save_as_pov_ray_cmd_callback (GtkAction *action,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
|
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
|
||||||
|
GimpContext *context;
|
||||||
gradients_save_as_pov_query (editor);
|
GimpGradient *gradient;
|
||||||
}
|
GtkFileChooser *chooser;
|
||||||
|
gchar *title;
|
||||||
|
|
||||||
/* private functions */
|
|
||||||
|
|
||||||
static void
|
|
||||||
gradients_save_as_pov_query (GimpContainerEditor *editor)
|
|
||||||
{
|
|
||||||
GimpContext *context;
|
|
||||||
GimpGradient *gradient;
|
|
||||||
GtkFileChooser *chooser;
|
|
||||||
gchar *title;
|
|
||||||
|
|
||||||
context = gimp_container_view_get_context (editor->view);
|
context = gimp_container_view_get_context (editor->view);
|
||||||
|
|
||||||
|
@ -94,7 +83,7 @@ gradients_save_as_pov_query (GimpContainerEditor *editor)
|
||||||
gtk_window_set_position (GTK_WINDOW (chooser), GTK_WIN_POS_MOUSE);
|
gtk_window_set_position (GTK_WINDOW (chooser), GTK_WIN_POS_MOUSE);
|
||||||
|
|
||||||
g_signal_connect (chooser, "response",
|
g_signal_connect (chooser, "response",
|
||||||
G_CALLBACK (gradients_save_as_pov_response),
|
G_CALLBACK (gradients_save_as_pov_ray_response),
|
||||||
gradient);
|
gradient);
|
||||||
g_signal_connect (chooser, "delete_event",
|
g_signal_connect (chooser, "delete_event",
|
||||||
G_CALLBACK (gtk_true),
|
G_CALLBACK (gtk_true),
|
||||||
|
@ -113,10 +102,13 @@ gradients_save_as_pov_query (GimpContainerEditor *editor)
|
||||||
gtk_widget_show (GTK_WIDGET (chooser));
|
gtk_widget_show (GTK_WIDGET (chooser));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* private functions */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gradients_save_as_pov_response (GtkWidget *dialog,
|
gradients_save_as_pov_ray_response (GtkWidget *dialog,
|
||||||
gint response_id,
|
gint response_id,
|
||||||
GimpGradient *gradient)
|
GimpGradient *gradient)
|
||||||
{
|
{
|
||||||
if (response_id == GTK_RESPONSE_OK)
|
if (response_id == GTK_RESPONSE_OK)
|
||||||
{
|
{
|
||||||
|
|
|
@ -43,13 +43,16 @@
|
||||||
|
|
||||||
static GimpActionEntry image_actions[] =
|
static GimpActionEntry image_actions[] =
|
||||||
{
|
{
|
||||||
{ "toolbox-menubar", NULL, N_("Toolbox Menu"), NULL, NULL, NULL,
|
{ "toolbox-menubar", NULL,
|
||||||
|
N_("Toolbox Menu"), NULL, NULL, NULL,
|
||||||
GIMP_HELP_TOOLBOX },
|
GIMP_HELP_TOOLBOX },
|
||||||
|
|
||||||
{ "image-menubar", NULL, N_("Image Menu"), NULL, NULL, NULL,
|
{ "image-menubar", NULL,
|
||||||
|
N_("Image Menu"), NULL, NULL, NULL,
|
||||||
GIMP_HELP_IMAGE_WINDOW },
|
GIMP_HELP_IMAGE_WINDOW },
|
||||||
|
|
||||||
{ "image-popup", NULL, N_("Image Menu"), NULL, NULL, NULL,
|
{ "image-popup", NULL,
|
||||||
|
N_("Image Menu"), NULL, NULL, NULL,
|
||||||
GIMP_HELP_IMAGE_WINDOW },
|
GIMP_HELP_IMAGE_WINDOW },
|
||||||
|
|
||||||
{ "extensions-menu", NULL, N_("_Xtns") },
|
{ "extensions-menu", NULL, N_("_Xtns") },
|
||||||
|
@ -199,7 +202,7 @@ void
|
||||||
image_actions_update (GimpActionGroup *group,
|
image_actions_update (GimpActionGroup *group,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpImage *gimage;
|
GimpImage *gimage = action_data_get_image (data);
|
||||||
gboolean is_rgb = FALSE;
|
gboolean is_rgb = FALSE;
|
||||||
gboolean is_gray = FALSE;
|
gboolean is_gray = FALSE;
|
||||||
gboolean is_indexed = FALSE;
|
gboolean is_indexed = FALSE;
|
||||||
|
@ -208,8 +211,6 @@ image_actions_update (GimpActionGroup *group,
|
||||||
gboolean lp = FALSE;
|
gboolean lp = FALSE;
|
||||||
gboolean sel = FALSE;
|
gboolean sel = FALSE;
|
||||||
|
|
||||||
gimage = action_data_get_image (data);
|
|
||||||
|
|
||||||
if (gimage)
|
if (gimage)
|
||||||
{
|
{
|
||||||
GimpImageBaseType base_type;
|
GimpImageBaseType base_type;
|
||||||
|
|
|
@ -349,14 +349,12 @@ image_duplicate_cmd_callback (GtkAction *action,
|
||||||
{
|
{
|
||||||
GimpDisplay *gdisp;
|
GimpDisplay *gdisp;
|
||||||
GimpDisplayShell *shell;
|
GimpDisplayShell *shell;
|
||||||
GimpImage *gimage;
|
|
||||||
GimpImage *new_gimage;
|
GimpImage *new_gimage;
|
||||||
return_if_no_display (gdisp, data);
|
return_if_no_display (gdisp, data);
|
||||||
|
|
||||||
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
|
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
|
||||||
gimage = gdisp->gimage;
|
|
||||||
|
|
||||||
new_gimage = gimp_image_duplicate (gimage);
|
new_gimage = gimp_image_duplicate (gdisp->gimage);
|
||||||
|
|
||||||
gimp_create_display (new_gimage->gimp,
|
gimp_create_display (new_gimage->gimp,
|
||||||
new_gimage,
|
new_gimage,
|
||||||
|
|
|
@ -39,7 +39,8 @@
|
||||||
|
|
||||||
static GimpActionEntry images_actions[] =
|
static GimpActionEntry images_actions[] =
|
||||||
{
|
{
|
||||||
{ "images-popup", GIMP_STOCK_IMAGES, N_("Images Menu"), NULL, NULL, NULL,
|
{ "images-popup", GIMP_STOCK_IMAGES,
|
||||||
|
N_("Images Menu"), NULL, NULL, NULL,
|
||||||
GIMP_HELP_IMAGE_DIALOG },
|
GIMP_HELP_IMAGE_DIALOG },
|
||||||
|
|
||||||
{ "images-raise-views", GTK_STOCK_GOTO_TOP,
|
{ "images-raise-views", GTK_STOCK_GOTO_TOP,
|
||||||
|
@ -74,10 +75,8 @@ void
|
||||||
images_actions_update (GimpActionGroup *group,
|
images_actions_update (GimpActionGroup *group,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpContext *context;
|
GimpContext *context = action_data_get_context (data);
|
||||||
GimpImage *image = NULL;
|
GimpImage *image = NULL;
|
||||||
|
|
||||||
context = action_data_get_context (data);
|
|
||||||
|
|
||||||
if (context)
|
if (context)
|
||||||
image = gimp_context_get_image (context);
|
image = gimp_context_get_image (context);
|
||||||
|
|
|
@ -44,7 +44,8 @@
|
||||||
|
|
||||||
static GimpActionEntry layers_actions[] =
|
static GimpActionEntry layers_actions[] =
|
||||||
{
|
{
|
||||||
{ "layers-popup", GIMP_STOCK_LAYERS, N_("Layers Menu"), NULL, NULL, NULL,
|
{ "layers-popup", GIMP_STOCK_LAYERS,
|
||||||
|
N_("Layers Menu"), NULL, NULL, NULL,
|
||||||
GIMP_HELP_LAYER_DIALOG },
|
GIMP_HELP_LAYER_DIALOG },
|
||||||
|
|
||||||
{ "layers-menu", NULL, N_("_Layer") },
|
{ "layers-menu", NULL, N_("_Layer") },
|
||||||
|
@ -382,7 +383,7 @@ void
|
||||||
layers_actions_update (GimpActionGroup *group,
|
layers_actions_update (GimpActionGroup *group,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpImage *gimage;
|
GimpImage *gimage = action_data_get_image (data);
|
||||||
GimpLayer *layer = NULL;
|
GimpLayer *layer = NULL;
|
||||||
GimpLayerMask *mask = FALSE; /* layer mask */
|
GimpLayerMask *mask = FALSE; /* layer mask */
|
||||||
gboolean fs = FALSE; /* floating sel */
|
gboolean fs = FALSE; /* floating sel */
|
||||||
|
@ -396,48 +397,37 @@ layers_actions_update (GimpActionGroup *group,
|
||||||
GList *next = NULL;
|
GList *next = NULL;
|
||||||
GList *prev = NULL;
|
GList *prev = NULL;
|
||||||
|
|
||||||
gimage = action_data_get_image (data);
|
|
||||||
|
|
||||||
if (gimage)
|
if (gimage)
|
||||||
{
|
{
|
||||||
GList *list;
|
fs = (gimp_image_floating_sel (gimage) != NULL);
|
||||||
|
ac = (gimp_image_get_active_channel (gimage) != NULL);
|
||||||
|
sel = ! gimp_channel_is_empty (gimp_image_get_mask (gimage));
|
||||||
|
indexed = (gimp_image_base_type (gimage) == GIMP_INDEXED);
|
||||||
|
|
||||||
layer = gimp_image_get_active_layer (gimage);
|
layer = gimp_image_get_active_layer (gimage);
|
||||||
|
|
||||||
if (layer)
|
if (layer)
|
||||||
{
|
{
|
||||||
mask = gimp_layer_get_mask (layer);
|
GList *list;
|
||||||
|
|
||||||
|
mask = gimp_layer_get_mask (layer);
|
||||||
preserve = gimp_layer_get_preserve_trans (layer);
|
preserve = gimp_layer_get_preserve_trans (layer);
|
||||||
}
|
alpha = gimp_drawable_has_alpha (GIMP_DRAWABLE (layer));
|
||||||
|
|
||||||
fs = (gimp_image_floating_sel (gimage) != NULL);
|
list = g_list_find (GIMP_LIST (gimage->layers)->list, layer);
|
||||||
ac = (gimp_image_get_active_channel (gimage) != NULL);
|
|
||||||
sel = ! gimp_channel_is_empty (gimp_image_get_mask (gimage));
|
|
||||||
|
|
||||||
alpha = layer && gimp_drawable_has_alpha (GIMP_DRAWABLE (layer));
|
if (list)
|
||||||
|
|
||||||
indexed = (gimp_image_base_type (gimage) == GIMP_INDEXED);
|
|
||||||
|
|
||||||
for (list = GIMP_LIST (gimage->layers)->list;
|
|
||||||
list;
|
|
||||||
list = g_list_next (list))
|
|
||||||
{
|
|
||||||
if (layer == (GimpLayer *) list->data)
|
|
||||||
{
|
{
|
||||||
prev = g_list_previous (list);
|
prev = g_list_previous (list);
|
||||||
next = g_list_next (list);
|
next = g_list_next (list);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (next)
|
||||||
|
next_alpha = gimp_drawable_has_alpha (GIMP_DRAWABLE (next->data));
|
||||||
|
|
||||||
|
if (layer)
|
||||||
|
text_layer = gimp_drawable_is_text_layer (GIMP_DRAWABLE (layer));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (next)
|
|
||||||
next_alpha = gimp_drawable_has_alpha (GIMP_DRAWABLE (next->data));
|
|
||||||
else
|
|
||||||
next_alpha = FALSE;
|
|
||||||
|
|
||||||
text_layer = (layer &&
|
|
||||||
gimp_drawable_is_text_layer (GIMP_DRAWABLE (layer)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define SET_VISIBLE(action,condition) \
|
#define SET_VISIBLE(action,condition) \
|
||||||
|
|
|
@ -98,26 +98,84 @@ static const GimpLayerModeEffects layer_modes[] =
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct _NewLayerOptions NewLayerOptions;
|
||||||
|
|
||||||
|
struct _NewLayerOptions
|
||||||
|
{
|
||||||
|
GtkWidget *dialog;
|
||||||
|
GtkWidget *name_entry;
|
||||||
|
GtkWidget *size_se;
|
||||||
|
|
||||||
|
GimpFillType fill_type;
|
||||||
|
gint xsize;
|
||||||
|
gint ysize;
|
||||||
|
|
||||||
|
GimpContext *context;
|
||||||
|
GimpImage *gimage;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct _EditLayerOptions EditLayerOptions;
|
||||||
|
|
||||||
|
struct _EditLayerOptions
|
||||||
|
{
|
||||||
|
GtkWidget *dialog;
|
||||||
|
GtkWidget *name_entry;
|
||||||
|
GtkWidget *toggle;
|
||||||
|
|
||||||
|
GimpLayer *layer;
|
||||||
|
GimpImage *gimage;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct _AddMaskOptions AddMaskOptions;
|
||||||
|
|
||||||
|
struct _AddMaskOptions
|
||||||
|
{
|
||||||
|
GtkWidget *dialog;
|
||||||
|
GimpLayer *layer;
|
||||||
|
GimpAddMaskType add_mask_type;
|
||||||
|
gboolean invert;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct _ResizeLayerOptions ResizeLayerOptions;
|
||||||
|
|
||||||
|
struct _ResizeLayerOptions
|
||||||
|
{
|
||||||
|
GimpLayer *layer;
|
||||||
|
GimpContext *context;
|
||||||
|
ResizeDialog *dialog;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/* local function prototypes */
|
/* local function prototypes */
|
||||||
|
|
||||||
static void layers_new_layer_query (GimpImage *gimage,
|
static void layers_new_layer_dialog (GimpImage *gimage,
|
||||||
GimpContext *context,
|
GimpContext *context,
|
||||||
GtkWidget *parent);
|
GtkWidget *parent);
|
||||||
static void layers_edit_layer_query (GimpLayer *layer,
|
static void layers_new_layer_response (GtkWidget *widget,
|
||||||
GimpContext *context,
|
gint response_id,
|
||||||
GtkWidget *parent);
|
NewLayerOptions *options);
|
||||||
static void layers_add_mask_query (GimpLayer *layer,
|
static void layers_edit_layer_dialog (GimpLayer *layer,
|
||||||
GtkWidget *parent);
|
GimpContext *context,
|
||||||
static void layers_scale_layer_query (GimpDisplay *gdisp,
|
GtkWidget *parent);
|
||||||
GimpImage *gimage,
|
static void layers_edit_layer_response (GtkWidget *widget,
|
||||||
GimpLayer *layer,
|
gint response_id,
|
||||||
GtkWidget *parent);
|
EditLayerOptions *options);
|
||||||
static void layers_resize_layer_query (GimpDisplay *gdisp,
|
static void layers_add_mask_response (GtkWidget *widget,
|
||||||
GimpImage *gimage,
|
gint response_id,
|
||||||
GimpLayer *layer,
|
AddMaskOptions *options);
|
||||||
GimpContext *context,
|
static void layers_scale_layer_callback (GtkWidget *dialog,
|
||||||
GtkWidget *parent);
|
GimpViewable *viewable,
|
||||||
static gint layers_mode_index (GimpLayerModeEffects layer_mode);
|
gint width,
|
||||||
|
gint height,
|
||||||
|
GimpUnit unit,
|
||||||
|
GimpInterpolationType interpolation,
|
||||||
|
gpointer data);
|
||||||
|
static void layers_resize_layer_callback (GtkWidget *widget,
|
||||||
|
gpointer data);
|
||||||
|
static gint layers_mode_index (GimpLayerModeEffects layer_mode);
|
||||||
|
|
||||||
|
|
||||||
/* private variables */
|
/* private variables */
|
||||||
|
@ -141,7 +199,7 @@ layers_text_tool_cmd_callback (GtkAction *action,
|
||||||
|
|
||||||
if (! gimp_drawable_is_text_layer (GIMP_DRAWABLE (layer)))
|
if (! gimp_drawable_is_text_layer (GIMP_DRAWABLE (layer)))
|
||||||
{
|
{
|
||||||
layers_edit_layer_query (layer, action_data_get_context (data), widget);
|
layers_edit_layer_dialog (layer, action_data_get_context (data), widget);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -176,7 +234,7 @@ layers_edit_attributes_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_edit_layer_query (layer, action_data_get_context (data), widget);
|
layers_edit_layer_dialog (layer, action_data_get_context (data), widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -199,7 +257,7 @@ layers_new_cmd_callback (GtkAction *action,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
layers_new_layer_query (gimage, action_data_get_context (data), widget);
|
layers_new_layer_dialog (gimage, action_data_get_context (data), widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -413,15 +471,39 @@ void
|
||||||
layers_resize_cmd_callback (GtkAction *action,
|
layers_resize_cmd_callback (GtkAction *action,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpImage *gimage;
|
ResizeLayerOptions *options;
|
||||||
GimpLayer *layer;
|
GimpImage *gimage;
|
||||||
GtkWidget *widget;
|
GimpLayer *layer;
|
||||||
|
GtkWidget *widget;
|
||||||
|
GimpDisplay *gdisp;
|
||||||
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 (GIMP_IS_DISPLAY (data) ? data : NULL,
|
gdisp = GIMP_IS_DISPLAY (data) ? data : NULL;
|
||||||
gimage, layer, action_data_get_context (data),
|
|
||||||
widget);
|
options = g_new0 (ResizeLayerOptions, 1);
|
||||||
|
|
||||||
|
options->context = action_data_get_context (data);
|
||||||
|
options->layer = layer;
|
||||||
|
|
||||||
|
options->dialog =
|
||||||
|
resize_dialog_new (GIMP_VIEWABLE (layer), widget,
|
||||||
|
RESIZE_DIALOG,
|
||||||
|
gimp_item_width (GIMP_ITEM (layer)),
|
||||||
|
gimp_item_height (GIMP_ITEM (layer)),
|
||||||
|
gimage->xresolution,
|
||||||
|
gimage->yresolution,
|
||||||
|
(gdisp ?
|
||||||
|
GIMP_DISPLAY_SHELL (gdisp->shell)->unit :
|
||||||
|
GIMP_UNIT_PIXEL),
|
||||||
|
G_CALLBACK (layers_resize_layer_callback),
|
||||||
|
options);
|
||||||
|
|
||||||
|
g_object_weak_ref (G_OBJECT (options->dialog->shell),
|
||||||
|
(GWeakNotify) g_free,
|
||||||
|
options);
|
||||||
|
|
||||||
|
gtk_widget_show (options->dialog->shell);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -440,14 +522,28 @@ void
|
||||||
layers_scale_cmd_callback (GtkAction *action,
|
layers_scale_cmd_callback (GtkAction *action,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpImage *gimage;
|
GimpImage *gimage;
|
||||||
GimpLayer *layer;
|
GimpLayer *layer;
|
||||||
GtkWidget *widget;
|
GtkWidget *widget;
|
||||||
|
GimpDisplay *gdisp;
|
||||||
|
GtkWidget *dialog;
|
||||||
|
GimpUnit unit;
|
||||||
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_scale_layer_query (action_data_get_display (data),
|
gdisp = action_data_get_display (data);
|
||||||
gimage, layer, widget);
|
|
||||||
|
unit = gdisp ? GIMP_DISPLAY_SHELL (gdisp->shell)->unit : GIMP_UNIT_PIXEL;
|
||||||
|
|
||||||
|
dialog = scale_dialog_new (GIMP_VIEWABLE (layer),
|
||||||
|
_("Scale Layer"), "gimp-layer-scale",
|
||||||
|
widget,
|
||||||
|
gimp_standard_help_func, GIMP_HELP_LAYER_SCALE,
|
||||||
|
unit, gimage->gimp->config->interpolation_type,
|
||||||
|
layers_scale_layer_callback,
|
||||||
|
gdisp);
|
||||||
|
|
||||||
|
gtk_widget_show (dialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -487,13 +583,71 @@ void
|
||||||
layers_mask_add_cmd_callback (GtkAction *action,
|
layers_mask_add_cmd_callback (GtkAction *action,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpImage *gimage;
|
AddMaskOptions *options;
|
||||||
GimpLayer *layer;
|
GimpImage *gimage;
|
||||||
GtkWidget *widget;
|
GimpLayer *layer;
|
||||||
|
GtkWidget *widget;
|
||||||
|
GtkWidget *vbox;
|
||||||
|
GtkWidget *frame;
|
||||||
|
GtkWidget *button;
|
||||||
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_add_mask_query (layer, widget);
|
options = g_new0 (AddMaskOptions, 1);
|
||||||
|
|
||||||
|
options->layer = layer;
|
||||||
|
options->add_mask_type = GIMP_ADD_WHITE_MASK;
|
||||||
|
options->invert = FALSE;
|
||||||
|
|
||||||
|
options->dialog =
|
||||||
|
gimp_viewable_dialog_new (GIMP_VIEWABLE (layer),
|
||||||
|
_("Add Layer Mask"), "gimp-layer-add-mask",
|
||||||
|
GIMP_STOCK_LAYER_MASK,
|
||||||
|
_("Add a Mask to the Layer"),
|
||||||
|
widget,
|
||||||
|
gimp_standard_help_func,
|
||||||
|
GIMP_HELP_LAYER_MASK_ADD,
|
||||||
|
|
||||||
|
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
|
||||||
|
GTK_STOCK_OK, GTK_RESPONSE_OK,
|
||||||
|
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
g_signal_connect (options->dialog, "response",
|
||||||
|
G_CALLBACK (layers_add_mask_response),
|
||||||
|
options);
|
||||||
|
|
||||||
|
g_object_weak_ref (G_OBJECT (options->dialog),
|
||||||
|
(GWeakNotify) g_free, options);
|
||||||
|
|
||||||
|
vbox = gtk_vbox_new (FALSE, 12);
|
||||||
|
gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
|
||||||
|
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (options->dialog)->vbox),
|
||||||
|
vbox);
|
||||||
|
gtk_widget_show (vbox);
|
||||||
|
|
||||||
|
frame =
|
||||||
|
gimp_enum_radio_frame_new (GIMP_TYPE_ADD_MASK_TYPE,
|
||||||
|
gtk_label_new (_("Initialize Layer Mask to:")),
|
||||||
|
G_CALLBACK (gimp_radio_button_update),
|
||||||
|
&options->add_mask_type,
|
||||||
|
&button);
|
||||||
|
gimp_int_radio_group_set_active (GTK_RADIO_BUTTON (button),
|
||||||
|
options->add_mask_type);
|
||||||
|
|
||||||
|
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
|
||||||
|
gtk_widget_show (frame);
|
||||||
|
|
||||||
|
button = gtk_check_button_new_with_mnemonic (_("In_vert Mask"));
|
||||||
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), options->invert);
|
||||||
|
gtk_box_pack_end (GTK_BOX (vbox), button, FALSE, FALSE, 0);
|
||||||
|
gtk_widget_show (button);
|
||||||
|
|
||||||
|
g_signal_connect (button, "toggled",
|
||||||
|
G_CALLBACK (gimp_toggle_button_update),
|
||||||
|
&options->invert);
|
||||||
|
|
||||||
|
gtk_widget_show (options->dialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -727,79 +881,12 @@ layers_preserve_trans_cmd_callback (GtkAction *action,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/********************************/
|
/* private functions */
|
||||||
/* The new layer query dialog */
|
|
||||||
/********************************/
|
|
||||||
|
|
||||||
typedef struct _NewLayerOptions NewLayerOptions;
|
|
||||||
|
|
||||||
struct _NewLayerOptions
|
|
||||||
{
|
|
||||||
GtkWidget *query_box;
|
|
||||||
GtkWidget *name_entry;
|
|
||||||
GtkWidget *size_se;
|
|
||||||
|
|
||||||
GimpFillType fill_type;
|
|
||||||
gint xsize;
|
|
||||||
gint ysize;
|
|
||||||
|
|
||||||
GimpContext *context;
|
|
||||||
GimpImage *gimage;
|
|
||||||
};
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
layers_new_layer_response (GtkWidget *widget,
|
layers_new_layer_dialog (GimpImage *gimage,
|
||||||
gint response_id,
|
GimpContext *context,
|
||||||
NewLayerOptions *options)
|
GtkWidget *parent)
|
||||||
{
|
|
||||||
if (response_id == GTK_RESPONSE_OK)
|
|
||||||
{
|
|
||||||
GimpLayer *layer;
|
|
||||||
|
|
||||||
if (layer_name)
|
|
||||||
g_free (layer_name);
|
|
||||||
layer_name =
|
|
||||||
g_strdup (gtk_entry_get_text (GTK_ENTRY (options->name_entry)));
|
|
||||||
|
|
||||||
options->xsize =
|
|
||||||
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (options->size_se),
|
|
||||||
0));
|
|
||||||
options->ysize =
|
|
||||||
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (options->size_se),
|
|
||||||
1));
|
|
||||||
|
|
||||||
fill_type = options->fill_type;
|
|
||||||
|
|
||||||
layer = gimp_layer_new (options->gimage,
|
|
||||||
options->xsize,
|
|
||||||
options->ysize,
|
|
||||||
gimp_image_base_type_with_alpha (options->gimage),
|
|
||||||
layer_name,
|
|
||||||
GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE);
|
|
||||||
|
|
||||||
if (layer)
|
|
||||||
{
|
|
||||||
gimp_drawable_fill_by_type (GIMP_DRAWABLE (layer),
|
|
||||||
options->context,
|
|
||||||
fill_type);
|
|
||||||
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");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
gtk_widget_destroy (options->query_box);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
layers_new_layer_query (GimpImage *gimage,
|
|
||||||
GimpContext *context,
|
|
||||||
GtkWidget *parent)
|
|
||||||
{
|
{
|
||||||
NewLayerOptions *options;
|
NewLayerOptions *options;
|
||||||
GtkWidget *vbox;
|
GtkWidget *vbox;
|
||||||
|
@ -816,7 +903,7 @@ layers_new_layer_query (GimpImage *gimage,
|
||||||
options->gimage = gimage;
|
options->gimage = gimage;
|
||||||
options->context = context;
|
options->context = context;
|
||||||
|
|
||||||
options->query_box =
|
options->dialog =
|
||||||
gimp_viewable_dialog_new (GIMP_VIEWABLE (gimage),
|
gimp_viewable_dialog_new (GIMP_VIEWABLE (gimage),
|
||||||
_("New Layer"), "gimp-layer-new",
|
_("New Layer"), "gimp-layer-new",
|
||||||
GIMP_STOCK_LAYER,
|
GIMP_STOCK_LAYER,
|
||||||
|
@ -830,17 +917,17 @@ layers_new_layer_query (GimpImage *gimage,
|
||||||
|
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
g_signal_connect (options->query_box, "response",
|
g_signal_connect (options->dialog, "response",
|
||||||
G_CALLBACK (layers_new_layer_response),
|
G_CALLBACK (layers_new_layer_response),
|
||||||
options);
|
options);
|
||||||
|
|
||||||
g_object_weak_ref (G_OBJECT (options->query_box),
|
g_object_weak_ref (G_OBJECT (options->dialog),
|
||||||
(GWeakNotify) g_free,
|
(GWeakNotify) g_free,
|
||||||
options);
|
options);
|
||||||
|
|
||||||
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->dialog)->vbox),
|
||||||
vbox);
|
vbox);
|
||||||
gtk_widget_show (vbox);
|
gtk_widget_show (vbox);
|
||||||
|
|
||||||
|
@ -931,55 +1018,56 @@ layers_new_layer_query (GimpImage *gimage,
|
||||||
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 (options->query_box);
|
gtk_widget_show (options->dialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**************************************/
|
|
||||||
/* The edit layer attributes dialog */
|
|
||||||
/**************************************/
|
|
||||||
|
|
||||||
typedef struct _EditLayerOptions EditLayerOptions;
|
|
||||||
|
|
||||||
struct _EditLayerOptions
|
|
||||||
{
|
|
||||||
GtkWidget *query_box;
|
|
||||||
GtkWidget *name_entry;
|
|
||||||
GtkWidget *toggle;
|
|
||||||
|
|
||||||
GimpLayer *layer;
|
|
||||||
GimpImage *gimage;
|
|
||||||
};
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
layers_edit_layer_response (GtkWidget *widget,
|
layers_new_layer_response (GtkWidget *widget,
|
||||||
gint response_id,
|
gint response_id,
|
||||||
EditLayerOptions *options)
|
NewLayerOptions *options)
|
||||||
{
|
{
|
||||||
if (response_id == GTK_RESPONSE_OK)
|
if (response_id == GTK_RESPONSE_OK)
|
||||||
{
|
{
|
||||||
GimpLayer *layer = options->layer;
|
GimpLayer *layer;
|
||||||
const gchar *new_name;
|
|
||||||
|
|
||||||
new_name = gtk_entry_get_text (GTK_ENTRY (options->name_entry));
|
if (layer_name)
|
||||||
|
g_free (layer_name);
|
||||||
|
layer_name =
|
||||||
|
g_strdup (gtk_entry_get_text (GTK_ENTRY (options->name_entry)));
|
||||||
|
|
||||||
if (strcmp (new_name, gimp_object_get_name (GIMP_OBJECT (layer))))
|
options->xsize =
|
||||||
|
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (options->size_se),
|
||||||
|
0));
|
||||||
|
options->ysize =
|
||||||
|
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (options->size_se),
|
||||||
|
1));
|
||||||
|
|
||||||
|
fill_type = options->fill_type;
|
||||||
|
|
||||||
|
layer = gimp_layer_new (options->gimage,
|
||||||
|
options->xsize,
|
||||||
|
options->ysize,
|
||||||
|
gimp_image_base_type_with_alpha (options->gimage),
|
||||||
|
layer_name,
|
||||||
|
GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE);
|
||||||
|
|
||||||
|
if (layer)
|
||||||
{
|
{
|
||||||
gimp_item_rename (GIMP_ITEM (layer), new_name);
|
gimp_drawable_fill_by_type (GIMP_DRAWABLE (layer),
|
||||||
|
options->context,
|
||||||
|
fill_type);
|
||||||
|
gimp_image_add_layer (options->gimage, layer, -1);
|
||||||
|
|
||||||
gimp_image_flush (options->gimage);
|
gimp_image_flush (options->gimage);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
if (options->toggle &&
|
|
||||||
gimp_drawable_is_text_layer (GIMP_DRAWABLE (layer)))
|
|
||||||
{
|
{
|
||||||
g_object_set (layer,
|
g_message ("new_layer_query_response: "
|
||||||
"auto-rename",
|
"could not allocate new layer");
|
||||||
GTK_TOGGLE_BUTTON (options->toggle)->active,
|
|
||||||
NULL);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gtk_widget_destroy (options->query_box);
|
gtk_widget_destroy (options->dialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1004,9 +1092,9 @@ layers_edit_layer_toggle_rename (GtkWidget *widget,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
layers_edit_layer_query (GimpLayer *layer,
|
layers_edit_layer_dialog (GimpLayer *layer,
|
||||||
GimpContext *context,
|
GimpContext *context,
|
||||||
GtkWidget *parent)
|
GtkWidget *parent)
|
||||||
{
|
{
|
||||||
EditLayerOptions *options;
|
EditLayerOptions *options;
|
||||||
GtkWidget *vbox;
|
GtkWidget *vbox;
|
||||||
|
@ -1020,7 +1108,7 @@ layers_edit_layer_query (GimpLayer *layer,
|
||||||
options->layer = layer;
|
options->layer = layer;
|
||||||
options->gimage = gimp_item_get_image (GIMP_ITEM (layer));
|
options->gimage = gimp_item_get_image (GIMP_ITEM (layer));
|
||||||
|
|
||||||
options->query_box =
|
options->dialog =
|
||||||
gimp_viewable_dialog_new (GIMP_VIEWABLE (layer),
|
gimp_viewable_dialog_new (GIMP_VIEWABLE (layer),
|
||||||
_("Layer Attributes"), "gimp-layer-edit",
|
_("Layer Attributes"), "gimp-layer-edit",
|
||||||
GIMP_STOCK_EDIT,
|
GIMP_STOCK_EDIT,
|
||||||
|
@ -1034,17 +1122,17 @@ layers_edit_layer_query (GimpLayer *layer,
|
||||||
|
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
g_signal_connect (options->query_box, "response",
|
g_signal_connect (options->dialog, "response",
|
||||||
G_CALLBACK (layers_edit_layer_response),
|
G_CALLBACK (layers_edit_layer_response),
|
||||||
options);
|
options);
|
||||||
|
|
||||||
g_object_weak_ref (G_OBJECT (options->query_box),
|
g_object_weak_ref (G_OBJECT (options->dialog),
|
||||||
(GWeakNotify) g_free,
|
(GWeakNotify) g_free,
|
||||||
options);
|
options);
|
||||||
|
|
||||||
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->dialog)->vbox),
|
||||||
vbox);
|
vbox);
|
||||||
gtk_widget_show (vbox);
|
gtk_widget_show (vbox);
|
||||||
|
|
||||||
|
@ -1080,23 +1168,39 @@ layers_edit_layer_query (GimpLayer *layer,
|
||||||
options);
|
options);
|
||||||
}
|
}
|
||||||
|
|
||||||
gtk_widget_show (options->query_box);
|
gtk_widget_show (options->dialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
/*******************************/
|
layers_edit_layer_response (GtkWidget *widget,
|
||||||
/* The add mask query dialog */
|
gint response_id,
|
||||||
/*******************************/
|
EditLayerOptions *options)
|
||||||
|
|
||||||
typedef struct _AddMaskOptions AddMaskOptions;
|
|
||||||
|
|
||||||
struct _AddMaskOptions
|
|
||||||
{
|
{
|
||||||
GtkWidget *query_box;
|
if (response_id == GTK_RESPONSE_OK)
|
||||||
GimpLayer *layer;
|
{
|
||||||
GimpAddMaskType add_mask_type;
|
GimpLayer *layer = options->layer;
|
||||||
gboolean invert;
|
const gchar *new_name;
|
||||||
};
|
|
||||||
|
new_name = gtk_entry_get_text (GTK_ENTRY (options->name_entry));
|
||||||
|
|
||||||
|
if (strcmp (new_name, gimp_object_get_name (GIMP_OBJECT (layer))))
|
||||||
|
{
|
||||||
|
gimp_item_rename (GIMP_ITEM (layer), new_name);
|
||||||
|
gimp_image_flush (options->gimage);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (options->toggle &&
|
||||||
|
gimp_drawable_is_text_layer (GIMP_DRAWABLE (layer)))
|
||||||
|
{
|
||||||
|
g_object_set (layer,
|
||||||
|
"auto-rename",
|
||||||
|
GTK_TOGGLE_BUTTON (options->toggle)->active,
|
||||||
|
NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gtk_widget_destroy (options->dialog);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
layers_add_mask_response (GtkWidget *widget,
|
layers_add_mask_response (GtkWidget *widget,
|
||||||
|
@ -1127,84 +1231,9 @@ layers_add_mask_response (GtkWidget *widget,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gtk_widget_destroy (options->query_box);
|
gtk_widget_destroy (options->dialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
layers_add_mask_query (GimpLayer *layer,
|
|
||||||
GtkWidget *parent)
|
|
||||||
{
|
|
||||||
AddMaskOptions *options;
|
|
||||||
GtkWidget *vbox;
|
|
||||||
GtkWidget *frame;
|
|
||||||
GtkWidget *button;
|
|
||||||
GimpImage *gimage;
|
|
||||||
|
|
||||||
/* The new options structure */
|
|
||||||
options = g_new (AddMaskOptions, 1);
|
|
||||||
options->layer = layer;
|
|
||||||
options->add_mask_type = GIMP_ADD_WHITE_MASK;
|
|
||||||
options->invert = FALSE;
|
|
||||||
|
|
||||||
gimage = gimp_item_get_image (GIMP_ITEM (layer));
|
|
||||||
|
|
||||||
/* The dialog */
|
|
||||||
options->query_box =
|
|
||||||
gimp_viewable_dialog_new (GIMP_VIEWABLE (layer),
|
|
||||||
_("Add Layer Mask"), "gimp-layer-add-mask",
|
|
||||||
GIMP_STOCK_LAYER_MASK,
|
|
||||||
_("Add a Mask to the Layer"),
|
|
||||||
parent,
|
|
||||||
gimp_standard_help_func,
|
|
||||||
GIMP_HELP_LAYER_MASK_ADD,
|
|
||||||
|
|
||||||
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
|
|
||||||
GTK_STOCK_OK, GTK_RESPONSE_OK,
|
|
||||||
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
g_signal_connect (options->query_box, "response",
|
|
||||||
G_CALLBACK (layers_add_mask_response),
|
|
||||||
options);
|
|
||||||
|
|
||||||
g_object_weak_ref (G_OBJECT (options->query_box),
|
|
||||||
(GWeakNotify) g_free, options);
|
|
||||||
|
|
||||||
vbox = gtk_vbox_new (FALSE, 12);
|
|
||||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
|
|
||||||
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (options->query_box)->vbox),
|
|
||||||
vbox);
|
|
||||||
gtk_widget_show (vbox);
|
|
||||||
|
|
||||||
frame =
|
|
||||||
gimp_enum_radio_frame_new (GIMP_TYPE_ADD_MASK_TYPE,
|
|
||||||
gtk_label_new (_("Initialize Layer Mask to:")),
|
|
||||||
G_CALLBACK (gimp_radio_button_update),
|
|
||||||
&options->add_mask_type,
|
|
||||||
&button);
|
|
||||||
gimp_int_radio_group_set_active (GTK_RADIO_BUTTON (button),
|
|
||||||
options->add_mask_type);
|
|
||||||
|
|
||||||
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
|
|
||||||
gtk_widget_show (frame);
|
|
||||||
|
|
||||||
button = gtk_check_button_new_with_mnemonic (_("In_vert Mask"));
|
|
||||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), options->invert);
|
|
||||||
gtk_box_pack_end (GTK_BOX (vbox), button, FALSE, FALSE, 0);
|
|
||||||
gtk_widget_show (button);
|
|
||||||
|
|
||||||
g_signal_connect (button, "toggled",
|
|
||||||
G_CALLBACK (gimp_toggle_button_update),
|
|
||||||
&options->invert);
|
|
||||||
|
|
||||||
gtk_widget_show (options->query_box);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/****************************/
|
|
||||||
/* The scale layer dialog */
|
|
||||||
/****************************/
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
layers_scale_layer_callback (GtkWidget *dialog,
|
layers_scale_layer_callback (GtkWidget *dialog,
|
||||||
GimpViewable *viewable,
|
GimpViewable *viewable,
|
||||||
|
@ -1257,42 +1286,6 @@ layers_scale_layer_callback (GtkWidget *dialog,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
layers_scale_layer_query (GimpDisplay *gdisp,
|
|
||||||
GimpImage *gimage,
|
|
||||||
GimpLayer *layer,
|
|
||||||
GtkWidget *parent)
|
|
||||||
{
|
|
||||||
GtkWidget *dialog;
|
|
||||||
GimpUnit unit;
|
|
||||||
|
|
||||||
unit = gdisp ? GIMP_DISPLAY_SHELL (gdisp->shell)->unit : GIMP_UNIT_PIXEL;
|
|
||||||
|
|
||||||
dialog = scale_dialog_new (GIMP_VIEWABLE (layer),
|
|
||||||
_("Scale Layer"), "gimp-layer-scale",
|
|
||||||
parent,
|
|
||||||
gimp_standard_help_func, GIMP_HELP_LAYER_SCALE,
|
|
||||||
unit, gimage->gimp->config->interpolation_type,
|
|
||||||
layers_scale_layer_callback,
|
|
||||||
gdisp);
|
|
||||||
|
|
||||||
gtk_widget_show (dialog);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*****************************/
|
|
||||||
/* The resize layer dialog */
|
|
||||||
/*****************************/
|
|
||||||
|
|
||||||
typedef struct _ResizeLayerOptions ResizeLayerOptions;
|
|
||||||
|
|
||||||
struct _ResizeLayerOptions
|
|
||||||
{
|
|
||||||
GimpLayer *layer;
|
|
||||||
GimpContext *context;
|
|
||||||
ResizeDialog *dialog;
|
|
||||||
};
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
layers_resize_layer_callback (GtkWidget *widget,
|
layers_resize_layer_callback (GtkWidget *widget,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
|
@ -1322,40 +1315,6 @@ layers_resize_layer_callback (GtkWidget *widget,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
layers_resize_layer_query (GimpDisplay *gdisp,
|
|
||||||
GimpImage *gimage,
|
|
||||||
GimpLayer *layer,
|
|
||||||
GimpContext *context,
|
|
||||||
GtkWidget *parent)
|
|
||||||
{
|
|
||||||
ResizeLayerOptions *options;
|
|
||||||
|
|
||||||
options = g_new0 (ResizeLayerOptions, 1);
|
|
||||||
|
|
||||||
options->context = context;
|
|
||||||
options->layer = layer;
|
|
||||||
|
|
||||||
options->dialog =
|
|
||||||
resize_dialog_new (GIMP_VIEWABLE (layer), parent,
|
|
||||||
RESIZE_DIALOG,
|
|
||||||
gimp_item_width (GIMP_ITEM (layer)),
|
|
||||||
gimp_item_height (GIMP_ITEM (layer)),
|
|
||||||
gimage->xresolution,
|
|
||||||
gimage->yresolution,
|
|
||||||
(gdisp ?
|
|
||||||
GIMP_DISPLAY_SHELL (gdisp->shell)->unit :
|
|
||||||
GIMP_UNIT_PIXEL),
|
|
||||||
G_CALLBACK (layers_resize_layer_callback),
|
|
||||||
options);
|
|
||||||
|
|
||||||
g_object_weak_ref (G_OBJECT (options->dialog->shell),
|
|
||||||
(GWeakNotify) g_free,
|
|
||||||
options);
|
|
||||||
|
|
||||||
gtk_widget_show (options->dialog->shell);
|
|
||||||
}
|
|
||||||
|
|
||||||
static gint
|
static gint
|
||||||
layers_mode_index (GimpLayerModeEffects layer_mode)
|
layers_mode_index (GimpLayerModeEffects layer_mode)
|
||||||
{
|
{
|
||||||
|
|
|
@ -39,8 +39,8 @@
|
||||||
|
|
||||||
static GimpActionEntry palette_editor_actions[] =
|
static GimpActionEntry palette_editor_actions[] =
|
||||||
{
|
{
|
||||||
{ "palette-editor-popup", GIMP_STOCK_PALETTE, N_("Palette Editor Menu"),
|
{ "palette-editor-popup", GIMP_STOCK_PALETTE,
|
||||||
NULL, NULL, NULL,
|
N_("Palette Editor Menu"), NULL, NULL, NULL,
|
||||||
GIMP_HELP_PALETTE_EDITOR_DIALOG },
|
GIMP_HELP_PALETTE_EDITOR_DIALOG },
|
||||||
|
|
||||||
{ "palette-editor-edit-color", GIMP_STOCK_EDIT,
|
{ "palette-editor-edit-color", GIMP_STOCK_EDIT,
|
||||||
|
@ -92,17 +92,14 @@ void
|
||||||
palette_editor_actions_update (GimpActionGroup *group,
|
palette_editor_actions_update (GimpActionGroup *group,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
GimpPaletteEditor *editor;
|
GimpPaletteEditor *editor = GIMP_PALETTE_EDITOR (user_data);
|
||||||
GimpDataEditor *data_editor;
|
GimpDataEditor *data_editor = GIMP_DATA_EDITOR (user_data);
|
||||||
GimpContext *context;
|
GimpContext *context;
|
||||||
GimpData *data;
|
GimpData *data;
|
||||||
gboolean editable = FALSE;
|
gboolean editable = FALSE;
|
||||||
GimpRGB fg;
|
GimpRGB fg;
|
||||||
GimpRGB bg;
|
GimpRGB bg;
|
||||||
|
|
||||||
editor = GIMP_PALETTE_EDITOR (user_data);
|
|
||||||
data_editor = GIMP_DATA_EDITOR (user_data);
|
|
||||||
|
|
||||||
context = gimp_get_user_context (group->gimp);
|
context = gimp_get_user_context (group->gimp);
|
||||||
|
|
||||||
data = data_editor->data;
|
data = data_editor->data;
|
||||||
|
|
|
@ -40,7 +40,8 @@
|
||||||
|
|
||||||
static GimpActionEntry palettes_actions[] =
|
static GimpActionEntry palettes_actions[] =
|
||||||
{
|
{
|
||||||
{ "palettes-popup", GIMP_STOCK_PALETTE, N_("Palettes Menu"), NULL, NULL, NULL,
|
{ "palettes-popup", GIMP_STOCK_PALETTE,
|
||||||
|
N_("Palettes Menu"), NULL, NULL, NULL,
|
||||||
GIMP_HELP_PALETTE_DIALOG },
|
GIMP_HELP_PALETTE_DIALOG },
|
||||||
|
|
||||||
{ "palettes-new", GTK_STOCK_NEW,
|
{ "palettes-new", GTK_STOCK_NEW,
|
||||||
|
@ -107,12 +108,10 @@ void
|
||||||
palettes_actions_update (GimpActionGroup *group,
|
palettes_actions_update (GimpActionGroup *group,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
GimpContext *context;
|
GimpContext *context = action_data_get_context (user_data);
|
||||||
GimpPalette *palette = NULL;
|
GimpPalette *palette = NULL;
|
||||||
GimpData *data = NULL;
|
GimpData *data = NULL;
|
||||||
|
|
||||||
context = action_data_get_context (user_data);
|
|
||||||
|
|
||||||
if (context)
|
if (context)
|
||||||
{
|
{
|
||||||
palette = gimp_context_get_palette (context);
|
palette = gimp_context_get_palette (context);
|
||||||
|
|
|
@ -43,10 +43,9 @@
|
||||||
|
|
||||||
/* local function prototypes */
|
/* local function prototypes */
|
||||||
|
|
||||||
static void palettes_merge_palettes_query (GimpContainerEditor *editor);
|
static void palettes_merge_palettes_callback (GtkWidget *widget,
|
||||||
static void palettes_merge_palettes_callback (GtkWidget *widget,
|
const gchar *palette_name,
|
||||||
const gchar *palette_name,
|
gpointer data);
|
||||||
gpointer data);
|
|
||||||
|
|
||||||
|
|
||||||
/* public functionss */
|
/* public functionss */
|
||||||
|
@ -68,17 +67,7 @@ palettes_merge_palettes_cmd_callback (GtkAction *action,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
|
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
|
||||||
|
GtkWidget *qbox;
|
||||||
palettes_merge_palettes_query (editor);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* private functions */
|
|
||||||
|
|
||||||
static void
|
|
||||||
palettes_merge_palettes_query (GimpContainerEditor *editor)
|
|
||||||
{
|
|
||||||
GtkWidget *qbox;
|
|
||||||
|
|
||||||
qbox = gimp_query_string_box (_("Merge Palette"),
|
qbox = gimp_query_string_box (_("Merge Palette"),
|
||||||
GTK_WIDGET (editor),
|
GTK_WIDGET (editor),
|
||||||
|
@ -92,6 +81,9 @@ palettes_merge_palettes_query (GimpContainerEditor *editor)
|
||||||
gtk_widget_show (qbox);
|
gtk_widget_show (qbox);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* private functions */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
palettes_merge_palettes_callback (GtkWidget *widget,
|
palettes_merge_palettes_callback (GtkWidget *widget,
|
||||||
const gchar *palette_name,
|
const gchar *palette_name,
|
||||||
|
|
|
@ -39,7 +39,8 @@
|
||||||
|
|
||||||
static GimpActionEntry patterns_actions[] =
|
static GimpActionEntry patterns_actions[] =
|
||||||
{
|
{
|
||||||
{ "patterns-popup", GIMP_STOCK_PATTERN, N_("Patterns Menu"), NULL, NULL, NULL,
|
{ "patterns-popup", GIMP_STOCK_PATTERN,
|
||||||
|
N_("Patterns Menu"), NULL, NULL, NULL,
|
||||||
GIMP_HELP_PATTERN_DIALOG },
|
GIMP_HELP_PATTERN_DIALOG },
|
||||||
|
|
||||||
{ "patterns-new", GTK_STOCK_NEW,
|
{ "patterns-new", GTK_STOCK_NEW,
|
||||||
|
@ -94,12 +95,10 @@ void
|
||||||
patterns_actions_update (GimpActionGroup *group,
|
patterns_actions_update (GimpActionGroup *group,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
GimpContext *context;
|
GimpContext *context = action_data_get_context (user_data);
|
||||||
GimpPattern *pattern = NULL;
|
GimpPattern *pattern = NULL;
|
||||||
GimpData *data = NULL;
|
GimpData *data = NULL;
|
||||||
|
|
||||||
context = action_data_get_context (user_data);
|
|
||||||
|
|
||||||
if (context)
|
if (context)
|
||||||
{
|
{
|
||||||
pattern = gimp_context_get_pattern (context);
|
pattern = gimp_context_get_pattern (context);
|
||||||
|
|
|
@ -143,12 +143,10 @@ void
|
||||||
plug_in_actions_update (GimpActionGroup *group,
|
plug_in_actions_update (GimpActionGroup *group,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpImage *gimage;
|
GimpImage *gimage = action_data_get_image (data);
|
||||||
GimpImageType type = -1;
|
GimpImageType type = -1;
|
||||||
GSList *list;
|
GSList *list;
|
||||||
|
|
||||||
gimage = action_data_get_image (data);
|
|
||||||
|
|
||||||
if (gimage)
|
if (gimage)
|
||||||
{
|
{
|
||||||
GimpDrawable *drawable = gimp_image_active_drawable (gimage);
|
GimpDrawable *drawable = gimp_image_active_drawable (gimage);
|
||||||
|
|
|
@ -38,7 +38,8 @@
|
||||||
|
|
||||||
static GimpActionEntry qmask_actions[] =
|
static GimpActionEntry qmask_actions[] =
|
||||||
{
|
{
|
||||||
{ "qmask-popup", NULL, N_("Quick Mask Menu"), NULL, NULL, NULL,
|
{ "qmask-popup", NULL,
|
||||||
|
N_("Quick Mask Menu"), NULL, NULL, NULL,
|
||||||
GIMP_HELP_QMASK },
|
GIMP_HELP_QMASK },
|
||||||
|
|
||||||
{ "qmask-configure", NULL,
|
{ "qmask-configure", NULL,
|
||||||
|
@ -80,6 +81,8 @@ static GimpRadioActionEntry qmask_invert_actions[] =
|
||||||
void
|
void
|
||||||
qmask_actions_setup (GimpActionGroup *group)
|
qmask_actions_setup (GimpActionGroup *group)
|
||||||
{
|
{
|
||||||
|
GtkAction *action;
|
||||||
|
|
||||||
gimp_action_group_add_actions (group,
|
gimp_action_group_add_actions (group,
|
||||||
qmask_actions,
|
qmask_actions,
|
||||||
G_N_ELEMENTS (qmask_actions));
|
G_N_ELEMENTS (qmask_actions));
|
||||||
|
@ -93,32 +96,51 @@ qmask_actions_setup (GimpActionGroup *group)
|
||||||
G_N_ELEMENTS (qmask_invert_actions),
|
G_N_ELEMENTS (qmask_invert_actions),
|
||||||
FALSE,
|
FALSE,
|
||||||
G_CALLBACK (qmask_invert_cmd_callback));
|
G_CALLBACK (qmask_invert_cmd_callback));
|
||||||
|
|
||||||
|
action = gtk_action_group_get_action (GTK_ACTION_GROUP (group),
|
||||||
|
"qmask-active");
|
||||||
|
gtk_action_set_accel_path (action, "<Actions>/qmask/qmask-toggle");
|
||||||
|
|
||||||
|
#ifdef __GNUC__
|
||||||
|
#warning FIXME: remove accel_path hack
|
||||||
|
#endif
|
||||||
|
g_object_set_data (G_OBJECT (action), "gimp-accel-path",
|
||||||
|
"<Actions>/qmask/qmask-toggle");
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
qmask_actions_update (GimpActionGroup *group,
|
qmask_actions_update (GimpActionGroup *group,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpImage *gimage;
|
GimpImage *gimage = action_data_get_image (data);
|
||||||
|
|
||||||
gimage = action_data_get_image (data);
|
|
||||||
|
|
||||||
|
#define SET_SENSITIVE(action,sensitive) \
|
||||||
|
gimp_action_group_set_action_sensitive (group, action, (sensitive) != 0)
|
||||||
#define SET_ACTIVE(action,active) \
|
#define SET_ACTIVE(action,active) \
|
||||||
gimp_action_group_set_action_active (group, action, (active))
|
gimp_action_group_set_action_active (group, action, (active) != 0)
|
||||||
#define SET_COLOR(action,color) \
|
#define SET_COLOR(action,color) \
|
||||||
gimp_action_group_set_action_color (group, action, (color), FALSE)
|
gimp_action_group_set_action_color (group, action, (color), FALSE)
|
||||||
|
|
||||||
|
SET_SENSITIVE ("qmask-active", gimage);
|
||||||
|
SET_SENSITIVE ("qmask-toggle", gimage);
|
||||||
|
|
||||||
SET_ACTIVE ("qmask-active", gimage && gimage->qmask_state);
|
SET_ACTIVE ("qmask-active", gimage && gimage->qmask_state);
|
||||||
SET_ACTIVE ("qmask-toggle", gimage && gimage->qmask_state);
|
SET_ACTIVE ("qmask-toggle", gimage && gimage->qmask_state);
|
||||||
|
|
||||||
|
SET_SENSITIVE ("qmask-invert-on", gimage);
|
||||||
|
SET_SENSITIVE ("qmask-invert-off", gimage);
|
||||||
|
|
||||||
if (gimage && gimage->qmask_inverted)
|
if (gimage && gimage->qmask_inverted)
|
||||||
SET_ACTIVE ("qmask-invert-on", TRUE);
|
SET_ACTIVE ("qmask-invert-on", TRUE);
|
||||||
else
|
else
|
||||||
SET_ACTIVE ("qmask-invert-off", TRUE);
|
SET_ACTIVE ("qmask-invert-off", TRUE);
|
||||||
|
|
||||||
|
SET_SENSITIVE ("qmask-configure", gimage);
|
||||||
|
|
||||||
if (gimage)
|
if (gimage)
|
||||||
SET_COLOR ("qmask-configure", &gimage->qmask_color);
|
SET_COLOR ("qmask-configure", &gimage->qmask_color);
|
||||||
|
|
||||||
#undef SET_SENSITIVE
|
#undef SET_SENSITIVE
|
||||||
|
#undef SET_ACTIVE
|
||||||
#undef SET_COLOR
|
#undef SET_COLOR
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,8 @@
|
||||||
|
|
||||||
static GimpActionEntry qmask_actions[] =
|
static GimpActionEntry qmask_actions[] =
|
||||||
{
|
{
|
||||||
{ "qmask-popup", NULL, N_("Quick Mask Menu"), NULL, NULL, NULL,
|
{ "qmask-popup", NULL,
|
||||||
|
N_("Quick Mask Menu"), NULL, NULL, NULL,
|
||||||
GIMP_HELP_QMASK },
|
GIMP_HELP_QMASK },
|
||||||
|
|
||||||
{ "qmask-configure", NULL,
|
{ "qmask-configure", NULL,
|
||||||
|
@ -80,6 +81,8 @@ static GimpRadioActionEntry qmask_invert_actions[] =
|
||||||
void
|
void
|
||||||
qmask_actions_setup (GimpActionGroup *group)
|
qmask_actions_setup (GimpActionGroup *group)
|
||||||
{
|
{
|
||||||
|
GtkAction *action;
|
||||||
|
|
||||||
gimp_action_group_add_actions (group,
|
gimp_action_group_add_actions (group,
|
||||||
qmask_actions,
|
qmask_actions,
|
||||||
G_N_ELEMENTS (qmask_actions));
|
G_N_ELEMENTS (qmask_actions));
|
||||||
|
@ -93,32 +96,51 @@ qmask_actions_setup (GimpActionGroup *group)
|
||||||
G_N_ELEMENTS (qmask_invert_actions),
|
G_N_ELEMENTS (qmask_invert_actions),
|
||||||
FALSE,
|
FALSE,
|
||||||
G_CALLBACK (qmask_invert_cmd_callback));
|
G_CALLBACK (qmask_invert_cmd_callback));
|
||||||
|
|
||||||
|
action = gtk_action_group_get_action (GTK_ACTION_GROUP (group),
|
||||||
|
"qmask-active");
|
||||||
|
gtk_action_set_accel_path (action, "<Actions>/qmask/qmask-toggle");
|
||||||
|
|
||||||
|
#ifdef __GNUC__
|
||||||
|
#warning FIXME: remove accel_path hack
|
||||||
|
#endif
|
||||||
|
g_object_set_data (G_OBJECT (action), "gimp-accel-path",
|
||||||
|
"<Actions>/qmask/qmask-toggle");
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
qmask_actions_update (GimpActionGroup *group,
|
qmask_actions_update (GimpActionGroup *group,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpImage *gimage;
|
GimpImage *gimage = action_data_get_image (data);
|
||||||
|
|
||||||
gimage = action_data_get_image (data);
|
|
||||||
|
|
||||||
|
#define SET_SENSITIVE(action,sensitive) \
|
||||||
|
gimp_action_group_set_action_sensitive (group, action, (sensitive) != 0)
|
||||||
#define SET_ACTIVE(action,active) \
|
#define SET_ACTIVE(action,active) \
|
||||||
gimp_action_group_set_action_active (group, action, (active))
|
gimp_action_group_set_action_active (group, action, (active) != 0)
|
||||||
#define SET_COLOR(action,color) \
|
#define SET_COLOR(action,color) \
|
||||||
gimp_action_group_set_action_color (group, action, (color), FALSE)
|
gimp_action_group_set_action_color (group, action, (color), FALSE)
|
||||||
|
|
||||||
|
SET_SENSITIVE ("qmask-active", gimage);
|
||||||
|
SET_SENSITIVE ("qmask-toggle", gimage);
|
||||||
|
|
||||||
SET_ACTIVE ("qmask-active", gimage && gimage->qmask_state);
|
SET_ACTIVE ("qmask-active", gimage && gimage->qmask_state);
|
||||||
SET_ACTIVE ("qmask-toggle", gimage && gimage->qmask_state);
|
SET_ACTIVE ("qmask-toggle", gimage && gimage->qmask_state);
|
||||||
|
|
||||||
|
SET_SENSITIVE ("qmask-invert-on", gimage);
|
||||||
|
SET_SENSITIVE ("qmask-invert-off", gimage);
|
||||||
|
|
||||||
if (gimage && gimage->qmask_inverted)
|
if (gimage && gimage->qmask_inverted)
|
||||||
SET_ACTIVE ("qmask-invert-on", TRUE);
|
SET_ACTIVE ("qmask-invert-on", TRUE);
|
||||||
else
|
else
|
||||||
SET_ACTIVE ("qmask-invert-off", TRUE);
|
SET_ACTIVE ("qmask-invert-off", TRUE);
|
||||||
|
|
||||||
|
SET_SENSITIVE ("qmask-configure", gimage);
|
||||||
|
|
||||||
if (gimage)
|
if (gimage)
|
||||||
SET_COLOR ("qmask-configure", &gimage->qmask_color);
|
SET_COLOR ("qmask-configure", &gimage->qmask_color);
|
||||||
|
|
||||||
#undef SET_SENSITIVE
|
#undef SET_SENSITIVE
|
||||||
|
#undef SET_ACTIVE
|
||||||
#undef SET_COLOR
|
#undef SET_COLOR
|
||||||
}
|
}
|
||||||
|
|
|
@ -120,13 +120,11 @@ void
|
||||||
select_actions_update (GimpActionGroup *group,
|
select_actions_update (GimpActionGroup *group,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpImage *gimage;
|
GimpImage *gimage = action_data_get_image (data);
|
||||||
GimpDrawable *drawable = NULL;
|
GimpDrawable *drawable = NULL;
|
||||||
gboolean fs = FALSE;
|
gboolean fs = FALSE;
|
||||||
gboolean sel = FALSE;
|
gboolean sel = FALSE;
|
||||||
|
|
||||||
gimage = action_data_get_image (data);
|
|
||||||
|
|
||||||
if (gimage)
|
if (gimage)
|
||||||
{
|
{
|
||||||
drawable = gimp_image_active_drawable (gimage);
|
drawable = gimp_image_active_drawable (gimage);
|
||||||
|
|
|
@ -25,10 +25,12 @@
|
||||||
|
|
||||||
#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"
|
||||||
#include "core/gimpselection.h"
|
#include "core/gimpselection.h"
|
||||||
|
#include "core/gimpstrokeoptions.h"
|
||||||
|
|
||||||
#include "widgets/gimphelp-ids.h"
|
#include "widgets/gimphelp-ids.h"
|
||||||
#include "widgets/gimpdialogfactory.h"
|
#include "widgets/gimpdialogfactory.h"
|
||||||
|
@ -47,22 +49,22 @@
|
||||||
|
|
||||||
/* local function prototypes */
|
/* local function prototypes */
|
||||||
|
|
||||||
static void gimp_image_mask_feather_callback (GtkWidget *widget,
|
static void select_feather_callback (GtkWidget *widget,
|
||||||
gdouble size,
|
gdouble size,
|
||||||
GimpUnit unit,
|
GimpUnit unit,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
static void gimp_image_mask_border_callback (GtkWidget *widget,
|
static void select_border_callback (GtkWidget *widget,
|
||||||
gdouble size,
|
gdouble size,
|
||||||
GimpUnit unit,
|
GimpUnit unit,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
static void gimp_image_mask_grow_callback (GtkWidget *widget,
|
static void select_grow_callback (GtkWidget *widget,
|
||||||
gdouble size,
|
gdouble size,
|
||||||
GimpUnit unit,
|
GimpUnit unit,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
static void gimp_image_mask_shrink_callback (GtkWidget *widget,
|
static void select_shrink_callback (GtkWidget *widget,
|
||||||
gdouble size,
|
gdouble size,
|
||||||
GimpUnit unit,
|
GimpUnit unit,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
|
|
||||||
|
|
||||||
/* local variables */
|
/* local variables */
|
||||||
|
@ -126,22 +128,22 @@ select_feather_cmd_callback (GtkAction *action,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpDisplay *gdisp;
|
GimpDisplay *gdisp;
|
||||||
GtkWidget *qbox;
|
GtkWidget *dialog;
|
||||||
return_if_no_display (gdisp, data);
|
return_if_no_display (gdisp, data);
|
||||||
|
|
||||||
qbox = gimp_query_size_box (_("Feather Selection"),
|
dialog = 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,
|
||||||
GIMP_DISPLAY_SHELL (gdisp->shell)->unit,
|
GIMP_DISPLAY_SHELL (gdisp->shell)->unit,
|
||||||
MIN (gdisp->gimage->xresolution,
|
MIN (gdisp->gimage->xresolution,
|
||||||
gdisp->gimage->yresolution),
|
gdisp->gimage->yresolution),
|
||||||
FALSE,
|
FALSE,
|
||||||
G_OBJECT (gdisp->gimage), "disconnect",
|
G_OBJECT (gdisp->gimage), "disconnect",
|
||||||
gimp_image_mask_feather_callback, gdisp->gimage);
|
select_feather_callback, gdisp->gimage);
|
||||||
gtk_widget_show (qbox);
|
gtk_widget_show (dialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -160,35 +162,34 @@ select_shrink_cmd_callback (GtkAction *action,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpDisplay *gdisp;
|
GimpDisplay *gdisp;
|
||||||
GtkWidget *shrink_dialog;
|
GtkWidget *dialog;
|
||||||
GtkWidget *edge_lock;
|
GtkWidget *edge_lock;
|
||||||
return_if_no_display (gdisp, data);
|
return_if_no_display (gdisp, data);
|
||||||
|
|
||||||
shrink_dialog =
|
dialog = gimp_query_size_box (_("Shrink Selection"),
|
||||||
gimp_query_size_box (_("Shrink Selection"),
|
gdisp->shell,
|
||||||
gdisp->shell,
|
gimp_standard_help_func,
|
||||||
gimp_standard_help_func,
|
GIMP_HELP_SELECTION_SHRINK,
|
||||||
GIMP_HELP_SELECTION_SHRINK,
|
_("Shrink selection by"),
|
||||||
_("Shrink selection by"),
|
selection_shrink_pixels, 1, 32767, 0,
|
||||||
selection_shrink_pixels, 1, 32767, 0,
|
GIMP_DISPLAY_SHELL (gdisp->shell)->unit,
|
||||||
GIMP_DISPLAY_SHELL (gdisp->shell)->unit,
|
MIN (gdisp->gimage->xresolution,
|
||||||
MIN (gdisp->gimage->xresolution,
|
gdisp->gimage->yresolution),
|
||||||
gdisp->gimage->yresolution),
|
FALSE,
|
||||||
FALSE,
|
G_OBJECT (gdisp->gimage), "disconnect",
|
||||||
G_OBJECT (gdisp->gimage), "disconnect",
|
select_shrink_callback, gdisp->gimage);
|
||||||
gimp_image_mask_shrink_callback, gdisp->gimage);
|
|
||||||
|
|
||||||
edge_lock = gtk_check_button_new_with_label (_("Shrink from image border"));
|
edge_lock = gtk_check_button_new_with_label (_("Shrink from image border"));
|
||||||
|
|
||||||
gtk_box_pack_start (GTK_BOX (GIMP_QUERY_BOX_VBOX (shrink_dialog)), edge_lock,
|
gtk_box_pack_start (GTK_BOX (GIMP_QUERY_BOX_VBOX (dialog)), edge_lock,
|
||||||
FALSE, FALSE, 0);
|
FALSE, FALSE, 0);
|
||||||
|
|
||||||
g_object_set_data (G_OBJECT (shrink_dialog), "edge_lock_toggle", edge_lock);
|
g_object_set_data (G_OBJECT (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 (dialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -196,22 +197,22 @@ select_grow_cmd_callback (GtkAction *action,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpDisplay *gdisp;
|
GimpDisplay *gdisp;
|
||||||
GtkWidget *qbox;
|
GtkWidget *dialog;
|
||||||
return_if_no_display (gdisp, data);
|
return_if_no_display (gdisp, data);
|
||||||
|
|
||||||
qbox = gimp_query_size_box (_("Grow Selection"),
|
dialog = gimp_query_size_box (_("Grow Selection"),
|
||||||
gdisp->shell,
|
gdisp->shell,
|
||||||
gimp_standard_help_func,
|
gimp_standard_help_func,
|
||||||
GIMP_HELP_SELECTION_GROW,
|
GIMP_HELP_SELECTION_GROW,
|
||||||
_("Grow selection by"),
|
_("Grow selection by"),
|
||||||
selection_grow_pixels, 1, 32767, 0,
|
selection_grow_pixels, 1, 32767, 0,
|
||||||
GIMP_DISPLAY_SHELL (gdisp->shell)->unit,
|
GIMP_DISPLAY_SHELL (gdisp->shell)->unit,
|
||||||
MIN (gdisp->gimage->xresolution,
|
MIN (gdisp->gimage->xresolution,
|
||||||
gdisp->gimage->yresolution),
|
gdisp->gimage->yresolution),
|
||||||
FALSE,
|
FALSE,
|
||||||
G_OBJECT (gdisp->gimage), "disconnect",
|
G_OBJECT (gdisp->gimage), "disconnect",
|
||||||
gimp_image_mask_grow_callback, gdisp->gimage);
|
select_grow_callback, gdisp->gimage);
|
||||||
gtk_widget_show (qbox);
|
gtk_widget_show (dialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -219,22 +220,22 @@ select_border_cmd_callback (GtkAction *action,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpDisplay *gdisp;
|
GimpDisplay *gdisp;
|
||||||
GtkWidget *qbox;
|
GtkWidget *dialog;
|
||||||
return_if_no_display (gdisp, data);
|
return_if_no_display (gdisp, data);
|
||||||
|
|
||||||
qbox = gimp_query_size_box (_("Border Selection"),
|
dialog = gimp_query_size_box (_("Border Selection"),
|
||||||
gdisp->shell,
|
gdisp->shell,
|
||||||
gimp_standard_help_func,
|
gimp_standard_help_func,
|
||||||
GIMP_HELP_SELECTION_BORDER,
|
GIMP_HELP_SELECTION_BORDER,
|
||||||
_("Border selection by"),
|
_("Border selection by"),
|
||||||
selection_border_radius, 1, 32767, 0,
|
selection_border_radius, 1, 32767, 0,
|
||||||
GIMP_DISPLAY_SHELL (gdisp->shell)->unit,
|
GIMP_DISPLAY_SHELL (gdisp->shell)->unit,
|
||||||
MIN (gdisp->gimage->xresolution,
|
MIN (gdisp->gimage->xresolution,
|
||||||
gdisp->gimage->yresolution),
|
gdisp->gimage->yresolution),
|
||||||
FALSE,
|
FALSE,
|
||||||
G_OBJECT (gdisp->gimage), "disconnect",
|
G_OBJECT (gdisp->gimage), "disconnect",
|
||||||
gimp_image_mask_border_callback, gdisp->gimage);
|
select_border_callback, gdisp->gimage);
|
||||||
gtk_widget_show (qbox);
|
gtk_widget_show (dialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -280,14 +281,70 @@ select_stroke_cmd_callback (GtkAction *action,
|
||||||
gtk_widget_show (dialog);
|
gtk_widget_show (dialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
select_stroke_last_vals_cmd_callback (GtkAction *action,
|
||||||
|
gpointer data)
|
||||||
|
{
|
||||||
|
GimpImage *image;
|
||||||
|
GimpDrawable *drawable;
|
||||||
|
GimpContext *context;
|
||||||
|
GimpObject *options;
|
||||||
|
GimpItem *item;
|
||||||
|
gboolean libart_stroking;
|
||||||
|
return_if_no_image (image, data);
|
||||||
|
|
||||||
|
drawable = gimp_image_active_drawable (image);
|
||||||
|
|
||||||
|
if (! drawable)
|
||||||
|
{
|
||||||
|
g_message (_("There is no active layer or channel to stroke to."));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
context = gimp_get_user_context (image->gimp);
|
||||||
|
|
||||||
|
options = g_object_get_data (G_OBJECT (context), "saved-stroke-options");
|
||||||
|
|
||||||
|
if (options)
|
||||||
|
{
|
||||||
|
g_object_ref (options);
|
||||||
|
libart_stroking = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (options),
|
||||||
|
"libart-stroking"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
options = g_object_new (GIMP_TYPE_STROKE_OPTIONS,
|
||||||
|
"gimp", image->gimp,
|
||||||
|
NULL);
|
||||||
|
libart_stroking = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
item = GIMP_ITEM (gimp_image_get_mask (image));
|
||||||
|
|
||||||
|
if (libart_stroking)
|
||||||
|
{
|
||||||
|
gimp_item_stroke (item, drawable, context, options, FALSE);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gimp_item_stroke (item, drawable, context,
|
||||||
|
g_object_get_data (G_OBJECT (options),
|
||||||
|
"gimp-paint-info"), FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
gimp_image_flush (image);
|
||||||
|
|
||||||
|
g_object_unref (options);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* private functions */
|
/* private functions */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_image_mask_feather_callback (GtkWidget *widget,
|
select_feather_callback (GtkWidget *widget,
|
||||||
gdouble size,
|
gdouble size,
|
||||||
GimpUnit unit,
|
GimpUnit unit,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpImage *gimage = GIMP_IMAGE (data);
|
GimpImage *gimage = GIMP_IMAGE (data);
|
||||||
gdouble radius_x;
|
gdouble radius_x;
|
||||||
|
@ -315,10 +372,10 @@ gimp_image_mask_feather_callback (GtkWidget *widget,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_image_mask_border_callback (GtkWidget *widget,
|
select_border_callback (GtkWidget *widget,
|
||||||
gdouble size,
|
gdouble size,
|
||||||
GimpUnit unit,
|
GimpUnit unit,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpImage *gimage = GIMP_IMAGE (data);
|
GimpImage *gimage = GIMP_IMAGE (data);
|
||||||
gdouble radius_x;
|
gdouble radius_x;
|
||||||
|
@ -346,10 +403,10 @@ gimp_image_mask_border_callback (GtkWidget *widget,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_image_mask_grow_callback (GtkWidget *widget,
|
select_grow_callback (GtkWidget *widget,
|
||||||
gdouble size,
|
gdouble size,
|
||||||
GimpUnit unit,
|
GimpUnit unit,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpImage *gimage = GIMP_IMAGE (data);
|
GimpImage *gimage = GIMP_IMAGE (data);
|
||||||
gdouble radius_x;
|
gdouble radius_x;
|
||||||
|
@ -377,10 +434,10 @@ gimp_image_mask_grow_callback (GtkWidget *widget,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_image_mask_shrink_callback (GtkWidget *widget,
|
select_shrink_callback (GtkWidget *widget,
|
||||||
gdouble size,
|
gdouble size,
|
||||||
GimpUnit unit,
|
GimpUnit unit,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpImage *gimage = GIMP_IMAGE (data);
|
GimpImage *gimage = GIMP_IMAGE (data);
|
||||||
gint radius_x;
|
gint radius_x;
|
||||||
|
|
|
@ -38,8 +38,8 @@
|
||||||
|
|
||||||
static GimpActionEntry templates_actions[] =
|
static GimpActionEntry templates_actions[] =
|
||||||
{
|
{
|
||||||
{ "templates-popup", GIMP_STOCK_TEMPLATE, N_("Templates Menu"),
|
{ "templates-popup", GIMP_STOCK_TEMPLATE,
|
||||||
NULL, NULL, NULL,
|
N_("Templates Menu"), NULL, NULL, NULL,
|
||||||
GIMP_HELP_TEMPLATE_DIALOG },
|
GIMP_HELP_TEMPLATE_DIALOG },
|
||||||
|
|
||||||
{ "templates-create-image", GIMP_STOCK_IMAGE,
|
{ "templates-create-image", GIMP_STOCK_IMAGE,
|
||||||
|
@ -86,11 +86,9 @@ void
|
||||||
templates_actions_update (GimpActionGroup *group,
|
templates_actions_update (GimpActionGroup *group,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpContext *context;
|
GimpContext *context = action_data_get_context (data);
|
||||||
GimpTemplate *template = NULL;
|
GimpTemplate *template = NULL;
|
||||||
|
|
||||||
context = action_data_get_context (data);
|
|
||||||
|
|
||||||
if (context)
|
if (context)
|
||||||
template = gimp_context_get_template (context);
|
template = gimp_context_get_template (context);
|
||||||
|
|
||||||
|
@ -98,7 +96,7 @@ templates_actions_update (GimpActionGroup *group,
|
||||||
gimp_action_group_set_action_sensitive (group, action, (condition) != 0)
|
gimp_action_group_set_action_sensitive (group, action, (condition) != 0)
|
||||||
|
|
||||||
SET_SENSITIVE ("templates-create-image", template);
|
SET_SENSITIVE ("templates-create-image", template);
|
||||||
SET_SENSITIVE ("templates-new", TRUE);
|
SET_SENSITIVE ("templates-new", context);
|
||||||
SET_SENSITIVE ("templates-duplicate", template);
|
SET_SENSITIVE ("templates-duplicate", template);
|
||||||
SET_SENSITIVE ("templates-edit", template);
|
SET_SENSITIVE ("templates-edit", template);
|
||||||
SET_SENSITIVE ("templates-delete", template);
|
SET_SENSITIVE ("templates-delete", template);
|
||||||
|
|
|
@ -52,18 +52,25 @@ static void tool_options_actions_update_presets (GimpActionGroup *group,
|
||||||
|
|
||||||
static GimpActionEntry tool_options_actions[] =
|
static GimpActionEntry tool_options_actions[] =
|
||||||
{
|
{
|
||||||
{ "tool-options-popup", GIMP_STOCK_TOOL_OPTIONS, N_("Tool Options Menu"),
|
{ "tool-options-popup", GIMP_STOCK_TOOL_OPTIONS,
|
||||||
NULL, NULL, NULL,
|
N_("Tool Options Menu"), NULL, NULL, NULL,
|
||||||
GIMP_HELP_TOOL_OPTIONS_DIALOG },
|
GIMP_HELP_TOOL_OPTIONS_DIALOG },
|
||||||
|
|
||||||
{ "tool-options-save-menu", GTK_STOCK_SAVE,
|
{ "tool-options-save-menu", GTK_STOCK_SAVE,
|
||||||
N_("_Save Options to"), "", NULL },
|
N_("_Save Options to"), "", NULL, NULL,
|
||||||
|
GIMP_HELP_TOOL_OPTIONS_SAVE },
|
||||||
|
|
||||||
{ "tool-options-restore-menu", GTK_STOCK_REVERT_TO_SAVED,
|
{ "tool-options-restore-menu", GTK_STOCK_REVERT_TO_SAVED,
|
||||||
N_("_Restore Options from"), "", NULL },
|
N_("_Restore Options from"), "", NULL, NULL,
|
||||||
|
GIMP_HELP_TOOL_OPTIONS_RESTORE },
|
||||||
|
|
||||||
{ "tool-options-rename-menu", GIMP_STOCK_EDIT,
|
{ "tool-options-rename-menu", GIMP_STOCK_EDIT,
|
||||||
N_("Re_name Saved Options"), NULL, NULL },
|
N_("Re_name Saved Options"), NULL, NULL, NULL,
|
||||||
|
GIMP_HELP_TOOL_OPTIONS_RENAME },
|
||||||
|
|
||||||
{ "tool-options-delete-menu", GTK_STOCK_DELETE,
|
{ "tool-options-delete-menu", GTK_STOCK_DELETE,
|
||||||
N_("_Delete Saved Options"), "", NULL },
|
N_("_Delete Saved Options"), "", NULL, NULL,
|
||||||
|
GIMP_HELP_TOOL_OPTIONS_DELETE },
|
||||||
|
|
||||||
{ "tool-options-save-new", GTK_STOCK_NEW,
|
{ "tool-options-save-new", GTK_STOCK_NEW,
|
||||||
N_("_New Entry..."), "", NULL,
|
N_("_New Entry..."), "", NULL,
|
||||||
|
@ -107,11 +114,8 @@ void
|
||||||
tool_options_actions_update (GimpActionGroup *group,
|
tool_options_actions_update (GimpActionGroup *group,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpContext *context;
|
GimpContext *context = gimp_get_user_context (group->gimp);
|
||||||
GimpToolInfo *tool_info;
|
GimpToolInfo *tool_info = gimp_context_get_tool (context);
|
||||||
|
|
||||||
context = gimp_get_user_context (group->gimp);
|
|
||||||
tool_info = gimp_context_get_tool (context);
|
|
||||||
|
|
||||||
SET_VISIBLE ("tool-options-save-menu", tool_info->options_presets);
|
SET_VISIBLE ("tool-options-save-menu", tool_info->options_presets);
|
||||||
SET_VISIBLE ("tool-options-restore-menu", tool_info->options_presets);
|
SET_VISIBLE ("tool-options-restore-menu", tool_info->options_presets);
|
||||||
|
|
|
@ -43,7 +43,8 @@
|
||||||
|
|
||||||
static GimpActionEntry tools_actions[] =
|
static GimpActionEntry tools_actions[] =
|
||||||
{
|
{
|
||||||
{ "tools-popup", GIMP_STOCK_TOOLS, N_("Tools Menu"), NULL, NULL, NULL,
|
{ "tools-popup", GIMP_STOCK_TOOLS,
|
||||||
|
N_("Tools Menu"), NULL, NULL, NULL,
|
||||||
GIMP_HELP_TOOLS_DIALOG },
|
GIMP_HELP_TOOLS_DIALOG },
|
||||||
|
|
||||||
{ "tools-menu", NULL, N_("_Tools") },
|
{ "tools-menu", NULL, N_("_Tools") },
|
||||||
|
@ -62,7 +63,7 @@ static GimpActionEntry tools_actions[] =
|
||||||
static GimpToggleActionEntry tools_toggle_actions[] =
|
static GimpToggleActionEntry tools_toggle_actions[] =
|
||||||
{
|
{
|
||||||
{ "tools-visibility", GIMP_STOCK_VISIBLE,
|
{ "tools-visibility", GIMP_STOCK_VISIBLE,
|
||||||
N_("Show in Toolbox"), NULL, NULL,
|
N_("_Show in Toolbox"), NULL, NULL,
|
||||||
G_CALLBACK (tools_toggle_visibility_cmd_callback),
|
G_CALLBACK (tools_toggle_visibility_cmd_callback),
|
||||||
TRUE,
|
TRUE,
|
||||||
NULL /* FIXME */ }
|
NULL /* FIXME */ }
|
||||||
|
@ -164,13 +165,8 @@ void
|
||||||
tools_actions_update (GimpActionGroup *group,
|
tools_actions_update (GimpActionGroup *group,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpContext *context;
|
GimpContext *context = gimp_get_user_context (group->gimp);
|
||||||
GimpToolInfo *tool_info = NULL;
|
GimpToolInfo *tool_info = gimp_context_get_tool (context);
|
||||||
|
|
||||||
context = gimp_get_user_context (group->gimp);
|
|
||||||
|
|
||||||
if (context)
|
|
||||||
tool_info = gimp_context_get_tool (context);
|
|
||||||
|
|
||||||
#define SET_SENSITIVE(action,condition) \
|
#define SET_SENSITIVE(action,condition) \
|
||||||
gimp_action_group_set_action_sensitive (group, action, (condition) != 0)
|
gimp_action_group_set_action_sensitive (group, action, (condition) != 0)
|
||||||
|
|
|
@ -40,7 +40,8 @@
|
||||||
|
|
||||||
static GimpActionEntry vectors_actions[] =
|
static GimpActionEntry vectors_actions[] =
|
||||||
{
|
{
|
||||||
{ "vectors-popup", GIMP_STOCK_PATHS, N_("Paths Menu"), NULL, NULL, NULL,
|
{ "vectors-popup", GIMP_STOCK_PATHS,
|
||||||
|
N_("Paths Menu"), NULL, NULL, NULL,
|
||||||
GIMP_HELP_PATH_DIALOG },
|
GIMP_HELP_PATH_DIALOG },
|
||||||
|
|
||||||
{ "vectors-path-tool", GIMP_STOCK_TOOL_PATH,
|
{ "vectors-path-tool", GIMP_STOCK_TOOL_PATH,
|
||||||
|
@ -228,7 +229,7 @@ void
|
||||||
vectors_actions_update (GimpActionGroup *group,
|
vectors_actions_update (GimpActionGroup *group,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpImage *gimage;
|
GimpImage *gimage = action_data_get_image (data);
|
||||||
GimpVectors *vectors = NULL;
|
GimpVectors *vectors = NULL;
|
||||||
gint n_vectors = 0;
|
gint n_vectors = 0;
|
||||||
gboolean mask_empty = TRUE;
|
gboolean mask_empty = TRUE;
|
||||||
|
@ -238,37 +239,28 @@ vectors_actions_update (GimpActionGroup *group,
|
||||||
GList *next = NULL;
|
GList *next = NULL;
|
||||||
GList *prev = NULL;
|
GList *prev = NULL;
|
||||||
|
|
||||||
gimage = action_data_get_image (data);
|
|
||||||
|
|
||||||
if (gimage)
|
if (gimage)
|
||||||
{
|
{
|
||||||
GList *list;
|
n_vectors = gimp_container_num_children (gimage->vectors);
|
||||||
|
mask_empty = gimp_channel_is_empty (gimp_image_get_mask (gimage));
|
||||||
|
global_buf = FALSE;
|
||||||
|
|
||||||
vectors = gimp_image_get_active_vectors (gimage);
|
vectors = gimp_image_get_active_vectors (gimage);
|
||||||
|
|
||||||
n_vectors = gimp_container_num_children (gimage->vectors);
|
|
||||||
|
|
||||||
mask_empty = gimp_channel_is_empty (gimp_image_get_mask (gimage));
|
|
||||||
|
|
||||||
global_buf = FALSE;
|
|
||||||
|
|
||||||
if (vectors)
|
if (vectors)
|
||||||
{
|
{
|
||||||
GimpItem *item = GIMP_ITEM (vectors);
|
GimpItem *item = GIMP_ITEM (vectors);
|
||||||
|
GList *list;
|
||||||
|
|
||||||
visible = gimp_item_get_visible (item);
|
visible = gimp_item_get_visible (item);
|
||||||
linked = gimp_item_get_linked (item);
|
linked = gimp_item_get_linked (item);
|
||||||
}
|
|
||||||
|
|
||||||
for (list = GIMP_LIST (gimage->vectors)->list;
|
list = g_list_find (GIMP_LIST (gimage->vectors)->list, vectors);
|
||||||
list;
|
|
||||||
list = g_list_next (list))
|
if (list)
|
||||||
{
|
|
||||||
if (vectors == (GimpVectors *) list->data)
|
|
||||||
{
|
{
|
||||||
prev = g_list_previous (list);
|
prev = g_list_previous (list);
|
||||||
next = g_list_next (list);
|
next = g_list_next (list);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,28 +77,21 @@ struct _VectorsOptions
|
||||||
|
|
||||||
/* local function prototypes */
|
/* local function prototypes */
|
||||||
|
|
||||||
static VectorsOptions * vectors_query_new (GimpImage *gimage,
|
static VectorsOptions * vectors_options_new (GimpImage *gimage,
|
||||||
GimpContext *context,
|
|
||||||
GimpVectors *vectors,
|
GimpVectors *vectors,
|
||||||
GtkWidget *parent);
|
GtkWidget *parent);
|
||||||
static void vectors_new_vectors_query (GimpImage *gimage,
|
|
||||||
GimpContext *context,
|
|
||||||
GtkWidget *parent);
|
|
||||||
static void vectors_new_vectors_response (GtkWidget *widget,
|
static void vectors_new_vectors_response (GtkWidget *widget,
|
||||||
gint response_id,
|
gint response_id,
|
||||||
VectorsOptions *options);
|
VectorsOptions *options);
|
||||||
static void vectors_edit_vectors_query (GimpVectors *vectors,
|
|
||||||
GimpContext *context,
|
|
||||||
GtkWidget *parent);
|
|
||||||
static void vectors_edit_vectors_response (GtkWidget *widget,
|
static void vectors_edit_vectors_response (GtkWidget *widget,
|
||||||
gint response_id,
|
gint response_id,
|
||||||
VectorsOptions *options);
|
VectorsOptions *options);
|
||||||
static void vectors_import_query (GimpImage *gimage,
|
static void vectors_import_dialog (GimpImage *gimage,
|
||||||
GtkWidget *parent);
|
GtkWidget *parent);
|
||||||
static void vectors_import_response (GtkWidget *dialog,
|
static void vectors_import_response (GtkWidget *dialog,
|
||||||
gint response_id,
|
gint response_id,
|
||||||
GimpImage *gimage);
|
GimpImage *gimage);
|
||||||
static void vectors_export_query (GimpImage *gimage,
|
static void vectors_export_dialog (GimpImage *gimage,
|
||||||
GimpVectors *vectors,
|
GimpVectors *vectors,
|
||||||
GtkWidget *parent);
|
GtkWidget *parent);
|
||||||
static void vectors_export_response (GtkWidget *dialog,
|
static void vectors_export_response (GtkWidget *dialog,
|
||||||
|
@ -147,25 +140,40 @@ void
|
||||||
vectors_edit_attributes_cmd_callback (GtkAction *action,
|
vectors_edit_attributes_cmd_callback (GtkAction *action,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpImage *gimage;
|
VectorsOptions *options;
|
||||||
GimpVectors *vectors;
|
GimpImage *gimage;
|
||||||
GtkWidget *widget;
|
GimpVectors *vectors;
|
||||||
|
GtkWidget *widget;
|
||||||
return_if_no_vectors (gimage, vectors, data);
|
return_if_no_vectors (gimage, vectors, data);
|
||||||
return_if_no_widget (widget, data);
|
return_if_no_widget (widget, data);
|
||||||
|
|
||||||
vectors_edit_vectors_query (vectors, action_data_get_context (data), widget);
|
options = vectors_options_new (gimp_item_get_image (GIMP_ITEM (vectors)),
|
||||||
|
vectors, widget);
|
||||||
|
|
||||||
|
g_signal_connect (options->query_box, "response",
|
||||||
|
G_CALLBACK (vectors_edit_vectors_response),
|
||||||
|
options);
|
||||||
|
|
||||||
|
gtk_widget_show (options->query_box);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
vectors_new_cmd_callback (GtkAction *action,
|
vectors_new_cmd_callback (GtkAction *action,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpImage *gimage;
|
VectorsOptions *options;
|
||||||
GtkWidget *widget;
|
GimpImage *gimage;
|
||||||
|
GtkWidget *widget;
|
||||||
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, action_data_get_context (data), widget);
|
options = vectors_options_new (gimage, NULL, widget);
|
||||||
|
|
||||||
|
g_signal_connect (options->query_box, "response",
|
||||||
|
G_CALLBACK (vectors_new_vectors_response),
|
||||||
|
options);
|
||||||
|
|
||||||
|
gtk_widget_show (options->query_box);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -396,7 +404,7 @@ vectors_import_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_import_query (gimage, widget);
|
vectors_import_dialog (gimage, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -409,7 +417,7 @@ vectors_export_cmd_callback (GtkAction *action,
|
||||||
return_if_no_vectors (gimage, 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, vectors, widget);
|
vectors_export_dialog (gimage, vectors, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -470,10 +478,9 @@ vectors_linked_cmd_callback (GtkAction *action,
|
||||||
/* private functions */
|
/* private functions */
|
||||||
|
|
||||||
static VectorsOptions *
|
static VectorsOptions *
|
||||||
vectors_query_new (GimpImage *gimage,
|
vectors_options_new (GimpImage *gimage,
|
||||||
GimpContext *context,
|
GimpVectors *vectors,
|
||||||
GimpVectors *vectors,
|
GtkWidget *parent)
|
||||||
GtkWidget *parent)
|
|
||||||
{
|
{
|
||||||
VectorsOptions *options;
|
VectorsOptions *options;
|
||||||
GtkWidget *hbox;
|
GtkWidget *hbox;
|
||||||
|
@ -555,22 +562,6 @@ vectors_query_new (GimpImage *gimage,
|
||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
vectors_new_vectors_query (GimpImage *gimage,
|
|
||||||
GimpContext *context,
|
|
||||||
GtkWidget *parent)
|
|
||||||
{
|
|
||||||
VectorsOptions *options;
|
|
||||||
|
|
||||||
options = vectors_query_new (gimage, context, NULL, parent);
|
|
||||||
|
|
||||||
g_signal_connect (options->query_box, "response",
|
|
||||||
G_CALLBACK (vectors_new_vectors_response),
|
|
||||||
options);
|
|
||||||
|
|
||||||
gtk_widget_show (options->query_box);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
vectors_new_vectors_response (GtkWidget *widget,
|
vectors_new_vectors_response (GtkWidget *widget,
|
||||||
gint response_id,
|
gint response_id,
|
||||||
|
@ -596,22 +587,6 @@ vectors_new_vectors_response (GtkWidget *widget,
|
||||||
gtk_widget_destroy (options->query_box);
|
gtk_widget_destroy (options->query_box);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
vectors_edit_vectors_query (GimpVectors *vectors,
|
|
||||||
GimpContext *context,
|
|
||||||
GtkWidget *parent)
|
|
||||||
{
|
|
||||||
VectorsOptions *options;
|
|
||||||
|
|
||||||
options = vectors_query_new (gimp_item_get_image (GIMP_ITEM (vectors)),
|
|
||||||
context, vectors, parent);
|
|
||||||
|
|
||||||
g_signal_connect (options->query_box, "response",
|
|
||||||
G_CALLBACK (vectors_edit_vectors_response),
|
|
||||||
options);
|
|
||||||
|
|
||||||
gtk_widget_show (options->query_box);
|
|
||||||
}
|
|
||||||
static void
|
static void
|
||||||
vectors_edit_vectors_response (GtkWidget *widget,
|
vectors_edit_vectors_response (GtkWidget *widget,
|
||||||
gint response_id,
|
gint response_id,
|
||||||
|
@ -635,8 +610,8 @@ vectors_edit_vectors_response (GtkWidget *widget,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
vectors_import_query (GimpImage *gimage,
|
vectors_import_dialog (GimpImage *gimage,
|
||||||
GtkWidget *parent)
|
GtkWidget *parent)
|
||||||
{
|
{
|
||||||
GtkWidget *dialog;
|
GtkWidget *dialog;
|
||||||
GtkFileFilter *filter;
|
GtkFileFilter *filter;
|
||||||
|
@ -671,7 +646,7 @@ vectors_import_query (GimpImage *gimage,
|
||||||
|
|
||||||
filter = gtk_file_filter_new ();
|
filter = gtk_file_filter_new ();
|
||||||
gtk_file_filter_set_name (filter, _("Scalable SVG image (*.svg)"));
|
gtk_file_filter_set_name (filter, _("Scalable SVG image (*.svg)"));
|
||||||
gtk_file_filter_add_pattern (filter, "*.svg");
|
gtk_file_filter_add_pattern (filter, "*.[Ss][Vv][Gg]");
|
||||||
gtk_file_filter_add_mime_type (filter, "image/svg+xml");
|
gtk_file_filter_add_mime_type (filter, "image/svg+xml");
|
||||||
gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter);
|
gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter);
|
||||||
|
|
||||||
|
@ -711,9 +686,9 @@ vectors_import_response (GtkWidget *dialog,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
vectors_export_query (GimpImage *gimage,
|
vectors_export_dialog (GimpImage *gimage,
|
||||||
GimpVectors *vectors,
|
GimpVectors *vectors,
|
||||||
GtkWidget *parent)
|
GtkWidget *parent)
|
||||||
{
|
{
|
||||||
GtkWidget *dialog;
|
GtkWidget *dialog;
|
||||||
|
|
||||||
|
|
|
@ -446,15 +446,13 @@ void
|
||||||
view_actions_update (GimpActionGroup *group,
|
view_actions_update (GimpActionGroup *group,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpDisplay *gdisp = NULL;
|
GimpDisplay *gdisp = action_data_get_display (data);
|
||||||
GimpDisplayShell *shell = NULL;
|
GimpDisplayShell *shell = NULL;
|
||||||
GimpDisplayOptions *options = NULL;
|
GimpDisplayOptions *options = NULL;
|
||||||
GimpImage *gimage = NULL;
|
GimpImage *gimage = NULL;
|
||||||
gboolean fullscreen = FALSE;
|
gboolean fullscreen = FALSE;
|
||||||
gint n_screens = 1;
|
gint n_screens = 1;
|
||||||
|
|
||||||
gdisp = action_data_get_display (data);
|
|
||||||
|
|
||||||
if (gdisp)
|
if (gdisp)
|
||||||
{
|
{
|
||||||
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
|
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
|
||||||
|
|
|
@ -276,7 +276,7 @@ gimp_iscissors_tool_register (GimpToolRegisterCallback callback,
|
||||||
"gimp-iscissors-tool",
|
"gimp-iscissors-tool",
|
||||||
_("Scissors"),
|
_("Scissors"),
|
||||||
_("Select shapes from image"),
|
_("Select shapes from image"),
|
||||||
N_("_Intelligent Scissors"),
|
N_("Intelligent _Scissors"),
|
||||||
"I",
|
"I",
|
||||||
NULL, GIMP_HELP_TOOL_ISCISSORS,
|
NULL, GIMP_HELP_TOOL_ISCISSORS,
|
||||||
GIMP_STOCK_TOOL_ISCISSORS,
|
GIMP_STOCK_TOOL_ISCISSORS,
|
||||||
|
|
|
@ -46,6 +46,8 @@
|
||||||
<menuitem action="context-opacity-opaque" />
|
<menuitem action="context-opacity-opaque" />
|
||||||
<menuitem action="context-opacity-decrease" />
|
<menuitem action="context-opacity-decrease" />
|
||||||
<menuitem action="context-opacity-increase" />
|
<menuitem action="context-opacity-increase" />
|
||||||
|
<menuitem action="context-opacity-decrease-skip" />
|
||||||
|
<menuitem action="context-opacity-increase-skip" />
|
||||||
</menu>
|
</menu>
|
||||||
<menu action="context-paint-mode-menu" name="Paint Mode">
|
<menu action="context-paint-mode-menu" name="Paint Mode">
|
||||||
<menuitem action="context-paint-mode-first" />
|
<menuitem action="context-paint-mode-first" />
|
||||||
|
@ -53,6 +55,12 @@
|
||||||
<menuitem action="context-paint-mode-previous" />
|
<menuitem action="context-paint-mode-previous" />
|
||||||
<menuitem action="context-paint-mode-next" />
|
<menuitem action="context-paint-mode-next" />
|
||||||
</menu>
|
</menu>
|
||||||
|
<menu action="context-tool-menu" name="Tool">
|
||||||
|
<menuitem action="context-tool-select-first" />
|
||||||
|
<menuitem action="context-tool-select-last" />
|
||||||
|
<menuitem action="context-tool-select-previous" />
|
||||||
|
<menuitem action="context-tool-select-next" />
|
||||||
|
</menu>
|
||||||
<separator />
|
<separator />
|
||||||
<menu action="context-brush-menu" name="Brush">
|
<menu action="context-brush-menu" name="Brush">
|
||||||
<menuitem action="context-brush-select-first" />
|
<menuitem action="context-brush-select-first" />
|
||||||
|
@ -132,7 +140,7 @@
|
||||||
</menu>
|
</menu>
|
||||||
</menu>
|
</menu>
|
||||||
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<menu action="edit-menu" name="Edit">
|
<menu action="edit-menu" name="Edit">
|
||||||
<placeholder name="Undo">
|
<placeholder name="Undo">
|
||||||
|
@ -392,7 +400,9 @@
|
||||||
<separator />
|
<separator />
|
||||||
<menuitem action="drawable-offset" />
|
<menuitem action="drawable-offset" />
|
||||||
</menu>
|
</menu>
|
||||||
<!--
|
|
||||||
|
<!-- Layer Properties
|
||||||
|
|
||||||
<menu action="layers-properties-menu" name="Properties">
|
<menu action="layers-properties-menu" name="Properties">
|
||||||
<menuitem action="layers-edit-attributes" />
|
<menuitem action="layers-edit-attributes" />
|
||||||
<menu action="layers-opacity-menu" name="Opacity">
|
<menu action="layers-opacity-menu" name="Opacity">
|
||||||
|
@ -411,7 +421,9 @@
|
||||||
<menuitem action="drawable-linked" />
|
<menuitem action="drawable-linked" />
|
||||||
<menuitem action="layers-preserve-transparency" />
|
<menuitem action="layers-preserve-transparency" />
|
||||||
</menu>
|
</menu>
|
||||||
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<separator />
|
<separator />
|
||||||
<placeholder name="Resize">
|
<placeholder name="Resize">
|
||||||
<menuitem action="layers-resize" />
|
<menuitem action="layers-resize" />
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue