mirror of https://github.com/GNOME/gimp.git
use the passed Gimp pointer instead of using "the_gimp".
2001-12-03 Michael Natterer <mitch@gimp.org> * app/devices.c: use the passed Gimp pointer instead of using "the_gimp". * app/base/temp-buf.c: indentation. * app/gui/preferences-dialog.c: prefs_toggle_callback(): fixed segfault when trying to find the prefs_dlg widget from a menu item callback (Fixes #65757). * app/gui/offset-dialog.[ch]: fixed public prototype, include the header in the .c file. * app/gui/menus.c: some menu cleanup: moved all functions which operate on the active layer/drawable to <Image>/Layer. Renamed "Layers" to "Layer". * app/display/gimpdisplayshell.c: changed menu update function accordingly. * app/gui/image-commands.[ch] * app/gui/layers-commands.[ch]: moved stuff from image-commands.* to layers-commads.*- * app/tools/gimpblendtool.c * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcurvestool.c * app/tools/gimphistogramtool.c * app/tools/gimphuesaturationtool.c * app/tools/gimplevelstool.c * app/tools/gimpposterizetool.c * app/tools/gimpthresholdtool.c * app/tools/paint_options.c * app/tools/transform_options.c * plug-ins/common/align_layers.c * plug-ins/common/autocrop.c * plug-ins/common/autostretch_hsv.c * plug-ins/common/c_astretch.c * plug-ins/common/color_enhance.c * plug-ins/common/guillotine.c * plug-ins/common/normalize.c * plug-ins/common/rotate.c * plug-ins/common/threshold_alpha.c * plug-ins/common/zealouscrop.c * plug-ins/rcm/rcm.c * plug-ins/fp/fp.c: register under <Image>/Layer, some cosmetic fixes.
This commit is contained in:
parent
4ba6db4e94
commit
403a38e20f
50
ChangeLog
50
ChangeLog
|
@ -1,3 +1,53 @@
|
|||
2001-12-03 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/devices.c: use the passed Gimp pointer instead of
|
||||
using "the_gimp".
|
||||
|
||||
* app/base/temp-buf.c: indentation.
|
||||
|
||||
* app/gui/preferences-dialog.c: prefs_toggle_callback(): fixed
|
||||
segfault when trying to find the prefs_dlg widget from a menu
|
||||
item callback (Fixes #65757).
|
||||
|
||||
* app/gui/offset-dialog.[ch]: fixed public prototype, include
|
||||
the header in the .c file.
|
||||
|
||||
* app/gui/menus.c: some menu cleanup: moved all functions which
|
||||
operate on the active layer/drawable to <Image>/Layer. Renamed
|
||||
"Layers" to "Layer".
|
||||
|
||||
* app/display/gimpdisplayshell.c: changed menu update function
|
||||
accordingly.
|
||||
|
||||
* app/gui/image-commands.[ch]
|
||||
* app/gui/layers-commands.[ch]: moved stuff from image-commands.*
|
||||
to layers-commads.*-
|
||||
|
||||
* app/tools/gimpblendtool.c
|
||||
* app/tools/gimpbrightnesscontrasttool.c
|
||||
* app/tools/gimpcolorbalancetool.c
|
||||
* app/tools/gimpcurvestool.c
|
||||
* app/tools/gimphistogramtool.c
|
||||
* app/tools/gimphuesaturationtool.c
|
||||
* app/tools/gimplevelstool.c
|
||||
* app/tools/gimpposterizetool.c
|
||||
* app/tools/gimpthresholdtool.c
|
||||
* app/tools/paint_options.c
|
||||
* app/tools/transform_options.c
|
||||
* plug-ins/common/align_layers.c
|
||||
* plug-ins/common/autocrop.c
|
||||
* plug-ins/common/autostretch_hsv.c
|
||||
* plug-ins/common/c_astretch.c
|
||||
* plug-ins/common/color_enhance.c
|
||||
* plug-ins/common/guillotine.c
|
||||
* plug-ins/common/normalize.c
|
||||
* plug-ins/common/rotate.c
|
||||
* plug-ins/common/threshold_alpha.c
|
||||
* plug-ins/common/zealouscrop.c
|
||||
* plug-ins/rcm/rcm.c
|
||||
* plug-ins/fp/fp.c: register under <Image>/Layer, some cosmetic
|
||||
fixes.
|
||||
|
||||
2001-12-03 Sven Neumann <sven@gimp.org>
|
||||
Michael Natterer <mitch@gimp.org>
|
||||
|
||||
|
|
|
@ -26,21 +26,15 @@
|
|||
|
||||
#include "core/gimp.h"
|
||||
#include "core/gimpcontext.h"
|
||||
#include "core/gimpdrawable.h"
|
||||
#include "core/gimpdrawable-desaturate.h"
|
||||
#include "core/gimpdrawable-equalize.h"
|
||||
#include "core/gimpimage.h"
|
||||
#include "core/gimpimage-duplicate.h"
|
||||
#include "core/gimpimage-resize.h"
|
||||
#include "core/gimpimage-scale.h"
|
||||
|
||||
#include "pdb/procedural_db.h"
|
||||
|
||||
#include "display/gimpdisplay.h"
|
||||
#include "display/gimpdisplay-foreach.h"
|
||||
|
||||
#include "convert-dialog.h"
|
||||
#include "offset-dialog.h"
|
||||
#include "resize-dialog.h"
|
||||
|
||||
#include "gimpprogress.h"
|
||||
|
@ -112,91 +106,6 @@ image_convert_indexed_cmd_callback (GtkWidget *widget,
|
|||
convert_to_indexed (gimage);
|
||||
}
|
||||
|
||||
void
|
||||
image_desaturate_cmd_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpDrawable *drawable;
|
||||
return_if_no_image (gimage, data);
|
||||
|
||||
drawable = gimp_image_active_drawable (gimage);
|
||||
|
||||
if (! gimp_drawable_is_rgb (drawable))
|
||||
{
|
||||
g_message (_("Desaturate operates only on RGB color drawables."));
|
||||
return;
|
||||
}
|
||||
|
||||
gimp_drawable_desaturate (drawable);
|
||||
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
void
|
||||
image_invert_cmd_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpDrawable *drawable;
|
||||
Argument *return_vals;
|
||||
gint nreturn_vals;
|
||||
return_if_no_image (gimage, data);
|
||||
|
||||
drawable = gimp_image_active_drawable (gimage);
|
||||
|
||||
if (gimp_drawable_is_indexed (drawable))
|
||||
{
|
||||
g_message (_("Invert does not operate on indexed drawables."));
|
||||
return;
|
||||
}
|
||||
|
||||
return_vals =
|
||||
procedural_db_run_proc (gimage->gimp,
|
||||
"gimp_invert",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, gimp_drawable_get_ID (drawable),
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (!return_vals || return_vals[0].value.pdb_int != GIMP_PDB_SUCCESS)
|
||||
g_message (_("Invert operation failed."));
|
||||
|
||||
procedural_db_destroy_args (return_vals, nreturn_vals);
|
||||
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
void
|
||||
image_equalize_cmd_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpDrawable *drawable;
|
||||
return_if_no_image (gimage, data);
|
||||
|
||||
drawable = gimp_image_active_drawable (gimage);
|
||||
|
||||
if (gimp_drawable_is_indexed (drawable))
|
||||
{
|
||||
g_message (_("Equalize does not operate on indexed drawables."));
|
||||
return;
|
||||
}
|
||||
|
||||
gimp_drawable_equalize (drawable, TRUE);
|
||||
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
void
|
||||
image_offset_cmd_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
return_if_no_image (gimage, data);
|
||||
|
||||
offset_dialog_create (gimage);
|
||||
}
|
||||
|
||||
void
|
||||
image_resize_cmd_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
|
|
|
@ -26,14 +26,6 @@ void image_convert_grayscale_cmd_callback (GtkWidget *widget,
|
|||
gpointer data);
|
||||
void image_convert_indexed_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void image_desaturate_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void image_invert_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void image_equalize_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void image_offset_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void image_resize_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void image_scale_cmd_callback (GtkWidget *widget,
|
||||
|
|
|
@ -31,6 +31,9 @@
|
|||
#include "paint-funcs/paint-funcs.h"
|
||||
|
||||
#include "core/gimp.h"
|
||||
#include "core/gimpcontext.h"
|
||||
#include "core/gimpdrawable-desaturate.h"
|
||||
#include "core/gimpdrawable-equalize.h"
|
||||
#include "core/gimpimage.h"
|
||||
#include "core/gimpimage-mask.h"
|
||||
#include "core/gimpimage-merge.h"
|
||||
|
@ -38,12 +41,15 @@
|
|||
#include "core/gimplayermask.h"
|
||||
#include "core/gimplist.h"
|
||||
|
||||
#include "pdb/procedural_db.h"
|
||||
|
||||
#include "display/gimpdisplay-foreach.h"
|
||||
|
||||
#include "widgets/gimpitemfactory.h"
|
||||
#include "widgets/gimpwidgets-utils.h"
|
||||
|
||||
#include "layers-commands.h"
|
||||
#include "offset-dialog.h"
|
||||
#include "resize-dialog.h"
|
||||
|
||||
#include "floating_sel.h"
|
||||
|
@ -61,6 +67,14 @@ static void layers_resize_layer_query (GimpImage *gimage,
|
|||
GimpLayer *layer);
|
||||
|
||||
|
||||
#define return_if_no_image(gimage) \
|
||||
gimage = (GimpImage *) gimp_widget_get_callback_context (widget); \
|
||||
if (! gimage) \
|
||||
gimage = gimp_context_get_image (gimp_get_user_context (GIMP (data))); \
|
||||
if (! gimage) \
|
||||
return
|
||||
|
||||
|
||||
/* public functions */
|
||||
|
||||
void
|
||||
|
@ -70,11 +84,7 @@ layers_previous_cmd_callback (GtkWidget *widget,
|
|||
GimpImage *gimage;
|
||||
GimpLayer *new_layer;
|
||||
gint current_layer;
|
||||
|
||||
gimage = (GimpImage *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
current_layer =
|
||||
gimp_image_get_layer_index (gimage, gimp_image_get_active_layer (gimage));
|
||||
|
@ -99,11 +109,7 @@ layers_next_cmd_callback (GtkWidget *widget,
|
|||
GimpImage *gimage;
|
||||
GimpLayer *new_layer;
|
||||
gint current_layer;
|
||||
|
||||
gimage = (GimpImage *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
current_layer =
|
||||
gimp_image_get_layer_index (gimage, gimp_image_get_active_layer (gimage));
|
||||
|
@ -124,11 +130,7 @@ layers_raise_cmd_callback (GtkWidget *widget,
|
|||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
|
||||
gimage = (GimpImage *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
gimp_image_raise_layer (gimage, gimp_image_get_active_layer (gimage));
|
||||
gdisplays_flush ();
|
||||
|
@ -139,11 +141,7 @@ layers_lower_cmd_callback (GtkWidget *widget,
|
|||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
|
||||
gimage = (GimpImage *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
gimp_image_lower_layer (gimage, gimp_image_get_active_layer (gimage));
|
||||
gdisplays_flush ();
|
||||
|
@ -154,11 +152,7 @@ layers_raise_to_top_cmd_callback (GtkWidget *widget,
|
|||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
|
||||
gimage = (GimpImage *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
gimp_image_raise_layer_to_top (gimage, gimp_image_get_active_layer (gimage));
|
||||
gdisplays_flush ();
|
||||
|
@ -169,11 +163,7 @@ layers_lower_to_bottom_cmd_callback (GtkWidget *widget,
|
|||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
|
||||
gimage = (GimpImage *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
gimp_image_lower_layer_to_bottom (gimage,
|
||||
gimp_image_get_active_layer (gimage));
|
||||
|
@ -185,11 +175,7 @@ layers_new_cmd_callback (GtkWidget *widget,
|
|||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
|
||||
gimage = (GimpImage *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
layers_new_layer_query (gimage);
|
||||
}
|
||||
|
@ -201,11 +187,7 @@ layers_duplicate_cmd_callback (GtkWidget *widget,
|
|||
GimpImage *gimage;
|
||||
GimpLayer *active_layer;
|
||||
GimpLayer *new_layer;
|
||||
|
||||
gimage = (GimpImage *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
active_layer = gimp_image_get_active_layer (gimage);
|
||||
new_layer = gimp_layer_copy (active_layer, TRUE);
|
||||
|
@ -214,17 +196,24 @@ layers_duplicate_cmd_callback (GtkWidget *widget,
|
|||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
void
|
||||
layers_anchor_cmd_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
floating_sel_anchor (gimp_image_get_active_layer (gimage));
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
void
|
||||
layers_delete_cmd_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpLayer *layer;
|
||||
|
||||
gimage = (GimpImage *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
layer = gimp_image_get_active_layer (gimage);
|
||||
|
||||
|
@ -239,16 +228,97 @@ layers_delete_cmd_callback (GtkWidget *widget,
|
|||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
void
|
||||
layers_desaturate_cmd_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpDrawable *drawable;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
drawable = gimp_image_active_drawable (gimage);
|
||||
|
||||
if (! gimp_drawable_is_rgb (drawable))
|
||||
{
|
||||
g_message (_("Desaturate operates only on RGB color drawables."));
|
||||
return;
|
||||
}
|
||||
|
||||
gimp_drawable_desaturate (drawable);
|
||||
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
void
|
||||
layers_invert_cmd_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpDrawable *drawable;
|
||||
Argument *return_vals;
|
||||
gint nreturn_vals;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
drawable = gimp_image_active_drawable (gimage);
|
||||
|
||||
if (gimp_drawable_is_indexed (drawable))
|
||||
{
|
||||
g_message (_("Invert does not operate on indexed drawables."));
|
||||
return;
|
||||
}
|
||||
|
||||
return_vals =
|
||||
procedural_db_run_proc (gimage->gimp,
|
||||
"gimp_invert",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, gimp_drawable_get_ID (drawable),
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (!return_vals || return_vals[0].value.pdb_int != GIMP_PDB_SUCCESS)
|
||||
g_message (_("Invert operation failed."));
|
||||
|
||||
procedural_db_destroy_args (return_vals, nreturn_vals);
|
||||
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
void
|
||||
layers_equalize_cmd_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpDrawable *drawable;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
drawable = gimp_image_active_drawable (gimage);
|
||||
|
||||
if (gimp_drawable_is_indexed (drawable))
|
||||
{
|
||||
g_message (_("Equalize does not operate on indexed drawables."));
|
||||
return;
|
||||
}
|
||||
|
||||
gimp_drawable_equalize (drawable, TRUE);
|
||||
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
void
|
||||
layers_offset_cmd_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
offset_dialog_create (gimp_image_active_drawable (gimage));
|
||||
}
|
||||
|
||||
void
|
||||
layers_scale_cmd_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
|
||||
gimage = (GimpImage *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
layers_scale_layer_query (gimage, gimp_image_get_active_layer (gimage));
|
||||
}
|
||||
|
@ -258,11 +328,7 @@ layers_resize_cmd_callback (GtkWidget *widget,
|
|||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
|
||||
gimage = (GimpImage *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
layers_resize_layer_query (gimage, gimp_image_get_active_layer (gimage));
|
||||
}
|
||||
|
@ -272,11 +338,7 @@ layers_resize_to_image_cmd_callback (GtkWidget *widget,
|
|||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
|
||||
gimage = (GimpImage *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
gimp_layer_resize_to_image (gimp_image_get_active_layer (gimage));
|
||||
|
||||
|
@ -288,11 +350,7 @@ layers_add_layer_mask_cmd_callback (GtkWidget *widget,
|
|||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
|
||||
gimage = (GimpImage *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
layers_add_mask_query (gimp_image_get_active_layer (gimage));
|
||||
}
|
||||
|
@ -303,11 +361,7 @@ layers_apply_layer_mask_cmd_callback (GtkWidget *widget,
|
|||
{
|
||||
GimpImage *gimage;
|
||||
GimpLayer *layer;
|
||||
|
||||
gimage = (GimpImage *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
layer = gimp_image_get_active_layer (gimage);
|
||||
|
||||
|
@ -329,11 +383,7 @@ layers_delete_layer_mask_cmd_callback (GtkWidget *widget,
|
|||
{
|
||||
GimpImage *gimage;
|
||||
GimpLayer *layer;
|
||||
|
||||
gimage = (GimpImage *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
layer = gimp_image_get_active_layer (gimage);
|
||||
|
||||
|
@ -349,31 +399,12 @@ layers_delete_layer_mask_cmd_callback (GtkWidget *widget,
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
layers_anchor_cmd_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
|
||||
gimage = (GimpImage *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
|
||||
floating_sel_anchor (gimp_image_get_active_layer (gimage));
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
void
|
||||
layers_merge_layers_cmd_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
|
||||
gimage = (GimpImage *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
layers_layer_merge_query (gimage, TRUE);
|
||||
}
|
||||
|
@ -383,12 +414,8 @@ layers_merge_down_cmd_callback (GtkWidget *widget,
|
|||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
gimage = (GimpImage *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
|
||||
gimp_image_merge_down (gimage, gimp_image_get_active_layer (gimage),
|
||||
EXPAND_AS_NECESSARY);
|
||||
gdisplays_flush ();
|
||||
|
@ -399,11 +426,7 @@ layers_flatten_image_cmd_callback (GtkWidget *widget,
|
|||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
|
||||
gimage = (GimpImage *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
gimp_image_flatten (gimage);
|
||||
gdisplays_flush ();
|
||||
|
@ -414,11 +437,7 @@ layers_alpha_select_cmd_callback (GtkWidget *widget,
|
|||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
|
||||
gimage = (GimpImage *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
gimp_image_mask_layer_alpha (gimage, gimp_image_get_active_layer (gimage));
|
||||
gdisplays_flush ();
|
||||
|
@ -429,11 +448,7 @@ layers_mask_select_cmd_callback (GtkWidget *widget,
|
|||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
|
||||
gimage = (GimpImage *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
gimp_image_mask_layer_mask (gimage, gimp_image_get_active_layer (gimage));
|
||||
gdisplays_flush ();
|
||||
|
@ -445,11 +460,7 @@ layers_add_alpha_channel_cmd_callback (GtkWidget *widget,
|
|||
{
|
||||
GimpImage *gimage;
|
||||
GimpLayer *layer;
|
||||
|
||||
gimage = (GimpImage *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
layer = gimp_image_get_active_layer (gimage);
|
||||
|
||||
|
@ -466,11 +477,7 @@ layers_edit_attributes_cmd_callback (GtkWidget *widget,
|
|||
{
|
||||
GimpImage *gimage;
|
||||
GimpLayer *layer;
|
||||
|
||||
gimage = (GimpImage *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
layer = gimp_image_get_active_layer (gimage);
|
||||
|
||||
|
@ -1275,15 +1282,12 @@ layers_menu_update (GtkItemFactory *factory,
|
|||
|
||||
SET_SENSITIVE ("/New Layer...", gimage);
|
||||
|
||||
SET_SENSITIVE ("/Stack/Raise Layer",
|
||||
!fs && !ac && gimage && lp && alpha && prev);
|
||||
SET_SENSITIVE ("/Raise Layer", !fs && !ac && gimage && lp && alpha && prev);
|
||||
SET_SENSITIVE ("/Layer to Top", !fs && !ac && gimage && lp && alpha && prev);
|
||||
|
||||
SET_SENSITIVE ("/Stack/Lower Layer",
|
||||
!fs && !ac && gimage && lp && next && next_alpha);
|
||||
|
||||
SET_SENSITIVE ("/Stack/Layer to Top",
|
||||
!fs && !ac && gimage && lp && alpha && prev);
|
||||
SET_SENSITIVE ("/Stack/Layer to Bottom",
|
||||
SET_SENSITIVE ("/Lower Layer",
|
||||
!fs && !ac && gimage && lp && next && next_alpha);
|
||||
SET_SENSITIVE ("/Layer to Bottom",
|
||||
!fs && !ac && gimage && lp && next && next_alpha);
|
||||
|
||||
SET_SENSITIVE ("/Duplicate Layer", !fs && !ac && gimage && lp);
|
||||
|
|
|
@ -32,32 +32,46 @@ void layers_raise_to_top_cmd_callback (GtkWidget *widet,
|
|||
gpointer data);
|
||||
void layers_lower_to_bottom_cmd_callback (GtkWidget *widet,
|
||||
gpointer data);
|
||||
|
||||
void layers_new_cmd_callback (GtkWidget *widet,
|
||||
gpointer data);
|
||||
void layers_duplicate_cmd_callback (GtkWidget *widet,
|
||||
gpointer data);
|
||||
void layers_anchor_cmd_callback (GtkWidget *widet,
|
||||
gpointer data);
|
||||
void layers_delete_cmd_callback (GtkWidget *widet,
|
||||
gpointer data);
|
||||
|
||||
void layers_desaturate_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void layers_invert_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void layers_equalize_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
|
||||
void layers_offset_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void layers_scale_cmd_callback (GtkWidget *widet,
|
||||
gpointer data);
|
||||
void layers_resize_cmd_callback (GtkWidget *widet,
|
||||
gpointer data);
|
||||
void layers_resize_to_image_cmd_callback (GtkWidget *widet,
|
||||
gpointer data);
|
||||
|
||||
void layers_add_layer_mask_cmd_callback (GtkWidget *widet,
|
||||
gpointer data);
|
||||
void layers_apply_layer_mask_cmd_callback (GtkWidget *widet,
|
||||
gpointer data);
|
||||
void layers_delete_layer_mask_cmd_callback (GtkWidget *widet,
|
||||
gpointer data);
|
||||
void layers_anchor_cmd_callback (GtkWidget *widet,
|
||||
gpointer data);
|
||||
|
||||
void layers_merge_layers_cmd_callback (GtkWidget *widet,
|
||||
gpointer data);
|
||||
void layers_merge_down_cmd_callback (GtkWidget *widet,
|
||||
gpointer data);
|
||||
void layers_flatten_image_cmd_callback (GtkWidget *widet,
|
||||
gpointer data);
|
||||
|
||||
void layers_alpha_select_cmd_callback (GtkWidget *widet,
|
||||
gpointer data);
|
||||
void layers_mask_select_cmd_callback (GtkWidget *widet,
|
||||
|
|
|
@ -105,7 +105,7 @@ gimp_color_balance_tool_register (Gimp *gimp,
|
|||
"gimp:color_balance_tool",
|
||||
_("Color Balance"),
|
||||
_("Adjust color balance"),
|
||||
N_("/Image/Colors/Color Balance..."), NULL,
|
||||
N_("/Layer/Colors/Color Balance..."), NULL,
|
||||
NULL, "tools/color_balance.html",
|
||||
GIMP_STOCK_TOOL_COLOR_BALANCE);
|
||||
}
|
||||
|
|
|
@ -208,7 +208,7 @@ gimp_curves_tool_register (Gimp *gimp,
|
|||
"gimp:curves_tool",
|
||||
_("Curves"),
|
||||
_("Adjust color curves"),
|
||||
N_("/Image/Colors/Curves..."), NULL,
|
||||
N_("/Layer/Colors/Curves..."), NULL,
|
||||
NULL, "tools/curves.html",
|
||||
GIMP_STOCK_TOOL_CURVES);
|
||||
}
|
||||
|
|
|
@ -128,7 +128,7 @@ gimp_hue_saturation_tool_register (Gimp *gimp,
|
|||
"gimp:hue_saturation_tool",
|
||||
_("Hue-Saturation"),
|
||||
_("Adjust hue and saturation"),
|
||||
N_("/Image/Colors/Hue-Saturation..."), NULL,
|
||||
N_("/Layer/Colors/Hue-Saturation..."), NULL,
|
||||
NULL, "tools/hue_saturation.html",
|
||||
GIMP_STOCK_TOOL_HUE_SATURATION);
|
||||
}
|
||||
|
|
|
@ -226,34 +226,34 @@ temp_buf_new_check (gint width,
|
|||
|
||||
switch (check_type)
|
||||
{
|
||||
case LIGHT_CHECKS:
|
||||
fg_color = 204;
|
||||
bg_color = 255;
|
||||
break;
|
||||
case GRAY_CHECKS:
|
||||
fg_color = 102;
|
||||
bg_color = 153;
|
||||
break;
|
||||
case DARK_CHECKS:
|
||||
fg_color = 0;
|
||||
bg_color = 51;
|
||||
break;
|
||||
case WHITE_ONLY:
|
||||
fg_color = 255;
|
||||
bg_color = 255;
|
||||
break;
|
||||
case GRAY_ONLY:
|
||||
fg_color = 127;
|
||||
bg_color = 127;
|
||||
break;
|
||||
case BLACK_ONLY:
|
||||
fg_color = 0;
|
||||
bg_color = 0;
|
||||
case LIGHT_CHECKS:
|
||||
fg_color = 204;
|
||||
bg_color = 255;
|
||||
break;
|
||||
case GRAY_CHECKS:
|
||||
fg_color = 102;
|
||||
bg_color = 153;
|
||||
break;
|
||||
case DARK_CHECKS:
|
||||
fg_color = 0;
|
||||
bg_color = 51;
|
||||
break;
|
||||
case WHITE_ONLY:
|
||||
fg_color = 255;
|
||||
bg_color = 255;
|
||||
break;
|
||||
case GRAY_ONLY:
|
||||
fg_color = 127;
|
||||
bg_color = 127;
|
||||
break;
|
||||
case BLACK_ONLY:
|
||||
fg_color = 0;
|
||||
bg_color = 0;
|
||||
}
|
||||
|
||||
newbuf = temp_buf_new (width, height, 3, 0, 0, NULL);
|
||||
data = temp_buf_data (newbuf);
|
||||
|
||||
|
||||
for (i = 0, j = 1; i <= height; j++)
|
||||
{
|
||||
for (i = 1; i <= width; i++)
|
||||
|
@ -262,7 +262,7 @@ temp_buf_new_check (gint width,
|
|||
? fg_color : bg_color;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return newbuf;
|
||||
}
|
||||
|
||||
|
@ -329,13 +329,13 @@ temp_buf_resize (TempBuf *buf,
|
|||
else
|
||||
{
|
||||
if (size != (buf->width * buf->height * buf->bytes))
|
||||
{
|
||||
/* Make sure the temp buf is unswapped */
|
||||
temp_buf_unswap (buf);
|
||||
{
|
||||
/* Make sure the temp buf is unswapped */
|
||||
temp_buf_unswap (buf);
|
||||
|
||||
/* Reallocate the data for it */
|
||||
buf->data = g_realloc (buf->data, size);
|
||||
}
|
||||
/* Reallocate the data for it */
|
||||
buf->data = g_realloc (buf->data, size);
|
||||
}
|
||||
|
||||
/* Make sure the temp buf fields are valid */
|
||||
buf->x = x;
|
||||
|
|
|
@ -113,7 +113,7 @@ gimp_threshold_tool_register (Gimp *gimp,
|
|||
"gimp:threshold_tool",
|
||||
_("Threshold"),
|
||||
_("Reduce image to two colors using a threshold"),
|
||||
N_("/Image/Colors/Threshold..."), NULL,
|
||||
N_("/Layer/Colors/Threshold..."), NULL,
|
||||
NULL, "tools/threshold.html",
|
||||
GIMP_STOCK_TOOL_THRESHOLD);
|
||||
}
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
#include "widgets/gimpdnd.h"
|
||||
#include "widgets/gimppreview.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "devices.h"
|
||||
#include "gimprc.h"
|
||||
|
||||
|
@ -376,12 +375,12 @@ devices_rc_update (Gimp *gimp,
|
|||
else
|
||||
device_info->mode = GDK_MODE_DISABLED;
|
||||
|
||||
device_info->context = gimp_create_context (the_gimp,
|
||||
device_info->context = gimp_create_context (gimp,
|
||||
device_info->name, NULL);
|
||||
gimp_context_define_properties (device_info->context,
|
||||
DEVICE_CONTEXT_MASK,
|
||||
FALSE);
|
||||
gimp_context_copy_properties (gimp_get_user_context (the_gimp),
|
||||
gimp_context_copy_properties (gimp_get_user_context (gimp),
|
||||
device_info->context,
|
||||
DEVICE_CONTEXT_MASK);
|
||||
device_status_context_connect (device_info->context,
|
||||
|
@ -437,7 +436,7 @@ devices_rc_update (Gimp *gimp,
|
|||
GimpToolInfo *tool_info;
|
||||
|
||||
tool_info = (GimpToolInfo *)
|
||||
gimp_container_get_child_by_name (the_gimp->tool_info_list,
|
||||
gimp_container_get_child_by_name (gimp->tool_info_list,
|
||||
tool_name);
|
||||
|
||||
if (tool_info)
|
||||
|
@ -466,14 +465,14 @@ devices_rc_update (Gimp *gimp,
|
|||
GimpBrush *brush;
|
||||
|
||||
brush = (GimpBrush *)
|
||||
gimp_container_get_child_by_name (the_gimp->brush_factory->container,
|
||||
gimp_container_get_child_by_name (gimp->brush_factory->container,
|
||||
brush_name);
|
||||
|
||||
if (brush)
|
||||
{
|
||||
gimp_context_set_brush (device_info->context, brush);
|
||||
}
|
||||
else if (the_gimp->no_data)
|
||||
else if (gimp->no_data)
|
||||
{
|
||||
g_free (device_info->context->brush_name);
|
||||
device_info->context->brush_name = g_strdup (brush_name);
|
||||
|
@ -485,14 +484,14 @@ devices_rc_update (Gimp *gimp,
|
|||
GimpPattern *pattern;
|
||||
|
||||
pattern = (GimpPattern *)
|
||||
gimp_container_get_child_by_name (the_gimp->pattern_factory->container,
|
||||
gimp_container_get_child_by_name (gimp->pattern_factory->container,
|
||||
pattern_name);
|
||||
|
||||
if (pattern)
|
||||
{
|
||||
gimp_context_set_pattern (device_info->context, pattern);
|
||||
}
|
||||
else if (the_gimp->no_data)
|
||||
else if (gimp->no_data)
|
||||
{
|
||||
g_free (device_info->context->pattern_name);
|
||||
device_info->context->pattern_name = g_strdup (pattern_name);
|
||||
|
@ -504,14 +503,14 @@ devices_rc_update (Gimp *gimp,
|
|||
GimpGradient *gradient;
|
||||
|
||||
gradient = (GimpGradient *)
|
||||
gimp_container_get_child_by_name (the_gimp->gradient_factory->container,
|
||||
gimp_container_get_child_by_name (gimp->gradient_factory->container,
|
||||
gradient_name);
|
||||
|
||||
if (gradient)
|
||||
{
|
||||
gimp_context_set_gradient (device_info->context, gradient);
|
||||
}
|
||||
else if (the_gimp->no_data)
|
||||
else if (gimp->no_data)
|
||||
{
|
||||
g_free (device_info->context->gradient_name);
|
||||
device_info->context->gradient_name = g_strdup (gradient_name);
|
||||
|
@ -539,7 +538,7 @@ select_device (Gimp *gimp,
|
|||
|
||||
current_device = new_device;
|
||||
|
||||
context = gimp_get_user_context (the_gimp);
|
||||
context = gimp_get_user_context (gimp);
|
||||
|
||||
gimp_context_copy_properties (device_info->context, context,
|
||||
DEVICE_CONTEXT_MASK);
|
||||
|
|
|
@ -31,6 +31,8 @@
|
|||
|
||||
#include "display/gimpdisplay-foreach.h"
|
||||
|
||||
#include "offset-dialog.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#define __OFFSET_DIALOG_H__
|
||||
|
||||
|
||||
void offset_dialog_create (GimpImage *gimage);
|
||||
void offset_dialog_create (GimpDrawable *drawable);
|
||||
|
||||
|
||||
#endif /* __OFFSET_DIALOG_H__ */
|
||||
|
|
|
@ -990,11 +990,15 @@ prefs_toggle_callback (GtkWidget *widget,
|
|||
Gimp *gimp;
|
||||
gint *val;
|
||||
|
||||
dialog = gtk_widget_get_toplevel (widget);
|
||||
|
||||
if (GTK_IS_MENU_SHELL (dialog))
|
||||
dialog =
|
||||
gtk_widget_get_toplevel (gtk_menu_get_attach_widget (GTK_MENU (dialog)));
|
||||
if (GTK_IS_MENU_ITEM (widget))
|
||||
{
|
||||
dialog =
|
||||
gtk_widget_get_toplevel (gtk_menu_get_attach_widget (GTK_MENU (widget->parent)));
|
||||
}
|
||||
else
|
||||
{
|
||||
dialog = gtk_widget_get_toplevel (widget);
|
||||
}
|
||||
|
||||
gimp = GIMP (g_object_get_data (G_OBJECT (dialog), "gimp"));
|
||||
|
||||
|
|
|
@ -1011,63 +1011,79 @@ gimp_display_shell_set_menu_sensitivity (GimpDisplayShell *shell)
|
|||
}
|
||||
|
||||
SET_SENSITIVE ("Image", gdisp);
|
||||
|
||||
SET_SENSITIVE ("Image/Mode", gdisp);
|
||||
SET_SENSITIVE ("Image/Colors", gdisp);
|
||||
SET_SENSITIVE ("Image/Colors/Auto", gdisp);
|
||||
SET_SENSITIVE ("Image/Alpha", gdisp);
|
||||
SET_SENSITIVE ("Image/Transforms", gdisp);
|
||||
SET_SENSITIVE ("Image/Transforms/Rotate", gdisp);
|
||||
if (gdisp)
|
||||
{
|
||||
SET_SENSITIVE ("Image/Mode/RGB", (base_type != RGB));
|
||||
SET_SENSITIVE ("Image/Mode/Grayscale", (base_type != GRAY));
|
||||
SET_SENSITIVE ("Image/Mode/Indexed...", (base_type != INDEXED));
|
||||
|
||||
SET_SENSITIVE ("Image/Histogram...", lp);
|
||||
|
||||
SET_SENSITIVE ("Image/Colors", lp);
|
||||
SET_SENSITIVE ("Image/Colors/Color Balance...", (base_type == RGB));
|
||||
SET_SENSITIVE ("Image/Colors/Hue-Saturation...", (base_type == RGB));
|
||||
SET_SENSITIVE ("Image/Colors/Brightness-Contrast...", (base_type != INDEXED));
|
||||
SET_SENSITIVE ("Image/Colors/Threshold...", (base_type != INDEXED));
|
||||
SET_SENSITIVE ("Image/Colors/Levels...", (base_type != INDEXED));
|
||||
SET_SENSITIVE ("Image/Colors/Curves...", (base_type != INDEXED));
|
||||
SET_SENSITIVE ("Image/Colors/Desaturate", (base_type == RGB));
|
||||
SET_SENSITIVE ("Image/Colors/Posterize...", (base_type != INDEXED));
|
||||
SET_SENSITIVE ("Image/Colors/Invert", (base_type != INDEXED));
|
||||
SET_SENSITIVE ("Image/Colors/Auto/Equalize", (base_type != INDEXED));
|
||||
|
||||
SET_SENSITIVE ("Image/Alpha/Add Alpha Channel",
|
||||
!fs && !aux && lp && !lm && !alpha);
|
||||
|
||||
SET_SENSITIVE ("Image/Transforms/Offset...", lp);
|
||||
}
|
||||
|
||||
SET_SENSITIVE ("Layers/Stack", gdisp);
|
||||
SET_SENSITIVE ("Layer/Stack", gdisp);
|
||||
if (gdisp)
|
||||
{
|
||||
SET_SENSITIVE ("Layers/Stack/Previous Layer",
|
||||
SET_SENSITIVE ("Layer/Stack/Previous Layer",
|
||||
!fs && !aux && lp && lind > 0);
|
||||
SET_SENSITIVE ("Layers/Stack/Next Layer",
|
||||
SET_SENSITIVE ("Layer/Stack/Next Layer",
|
||||
!fs && !aux && lp && lind < (lnum - 1));
|
||||
SET_SENSITIVE ("Layers/Stack/Raise Layer",
|
||||
SET_SENSITIVE ("Layer/Stack/Raise Layer",
|
||||
!fs && !aux && lp && alpha && lind > 0);
|
||||
SET_SENSITIVE ("Layers/Stack/Lower Layer",
|
||||
SET_SENSITIVE ("Layer/Stack/Lower Layer",
|
||||
!fs && !aux && lp && alpha && lind < (lnum - 1));
|
||||
SET_SENSITIVE ("Layers/Stack/Layer to Top",
|
||||
SET_SENSITIVE ("Layer/Stack/Layer to Top",
|
||||
!fs && !aux && lp && alpha && lind > 0);
|
||||
SET_SENSITIVE ("Layers/Stack/Layer to Bottom",
|
||||
SET_SENSITIVE ("Layer/Stack/Layer to Bottom",
|
||||
!fs && !aux && lp && alpha && lind < (lnum - 1));
|
||||
}
|
||||
SET_SENSITIVE ("Layers/Rotate", gdisp && !aux && !lm & lp);
|
||||
SET_SENSITIVE ("Layers/Layer to Imagesize", gdisp && !aux && lp);
|
||||
|
||||
SET_SENSITIVE ("Layers/Anchor Layer", gdisp && fs && !aux && lp);
|
||||
SET_SENSITIVE ("Layers/Merge Visible Layers...", gdisp && !fs && !aux && lp);
|
||||
SET_SENSITIVE ("Layers/Flatten Image", gdisp && !fs && !aux && lp);
|
||||
SET_SENSITIVE ("Layers/Alpha to Selection", gdisp && !aux && lp && alpha);
|
||||
SET_SENSITIVE ("Layers/Mask to Selection", gdisp && !aux && lm && lp);
|
||||
SET_SENSITIVE ("Layers/Add Alpha Channel",
|
||||
SET_SENSITIVE ("Layer/New Layer...", gdisp);
|
||||
SET_SENSITIVE ("Layer/Duplicate Layer", gdisp && !fs && !aux && lp);
|
||||
SET_SENSITIVE ("Layer/Anchor Layer", gdisp && fs && !aux && lp);
|
||||
SET_SENSITIVE ("Layer/Delete Layer", gdisp && !aux && lp);
|
||||
|
||||
SET_SENSITIVE ("Layer/Layer Boundary Size...", gdisp && !aux && lp);
|
||||
SET_SENSITIVE ("Layer/Layer to Imagesize", gdisp && !aux && lp);
|
||||
SET_SENSITIVE ("Layer/Scale Layer...", gdisp && !aux && lp);
|
||||
|
||||
SET_SENSITIVE ("Layer/Transform/Offset...", lp);
|
||||
|
||||
SET_SENSITIVE ("Layer/Merge Visible Layers...", gdisp && !fs && !aux && lp);
|
||||
SET_SENSITIVE ("Layer/Merge Down", gdisp && !fs && !aux && lp);
|
||||
SET_SENSITIVE ("Layer/Flatten Image", gdisp && !fs && !aux && lp);
|
||||
|
||||
SET_SENSITIVE ("Layer/Colors", gdisp);
|
||||
SET_SENSITIVE ("Layer/Colors/Auto", gdisp);
|
||||
|
||||
if (gdisp)
|
||||
{
|
||||
SET_SENSITIVE ("Layer/Colors", lp);
|
||||
SET_SENSITIVE ("Layer/Colors/Color Balance...", (base_type == RGB));
|
||||
SET_SENSITIVE ("Layer/Colors/Hue-Saturation...", (base_type == RGB));
|
||||
SET_SENSITIVE ("Layer/Colors/Brightness-Contrast...", (base_type != INDEXED));
|
||||
SET_SENSITIVE ("Layer/Colors/Threshold...", (base_type != INDEXED));
|
||||
SET_SENSITIVE ("Layer/Colors/Levels...", (base_type != INDEXED));
|
||||
SET_SENSITIVE ("Layer/Colors/Curves...", (base_type != INDEXED));
|
||||
SET_SENSITIVE ("Layer/Colors/Desaturate", (base_type == RGB));
|
||||
SET_SENSITIVE ("Layer/Colors/Posterize...", (base_type != INDEXED));
|
||||
SET_SENSITIVE ("Layer/Colors/Invert", (base_type != INDEXED));
|
||||
SET_SENSITIVE ("Layer/Colors/Auto/Equalize", (base_type != INDEXED));
|
||||
|
||||
SET_SENSITIVE ("Layer/Colors/Histogram...", lp);
|
||||
}
|
||||
|
||||
SET_SENSITIVE ("Layer/Mask/Add Layer Mask...",
|
||||
gdisp && !aux && !lm && lp && alpha && (base_type != INDEXED));
|
||||
SET_SENSITIVE ("Layer/Mask/Apply Layer Mask",
|
||||
gdisp && !aux && lm && lp);
|
||||
SET_SENSITIVE ("Layer/Mask/Delete Layer Mask",
|
||||
gdisp && !aux && lm && lp);
|
||||
SET_SENSITIVE ("Layer/Mask/Mask to Selection",
|
||||
gdisp && !aux && lm && lp);
|
||||
|
||||
SET_SENSITIVE ("Layer/Alpha/Alpha to Selection",
|
||||
gdisp && !aux && lp && alpha);
|
||||
SET_SENSITIVE ("Layer/Alpha/Add Alpha Channel",
|
||||
gdisp && !fs && !aux && lp && !lm && !alpha);
|
||||
|
||||
SET_SENSITIVE ("Filters", gdisp && lp);
|
||||
|
|
|
@ -1011,63 +1011,79 @@ gimp_display_shell_set_menu_sensitivity (GimpDisplayShell *shell)
|
|||
}
|
||||
|
||||
SET_SENSITIVE ("Image", gdisp);
|
||||
|
||||
SET_SENSITIVE ("Image/Mode", gdisp);
|
||||
SET_SENSITIVE ("Image/Colors", gdisp);
|
||||
SET_SENSITIVE ("Image/Colors/Auto", gdisp);
|
||||
SET_SENSITIVE ("Image/Alpha", gdisp);
|
||||
SET_SENSITIVE ("Image/Transforms", gdisp);
|
||||
SET_SENSITIVE ("Image/Transforms/Rotate", gdisp);
|
||||
if (gdisp)
|
||||
{
|
||||
SET_SENSITIVE ("Image/Mode/RGB", (base_type != RGB));
|
||||
SET_SENSITIVE ("Image/Mode/Grayscale", (base_type != GRAY));
|
||||
SET_SENSITIVE ("Image/Mode/Indexed...", (base_type != INDEXED));
|
||||
|
||||
SET_SENSITIVE ("Image/Histogram...", lp);
|
||||
|
||||
SET_SENSITIVE ("Image/Colors", lp);
|
||||
SET_SENSITIVE ("Image/Colors/Color Balance...", (base_type == RGB));
|
||||
SET_SENSITIVE ("Image/Colors/Hue-Saturation...", (base_type == RGB));
|
||||
SET_SENSITIVE ("Image/Colors/Brightness-Contrast...", (base_type != INDEXED));
|
||||
SET_SENSITIVE ("Image/Colors/Threshold...", (base_type != INDEXED));
|
||||
SET_SENSITIVE ("Image/Colors/Levels...", (base_type != INDEXED));
|
||||
SET_SENSITIVE ("Image/Colors/Curves...", (base_type != INDEXED));
|
||||
SET_SENSITIVE ("Image/Colors/Desaturate", (base_type == RGB));
|
||||
SET_SENSITIVE ("Image/Colors/Posterize...", (base_type != INDEXED));
|
||||
SET_SENSITIVE ("Image/Colors/Invert", (base_type != INDEXED));
|
||||
SET_SENSITIVE ("Image/Colors/Auto/Equalize", (base_type != INDEXED));
|
||||
|
||||
SET_SENSITIVE ("Image/Alpha/Add Alpha Channel",
|
||||
!fs && !aux && lp && !lm && !alpha);
|
||||
|
||||
SET_SENSITIVE ("Image/Transforms/Offset...", lp);
|
||||
}
|
||||
|
||||
SET_SENSITIVE ("Layers/Stack", gdisp);
|
||||
SET_SENSITIVE ("Layer/Stack", gdisp);
|
||||
if (gdisp)
|
||||
{
|
||||
SET_SENSITIVE ("Layers/Stack/Previous Layer",
|
||||
SET_SENSITIVE ("Layer/Stack/Previous Layer",
|
||||
!fs && !aux && lp && lind > 0);
|
||||
SET_SENSITIVE ("Layers/Stack/Next Layer",
|
||||
SET_SENSITIVE ("Layer/Stack/Next Layer",
|
||||
!fs && !aux && lp && lind < (lnum - 1));
|
||||
SET_SENSITIVE ("Layers/Stack/Raise Layer",
|
||||
SET_SENSITIVE ("Layer/Stack/Raise Layer",
|
||||
!fs && !aux && lp && alpha && lind > 0);
|
||||
SET_SENSITIVE ("Layers/Stack/Lower Layer",
|
||||
SET_SENSITIVE ("Layer/Stack/Lower Layer",
|
||||
!fs && !aux && lp && alpha && lind < (lnum - 1));
|
||||
SET_SENSITIVE ("Layers/Stack/Layer to Top",
|
||||
SET_SENSITIVE ("Layer/Stack/Layer to Top",
|
||||
!fs && !aux && lp && alpha && lind > 0);
|
||||
SET_SENSITIVE ("Layers/Stack/Layer to Bottom",
|
||||
SET_SENSITIVE ("Layer/Stack/Layer to Bottom",
|
||||
!fs && !aux && lp && alpha && lind < (lnum - 1));
|
||||
}
|
||||
SET_SENSITIVE ("Layers/Rotate", gdisp && !aux && !lm & lp);
|
||||
SET_SENSITIVE ("Layers/Layer to Imagesize", gdisp && !aux && lp);
|
||||
|
||||
SET_SENSITIVE ("Layers/Anchor Layer", gdisp && fs && !aux && lp);
|
||||
SET_SENSITIVE ("Layers/Merge Visible Layers...", gdisp && !fs && !aux && lp);
|
||||
SET_SENSITIVE ("Layers/Flatten Image", gdisp && !fs && !aux && lp);
|
||||
SET_SENSITIVE ("Layers/Alpha to Selection", gdisp && !aux && lp && alpha);
|
||||
SET_SENSITIVE ("Layers/Mask to Selection", gdisp && !aux && lm && lp);
|
||||
SET_SENSITIVE ("Layers/Add Alpha Channel",
|
||||
SET_SENSITIVE ("Layer/New Layer...", gdisp);
|
||||
SET_SENSITIVE ("Layer/Duplicate Layer", gdisp && !fs && !aux && lp);
|
||||
SET_SENSITIVE ("Layer/Anchor Layer", gdisp && fs && !aux && lp);
|
||||
SET_SENSITIVE ("Layer/Delete Layer", gdisp && !aux && lp);
|
||||
|
||||
SET_SENSITIVE ("Layer/Layer Boundary Size...", gdisp && !aux && lp);
|
||||
SET_SENSITIVE ("Layer/Layer to Imagesize", gdisp && !aux && lp);
|
||||
SET_SENSITIVE ("Layer/Scale Layer...", gdisp && !aux && lp);
|
||||
|
||||
SET_SENSITIVE ("Layer/Transform/Offset...", lp);
|
||||
|
||||
SET_SENSITIVE ("Layer/Merge Visible Layers...", gdisp && !fs && !aux && lp);
|
||||
SET_SENSITIVE ("Layer/Merge Down", gdisp && !fs && !aux && lp);
|
||||
SET_SENSITIVE ("Layer/Flatten Image", gdisp && !fs && !aux && lp);
|
||||
|
||||
SET_SENSITIVE ("Layer/Colors", gdisp);
|
||||
SET_SENSITIVE ("Layer/Colors/Auto", gdisp);
|
||||
|
||||
if (gdisp)
|
||||
{
|
||||
SET_SENSITIVE ("Layer/Colors", lp);
|
||||
SET_SENSITIVE ("Layer/Colors/Color Balance...", (base_type == RGB));
|
||||
SET_SENSITIVE ("Layer/Colors/Hue-Saturation...", (base_type == RGB));
|
||||
SET_SENSITIVE ("Layer/Colors/Brightness-Contrast...", (base_type != INDEXED));
|
||||
SET_SENSITIVE ("Layer/Colors/Threshold...", (base_type != INDEXED));
|
||||
SET_SENSITIVE ("Layer/Colors/Levels...", (base_type != INDEXED));
|
||||
SET_SENSITIVE ("Layer/Colors/Curves...", (base_type != INDEXED));
|
||||
SET_SENSITIVE ("Layer/Colors/Desaturate", (base_type == RGB));
|
||||
SET_SENSITIVE ("Layer/Colors/Posterize...", (base_type != INDEXED));
|
||||
SET_SENSITIVE ("Layer/Colors/Invert", (base_type != INDEXED));
|
||||
SET_SENSITIVE ("Layer/Colors/Auto/Equalize", (base_type != INDEXED));
|
||||
|
||||
SET_SENSITIVE ("Layer/Colors/Histogram...", lp);
|
||||
}
|
||||
|
||||
SET_SENSITIVE ("Layer/Mask/Add Layer Mask...",
|
||||
gdisp && !aux && !lm && lp && alpha && (base_type != INDEXED));
|
||||
SET_SENSITIVE ("Layer/Mask/Apply Layer Mask",
|
||||
gdisp && !aux && lm && lp);
|
||||
SET_SENSITIVE ("Layer/Mask/Delete Layer Mask",
|
||||
gdisp && !aux && lm && lp);
|
||||
SET_SENSITIVE ("Layer/Mask/Mask to Selection",
|
||||
gdisp && !aux && lm && lp);
|
||||
|
||||
SET_SENSITIVE ("Layer/Alpha/Alpha to Selection",
|
||||
gdisp && !aux && lp && alpha);
|
||||
SET_SENSITIVE ("Layer/Alpha/Add Alpha Channel",
|
||||
gdisp && !fs && !aux && lp && !lm && !alpha);
|
||||
|
||||
SET_SENSITIVE ("Filters", gdisp && lp);
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
#include "widgets/gimpdnd.h"
|
||||
#include "widgets/gimppreview.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "devices.h"
|
||||
#include "gimprc.h"
|
||||
|
||||
|
@ -376,12 +375,12 @@ devices_rc_update (Gimp *gimp,
|
|||
else
|
||||
device_info->mode = GDK_MODE_DISABLED;
|
||||
|
||||
device_info->context = gimp_create_context (the_gimp,
|
||||
device_info->context = gimp_create_context (gimp,
|
||||
device_info->name, NULL);
|
||||
gimp_context_define_properties (device_info->context,
|
||||
DEVICE_CONTEXT_MASK,
|
||||
FALSE);
|
||||
gimp_context_copy_properties (gimp_get_user_context (the_gimp),
|
||||
gimp_context_copy_properties (gimp_get_user_context (gimp),
|
||||
device_info->context,
|
||||
DEVICE_CONTEXT_MASK);
|
||||
device_status_context_connect (device_info->context,
|
||||
|
@ -437,7 +436,7 @@ devices_rc_update (Gimp *gimp,
|
|||
GimpToolInfo *tool_info;
|
||||
|
||||
tool_info = (GimpToolInfo *)
|
||||
gimp_container_get_child_by_name (the_gimp->tool_info_list,
|
||||
gimp_container_get_child_by_name (gimp->tool_info_list,
|
||||
tool_name);
|
||||
|
||||
if (tool_info)
|
||||
|
@ -466,14 +465,14 @@ devices_rc_update (Gimp *gimp,
|
|||
GimpBrush *brush;
|
||||
|
||||
brush = (GimpBrush *)
|
||||
gimp_container_get_child_by_name (the_gimp->brush_factory->container,
|
||||
gimp_container_get_child_by_name (gimp->brush_factory->container,
|
||||
brush_name);
|
||||
|
||||
if (brush)
|
||||
{
|
||||
gimp_context_set_brush (device_info->context, brush);
|
||||
}
|
||||
else if (the_gimp->no_data)
|
||||
else if (gimp->no_data)
|
||||
{
|
||||
g_free (device_info->context->brush_name);
|
||||
device_info->context->brush_name = g_strdup (brush_name);
|
||||
|
@ -485,14 +484,14 @@ devices_rc_update (Gimp *gimp,
|
|||
GimpPattern *pattern;
|
||||
|
||||
pattern = (GimpPattern *)
|
||||
gimp_container_get_child_by_name (the_gimp->pattern_factory->container,
|
||||
gimp_container_get_child_by_name (gimp->pattern_factory->container,
|
||||
pattern_name);
|
||||
|
||||
if (pattern)
|
||||
{
|
||||
gimp_context_set_pattern (device_info->context, pattern);
|
||||
}
|
||||
else if (the_gimp->no_data)
|
||||
else if (gimp->no_data)
|
||||
{
|
||||
g_free (device_info->context->pattern_name);
|
||||
device_info->context->pattern_name = g_strdup (pattern_name);
|
||||
|
@ -504,14 +503,14 @@ devices_rc_update (Gimp *gimp,
|
|||
GimpGradient *gradient;
|
||||
|
||||
gradient = (GimpGradient *)
|
||||
gimp_container_get_child_by_name (the_gimp->gradient_factory->container,
|
||||
gimp_container_get_child_by_name (gimp->gradient_factory->container,
|
||||
gradient_name);
|
||||
|
||||
if (gradient)
|
||||
{
|
||||
gimp_context_set_gradient (device_info->context, gradient);
|
||||
}
|
||||
else if (the_gimp->no_data)
|
||||
else if (gimp->no_data)
|
||||
{
|
||||
g_free (device_info->context->gradient_name);
|
||||
device_info->context->gradient_name = g_strdup (gradient_name);
|
||||
|
@ -539,7 +538,7 @@ select_device (Gimp *gimp,
|
|||
|
||||
current_device = new_device;
|
||||
|
||||
context = gimp_get_user_context (the_gimp);
|
||||
context = gimp_get_user_context (gimp);
|
||||
|
||||
gimp_context_copy_properties (device_info->context, context,
|
||||
DEVICE_CONTEXT_MASK);
|
||||
|
|
|
@ -26,21 +26,15 @@
|
|||
|
||||
#include "core/gimp.h"
|
||||
#include "core/gimpcontext.h"
|
||||
#include "core/gimpdrawable.h"
|
||||
#include "core/gimpdrawable-desaturate.h"
|
||||
#include "core/gimpdrawable-equalize.h"
|
||||
#include "core/gimpimage.h"
|
||||
#include "core/gimpimage-duplicate.h"
|
||||
#include "core/gimpimage-resize.h"
|
||||
#include "core/gimpimage-scale.h"
|
||||
|
||||
#include "pdb/procedural_db.h"
|
||||
|
||||
#include "display/gimpdisplay.h"
|
||||
#include "display/gimpdisplay-foreach.h"
|
||||
|
||||
#include "convert-dialog.h"
|
||||
#include "offset-dialog.h"
|
||||
#include "resize-dialog.h"
|
||||
|
||||
#include "gimpprogress.h"
|
||||
|
@ -112,91 +106,6 @@ image_convert_indexed_cmd_callback (GtkWidget *widget,
|
|||
convert_to_indexed (gimage);
|
||||
}
|
||||
|
||||
void
|
||||
image_desaturate_cmd_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpDrawable *drawable;
|
||||
return_if_no_image (gimage, data);
|
||||
|
||||
drawable = gimp_image_active_drawable (gimage);
|
||||
|
||||
if (! gimp_drawable_is_rgb (drawable))
|
||||
{
|
||||
g_message (_("Desaturate operates only on RGB color drawables."));
|
||||
return;
|
||||
}
|
||||
|
||||
gimp_drawable_desaturate (drawable);
|
||||
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
void
|
||||
image_invert_cmd_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpDrawable *drawable;
|
||||
Argument *return_vals;
|
||||
gint nreturn_vals;
|
||||
return_if_no_image (gimage, data);
|
||||
|
||||
drawable = gimp_image_active_drawable (gimage);
|
||||
|
||||
if (gimp_drawable_is_indexed (drawable))
|
||||
{
|
||||
g_message (_("Invert does not operate on indexed drawables."));
|
||||
return;
|
||||
}
|
||||
|
||||
return_vals =
|
||||
procedural_db_run_proc (gimage->gimp,
|
||||
"gimp_invert",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, gimp_drawable_get_ID (drawable),
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (!return_vals || return_vals[0].value.pdb_int != GIMP_PDB_SUCCESS)
|
||||
g_message (_("Invert operation failed."));
|
||||
|
||||
procedural_db_destroy_args (return_vals, nreturn_vals);
|
||||
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
void
|
||||
image_equalize_cmd_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpDrawable *drawable;
|
||||
return_if_no_image (gimage, data);
|
||||
|
||||
drawable = gimp_image_active_drawable (gimage);
|
||||
|
||||
if (gimp_drawable_is_indexed (drawable))
|
||||
{
|
||||
g_message (_("Equalize does not operate on indexed drawables."));
|
||||
return;
|
||||
}
|
||||
|
||||
gimp_drawable_equalize (drawable, TRUE);
|
||||
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
void
|
||||
image_offset_cmd_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
return_if_no_image (gimage, data);
|
||||
|
||||
offset_dialog_create (gimage);
|
||||
}
|
||||
|
||||
void
|
||||
image_resize_cmd_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
|
|
|
@ -26,14 +26,6 @@ void image_convert_grayscale_cmd_callback (GtkWidget *widget,
|
|||
gpointer data);
|
||||
void image_convert_indexed_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void image_desaturate_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void image_invert_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void image_equalize_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void image_offset_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void image_resize_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void image_scale_cmd_callback (GtkWidget *widget,
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
#include "widgets/gimpdnd.h"
|
||||
#include "widgets/gimppreview.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "devices.h"
|
||||
#include "gimprc.h"
|
||||
|
||||
|
@ -376,12 +375,12 @@ devices_rc_update (Gimp *gimp,
|
|||
else
|
||||
device_info->mode = GDK_MODE_DISABLED;
|
||||
|
||||
device_info->context = gimp_create_context (the_gimp,
|
||||
device_info->context = gimp_create_context (gimp,
|
||||
device_info->name, NULL);
|
||||
gimp_context_define_properties (device_info->context,
|
||||
DEVICE_CONTEXT_MASK,
|
||||
FALSE);
|
||||
gimp_context_copy_properties (gimp_get_user_context (the_gimp),
|
||||
gimp_context_copy_properties (gimp_get_user_context (gimp),
|
||||
device_info->context,
|
||||
DEVICE_CONTEXT_MASK);
|
||||
device_status_context_connect (device_info->context,
|
||||
|
@ -437,7 +436,7 @@ devices_rc_update (Gimp *gimp,
|
|||
GimpToolInfo *tool_info;
|
||||
|
||||
tool_info = (GimpToolInfo *)
|
||||
gimp_container_get_child_by_name (the_gimp->tool_info_list,
|
||||
gimp_container_get_child_by_name (gimp->tool_info_list,
|
||||
tool_name);
|
||||
|
||||
if (tool_info)
|
||||
|
@ -466,14 +465,14 @@ devices_rc_update (Gimp *gimp,
|
|||
GimpBrush *brush;
|
||||
|
||||
brush = (GimpBrush *)
|
||||
gimp_container_get_child_by_name (the_gimp->brush_factory->container,
|
||||
gimp_container_get_child_by_name (gimp->brush_factory->container,
|
||||
brush_name);
|
||||
|
||||
if (brush)
|
||||
{
|
||||
gimp_context_set_brush (device_info->context, brush);
|
||||
}
|
||||
else if (the_gimp->no_data)
|
||||
else if (gimp->no_data)
|
||||
{
|
||||
g_free (device_info->context->brush_name);
|
||||
device_info->context->brush_name = g_strdup (brush_name);
|
||||
|
@ -485,14 +484,14 @@ devices_rc_update (Gimp *gimp,
|
|||
GimpPattern *pattern;
|
||||
|
||||
pattern = (GimpPattern *)
|
||||
gimp_container_get_child_by_name (the_gimp->pattern_factory->container,
|
||||
gimp_container_get_child_by_name (gimp->pattern_factory->container,
|
||||
pattern_name);
|
||||
|
||||
if (pattern)
|
||||
{
|
||||
gimp_context_set_pattern (device_info->context, pattern);
|
||||
}
|
||||
else if (the_gimp->no_data)
|
||||
else if (gimp->no_data)
|
||||
{
|
||||
g_free (device_info->context->pattern_name);
|
||||
device_info->context->pattern_name = g_strdup (pattern_name);
|
||||
|
@ -504,14 +503,14 @@ devices_rc_update (Gimp *gimp,
|
|||
GimpGradient *gradient;
|
||||
|
||||
gradient = (GimpGradient *)
|
||||
gimp_container_get_child_by_name (the_gimp->gradient_factory->container,
|
||||
gimp_container_get_child_by_name (gimp->gradient_factory->container,
|
||||
gradient_name);
|
||||
|
||||
if (gradient)
|
||||
{
|
||||
gimp_context_set_gradient (device_info->context, gradient);
|
||||
}
|
||||
else if (the_gimp->no_data)
|
||||
else if (gimp->no_data)
|
||||
{
|
||||
g_free (device_info->context->gradient_name);
|
||||
device_info->context->gradient_name = g_strdup (gradient_name);
|
||||
|
@ -539,7 +538,7 @@ select_device (Gimp *gimp,
|
|||
|
||||
current_device = new_device;
|
||||
|
||||
context = gimp_get_user_context (the_gimp);
|
||||
context = gimp_get_user_context (gimp);
|
||||
|
||||
gimp_context_copy_properties (device_info->context, context,
|
||||
DEVICE_CONTEXT_MASK);
|
||||
|
|
|
@ -31,6 +31,9 @@
|
|||
#include "paint-funcs/paint-funcs.h"
|
||||
|
||||
#include "core/gimp.h"
|
||||
#include "core/gimpcontext.h"
|
||||
#include "core/gimpdrawable-desaturate.h"
|
||||
#include "core/gimpdrawable-equalize.h"
|
||||
#include "core/gimpimage.h"
|
||||
#include "core/gimpimage-mask.h"
|
||||
#include "core/gimpimage-merge.h"
|
||||
|
@ -38,12 +41,15 @@
|
|||
#include "core/gimplayermask.h"
|
||||
#include "core/gimplist.h"
|
||||
|
||||
#include "pdb/procedural_db.h"
|
||||
|
||||
#include "display/gimpdisplay-foreach.h"
|
||||
|
||||
#include "widgets/gimpitemfactory.h"
|
||||
#include "widgets/gimpwidgets-utils.h"
|
||||
|
||||
#include "layers-commands.h"
|
||||
#include "offset-dialog.h"
|
||||
#include "resize-dialog.h"
|
||||
|
||||
#include "floating_sel.h"
|
||||
|
@ -61,6 +67,14 @@ static void layers_resize_layer_query (GimpImage *gimage,
|
|||
GimpLayer *layer);
|
||||
|
||||
|
||||
#define return_if_no_image(gimage) \
|
||||
gimage = (GimpImage *) gimp_widget_get_callback_context (widget); \
|
||||
if (! gimage) \
|
||||
gimage = gimp_context_get_image (gimp_get_user_context (GIMP (data))); \
|
||||
if (! gimage) \
|
||||
return
|
||||
|
||||
|
||||
/* public functions */
|
||||
|
||||
void
|
||||
|
@ -70,11 +84,7 @@ layers_previous_cmd_callback (GtkWidget *widget,
|
|||
GimpImage *gimage;
|
||||
GimpLayer *new_layer;
|
||||
gint current_layer;
|
||||
|
||||
gimage = (GimpImage *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
current_layer =
|
||||
gimp_image_get_layer_index (gimage, gimp_image_get_active_layer (gimage));
|
||||
|
@ -99,11 +109,7 @@ layers_next_cmd_callback (GtkWidget *widget,
|
|||
GimpImage *gimage;
|
||||
GimpLayer *new_layer;
|
||||
gint current_layer;
|
||||
|
||||
gimage = (GimpImage *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
current_layer =
|
||||
gimp_image_get_layer_index (gimage, gimp_image_get_active_layer (gimage));
|
||||
|
@ -124,11 +130,7 @@ layers_raise_cmd_callback (GtkWidget *widget,
|
|||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
|
||||
gimage = (GimpImage *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
gimp_image_raise_layer (gimage, gimp_image_get_active_layer (gimage));
|
||||
gdisplays_flush ();
|
||||
|
@ -139,11 +141,7 @@ layers_lower_cmd_callback (GtkWidget *widget,
|
|||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
|
||||
gimage = (GimpImage *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
gimp_image_lower_layer (gimage, gimp_image_get_active_layer (gimage));
|
||||
gdisplays_flush ();
|
||||
|
@ -154,11 +152,7 @@ layers_raise_to_top_cmd_callback (GtkWidget *widget,
|
|||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
|
||||
gimage = (GimpImage *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
gimp_image_raise_layer_to_top (gimage, gimp_image_get_active_layer (gimage));
|
||||
gdisplays_flush ();
|
||||
|
@ -169,11 +163,7 @@ layers_lower_to_bottom_cmd_callback (GtkWidget *widget,
|
|||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
|
||||
gimage = (GimpImage *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
gimp_image_lower_layer_to_bottom (gimage,
|
||||
gimp_image_get_active_layer (gimage));
|
||||
|
@ -185,11 +175,7 @@ layers_new_cmd_callback (GtkWidget *widget,
|
|||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
|
||||
gimage = (GimpImage *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
layers_new_layer_query (gimage);
|
||||
}
|
||||
|
@ -201,11 +187,7 @@ layers_duplicate_cmd_callback (GtkWidget *widget,
|
|||
GimpImage *gimage;
|
||||
GimpLayer *active_layer;
|
||||
GimpLayer *new_layer;
|
||||
|
||||
gimage = (GimpImage *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
active_layer = gimp_image_get_active_layer (gimage);
|
||||
new_layer = gimp_layer_copy (active_layer, TRUE);
|
||||
|
@ -214,17 +196,24 @@ layers_duplicate_cmd_callback (GtkWidget *widget,
|
|||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
void
|
||||
layers_anchor_cmd_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
floating_sel_anchor (gimp_image_get_active_layer (gimage));
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
void
|
||||
layers_delete_cmd_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpLayer *layer;
|
||||
|
||||
gimage = (GimpImage *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
layer = gimp_image_get_active_layer (gimage);
|
||||
|
||||
|
@ -239,16 +228,97 @@ layers_delete_cmd_callback (GtkWidget *widget,
|
|||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
void
|
||||
layers_desaturate_cmd_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpDrawable *drawable;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
drawable = gimp_image_active_drawable (gimage);
|
||||
|
||||
if (! gimp_drawable_is_rgb (drawable))
|
||||
{
|
||||
g_message (_("Desaturate operates only on RGB color drawables."));
|
||||
return;
|
||||
}
|
||||
|
||||
gimp_drawable_desaturate (drawable);
|
||||
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
void
|
||||
layers_invert_cmd_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpDrawable *drawable;
|
||||
Argument *return_vals;
|
||||
gint nreturn_vals;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
drawable = gimp_image_active_drawable (gimage);
|
||||
|
||||
if (gimp_drawable_is_indexed (drawable))
|
||||
{
|
||||
g_message (_("Invert does not operate on indexed drawables."));
|
||||
return;
|
||||
}
|
||||
|
||||
return_vals =
|
||||
procedural_db_run_proc (gimage->gimp,
|
||||
"gimp_invert",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, gimp_drawable_get_ID (drawable),
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (!return_vals || return_vals[0].value.pdb_int != GIMP_PDB_SUCCESS)
|
||||
g_message (_("Invert operation failed."));
|
||||
|
||||
procedural_db_destroy_args (return_vals, nreturn_vals);
|
||||
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
void
|
||||
layers_equalize_cmd_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpDrawable *drawable;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
drawable = gimp_image_active_drawable (gimage);
|
||||
|
||||
if (gimp_drawable_is_indexed (drawable))
|
||||
{
|
||||
g_message (_("Equalize does not operate on indexed drawables."));
|
||||
return;
|
||||
}
|
||||
|
||||
gimp_drawable_equalize (drawable, TRUE);
|
||||
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
void
|
||||
layers_offset_cmd_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
offset_dialog_create (gimp_image_active_drawable (gimage));
|
||||
}
|
||||
|
||||
void
|
||||
layers_scale_cmd_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
|
||||
gimage = (GimpImage *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
layers_scale_layer_query (gimage, gimp_image_get_active_layer (gimage));
|
||||
}
|
||||
|
@ -258,11 +328,7 @@ layers_resize_cmd_callback (GtkWidget *widget,
|
|||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
|
||||
gimage = (GimpImage *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
layers_resize_layer_query (gimage, gimp_image_get_active_layer (gimage));
|
||||
}
|
||||
|
@ -272,11 +338,7 @@ layers_resize_to_image_cmd_callback (GtkWidget *widget,
|
|||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
|
||||
gimage = (GimpImage *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
gimp_layer_resize_to_image (gimp_image_get_active_layer (gimage));
|
||||
|
||||
|
@ -288,11 +350,7 @@ layers_add_layer_mask_cmd_callback (GtkWidget *widget,
|
|||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
|
||||
gimage = (GimpImage *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
layers_add_mask_query (gimp_image_get_active_layer (gimage));
|
||||
}
|
||||
|
@ -303,11 +361,7 @@ layers_apply_layer_mask_cmd_callback (GtkWidget *widget,
|
|||
{
|
||||
GimpImage *gimage;
|
||||
GimpLayer *layer;
|
||||
|
||||
gimage = (GimpImage *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
layer = gimp_image_get_active_layer (gimage);
|
||||
|
||||
|
@ -329,11 +383,7 @@ layers_delete_layer_mask_cmd_callback (GtkWidget *widget,
|
|||
{
|
||||
GimpImage *gimage;
|
||||
GimpLayer *layer;
|
||||
|
||||
gimage = (GimpImage *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
layer = gimp_image_get_active_layer (gimage);
|
||||
|
||||
|
@ -349,31 +399,12 @@ layers_delete_layer_mask_cmd_callback (GtkWidget *widget,
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
layers_anchor_cmd_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
|
||||
gimage = (GimpImage *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
|
||||
floating_sel_anchor (gimp_image_get_active_layer (gimage));
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
void
|
||||
layers_merge_layers_cmd_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
|
||||
gimage = (GimpImage *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
layers_layer_merge_query (gimage, TRUE);
|
||||
}
|
||||
|
@ -383,12 +414,8 @@ layers_merge_down_cmd_callback (GtkWidget *widget,
|
|||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
gimage = (GimpImage *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
|
||||
gimp_image_merge_down (gimage, gimp_image_get_active_layer (gimage),
|
||||
EXPAND_AS_NECESSARY);
|
||||
gdisplays_flush ();
|
||||
|
@ -399,11 +426,7 @@ layers_flatten_image_cmd_callback (GtkWidget *widget,
|
|||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
|
||||
gimage = (GimpImage *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
gimp_image_flatten (gimage);
|
||||
gdisplays_flush ();
|
||||
|
@ -414,11 +437,7 @@ layers_alpha_select_cmd_callback (GtkWidget *widget,
|
|||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
|
||||
gimage = (GimpImage *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
gimp_image_mask_layer_alpha (gimage, gimp_image_get_active_layer (gimage));
|
||||
gdisplays_flush ();
|
||||
|
@ -429,11 +448,7 @@ layers_mask_select_cmd_callback (GtkWidget *widget,
|
|||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
|
||||
gimage = (GimpImage *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
gimp_image_mask_layer_mask (gimage, gimp_image_get_active_layer (gimage));
|
||||
gdisplays_flush ();
|
||||
|
@ -445,11 +460,7 @@ layers_add_alpha_channel_cmd_callback (GtkWidget *widget,
|
|||
{
|
||||
GimpImage *gimage;
|
||||
GimpLayer *layer;
|
||||
|
||||
gimage = (GimpImage *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
layer = gimp_image_get_active_layer (gimage);
|
||||
|
||||
|
@ -466,11 +477,7 @@ layers_edit_attributes_cmd_callback (GtkWidget *widget,
|
|||
{
|
||||
GimpImage *gimage;
|
||||
GimpLayer *layer;
|
||||
|
||||
gimage = (GimpImage *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! gimage)
|
||||
return;
|
||||
return_if_no_image (gimage);
|
||||
|
||||
layer = gimp_image_get_active_layer (gimage);
|
||||
|
||||
|
@ -1275,15 +1282,12 @@ layers_menu_update (GtkItemFactory *factory,
|
|||
|
||||
SET_SENSITIVE ("/New Layer...", gimage);
|
||||
|
||||
SET_SENSITIVE ("/Stack/Raise Layer",
|
||||
!fs && !ac && gimage && lp && alpha && prev);
|
||||
SET_SENSITIVE ("/Raise Layer", !fs && !ac && gimage && lp && alpha && prev);
|
||||
SET_SENSITIVE ("/Layer to Top", !fs && !ac && gimage && lp && alpha && prev);
|
||||
|
||||
SET_SENSITIVE ("/Stack/Lower Layer",
|
||||
!fs && !ac && gimage && lp && next && next_alpha);
|
||||
|
||||
SET_SENSITIVE ("/Stack/Layer to Top",
|
||||
!fs && !ac && gimage && lp && alpha && prev);
|
||||
SET_SENSITIVE ("/Stack/Layer to Bottom",
|
||||
SET_SENSITIVE ("/Lower Layer",
|
||||
!fs && !ac && gimage && lp && next && next_alpha);
|
||||
SET_SENSITIVE ("/Layer to Bottom",
|
||||
!fs && !ac && gimage && lp && next && next_alpha);
|
||||
|
||||
SET_SENSITIVE ("/Duplicate Layer", !fs && !ac && gimage && lp);
|
||||
|
|
|
@ -32,32 +32,46 @@ void layers_raise_to_top_cmd_callback (GtkWidget *widet,
|
|||
gpointer data);
|
||||
void layers_lower_to_bottom_cmd_callback (GtkWidget *widet,
|
||||
gpointer data);
|
||||
|
||||
void layers_new_cmd_callback (GtkWidget *widet,
|
||||
gpointer data);
|
||||
void layers_duplicate_cmd_callback (GtkWidget *widet,
|
||||
gpointer data);
|
||||
void layers_anchor_cmd_callback (GtkWidget *widet,
|
||||
gpointer data);
|
||||
void layers_delete_cmd_callback (GtkWidget *widet,
|
||||
gpointer data);
|
||||
|
||||
void layers_desaturate_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void layers_invert_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void layers_equalize_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
|
||||
void layers_offset_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void layers_scale_cmd_callback (GtkWidget *widet,
|
||||
gpointer data);
|
||||
void layers_resize_cmd_callback (GtkWidget *widet,
|
||||
gpointer data);
|
||||
void layers_resize_to_image_cmd_callback (GtkWidget *widet,
|
||||
gpointer data);
|
||||
|
||||
void layers_add_layer_mask_cmd_callback (GtkWidget *widet,
|
||||
gpointer data);
|
||||
void layers_apply_layer_mask_cmd_callback (GtkWidget *widet,
|
||||
gpointer data);
|
||||
void layers_delete_layer_mask_cmd_callback (GtkWidget *widet,
|
||||
gpointer data);
|
||||
void layers_anchor_cmd_callback (GtkWidget *widet,
|
||||
gpointer data);
|
||||
|
||||
void layers_merge_layers_cmd_callback (GtkWidget *widet,
|
||||
gpointer data);
|
||||
void layers_merge_down_cmd_callback (GtkWidget *widet,
|
||||
gpointer data);
|
||||
void layers_flatten_image_cmd_callback (GtkWidget *widet,
|
||||
gpointer data);
|
||||
|
||||
void layers_alpha_select_cmd_callback (GtkWidget *widet,
|
||||
gpointer data);
|
||||
void layers_mask_select_cmd_callback (GtkWidget *widet,
|
||||
|
|
215
app/gui/menus.c
215
app/gui/menus.c
|
@ -316,6 +316,9 @@ static GimpItemFactoryEntry image_entries[] =
|
|||
"<StockItem>", GTK_STOCK_OPEN },
|
||||
NULL,
|
||||
"file/dialogs/file_open.html", NULL },
|
||||
|
||||
SEPARATOR ("/File/---"),
|
||||
|
||||
{ { N_("/File/Save"), "<control>S",
|
||||
file_save_cmd_callback, 0,
|
||||
"<StockItem>", GTK_STOCK_SAVE },
|
||||
|
@ -631,45 +634,11 @@ static GimpItemFactoryEntry image_entries[] =
|
|||
|
||||
SEPARATOR ("/Image/Mode/---"),
|
||||
|
||||
/* <Image>/Image/Colors */
|
||||
/* <Image>/Image/Transform */
|
||||
|
||||
{ { N_("/Image/Colors/Desaturate"), NULL,
|
||||
image_desaturate_cmd_callback, 0 },
|
||||
NULL,
|
||||
"image/colors/desaturate.html", NULL },
|
||||
{ { N_("/Image/Colors/Invert"), NULL,
|
||||
image_invert_cmd_callback, 0 },
|
||||
NULL,
|
||||
"image/colors/invert.html", NULL },
|
||||
BRANCH (N_("/Image/Transform")),
|
||||
|
||||
SEPARATOR ("/Image/Colors/---"),
|
||||
|
||||
/* <Image>/Image/Colors/Auto */
|
||||
|
||||
{ { N_("/Image/Colors/Auto/Equalize"), NULL,
|
||||
image_equalize_cmd_callback, 0 },
|
||||
NULL,
|
||||
"image/colors/auto/equalize.html", NULL },
|
||||
|
||||
SEPARATOR ("/Image/Colors/---"),
|
||||
|
||||
/* <Image>/Image/Alpha */
|
||||
|
||||
{ { N_("/Image/Alpha/Add Alpha Channel"), NULL,
|
||||
layers_add_alpha_channel_cmd_callback, 0 },
|
||||
NULL,
|
||||
"layers/add_alpha_channel.html", NULL },
|
||||
|
||||
/* <Image>/Image/Transforms */
|
||||
|
||||
{ { N_("/Image/Transforms/Offset..."), "<control><shift>O",
|
||||
image_offset_cmd_callback, 0 },
|
||||
NULL,
|
||||
"image/transforms/dialogs/offset.html", NULL },
|
||||
|
||||
BRANCH (N_("/Image/Transforms/Rotate")),
|
||||
|
||||
SEPARATOR ("/Image/Transforms/---"),
|
||||
SEPARATOR ("/Image/Transform/---"),
|
||||
|
||||
SEPARATOR ("/Image/---"),
|
||||
|
||||
|
@ -690,101 +659,159 @@ static GimpItemFactoryEntry image_entries[] =
|
|||
|
||||
SEPARATOR ("/Image/---"),
|
||||
|
||||
/* <Image>/Layers */
|
||||
/* <Image>/Layer */
|
||||
|
||||
{ { N_("/Layers/Layers, Channels & Paths..."), "<control>L",
|
||||
dialogs_create_lc_cmd_callback, 0 },
|
||||
NULL,
|
||||
"dialogs/layers_and_channels.html", NULL },
|
||||
/* <Image>/Layer/Stack */
|
||||
|
||||
SEPARATOR ("/Layers/---"),
|
||||
|
||||
/* <Image>/Layers/Stack */
|
||||
|
||||
{ { N_("/Layers/Stack/Previous Layer"), "Prior",
|
||||
{ { N_("/Layer/Stack/Previous Layer"), "Prior",
|
||||
layers_previous_cmd_callback, 0 },
|
||||
NULL,
|
||||
"layers/stack/stack.html#previous_layer", NULL },
|
||||
{ { N_("/Layers/Stack/Next Layer"), "Next",
|
||||
{ { N_("/Layer/Stack/Next Layer"), "Next",
|
||||
layers_next_cmd_callback, 0 },
|
||||
NULL,
|
||||
"layers/stack/stack.html#next_layer", NULL },
|
||||
{ { N_("/Layers/Stack/Raise Layer"), "<shift>Prior",
|
||||
{ { N_("/Layer/Stack/Raise Layer"), "<shift>Prior",
|
||||
layers_raise_cmd_callback, 0,
|
||||
"<StockItem>", GIMP_STOCK_RAISE },
|
||||
NULL,
|
||||
"layers/stack/stack.html#raise_layer", NULL },
|
||||
{ { N_("/Layers/Stack/Lower Layer"), "<shift>Next",
|
||||
{ { N_("/Layer/Stack/Lower Layer"), "<shift>Next",
|
||||
layers_lower_cmd_callback, 0,
|
||||
"<StockItem>", GIMP_STOCK_LOWER },
|
||||
NULL,
|
||||
"layers/stack/stack.html#lower_layer", NULL },
|
||||
{ { N_("/Layers/Stack/Layer to Top"), "<control>Prior",
|
||||
{ { N_("/Layer/Stack/Layer to Top"), "<control>Prior",
|
||||
layers_raise_to_top_cmd_callback, 0,
|
||||
"<StockItem>", GIMP_STOCK_RAISE },
|
||||
NULL,
|
||||
"layers/stack/stack.html#layer_to_top", NULL },
|
||||
{ { N_("/Layers/Stack/Layer to Bottom"), "<control>Next",
|
||||
{ { N_("/Layer/Stack/Layer to Bottom"), "<control>Next",
|
||||
layers_lower_to_bottom_cmd_callback, 0,
|
||||
"<StockItem>", GIMP_STOCK_LOWER },
|
||||
NULL,
|
||||
"layers/stack/stack.html#layer_to_bottom", NULL },
|
||||
|
||||
SEPARATOR ("/Layers/Stack/---"),
|
||||
SEPARATOR ("/Layer/Stack/---"),
|
||||
|
||||
/* <Image>/Layers/Rotate */
|
||||
|
||||
BRANCH (N_("/Layers/Rotate")),
|
||||
|
||||
SEPARATOR ("/Layers/---"),
|
||||
|
||||
{ { N_("/Layers/Anchor Layer"), "<control>H",
|
||||
{ { N_("/Layer/New Layer..."), NULL,
|
||||
layers_new_cmd_callback, 0,
|
||||
"<StockItem>", GIMP_STOCK_NEW },
|
||||
NULL,
|
||||
"layers/dialogs/new_layer.html", NULL },
|
||||
{ { N_("/Layer/Duplicate Layer"), NULL,
|
||||
layers_duplicate_cmd_callback, 0,
|
||||
"<StockItem>", GIMP_STOCK_DUPLICATE },
|
||||
NULL,
|
||||
"layers/duplicate_layer.html", NULL },
|
||||
{ { N_("/Layer/Anchor Layer"), "<control>H",
|
||||
layers_anchor_cmd_callback, 0,
|
||||
"<StockItem>", GIMP_STOCK_ANCHOR },
|
||||
NULL,
|
||||
"layers/anchor_layer.html", NULL },
|
||||
{ { N_("/Layer/Delete Layer"), NULL,
|
||||
layers_delete_cmd_callback, 0,
|
||||
"<StockItem>", GIMP_STOCK_DELETE },
|
||||
NULL,
|
||||
"layers/delete_layer.html", NULL },
|
||||
|
||||
SEPARATOR ("/Layers/---"),
|
||||
SEPARATOR ("/Layer/---"),
|
||||
|
||||
{ { N_("/Layers/Layer to Imagesize"), NULL,
|
||||
{ { N_("/Layer/Layer Boundary Size..."), NULL,
|
||||
layers_resize_cmd_callback, 0 },
|
||||
NULL,
|
||||
"layers/dialogs/layer_boundary_size.html", NULL },
|
||||
{ { N_("/Layer/Scale Layer..."), NULL,
|
||||
layers_scale_cmd_callback, 0,
|
||||
"<StockItem>", GIMP_STOCK_TOOL_SCALE },
|
||||
NULL,
|
||||
"layers/dialogs/scale_layer.html", NULL },
|
||||
{ { N_("/Layer/Layer to Imagesize"), NULL,
|
||||
layers_resize_to_image_cmd_callback, 0 },
|
||||
NULL,
|
||||
"layers/layer_to_image_size.html", NULL },
|
||||
|
||||
SEPARATOR ("/Layers/---"),
|
||||
/* <Image>/Layer/Transform */
|
||||
|
||||
{ { N_("/Layers/Merge Visible Layers..."), "<control>M",
|
||||
SEPARATOR ("/Layer/Transform/---"),
|
||||
|
||||
{ { N_("/Layer/Transform/Offset..."), "<control><shift>O",
|
||||
layers_offset_cmd_callback, 0 },
|
||||
NULL,
|
||||
"layers/dialogs/offset.html", NULL },
|
||||
|
||||
SEPARATOR ("/Layer/---"),
|
||||
|
||||
{ { N_("/Layer/Merge Visible Layers..."), "<control>M",
|
||||
layers_merge_layers_cmd_callback, 0 },
|
||||
NULL,
|
||||
"layers/dialogs/merge_visible_layers.html", NULL },
|
||||
{ { N_("/Layers/Merge Down"), "<control><shift>M",
|
||||
{ { N_("/Layer/Merge Down"), "<control><shift>M",
|
||||
layers_merge_down_cmd_callback, 0 },
|
||||
NULL,
|
||||
"layers/merge_visible_layers.html", NULL },
|
||||
{ { N_("/Layers/Flatten Image"), NULL,
|
||||
{ { N_("/Layer/Flatten Image"), NULL,
|
||||
layers_flatten_image_cmd_callback, 0 },
|
||||
NULL,
|
||||
"layers/flatten_image.html", NULL },
|
||||
|
||||
SEPARATOR ("/Layers/---"),
|
||||
SEPARATOR ("/Layer/---"),
|
||||
|
||||
{ { N_("/Layers/Mask to Selection"), NULL,
|
||||
/* <Image>/Layer/Colors */
|
||||
|
||||
{ { N_("/Layer/Colors/Desaturate"), NULL,
|
||||
layers_desaturate_cmd_callback, 0 },
|
||||
NULL,
|
||||
"layers/colors/desaturate.html", NULL },
|
||||
{ { N_("/Layer/Colors/Invert"), NULL,
|
||||
layers_invert_cmd_callback, 0 },
|
||||
NULL,
|
||||
"layers/colors/invert.html", NULL },
|
||||
|
||||
SEPARATOR ("/Layer/Colors/---"),
|
||||
|
||||
/* <Image>/Layer/Colors/Auto */
|
||||
|
||||
{ { N_("/Layer/Colors/Auto/Equalize"), NULL,
|
||||
layers_equalize_cmd_callback, 0 },
|
||||
NULL,
|
||||
"layers/colors/auto/equalize.html", NULL },
|
||||
|
||||
SEPARATOR ("/Layer/Colors/---"),
|
||||
|
||||
/* <Image>/Layer/Mask */
|
||||
|
||||
{ { N_("/Layer/Mask/Add Layer Mask..."), NULL,
|
||||
layers_add_layer_mask_cmd_callback, 0 },
|
||||
NULL,
|
||||
"layers/dialogs/add_layer_mask.html", NULL },
|
||||
{ { N_("/Layer/Mask/Apply Layer Mask"), NULL,
|
||||
layers_apply_layer_mask_cmd_callback, 0 },
|
||||
NULL,
|
||||
"layers/apply_mask.html", NULL },
|
||||
{ { N_("/Layer/Mask/Delete Layer Mask"), NULL,
|
||||
layers_delete_layer_mask_cmd_callback, 0 },
|
||||
NULL,
|
||||
"layers/delete_mask.html", NULL },
|
||||
{ { N_("/Layer/Mask/Mask to Selection"), NULL,
|
||||
layers_mask_select_cmd_callback, 0 },
|
||||
NULL,
|
||||
"layers/mask_to_selection.html", NULL },
|
||||
|
||||
SEPARATOR ("/Layers/---"),
|
||||
/* <Image>/Layer/Alpha */
|
||||
|
||||
{ { N_("/Layers/Add Alpha Channel"), NULL,
|
||||
{ { N_("/Layer/Alpha/Add Alpha Channel"), NULL,
|
||||
layers_add_alpha_channel_cmd_callback, 0 },
|
||||
NULL,
|
||||
"layers/add_alpha_channel.html", NULL },
|
||||
{ { N_("/Layers/Alpha to Selection"), NULL,
|
||||
{ { N_("/Layer/Alpha/Alpha to Selection"), NULL,
|
||||
layers_alpha_select_cmd_callback, 0 },
|
||||
NULL,
|
||||
"layers/alpha_to_selection.html", NULL },
|
||||
|
||||
SEPARATOR ("/Layers/---"),
|
||||
SEPARATOR ("/Layer/Alpha/---"),
|
||||
|
||||
SEPARATOR ("/Layer/---"),
|
||||
|
||||
/* <Image>/Tools */
|
||||
|
||||
|
@ -856,7 +883,7 @@ static GimpItemFactoryEntry image_entries[] =
|
|||
NULL, NULL },
|
||||
{ { N_("/Dialogs/Images..."), NULL,
|
||||
dialogs_create_dockable_cmd_callback, 0 },
|
||||
"gimp:buffer-list",
|
||||
"gimp:image-list",
|
||||
NULL, NULL },
|
||||
|
||||
SEPARATOR ("/Dialogs/---"),
|
||||
|
@ -973,24 +1000,22 @@ static GimpItemFactoryEntry layers_entries[] =
|
|||
NULL,
|
||||
"dialogs/new_layer.html", NULL },
|
||||
|
||||
/* <Layers>/Stack */
|
||||
|
||||
{ { N_("/Stack/Raise Layer"), "<control>F",
|
||||
{ { N_("/Raise Layer"), "<control>F",
|
||||
layers_raise_cmd_callback, 0,
|
||||
"<StockItem>", GIMP_STOCK_RAISE },
|
||||
NULL,
|
||||
"stack/stack.html#raise_layer", NULL },
|
||||
{ { N_("/Stack/Lower Layer"), "<control>B",
|
||||
layers_lower_cmd_callback, 0,
|
||||
"<StockItem>", GIMP_STOCK_LOWER },
|
||||
NULL,
|
||||
"stack/stack.html#lower_layer", NULL },
|
||||
{ { N_("/Stack/Layer to Top"), "<control><shift>F",
|
||||
{ { N_("/Layer to Top"), "<control><shift>F",
|
||||
layers_raise_to_top_cmd_callback, 0,
|
||||
"<StockItem>", GIMP_STOCK_RAISE },
|
||||
NULL,
|
||||
"stack/stack.html#later_to_top", NULL },
|
||||
{ { N_("/Stack/Layer to Bottom"), "<control><shift>B",
|
||||
{ { N_("/Lower Layer"), "<control>B",
|
||||
layers_lower_cmd_callback, 0,
|
||||
"<StockItem>", GIMP_STOCK_LOWER },
|
||||
NULL,
|
||||
"stack/stack.html#lower_layer", NULL },
|
||||
{ { N_("/Layer to Bottom"), "<control><shift>B",
|
||||
layers_lower_to_bottom_cmd_callback, 0,
|
||||
"<StockItem>", GIMP_STOCK_LOWER },
|
||||
NULL,
|
||||
|
@ -1018,15 +1043,15 @@ static GimpItemFactoryEntry layers_entries[] =
|
|||
layers_resize_cmd_callback, 0 },
|
||||
NULL,
|
||||
"dialogs/layer_boundary_size.html", NULL },
|
||||
{ { N_("/Layer to Imagesize"), NULL,
|
||||
layers_resize_to_image_cmd_callback, 0 },
|
||||
NULL,
|
||||
"layer_to_image_size.html", NULL },
|
||||
{ { N_("/Scale Layer..."), "<control>S",
|
||||
layers_scale_cmd_callback, 0,
|
||||
"<StockItem>", GIMP_STOCK_TOOL_SCALE },
|
||||
NULL,
|
||||
"dialogs/scale_layer.html", NULL },
|
||||
{ { N_("/Layer to Imagesize"), NULL,
|
||||
layers_resize_to_image_cmd_callback, 0 },
|
||||
NULL,
|
||||
"layer_to_image_size.html", NULL },
|
||||
|
||||
SEPARATOR ("/---"),
|
||||
|
||||
|
@ -2176,9 +2201,9 @@ menus_exit (Gimp *gimp)
|
|||
void
|
||||
menus_restore (Gimp *gimp)
|
||||
{
|
||||
static gchar *rotate_plugins[] = { "90 degrees",
|
||||
"180 degrees",
|
||||
"270 degrees" };
|
||||
static gchar *rotate_plugins[] = { "Rotate 90 degrees",
|
||||
"Rotate 180 degrees",
|
||||
"Rotate 270 degrees" };
|
||||
static gchar *image_file_entries[] = { "---moved",
|
||||
"Close",
|
||||
"Quit" };
|
||||
|
@ -2249,10 +2274,10 @@ menus_restore (Gimp *gimp)
|
|||
}
|
||||
|
||||
/* Reorder Rotate plugin menu entries */
|
||||
pos = 2;
|
||||
pos = 1;
|
||||
for (i = 0; i < G_N_ELEMENTS (rotate_plugins); i++)
|
||||
{
|
||||
path = g_strconcat ("/Image/Transforms/Rotate/", rotate_plugins[i], NULL);
|
||||
path = g_strconcat ("/Image/Transform/", rotate_plugins[i], NULL);
|
||||
menu_item = gtk_item_factory_get_widget (image_factory, path);
|
||||
g_free (path);
|
||||
|
||||
|
@ -2263,10 +2288,10 @@ menus_restore (Gimp *gimp)
|
|||
}
|
||||
}
|
||||
|
||||
pos = 2;
|
||||
pos = 1;
|
||||
for (i = 0; i < G_N_ELEMENTS (rotate_plugins); i++)
|
||||
{
|
||||
path = g_strconcat ("/Layers/Rotate/", rotate_plugins[i], NULL);
|
||||
path = g_strconcat ("/Layer/Transform/", rotate_plugins[i], NULL);
|
||||
menu_item = gtk_item_factory_get_widget (image_factory, path);
|
||||
g_free (path);
|
||||
|
||||
|
@ -2285,7 +2310,7 @@ menus_restore (Gimp *gimp)
|
|||
g_free (path);
|
||||
|
||||
if (menu_item && menu_item->parent)
|
||||
gtk_menu_reorder_child (GTK_MENU (menu_item->parent), menu_item, -1);
|
||||
gtk_menu_reorder_child (GTK_MENU (menu_item->parent), menu_item, -1);
|
||||
}
|
||||
|
||||
/* Reorder menus where plugins registered submenus */
|
||||
|
|
|
@ -31,6 +31,8 @@
|
|||
|
||||
#include "display/gimpdisplay-foreach.h"
|
||||
|
||||
#include "offset-dialog.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#define __OFFSET_DIALOG_H__
|
||||
|
||||
|
||||
void offset_dialog_create (GimpImage *gimage);
|
||||
void offset_dialog_create (GimpDrawable *drawable);
|
||||
|
||||
|
||||
#endif /* __OFFSET_DIALOG_H__ */
|
||||
|
|
|
@ -990,11 +990,15 @@ prefs_toggle_callback (GtkWidget *widget,
|
|||
Gimp *gimp;
|
||||
gint *val;
|
||||
|
||||
dialog = gtk_widget_get_toplevel (widget);
|
||||
|
||||
if (GTK_IS_MENU_SHELL (dialog))
|
||||
dialog =
|
||||
gtk_widget_get_toplevel (gtk_menu_get_attach_widget (GTK_MENU (dialog)));
|
||||
if (GTK_IS_MENU_ITEM (widget))
|
||||
{
|
||||
dialog =
|
||||
gtk_widget_get_toplevel (gtk_menu_get_attach_widget (GTK_MENU (widget->parent)));
|
||||
}
|
||||
else
|
||||
{
|
||||
dialog = gtk_widget_get_toplevel (widget);
|
||||
}
|
||||
|
||||
gimp = GIMP (g_object_get_data (G_OBJECT (dialog), "gimp"));
|
||||
|
||||
|
|
|
@ -316,6 +316,9 @@ static GimpItemFactoryEntry image_entries[] =
|
|||
"<StockItem>", GTK_STOCK_OPEN },
|
||||
NULL,
|
||||
"file/dialogs/file_open.html", NULL },
|
||||
|
||||
SEPARATOR ("/File/---"),
|
||||
|
||||
{ { N_("/File/Save"), "<control>S",
|
||||
file_save_cmd_callback, 0,
|
||||
"<StockItem>", GTK_STOCK_SAVE },
|
||||
|
@ -631,45 +634,11 @@ static GimpItemFactoryEntry image_entries[] =
|
|||
|
||||
SEPARATOR ("/Image/Mode/---"),
|
||||
|
||||
/* <Image>/Image/Colors */
|
||||
/* <Image>/Image/Transform */
|
||||
|
||||
{ { N_("/Image/Colors/Desaturate"), NULL,
|
||||
image_desaturate_cmd_callback, 0 },
|
||||
NULL,
|
||||
"image/colors/desaturate.html", NULL },
|
||||
{ { N_("/Image/Colors/Invert"), NULL,
|
||||
image_invert_cmd_callback, 0 },
|
||||
NULL,
|
||||
"image/colors/invert.html", NULL },
|
||||
BRANCH (N_("/Image/Transform")),
|
||||
|
||||
SEPARATOR ("/Image/Colors/---"),
|
||||
|
||||
/* <Image>/Image/Colors/Auto */
|
||||
|
||||
{ { N_("/Image/Colors/Auto/Equalize"), NULL,
|
||||
image_equalize_cmd_callback, 0 },
|
||||
NULL,
|
||||
"image/colors/auto/equalize.html", NULL },
|
||||
|
||||
SEPARATOR ("/Image/Colors/---"),
|
||||
|
||||
/* <Image>/Image/Alpha */
|
||||
|
||||
{ { N_("/Image/Alpha/Add Alpha Channel"), NULL,
|
||||
layers_add_alpha_channel_cmd_callback, 0 },
|
||||
NULL,
|
||||
"layers/add_alpha_channel.html", NULL },
|
||||
|
||||
/* <Image>/Image/Transforms */
|
||||
|
||||
{ { N_("/Image/Transforms/Offset..."), "<control><shift>O",
|
||||
image_offset_cmd_callback, 0 },
|
||||
NULL,
|
||||
"image/transforms/dialogs/offset.html", NULL },
|
||||
|
||||
BRANCH (N_("/Image/Transforms/Rotate")),
|
||||
|
||||
SEPARATOR ("/Image/Transforms/---"),
|
||||
SEPARATOR ("/Image/Transform/---"),
|
||||
|
||||
SEPARATOR ("/Image/---"),
|
||||
|
||||
|
@ -690,101 +659,159 @@ static GimpItemFactoryEntry image_entries[] =
|
|||
|
||||
SEPARATOR ("/Image/---"),
|
||||
|
||||
/* <Image>/Layers */
|
||||
/* <Image>/Layer */
|
||||
|
||||
{ { N_("/Layers/Layers, Channels & Paths..."), "<control>L",
|
||||
dialogs_create_lc_cmd_callback, 0 },
|
||||
NULL,
|
||||
"dialogs/layers_and_channels.html", NULL },
|
||||
/* <Image>/Layer/Stack */
|
||||
|
||||
SEPARATOR ("/Layers/---"),
|
||||
|
||||
/* <Image>/Layers/Stack */
|
||||
|
||||
{ { N_("/Layers/Stack/Previous Layer"), "Prior",
|
||||
{ { N_("/Layer/Stack/Previous Layer"), "Prior",
|
||||
layers_previous_cmd_callback, 0 },
|
||||
NULL,
|
||||
"layers/stack/stack.html#previous_layer", NULL },
|
||||
{ { N_("/Layers/Stack/Next Layer"), "Next",
|
||||
{ { N_("/Layer/Stack/Next Layer"), "Next",
|
||||
layers_next_cmd_callback, 0 },
|
||||
NULL,
|
||||
"layers/stack/stack.html#next_layer", NULL },
|
||||
{ { N_("/Layers/Stack/Raise Layer"), "<shift>Prior",
|
||||
{ { N_("/Layer/Stack/Raise Layer"), "<shift>Prior",
|
||||
layers_raise_cmd_callback, 0,
|
||||
"<StockItem>", GIMP_STOCK_RAISE },
|
||||
NULL,
|
||||
"layers/stack/stack.html#raise_layer", NULL },
|
||||
{ { N_("/Layers/Stack/Lower Layer"), "<shift>Next",
|
||||
{ { N_("/Layer/Stack/Lower Layer"), "<shift>Next",
|
||||
layers_lower_cmd_callback, 0,
|
||||
"<StockItem>", GIMP_STOCK_LOWER },
|
||||
NULL,
|
||||
"layers/stack/stack.html#lower_layer", NULL },
|
||||
{ { N_("/Layers/Stack/Layer to Top"), "<control>Prior",
|
||||
{ { N_("/Layer/Stack/Layer to Top"), "<control>Prior",
|
||||
layers_raise_to_top_cmd_callback, 0,
|
||||
"<StockItem>", GIMP_STOCK_RAISE },
|
||||
NULL,
|
||||
"layers/stack/stack.html#layer_to_top", NULL },
|
||||
{ { N_("/Layers/Stack/Layer to Bottom"), "<control>Next",
|
||||
{ { N_("/Layer/Stack/Layer to Bottom"), "<control>Next",
|
||||
layers_lower_to_bottom_cmd_callback, 0,
|
||||
"<StockItem>", GIMP_STOCK_LOWER },
|
||||
NULL,
|
||||
"layers/stack/stack.html#layer_to_bottom", NULL },
|
||||
|
||||
SEPARATOR ("/Layers/Stack/---"),
|
||||
SEPARATOR ("/Layer/Stack/---"),
|
||||
|
||||
/* <Image>/Layers/Rotate */
|
||||
|
||||
BRANCH (N_("/Layers/Rotate")),
|
||||
|
||||
SEPARATOR ("/Layers/---"),
|
||||
|
||||
{ { N_("/Layers/Anchor Layer"), "<control>H",
|
||||
{ { N_("/Layer/New Layer..."), NULL,
|
||||
layers_new_cmd_callback, 0,
|
||||
"<StockItem>", GIMP_STOCK_NEW },
|
||||
NULL,
|
||||
"layers/dialogs/new_layer.html", NULL },
|
||||
{ { N_("/Layer/Duplicate Layer"), NULL,
|
||||
layers_duplicate_cmd_callback, 0,
|
||||
"<StockItem>", GIMP_STOCK_DUPLICATE },
|
||||
NULL,
|
||||
"layers/duplicate_layer.html", NULL },
|
||||
{ { N_("/Layer/Anchor Layer"), "<control>H",
|
||||
layers_anchor_cmd_callback, 0,
|
||||
"<StockItem>", GIMP_STOCK_ANCHOR },
|
||||
NULL,
|
||||
"layers/anchor_layer.html", NULL },
|
||||
{ { N_("/Layer/Delete Layer"), NULL,
|
||||
layers_delete_cmd_callback, 0,
|
||||
"<StockItem>", GIMP_STOCK_DELETE },
|
||||
NULL,
|
||||
"layers/delete_layer.html", NULL },
|
||||
|
||||
SEPARATOR ("/Layers/---"),
|
||||
SEPARATOR ("/Layer/---"),
|
||||
|
||||
{ { N_("/Layers/Layer to Imagesize"), NULL,
|
||||
{ { N_("/Layer/Layer Boundary Size..."), NULL,
|
||||
layers_resize_cmd_callback, 0 },
|
||||
NULL,
|
||||
"layers/dialogs/layer_boundary_size.html", NULL },
|
||||
{ { N_("/Layer/Scale Layer..."), NULL,
|
||||
layers_scale_cmd_callback, 0,
|
||||
"<StockItem>", GIMP_STOCK_TOOL_SCALE },
|
||||
NULL,
|
||||
"layers/dialogs/scale_layer.html", NULL },
|
||||
{ { N_("/Layer/Layer to Imagesize"), NULL,
|
||||
layers_resize_to_image_cmd_callback, 0 },
|
||||
NULL,
|
||||
"layers/layer_to_image_size.html", NULL },
|
||||
|
||||
SEPARATOR ("/Layers/---"),
|
||||
/* <Image>/Layer/Transform */
|
||||
|
||||
{ { N_("/Layers/Merge Visible Layers..."), "<control>M",
|
||||
SEPARATOR ("/Layer/Transform/---"),
|
||||
|
||||
{ { N_("/Layer/Transform/Offset..."), "<control><shift>O",
|
||||
layers_offset_cmd_callback, 0 },
|
||||
NULL,
|
||||
"layers/dialogs/offset.html", NULL },
|
||||
|
||||
SEPARATOR ("/Layer/---"),
|
||||
|
||||
{ { N_("/Layer/Merge Visible Layers..."), "<control>M",
|
||||
layers_merge_layers_cmd_callback, 0 },
|
||||
NULL,
|
||||
"layers/dialogs/merge_visible_layers.html", NULL },
|
||||
{ { N_("/Layers/Merge Down"), "<control><shift>M",
|
||||
{ { N_("/Layer/Merge Down"), "<control><shift>M",
|
||||
layers_merge_down_cmd_callback, 0 },
|
||||
NULL,
|
||||
"layers/merge_visible_layers.html", NULL },
|
||||
{ { N_("/Layers/Flatten Image"), NULL,
|
||||
{ { N_("/Layer/Flatten Image"), NULL,
|
||||
layers_flatten_image_cmd_callback, 0 },
|
||||
NULL,
|
||||
"layers/flatten_image.html", NULL },
|
||||
|
||||
SEPARATOR ("/Layers/---"),
|
||||
SEPARATOR ("/Layer/---"),
|
||||
|
||||
{ { N_("/Layers/Mask to Selection"), NULL,
|
||||
/* <Image>/Layer/Colors */
|
||||
|
||||
{ { N_("/Layer/Colors/Desaturate"), NULL,
|
||||
layers_desaturate_cmd_callback, 0 },
|
||||
NULL,
|
||||
"layers/colors/desaturate.html", NULL },
|
||||
{ { N_("/Layer/Colors/Invert"), NULL,
|
||||
layers_invert_cmd_callback, 0 },
|
||||
NULL,
|
||||
"layers/colors/invert.html", NULL },
|
||||
|
||||
SEPARATOR ("/Layer/Colors/---"),
|
||||
|
||||
/* <Image>/Layer/Colors/Auto */
|
||||
|
||||
{ { N_("/Layer/Colors/Auto/Equalize"), NULL,
|
||||
layers_equalize_cmd_callback, 0 },
|
||||
NULL,
|
||||
"layers/colors/auto/equalize.html", NULL },
|
||||
|
||||
SEPARATOR ("/Layer/Colors/---"),
|
||||
|
||||
/* <Image>/Layer/Mask */
|
||||
|
||||
{ { N_("/Layer/Mask/Add Layer Mask..."), NULL,
|
||||
layers_add_layer_mask_cmd_callback, 0 },
|
||||
NULL,
|
||||
"layers/dialogs/add_layer_mask.html", NULL },
|
||||
{ { N_("/Layer/Mask/Apply Layer Mask"), NULL,
|
||||
layers_apply_layer_mask_cmd_callback, 0 },
|
||||
NULL,
|
||||
"layers/apply_mask.html", NULL },
|
||||
{ { N_("/Layer/Mask/Delete Layer Mask"), NULL,
|
||||
layers_delete_layer_mask_cmd_callback, 0 },
|
||||
NULL,
|
||||
"layers/delete_mask.html", NULL },
|
||||
{ { N_("/Layer/Mask/Mask to Selection"), NULL,
|
||||
layers_mask_select_cmd_callback, 0 },
|
||||
NULL,
|
||||
"layers/mask_to_selection.html", NULL },
|
||||
|
||||
SEPARATOR ("/Layers/---"),
|
||||
/* <Image>/Layer/Alpha */
|
||||
|
||||
{ { N_("/Layers/Add Alpha Channel"), NULL,
|
||||
{ { N_("/Layer/Alpha/Add Alpha Channel"), NULL,
|
||||
layers_add_alpha_channel_cmd_callback, 0 },
|
||||
NULL,
|
||||
"layers/add_alpha_channel.html", NULL },
|
||||
{ { N_("/Layers/Alpha to Selection"), NULL,
|
||||
{ { N_("/Layer/Alpha/Alpha to Selection"), NULL,
|
||||
layers_alpha_select_cmd_callback, 0 },
|
||||
NULL,
|
||||
"layers/alpha_to_selection.html", NULL },
|
||||
|
||||
SEPARATOR ("/Layers/---"),
|
||||
SEPARATOR ("/Layer/Alpha/---"),
|
||||
|
||||
SEPARATOR ("/Layer/---"),
|
||||
|
||||
/* <Image>/Tools */
|
||||
|
||||
|
@ -856,7 +883,7 @@ static GimpItemFactoryEntry image_entries[] =
|
|||
NULL, NULL },
|
||||
{ { N_("/Dialogs/Images..."), NULL,
|
||||
dialogs_create_dockable_cmd_callback, 0 },
|
||||
"gimp:buffer-list",
|
||||
"gimp:image-list",
|
||||
NULL, NULL },
|
||||
|
||||
SEPARATOR ("/Dialogs/---"),
|
||||
|
@ -973,24 +1000,22 @@ static GimpItemFactoryEntry layers_entries[] =
|
|||
NULL,
|
||||
"dialogs/new_layer.html", NULL },
|
||||
|
||||
/* <Layers>/Stack */
|
||||
|
||||
{ { N_("/Stack/Raise Layer"), "<control>F",
|
||||
{ { N_("/Raise Layer"), "<control>F",
|
||||
layers_raise_cmd_callback, 0,
|
||||
"<StockItem>", GIMP_STOCK_RAISE },
|
||||
NULL,
|
||||
"stack/stack.html#raise_layer", NULL },
|
||||
{ { N_("/Stack/Lower Layer"), "<control>B",
|
||||
layers_lower_cmd_callback, 0,
|
||||
"<StockItem>", GIMP_STOCK_LOWER },
|
||||
NULL,
|
||||
"stack/stack.html#lower_layer", NULL },
|
||||
{ { N_("/Stack/Layer to Top"), "<control><shift>F",
|
||||
{ { N_("/Layer to Top"), "<control><shift>F",
|
||||
layers_raise_to_top_cmd_callback, 0,
|
||||
"<StockItem>", GIMP_STOCK_RAISE },
|
||||
NULL,
|
||||
"stack/stack.html#later_to_top", NULL },
|
||||
{ { N_("/Stack/Layer to Bottom"), "<control><shift>B",
|
||||
{ { N_("/Lower Layer"), "<control>B",
|
||||
layers_lower_cmd_callback, 0,
|
||||
"<StockItem>", GIMP_STOCK_LOWER },
|
||||
NULL,
|
||||
"stack/stack.html#lower_layer", NULL },
|
||||
{ { N_("/Layer to Bottom"), "<control><shift>B",
|
||||
layers_lower_to_bottom_cmd_callback, 0,
|
||||
"<StockItem>", GIMP_STOCK_LOWER },
|
||||
NULL,
|
||||
|
@ -1018,15 +1043,15 @@ static GimpItemFactoryEntry layers_entries[] =
|
|||
layers_resize_cmd_callback, 0 },
|
||||
NULL,
|
||||
"dialogs/layer_boundary_size.html", NULL },
|
||||
{ { N_("/Layer to Imagesize"), NULL,
|
||||
layers_resize_to_image_cmd_callback, 0 },
|
||||
NULL,
|
||||
"layer_to_image_size.html", NULL },
|
||||
{ { N_("/Scale Layer..."), "<control>S",
|
||||
layers_scale_cmd_callback, 0,
|
||||
"<StockItem>", GIMP_STOCK_TOOL_SCALE },
|
||||
NULL,
|
||||
"dialogs/scale_layer.html", NULL },
|
||||
{ { N_("/Layer to Imagesize"), NULL,
|
||||
layers_resize_to_image_cmd_callback, 0 },
|
||||
NULL,
|
||||
"layer_to_image_size.html", NULL },
|
||||
|
||||
SEPARATOR ("/---"),
|
||||
|
||||
|
@ -2176,9 +2201,9 @@ menus_exit (Gimp *gimp)
|
|||
void
|
||||
menus_restore (Gimp *gimp)
|
||||
{
|
||||
static gchar *rotate_plugins[] = { "90 degrees",
|
||||
"180 degrees",
|
||||
"270 degrees" };
|
||||
static gchar *rotate_plugins[] = { "Rotate 90 degrees",
|
||||
"Rotate 180 degrees",
|
||||
"Rotate 270 degrees" };
|
||||
static gchar *image_file_entries[] = { "---moved",
|
||||
"Close",
|
||||
"Quit" };
|
||||
|
@ -2249,10 +2274,10 @@ menus_restore (Gimp *gimp)
|
|||
}
|
||||
|
||||
/* Reorder Rotate plugin menu entries */
|
||||
pos = 2;
|
||||
pos = 1;
|
||||
for (i = 0; i < G_N_ELEMENTS (rotate_plugins); i++)
|
||||
{
|
||||
path = g_strconcat ("/Image/Transforms/Rotate/", rotate_plugins[i], NULL);
|
||||
path = g_strconcat ("/Image/Transform/", rotate_plugins[i], NULL);
|
||||
menu_item = gtk_item_factory_get_widget (image_factory, path);
|
||||
g_free (path);
|
||||
|
||||
|
@ -2263,10 +2288,10 @@ menus_restore (Gimp *gimp)
|
|||
}
|
||||
}
|
||||
|
||||
pos = 2;
|
||||
pos = 1;
|
||||
for (i = 0; i < G_N_ELEMENTS (rotate_plugins); i++)
|
||||
{
|
||||
path = g_strconcat ("/Layers/Rotate/", rotate_plugins[i], NULL);
|
||||
path = g_strconcat ("/Layer/Transform/", rotate_plugins[i], NULL);
|
||||
menu_item = gtk_item_factory_get_widget (image_factory, path);
|
||||
g_free (path);
|
||||
|
||||
|
@ -2285,7 +2310,7 @@ menus_restore (Gimp *gimp)
|
|||
g_free (path);
|
||||
|
||||
if (menu_item && menu_item->parent)
|
||||
gtk_menu_reorder_child (GTK_MENU (menu_item->parent), menu_item, -1);
|
||||
gtk_menu_reorder_child (GTK_MENU (menu_item->parent), menu_item, -1);
|
||||
}
|
||||
|
||||
/* Reorder menus where plugins registered submenus */
|
||||
|
|
|
@ -44,7 +44,6 @@
|
|||
#include "gimpblendtool.h"
|
||||
#include "paint_options.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "gimpprogress.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
@ -764,12 +763,16 @@ blend_options_drop_gradient (GtkWidget *widget,
|
|||
GimpViewable *viewable,
|
||||
gpointer data)
|
||||
{
|
||||
BlendOptions *options;
|
||||
BlendOptions *options;
|
||||
GimpToolOptions *tool_options;
|
||||
GimpContext *context;
|
||||
|
||||
options = (BlendOptions *) data;
|
||||
options = (BlendOptions *) data;
|
||||
tool_options = (GimpToolOptions *) data;
|
||||
|
||||
gimp_context_set_gradient (gimp_get_user_context (the_gimp),
|
||||
GIMP_GRADIENT (viewable));
|
||||
context = gimp_get_user_context (tool_options->tool_info->gimp);
|
||||
|
||||
gimp_context_set_gradient (context, GIMP_GRADIENT (viewable));
|
||||
|
||||
gtk_option_menu_set_history (GTK_OPTION_MENU (options->blend_mode_w),
|
||||
CUSTOM_MODE);
|
||||
|
@ -781,6 +784,12 @@ blend_options_drop_tool (GtkWidget *widget,
|
|||
GimpViewable *viewable,
|
||||
gpointer data)
|
||||
{
|
||||
gimp_context_set_tool (gimp_get_user_context (the_gimp),
|
||||
GIMP_TOOL_INFO (viewable));
|
||||
GimpToolOptions *tool_options;
|
||||
GimpContext *context;
|
||||
|
||||
tool_options = (GimpToolOptions *) data;
|
||||
|
||||
context = gimp_get_user_context (tool_options->tool_info->gimp);
|
||||
|
||||
gimp_context_set_tool (context, GIMP_TOOL_INFO (viewable));
|
||||
}
|
||||
|
|
|
@ -123,7 +123,7 @@ gimp_brightness_contrast_tool_register (Gimp *gimp,
|
|||
"gimp:brightness_contrast_tool",
|
||||
_("Brightness-Contrast"),
|
||||
_("Adjust brightness and contrast"),
|
||||
N_("/Image/Colors/Brightness-Contrast..."), NULL,
|
||||
N_("/Layer/Colors/Brightness-Contrast..."), NULL,
|
||||
NULL, "tools/brightness_contrast.html",
|
||||
GIMP_STOCK_TOOL_BRIGHTNESS_CONTRAST);
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ gimp_color_balance_tool_register (Gimp *gimp,
|
|||
"gimp:color_balance_tool",
|
||||
_("Color Balance"),
|
||||
_("Adjust color balance"),
|
||||
N_("/Image/Colors/Color Balance..."), NULL,
|
||||
N_("/Layer/Colors/Color Balance..."), NULL,
|
||||
NULL, "tools/color_balance.html",
|
||||
GIMP_STOCK_TOOL_COLOR_BALANCE);
|
||||
}
|
||||
|
|
|
@ -208,7 +208,7 @@ gimp_curves_tool_register (Gimp *gimp,
|
|||
"gimp:curves_tool",
|
||||
_("Curves"),
|
||||
_("Adjust color curves"),
|
||||
N_("/Image/Colors/Curves..."), NULL,
|
||||
N_("/Layer/Colors/Curves..."), NULL,
|
||||
NULL, "tools/curves.html",
|
||||
GIMP_STOCK_TOOL_CURVES);
|
||||
}
|
||||
|
|
|
@ -121,7 +121,7 @@ gimp_histogram_tool_register (Gimp *gimp,
|
|||
"gimp:histogram_tool",
|
||||
_("Histogram"),
|
||||
_("View image histogram"),
|
||||
N_("/Image/Histogram..."), NULL,
|
||||
N_("/Layer/Colors/Histogram..."), NULL,
|
||||
NULL, "tools/histogram.html",
|
||||
GIMP_STOCK_TOOL_HISTOGRAM);
|
||||
}
|
||||
|
|
|
@ -128,7 +128,7 @@ gimp_hue_saturation_tool_register (Gimp *gimp,
|
|||
"gimp:hue_saturation_tool",
|
||||
_("Hue-Saturation"),
|
||||
_("Adjust hue and saturation"),
|
||||
N_("/Image/Colors/Hue-Saturation..."), NULL,
|
||||
N_("/Layer/Colors/Hue-Saturation..."), NULL,
|
||||
NULL, "tools/hue_saturation.html",
|
||||
GIMP_STOCK_TOOL_HUE_SATURATION);
|
||||
}
|
||||
|
|
|
@ -206,7 +206,7 @@ gimp_levels_tool_register (Gimp *gimp,
|
|||
"gimp:levels_tool",
|
||||
_("Levels"),
|
||||
_("Adjust color levels"),
|
||||
N_("/Image/Colors/Levels..."), NULL,
|
||||
N_("/Layer/Colors/Levels..."), NULL,
|
||||
NULL, "tools/levels.html",
|
||||
GIMP_STOCK_TOOL_LEVELS);
|
||||
}
|
||||
|
|
|
@ -49,7 +49,6 @@
|
|||
#include "gimpclonetool.h"
|
||||
#include "gimpconvolvetool.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "gimprc.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
@ -278,7 +277,7 @@ paint_options_reset (GimpToolOptions *tool_options)
|
|||
|
||||
options = (PaintOptions *) tool_options;
|
||||
|
||||
default_context = gimp_get_default_context (the_gimp);
|
||||
default_context = gimp_get_default_context (tool_options->tool_info->gimp);
|
||||
|
||||
if (options->opacity_w)
|
||||
{
|
||||
|
|
|
@ -106,7 +106,7 @@ gimp_posterize_tool_register (Gimp *gimp,
|
|||
"gimp:posterize_tool",
|
||||
_("Posterize"),
|
||||
_("Reduce image to a fixed numer of colors"),
|
||||
N_("/Image/Colors/Posterize..."), NULL,
|
||||
N_("/Layer/Colors/Posterize..."), NULL,
|
||||
NULL, "tools/posterize.html",
|
||||
GIMP_STOCK_TOOL_POSTERIZE);
|
||||
}
|
||||
|
|
|
@ -113,7 +113,7 @@ gimp_threshold_tool_register (Gimp *gimp,
|
|||
"gimp:threshold_tool",
|
||||
_("Threshold"),
|
||||
_("Reduce image to two colors using a threshold"),
|
||||
N_("/Image/Colors/Threshold..."), NULL,
|
||||
N_("/Layer/Colors/Threshold..."), NULL,
|
||||
NULL, "tools/threshold.html",
|
||||
GIMP_STOCK_TOOL_THRESHOLD);
|
||||
}
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
#include "transform_options.h"
|
||||
#include "tool_manager.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "gimprc.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
@ -144,7 +143,7 @@ transform_options_init (TransformOptions *options,
|
|||
|
||||
g_signal_connect (G_OBJECT (options->show_grid_w), "toggled",
|
||||
G_CALLBACK (gimp_transform_tool_show_grid_update),
|
||||
&options->show_grid);
|
||||
options);
|
||||
|
||||
/* the grid density entry */
|
||||
hbox = gtk_hbox_new (FALSE, 6);
|
||||
|
@ -181,7 +180,7 @@ transform_options_init (TransformOptions *options,
|
|||
|
||||
g_signal_connect (G_OBJECT (options->show_path_w), "toggled",
|
||||
G_CALLBACK (gimp_transform_tool_show_path_update),
|
||||
&options->show_path);
|
||||
options);
|
||||
|
||||
if (tool_info->tool_type == GIMP_TYPE_ROTATE_TOOL ||
|
||||
tool_info->tool_type == GIMP_TYPE_SCALE_TOOL)
|
||||
|
@ -286,14 +285,16 @@ gimp_transform_tool_grid_density_update (GtkWidget *widget,
|
|||
gpointer data)
|
||||
{
|
||||
TransformOptions *options;
|
||||
GimpToolOptions *tool_options;
|
||||
GimpTool *active_tool;
|
||||
|
||||
options = (TransformOptions *) data;
|
||||
options = (TransformOptions *) data;
|
||||
tool_options = (GimpToolOptions *) data;
|
||||
|
||||
options->grid_size =
|
||||
(gint) (pow (2.0, 7.0 - GTK_ADJUSTMENT (widget)->value) + 0.5);
|
||||
|
||||
active_tool = tool_manager_get_active (the_gimp);
|
||||
active_tool = tool_manager_get_active (tool_options->tool_info->gimp);
|
||||
|
||||
if (GIMP_IS_TRANSFORM_TOOL (active_tool))
|
||||
gimp_transform_tool_grid_density_changed (GIMP_TRANSFORM_TOOL (active_tool));
|
||||
|
@ -303,9 +304,11 @@ static void
|
|||
gimp_transform_tool_show_grid_update (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
static gboolean first_call = TRUE; /* eek, this hack avoids a segfault */
|
||||
TransformOptions *options;
|
||||
GimpToolOptions *tool_options;
|
||||
GimpTool *active_tool;
|
||||
|
||||
GimpTool *active_tool;
|
||||
static gboolean first_call = TRUE; /* eek, this hack avoids a segfault */
|
||||
|
||||
if (first_call)
|
||||
{
|
||||
|
@ -313,9 +316,12 @@ gimp_transform_tool_show_grid_update (GtkWidget *widget,
|
|||
return;
|
||||
}
|
||||
|
||||
gimp_toggle_button_update (widget, data);
|
||||
options = (TransformOptions *) data;
|
||||
tool_options = (GimpToolOptions *) data;
|
||||
|
||||
active_tool = tool_manager_get_active (the_gimp);
|
||||
gimp_toggle_button_update (widget, &options->show_grid);
|
||||
|
||||
active_tool = tool_manager_get_active (tool_options->tool_info->gimp);
|
||||
|
||||
if (GIMP_IS_TRANSFORM_TOOL (active_tool))
|
||||
gimp_transform_tool_grid_density_changed (GIMP_TRANSFORM_TOOL (active_tool));
|
||||
|
@ -325,10 +331,11 @@ static void
|
|||
gimp_transform_tool_show_path_update (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
static gboolean first_call = TRUE; /* eek, this hack avoids a segfault */
|
||||
|
||||
TransformOptions *options;
|
||||
GimpToolOptions *tool_options;
|
||||
GimpTool *active_tool;
|
||||
GimpTransformTool *transform_tool = NULL;
|
||||
|
||||
static gboolean first_call = TRUE; /* eek, this hack avoids a segfault */
|
||||
|
||||
if (first_call)
|
||||
{
|
||||
|
@ -336,16 +343,25 @@ gimp_transform_tool_show_path_update (GtkWidget *widget,
|
|||
return;
|
||||
}
|
||||
|
||||
active_tool = tool_manager_get_active (the_gimp);
|
||||
options = (TransformOptions *) data;
|
||||
tool_options = (GimpToolOptions *) data;
|
||||
|
||||
active_tool = tool_manager_get_active (tool_options->tool_info->gimp);
|
||||
|
||||
if (GIMP_IS_TRANSFORM_TOOL (active_tool))
|
||||
transform_tool = GIMP_TRANSFORM_TOOL (active_tool);
|
||||
{
|
||||
GimpTransformTool *transform_tool;
|
||||
|
||||
if (transform_tool)
|
||||
gimp_transform_tool_show_path_changed (transform_tool, 1); /* pause */
|
||||
transform_tool = GIMP_TRANSFORM_TOOL (active_tool);
|
||||
|
||||
gimp_toggle_button_update (widget, data);
|
||||
gimp_transform_tool_show_path_changed (transform_tool, 1); /* pause */
|
||||
|
||||
if (transform_tool)
|
||||
gimp_transform_tool_show_path_changed (transform_tool, 0); /* resume */
|
||||
gimp_toggle_button_update (widget, &options->show_path);
|
||||
|
||||
gimp_transform_tool_show_path_changed (transform_tool, 0); /* resume */
|
||||
}
|
||||
else
|
||||
{
|
||||
gimp_toggle_button_update (widget, &options->show_path);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,7 +49,6 @@
|
|||
#include "gimpclonetool.h"
|
||||
#include "gimpconvolvetool.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "gimprc.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
@ -278,7 +277,7 @@ paint_options_reset (GimpToolOptions *tool_options)
|
|||
|
||||
options = (PaintOptions *) tool_options;
|
||||
|
||||
default_context = gimp_get_default_context (the_gimp);
|
||||
default_context = gimp_get_default_context (tool_options->tool_info->gimp);
|
||||
|
||||
if (options->opacity_w)
|
||||
{
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
#include "transform_options.h"
|
||||
#include "tool_manager.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "gimprc.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
@ -144,7 +143,7 @@ transform_options_init (TransformOptions *options,
|
|||
|
||||
g_signal_connect (G_OBJECT (options->show_grid_w), "toggled",
|
||||
G_CALLBACK (gimp_transform_tool_show_grid_update),
|
||||
&options->show_grid);
|
||||
options);
|
||||
|
||||
/* the grid density entry */
|
||||
hbox = gtk_hbox_new (FALSE, 6);
|
||||
|
@ -181,7 +180,7 @@ transform_options_init (TransformOptions *options,
|
|||
|
||||
g_signal_connect (G_OBJECT (options->show_path_w), "toggled",
|
||||
G_CALLBACK (gimp_transform_tool_show_path_update),
|
||||
&options->show_path);
|
||||
options);
|
||||
|
||||
if (tool_info->tool_type == GIMP_TYPE_ROTATE_TOOL ||
|
||||
tool_info->tool_type == GIMP_TYPE_SCALE_TOOL)
|
||||
|
@ -286,14 +285,16 @@ gimp_transform_tool_grid_density_update (GtkWidget *widget,
|
|||
gpointer data)
|
||||
{
|
||||
TransformOptions *options;
|
||||
GimpToolOptions *tool_options;
|
||||
GimpTool *active_tool;
|
||||
|
||||
options = (TransformOptions *) data;
|
||||
options = (TransformOptions *) data;
|
||||
tool_options = (GimpToolOptions *) data;
|
||||
|
||||
options->grid_size =
|
||||
(gint) (pow (2.0, 7.0 - GTK_ADJUSTMENT (widget)->value) + 0.5);
|
||||
|
||||
active_tool = tool_manager_get_active (the_gimp);
|
||||
active_tool = tool_manager_get_active (tool_options->tool_info->gimp);
|
||||
|
||||
if (GIMP_IS_TRANSFORM_TOOL (active_tool))
|
||||
gimp_transform_tool_grid_density_changed (GIMP_TRANSFORM_TOOL (active_tool));
|
||||
|
@ -303,9 +304,11 @@ static void
|
|||
gimp_transform_tool_show_grid_update (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
static gboolean first_call = TRUE; /* eek, this hack avoids a segfault */
|
||||
TransformOptions *options;
|
||||
GimpToolOptions *tool_options;
|
||||
GimpTool *active_tool;
|
||||
|
||||
GimpTool *active_tool;
|
||||
static gboolean first_call = TRUE; /* eek, this hack avoids a segfault */
|
||||
|
||||
if (first_call)
|
||||
{
|
||||
|
@ -313,9 +316,12 @@ gimp_transform_tool_show_grid_update (GtkWidget *widget,
|
|||
return;
|
||||
}
|
||||
|
||||
gimp_toggle_button_update (widget, data);
|
||||
options = (TransformOptions *) data;
|
||||
tool_options = (GimpToolOptions *) data;
|
||||
|
||||
active_tool = tool_manager_get_active (the_gimp);
|
||||
gimp_toggle_button_update (widget, &options->show_grid);
|
||||
|
||||
active_tool = tool_manager_get_active (tool_options->tool_info->gimp);
|
||||
|
||||
if (GIMP_IS_TRANSFORM_TOOL (active_tool))
|
||||
gimp_transform_tool_grid_density_changed (GIMP_TRANSFORM_TOOL (active_tool));
|
||||
|
@ -325,10 +331,11 @@ static void
|
|||
gimp_transform_tool_show_path_update (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
static gboolean first_call = TRUE; /* eek, this hack avoids a segfault */
|
||||
|
||||
TransformOptions *options;
|
||||
GimpToolOptions *tool_options;
|
||||
GimpTool *active_tool;
|
||||
GimpTransformTool *transform_tool = NULL;
|
||||
|
||||
static gboolean first_call = TRUE; /* eek, this hack avoids a segfault */
|
||||
|
||||
if (first_call)
|
||||
{
|
||||
|
@ -336,16 +343,25 @@ gimp_transform_tool_show_path_update (GtkWidget *widget,
|
|||
return;
|
||||
}
|
||||
|
||||
active_tool = tool_manager_get_active (the_gimp);
|
||||
options = (TransformOptions *) data;
|
||||
tool_options = (GimpToolOptions *) data;
|
||||
|
||||
active_tool = tool_manager_get_active (tool_options->tool_info->gimp);
|
||||
|
||||
if (GIMP_IS_TRANSFORM_TOOL (active_tool))
|
||||
transform_tool = GIMP_TRANSFORM_TOOL (active_tool);
|
||||
{
|
||||
GimpTransformTool *transform_tool;
|
||||
|
||||
if (transform_tool)
|
||||
gimp_transform_tool_show_path_changed (transform_tool, 1); /* pause */
|
||||
transform_tool = GIMP_TRANSFORM_TOOL (active_tool);
|
||||
|
||||
gimp_toggle_button_update (widget, data);
|
||||
gimp_transform_tool_show_path_changed (transform_tool, 1); /* pause */
|
||||
|
||||
if (transform_tool)
|
||||
gimp_transform_tool_show_path_changed (transform_tool, 0); /* resume */
|
||||
gimp_toggle_button_update (widget, &options->show_path);
|
||||
|
||||
gimp_transform_tool_show_path_changed (transform_tool, 0); /* resume */
|
||||
}
|
||||
else
|
||||
{
|
||||
gimp_toggle_button_update (widget, &options->show_path);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
#include "widgets/gimpdnd.h"
|
||||
#include "widgets/gimppreview.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "devices.h"
|
||||
#include "gimprc.h"
|
||||
|
||||
|
@ -376,12 +375,12 @@ devices_rc_update (Gimp *gimp,
|
|||
else
|
||||
device_info->mode = GDK_MODE_DISABLED;
|
||||
|
||||
device_info->context = gimp_create_context (the_gimp,
|
||||
device_info->context = gimp_create_context (gimp,
|
||||
device_info->name, NULL);
|
||||
gimp_context_define_properties (device_info->context,
|
||||
DEVICE_CONTEXT_MASK,
|
||||
FALSE);
|
||||
gimp_context_copy_properties (gimp_get_user_context (the_gimp),
|
||||
gimp_context_copy_properties (gimp_get_user_context (gimp),
|
||||
device_info->context,
|
||||
DEVICE_CONTEXT_MASK);
|
||||
device_status_context_connect (device_info->context,
|
||||
|
@ -437,7 +436,7 @@ devices_rc_update (Gimp *gimp,
|
|||
GimpToolInfo *tool_info;
|
||||
|
||||
tool_info = (GimpToolInfo *)
|
||||
gimp_container_get_child_by_name (the_gimp->tool_info_list,
|
||||
gimp_container_get_child_by_name (gimp->tool_info_list,
|
||||
tool_name);
|
||||
|
||||
if (tool_info)
|
||||
|
@ -466,14 +465,14 @@ devices_rc_update (Gimp *gimp,
|
|||
GimpBrush *brush;
|
||||
|
||||
brush = (GimpBrush *)
|
||||
gimp_container_get_child_by_name (the_gimp->brush_factory->container,
|
||||
gimp_container_get_child_by_name (gimp->brush_factory->container,
|
||||
brush_name);
|
||||
|
||||
if (brush)
|
||||
{
|
||||
gimp_context_set_brush (device_info->context, brush);
|
||||
}
|
||||
else if (the_gimp->no_data)
|
||||
else if (gimp->no_data)
|
||||
{
|
||||
g_free (device_info->context->brush_name);
|
||||
device_info->context->brush_name = g_strdup (brush_name);
|
||||
|
@ -485,14 +484,14 @@ devices_rc_update (Gimp *gimp,
|
|||
GimpPattern *pattern;
|
||||
|
||||
pattern = (GimpPattern *)
|
||||
gimp_container_get_child_by_name (the_gimp->pattern_factory->container,
|
||||
gimp_container_get_child_by_name (gimp->pattern_factory->container,
|
||||
pattern_name);
|
||||
|
||||
if (pattern)
|
||||
{
|
||||
gimp_context_set_pattern (device_info->context, pattern);
|
||||
}
|
||||
else if (the_gimp->no_data)
|
||||
else if (gimp->no_data)
|
||||
{
|
||||
g_free (device_info->context->pattern_name);
|
||||
device_info->context->pattern_name = g_strdup (pattern_name);
|
||||
|
@ -504,14 +503,14 @@ devices_rc_update (Gimp *gimp,
|
|||
GimpGradient *gradient;
|
||||
|
||||
gradient = (GimpGradient *)
|
||||
gimp_container_get_child_by_name (the_gimp->gradient_factory->container,
|
||||
gimp_container_get_child_by_name (gimp->gradient_factory->container,
|
||||
gradient_name);
|
||||
|
||||
if (gradient)
|
||||
{
|
||||
gimp_context_set_gradient (device_info->context, gradient);
|
||||
}
|
||||
else if (the_gimp->no_data)
|
||||
else if (gimp->no_data)
|
||||
{
|
||||
g_free (device_info->context->gradient_name);
|
||||
device_info->context->gradient_name = g_strdup (gradient_name);
|
||||
|
@ -539,7 +538,7 @@ select_device (Gimp *gimp,
|
|||
|
||||
current_device = new_device;
|
||||
|
||||
context = gimp_get_user_context (the_gimp);
|
||||
context = gimp_get_user_context (gimp);
|
||||
|
||||
gimp_context_copy_properties (device_info->context, context,
|
||||
DEVICE_CONTEXT_MASK);
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
#include "widgets/gimpdnd.h"
|
||||
#include "widgets/gimppreview.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "devices.h"
|
||||
#include "gimprc.h"
|
||||
|
||||
|
@ -376,12 +375,12 @@ devices_rc_update (Gimp *gimp,
|
|||
else
|
||||
device_info->mode = GDK_MODE_DISABLED;
|
||||
|
||||
device_info->context = gimp_create_context (the_gimp,
|
||||
device_info->context = gimp_create_context (gimp,
|
||||
device_info->name, NULL);
|
||||
gimp_context_define_properties (device_info->context,
|
||||
DEVICE_CONTEXT_MASK,
|
||||
FALSE);
|
||||
gimp_context_copy_properties (gimp_get_user_context (the_gimp),
|
||||
gimp_context_copy_properties (gimp_get_user_context (gimp),
|
||||
device_info->context,
|
||||
DEVICE_CONTEXT_MASK);
|
||||
device_status_context_connect (device_info->context,
|
||||
|
@ -437,7 +436,7 @@ devices_rc_update (Gimp *gimp,
|
|||
GimpToolInfo *tool_info;
|
||||
|
||||
tool_info = (GimpToolInfo *)
|
||||
gimp_container_get_child_by_name (the_gimp->tool_info_list,
|
||||
gimp_container_get_child_by_name (gimp->tool_info_list,
|
||||
tool_name);
|
||||
|
||||
if (tool_info)
|
||||
|
@ -466,14 +465,14 @@ devices_rc_update (Gimp *gimp,
|
|||
GimpBrush *brush;
|
||||
|
||||
brush = (GimpBrush *)
|
||||
gimp_container_get_child_by_name (the_gimp->brush_factory->container,
|
||||
gimp_container_get_child_by_name (gimp->brush_factory->container,
|
||||
brush_name);
|
||||
|
||||
if (brush)
|
||||
{
|
||||
gimp_context_set_brush (device_info->context, brush);
|
||||
}
|
||||
else if (the_gimp->no_data)
|
||||
else if (gimp->no_data)
|
||||
{
|
||||
g_free (device_info->context->brush_name);
|
||||
device_info->context->brush_name = g_strdup (brush_name);
|
||||
|
@ -485,14 +484,14 @@ devices_rc_update (Gimp *gimp,
|
|||
GimpPattern *pattern;
|
||||
|
||||
pattern = (GimpPattern *)
|
||||
gimp_container_get_child_by_name (the_gimp->pattern_factory->container,
|
||||
gimp_container_get_child_by_name (gimp->pattern_factory->container,
|
||||
pattern_name);
|
||||
|
||||
if (pattern)
|
||||
{
|
||||
gimp_context_set_pattern (device_info->context, pattern);
|
||||
}
|
||||
else if (the_gimp->no_data)
|
||||
else if (gimp->no_data)
|
||||
{
|
||||
g_free (device_info->context->pattern_name);
|
||||
device_info->context->pattern_name = g_strdup (pattern_name);
|
||||
|
@ -504,14 +503,14 @@ devices_rc_update (Gimp *gimp,
|
|||
GimpGradient *gradient;
|
||||
|
||||
gradient = (GimpGradient *)
|
||||
gimp_container_get_child_by_name (the_gimp->gradient_factory->container,
|
||||
gimp_container_get_child_by_name (gimp->gradient_factory->container,
|
||||
gradient_name);
|
||||
|
||||
if (gradient)
|
||||
{
|
||||
gimp_context_set_gradient (device_info->context, gradient);
|
||||
}
|
||||
else if (the_gimp->no_data)
|
||||
else if (gimp->no_data)
|
||||
{
|
||||
g_free (device_info->context->gradient_name);
|
||||
device_info->context->gradient_name = g_strdup (gradient_name);
|
||||
|
@ -539,7 +538,7 @@ select_device (Gimp *gimp,
|
|||
|
||||
current_device = new_device;
|
||||
|
||||
context = gimp_get_user_context (the_gimp);
|
||||
context = gimp_get_user_context (gimp);
|
||||
|
||||
gimp_context_copy_properties (device_info->context, context,
|
||||
DEVICE_CONTEXT_MASK);
|
||||
|
|
|
@ -70,16 +70,16 @@ enum
|
|||
};
|
||||
|
||||
static void query (void);
|
||||
static void run (gchar *name,
|
||||
gint nparams,
|
||||
static void run (gchar *name,
|
||||
gint nparams,
|
||||
GimpParam *param,
|
||||
gint *nreturn_vals,
|
||||
gint *nreturn_vals,
|
||||
GimpParam **return_vals);
|
||||
|
||||
static GimpPDBStatusType align_layers (gint32 image_id);
|
||||
static void align_layers_get_align_offsets (gint32 drawable_id,
|
||||
gint *x,
|
||||
gint *y);
|
||||
static void align_layers_get_align_offsets (gint32 drawable_id,
|
||||
gint *x,
|
||||
gint *y);
|
||||
|
||||
static gint align_layers_dialog (void);
|
||||
static void align_layers_ok_callback (GtkWidget *widget,
|
||||
|
@ -141,7 +141,6 @@ query (void)
|
|||
{ GIMP_PDB_INT32, "link-afteer-alignment", "Link the visible layers after alignment"},
|
||||
{ GIMP_PDB_INT32, "use-bottom", "use the bottom layer as the base of alignment"}
|
||||
};
|
||||
static gint nargs = sizeof (args) / sizeof (args[0]);
|
||||
|
||||
gimp_install_procedure (PLUG_IN_NAME,
|
||||
"Align visible layers",
|
||||
|
@ -149,24 +148,24 @@ query (void)
|
|||
"Shuji Narazaki <narazaki@InetQ.or.jp>",
|
||||
"Shuji Narazaki",
|
||||
"1997",
|
||||
N_("<Image>/Layers/Align Visible Layers..."),
|
||||
N_("<Image>/Layer/Align Visible Layers..."),
|
||||
"RGB*,GRAY*",
|
||||
GIMP_PLUGIN,
|
||||
nargs, 0,
|
||||
G_N_ELEMENTS (args), 0,
|
||||
args, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
run (gchar *name,
|
||||
gint nparams,
|
||||
run (gchar *name,
|
||||
gint nparams,
|
||||
GimpParam *param,
|
||||
gint *nreturn_vals,
|
||||
gint *nreturn_vals,
|
||||
GimpParam **return_vals)
|
||||
{
|
||||
static GimpParam values[1];
|
||||
GimpPDBStatusType status = GIMP_PDB_EXECUTION_ERROR;
|
||||
GimpRunModeType run_mode;
|
||||
gint image_id, layer_num;
|
||||
static GimpParam values[1];
|
||||
GimpPDBStatusType status = GIMP_PDB_EXECUTION_ERROR;
|
||||
GimpRunModeType run_mode;
|
||||
gint image_id, layer_num;
|
||||
|
||||
run_mode = param[0].data.d_int32;
|
||||
image_id = param[1].data.d_int32;
|
||||
|
|
|
@ -65,7 +65,6 @@ query (void)
|
|||
{ GIMP_PDB_IMAGE, "image", "Input image" },
|
||||
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" }
|
||||
};
|
||||
static gint nargs = sizeof (args) / sizeof (args[0]);
|
||||
|
||||
gimp_install_procedure ("plug_in_autocrop",
|
||||
"Automagically crops a picture.",
|
||||
|
@ -73,10 +72,10 @@ query (void)
|
|||
"Tim Newsome",
|
||||
"Tim Newsome",
|
||||
"1997",
|
||||
N_("<Image>/Image/Transforms/Autocrop"),
|
||||
N_("<Image>/Image/Transform/Autocrop"),
|
||||
"RGB*, GRAY*, INDEXED*",
|
||||
GIMP_PLUGIN,
|
||||
nargs, 0,
|
||||
G_N_ELEMENTS (args), 0,
|
||||
args, NULL);
|
||||
}
|
||||
|
||||
|
|
|
@ -41,15 +41,16 @@
|
|||
|
||||
/* Declare local functions.
|
||||
*/
|
||||
static void query (void);
|
||||
static void run (gchar *name,
|
||||
gint nparams,
|
||||
GimpParam *param,
|
||||
gint *nreturn_vals,
|
||||
GimpParam **return_vals);
|
||||
static void query (void);
|
||||
static void run (gchar *name,
|
||||
gint nparams,
|
||||
GimpParam *param,
|
||||
gint *nreturn_vals,
|
||||
GimpParam **return_vals);
|
||||
|
||||
static void autostretch_hsv (GimpDrawable *drawable);
|
||||
static void indexed_autostretch_hsv (gint32 image_ID);
|
||||
|
||||
static void autostretch_hsv (GimpDrawable *drawable);
|
||||
static void indexed_autostretch_hsv (gint32 image_ID);
|
||||
|
||||
GimpPlugInInfo PLUG_IN_INFO =
|
||||
{
|
||||
|
@ -71,7 +72,6 @@ query (void)
|
|||
{ GIMP_PDB_IMAGE, "image", "Input image" },
|
||||
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" }
|
||||
};
|
||||
static gint nargs = sizeof (args) / sizeof (args[0]);
|
||||
|
||||
gimp_install_procedure ("plug_in_autostretch_hsv",
|
||||
"Automatically stretch the contrast of the specified "
|
||||
|
@ -88,24 +88,24 @@ query (void)
|
|||
"Scott Goehring and Federico Mena Quintero",
|
||||
"Scott Goehring and Federico Mena Quintero",
|
||||
"1997",
|
||||
N_("<Image>/Image/Colors/Auto/Stretch HSV"),
|
||||
N_("<Image>/Layer/Colors/Auto/Stretch HSV"),
|
||||
"RGB*, INDEXED*",
|
||||
GIMP_PLUGIN,
|
||||
nargs, 0,
|
||||
G_N_ELEMENTS (args), 0,
|
||||
args, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
run (gchar *name,
|
||||
gint nparams,
|
||||
run (gchar *name,
|
||||
gint nparams,
|
||||
GimpParam *param,
|
||||
gint *nreturn_vals,
|
||||
gint *nreturn_vals,
|
||||
GimpParam **return_vals)
|
||||
{
|
||||
static GimpParam values[1];
|
||||
GimpDrawable *drawable;
|
||||
GimpRunModeType run_mode;
|
||||
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
|
||||
static GimpParam values[1];
|
||||
GimpDrawable *drawable;
|
||||
GimpRunModeType run_mode;
|
||||
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
|
||||
|
||||
gint32 image_ID;
|
||||
|
||||
|
|
|
@ -39,15 +39,15 @@
|
|||
|
||||
/* Declare local functions.
|
||||
*/
|
||||
static void query (void);
|
||||
static void run (gchar *name,
|
||||
gint nparams,
|
||||
GimpParam *param,
|
||||
gint *nreturn_vals,
|
||||
GimpParam **return_vals);
|
||||
static void query (void);
|
||||
static void run (gchar *name,
|
||||
gint nparams,
|
||||
GimpParam *param,
|
||||
gint *nreturn_vals,
|
||||
GimpParam **return_vals);
|
||||
|
||||
static void c_astretch (GimpDrawable * drawable);
|
||||
static void indexed_c_astretch (gint32 image_ID);
|
||||
static void c_astretch (GimpDrawable *drawable);
|
||||
static void indexed_c_astretch (gint32 image_ID);
|
||||
|
||||
|
||||
GimpPlugInInfo PLUG_IN_INFO =
|
||||
|
@ -70,7 +70,6 @@ query (void)
|
|||
{ GIMP_PDB_IMAGE, "image", "Input image" },
|
||||
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" }
|
||||
};
|
||||
static gint nargs = sizeof (args) / sizeof (args[0]);
|
||||
|
||||
gimp_install_procedure ("plug_in_c_astretch",
|
||||
"Automatically stretch the contrast of the "
|
||||
|
@ -85,24 +84,24 @@ query (void)
|
|||
"Federico Mena Quintero",
|
||||
"Federico Mena Quintero",
|
||||
"1996",
|
||||
N_("<Image>/Image/Colors/Auto/Stretch Contrast"),
|
||||
N_("<Image>/Layer/Colors/Auto/Stretch Contrast"),
|
||||
"RGB*, GRAY*, INDEXED*",
|
||||
GIMP_PLUGIN,
|
||||
nargs, 0,
|
||||
G_N_ELEMENTS (args), 0,
|
||||
args, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
run (gchar *name,
|
||||
gint nparams,
|
||||
run (gchar *name,
|
||||
gint nparams,
|
||||
GimpParam *param,
|
||||
gint *nreturn_vals,
|
||||
gint *nreturn_vals,
|
||||
GimpParam **return_vals)
|
||||
{
|
||||
static GimpParam values[1];
|
||||
GimpDrawable *drawable;
|
||||
GimpRunModeType run_mode;
|
||||
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
|
||||
static GimpParam values[1];
|
||||
GimpDrawable *drawable;
|
||||
GimpRunModeType run_mode;
|
||||
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
|
||||
|
||||
gint32 image_ID;
|
||||
|
||||
|
@ -149,7 +148,7 @@ run (gchar *name,
|
|||
|
||||
|
||||
static void
|
||||
indexed_c_astretch(gint32 image_ID) /* a.d.m. */
|
||||
indexed_c_astretch (gint32 image_ID) /* a.d.m. */
|
||||
{
|
||||
guchar *cmap;
|
||||
gint ncols,i;
|
||||
|
|
|
@ -42,15 +42,16 @@
|
|||
|
||||
/* Declare local functions.
|
||||
*/
|
||||
static void query (void);
|
||||
static void run (gchar *name,
|
||||
gint nparams,
|
||||
GimpParam *param,
|
||||
gint *nreturn_vals,
|
||||
GimpParam **return_vals);
|
||||
static void query (void);
|
||||
static void run (gchar *name,
|
||||
gint nparams,
|
||||
GimpParam *param,
|
||||
gint *nreturn_vals,
|
||||
GimpParam **return_vals);
|
||||
|
||||
static void Color_Enhance (GimpDrawable *drawable);
|
||||
static void indexed_Color_Enhance (gint32 image_ID);
|
||||
|
||||
static void Color_Enhance (GimpDrawable * drawable);
|
||||
static void indexed_Color_Enhance (gint32 image_ID);
|
||||
|
||||
GimpPlugInInfo PLUG_IN_INFO =
|
||||
{
|
||||
|
@ -72,7 +73,6 @@ query (void)
|
|||
{ GIMP_PDB_IMAGE, "image", "Input image" },
|
||||
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" }
|
||||
};
|
||||
static gint nargs = sizeof (args) / sizeof (args[0]);
|
||||
|
||||
gimp_install_procedure ("plug_in_color_enhance",
|
||||
"Automatically stretch the saturation of the "
|
||||
|
@ -88,24 +88,24 @@ query (void)
|
|||
"Martin Weber",
|
||||
"Martin Weber",
|
||||
"1997",
|
||||
N_("<Image>/Image/Colors/Auto/Color Enhance"),
|
||||
N_("<Image>/Layer/Colors/Auto/Color Enhance"),
|
||||
"RGB*, INDEXED*",
|
||||
GIMP_PLUGIN,
|
||||
nargs, 0,
|
||||
G_N_ELEMENTS (args), 0,
|
||||
args, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
run (gchar *name,
|
||||
gint nparams,
|
||||
run (gchar *name,
|
||||
gint nparams,
|
||||
GimpParam *param,
|
||||
gint *nreturn_vals,
|
||||
gint *nreturn_vals,
|
||||
GimpParam **return_vals)
|
||||
{
|
||||
static GimpParam values[1];
|
||||
GimpDrawable *drawable;
|
||||
GimpRunModeType run_mode;
|
||||
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
|
||||
static GimpParam values[1];
|
||||
GimpDrawable *drawable;
|
||||
GimpRunModeType run_mode;
|
||||
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
|
||||
|
||||
gint32 image_ID;
|
||||
|
||||
|
|
|
@ -82,7 +82,6 @@ query (void)
|
|||
{ GIMP_PDB_IMAGE, "image", "Input image (used for indexed images)" },
|
||||
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" },
|
||||
};
|
||||
gint nargs = sizeof (args) / sizeof (args[0]);
|
||||
|
||||
gimp_install_procedure ("plug_in_filter_pack",
|
||||
"Allows the user to change H, S, or C with many previews",
|
||||
|
@ -90,10 +89,10 @@ query (void)
|
|||
"Pavel Grinfeld (pavel@ml.com)",
|
||||
"Pavel Grinfeld (pavel@ml.com)",
|
||||
"27th March 1997",
|
||||
N_("<Image>/Image/Colors/Filter Pack..."),
|
||||
N_("<Image>/Layer/Colors/Filter Pack..."),
|
||||
"RGB*",
|
||||
GIMP_PLUGIN,
|
||||
nargs, 0,
|
||||
G_N_ELEMENTS (args), 0,
|
||||
args, NULL);
|
||||
}
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ query (void)
|
|||
"Adam D. Moss (adam@foxbox.org)",
|
||||
"Adam D. Moss (adam@foxbox.org)",
|
||||
"1998",
|
||||
N_("<Image>/Image/Transforms/Guillotine"),
|
||||
N_("<Image>/Image/Transform/Guillotine"),
|
||||
"RGB*, INDEXED*, GRAY*",
|
||||
GIMP_PLUGIN,
|
||||
nargs, 0,
|
||||
|
|
|
@ -39,15 +39,15 @@
|
|||
|
||||
/* Declare local functions.
|
||||
*/
|
||||
static void query (void);
|
||||
static void run (gchar *name,
|
||||
gint nparams,
|
||||
GimpParam *param,
|
||||
gint *nreturn_vals,
|
||||
GimpParam **return_vals);
|
||||
static void query (void);
|
||||
static void run (gchar *name,
|
||||
gint nparams,
|
||||
GimpParam *param,
|
||||
gint *nreturn_vals,
|
||||
GimpParam **return_vals);
|
||||
|
||||
static void norma (GimpDrawable *drawable);
|
||||
static void indexed_norma (gint32 image_ID);
|
||||
static void normalize (GimpDrawable *drawable);
|
||||
static void indexed_normalize (gint32 image_ID);
|
||||
|
||||
|
||||
GimpPlugInInfo PLUG_IN_INFO =
|
||||
|
@ -70,7 +70,6 @@ query (void)
|
|||
{ GIMP_PDB_IMAGE, "image", "Input image" },
|
||||
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" }
|
||||
};
|
||||
static gint nargs = sizeof (args) / sizeof (args[0]);
|
||||
|
||||
gimp_install_procedure ("plug_in_normalize",
|
||||
"Normalize the contrast of the specified drawable to "
|
||||
|
@ -86,24 +85,24 @@ query (void)
|
|||
"Adam D. Moss, Federico Mena Quintero",
|
||||
"Adam D. Moss, Federico Mena Quintero",
|
||||
"1997",
|
||||
N_("<Image>/Image/Colors/Auto/Normalize"),
|
||||
N_("<Image>/Layer/Colors/Auto/Normalize"),
|
||||
"RGB*, GRAY*, INDEXED*",
|
||||
GIMP_PLUGIN,
|
||||
nargs, 0,
|
||||
G_N_ELEMENTS (args), 0,
|
||||
args, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
run (gchar *name,
|
||||
gint nparams,
|
||||
run (gchar *name,
|
||||
gint nparams,
|
||||
GimpParam *param,
|
||||
gint *nreturn_vals,
|
||||
gint *nreturn_vals,
|
||||
GimpParam **return_vals)
|
||||
{
|
||||
static GimpParam values[1];
|
||||
GimpDrawable *drawable;
|
||||
GimpRunModeType run_mode;
|
||||
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
|
||||
static GimpParam values[1];
|
||||
GimpDrawable *drawable;
|
||||
GimpRunModeType run_mode;
|
||||
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
|
||||
|
||||
gint32 image_ID;
|
||||
|
||||
|
@ -120,14 +119,14 @@ run (gchar *name,
|
|||
{
|
||||
gimp_progress_init (_("Normalizing..."));
|
||||
gimp_tile_cache_ntiles (2 * (drawable->width / gimp_tile_width () + 1));
|
||||
norma (drawable);
|
||||
normalize (drawable);
|
||||
|
||||
if (run_mode != GIMP_RUN_NONINTERACTIVE)
|
||||
gimp_displays_flush ();
|
||||
}
|
||||
else if (gimp_drawable_is_indexed (drawable->drawable_id))
|
||||
{
|
||||
indexed_norma (image_ID);
|
||||
indexed_normalize (image_ID);
|
||||
if (run_mode != GIMP_RUN_NONINTERACTIVE)
|
||||
gimp_displays_flush ();
|
||||
}
|
||||
|
@ -148,7 +147,7 @@ run (gchar *name,
|
|||
|
||||
|
||||
static void
|
||||
indexed_norma (gint32 image_ID) /* a.d.m. */
|
||||
indexed_normalize (gint32 image_ID) /* a.d.m. */
|
||||
{
|
||||
guchar *cmap;
|
||||
gint ncols,i;
|
||||
|
@ -185,7 +184,7 @@ indexed_norma (gint32 image_ID) /* a.d.m. */
|
|||
|
||||
|
||||
static void
|
||||
norma (GimpDrawable *drawable)
|
||||
normalize (GimpDrawable *drawable)
|
||||
{
|
||||
GimpPixelRgn src_rgn, dest_rgn;
|
||||
guchar *src, *s;
|
||||
|
|
|
@ -127,7 +127,6 @@ query (void)
|
|||
{ GIMP_PDB_INT32, "angle", "Angle { 90 (1), 180 (2), 270 (3) } degrees" },
|
||||
{ GIMP_PDB_INT32, "everything", "Rotate the whole image? { TRUE, FALSE }" }
|
||||
};
|
||||
static gint nargs = sizeof (args) / sizeof (args[0]);
|
||||
|
||||
static GimpParamDef menuargs[] =
|
||||
{
|
||||
|
@ -135,7 +134,6 @@ query (void)
|
|||
{ GIMP_PDB_IMAGE, "image", "Input image" },
|
||||
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable"}
|
||||
};
|
||||
static gint nmenuargs = sizeof (menuargs) / sizeof (menuargs[0]);
|
||||
|
||||
gimp_install_procedure ("plug_in_rotate",
|
||||
"Rotates a layer or the whole image by 90, 180 or 270 degrees",
|
||||
|
@ -149,7 +147,7 @@ query (void)
|
|||
NULL,
|
||||
PLUG_IN_IMAGE_TYPES,
|
||||
GIMP_PLUGIN,
|
||||
nargs, 0,
|
||||
G_N_ELEMENTS (args), 0,
|
||||
args, NULL);
|
||||
|
||||
gimp_install_procedure ("plug_in_layer_rot90",
|
||||
|
@ -158,10 +156,10 @@ query (void)
|
|||
PLUG_IN_AUTHOR,
|
||||
PLUG_IN_COPYRIGHT,
|
||||
PLUG_IN_VERSION,
|
||||
N_("<Image>/Layers/Rotate/90 degrees"),
|
||||
N_("<Image>/Layer/Transform/Rotate 90 degrees"),
|
||||
PLUG_IN_IMAGE_TYPES,
|
||||
GIMP_PLUGIN,
|
||||
nmenuargs, 0,
|
||||
G_N_ELEMENTS (menuargs), 0,
|
||||
menuargs, NULL);
|
||||
gimp_install_procedure ("plug_in_layer_rot180",
|
||||
"Rotates the given layer 180 degrees.",
|
||||
|
@ -169,10 +167,10 @@ query (void)
|
|||
PLUG_IN_AUTHOR,
|
||||
PLUG_IN_COPYRIGHT,
|
||||
PLUG_IN_VERSION,
|
||||
N_("<Image>/Layers/Rotate/180 degrees"),
|
||||
N_("<Image>/Layer/Transform/Rotate 180 degrees"),
|
||||
PLUG_IN_IMAGE_TYPES,
|
||||
GIMP_PLUGIN,
|
||||
nmenuargs, 0,
|
||||
G_N_ELEMENTS (menuargs), 0,
|
||||
menuargs, NULL);
|
||||
gimp_install_procedure ("plug_in_layer_rot270",
|
||||
"Rotates the given layer 270 degrees clockwise.",
|
||||
|
@ -180,10 +178,10 @@ query (void)
|
|||
PLUG_IN_AUTHOR,
|
||||
PLUG_IN_COPYRIGHT,
|
||||
PLUG_IN_VERSION,
|
||||
N_("<Image>/Layers/Rotate/270 degrees"),
|
||||
N_("<Image>/Layer/Transform/Rotate 270 degrees"),
|
||||
PLUG_IN_IMAGE_TYPES,
|
||||
GIMP_PLUGIN,
|
||||
nmenuargs, 0,
|
||||
G_N_ELEMENTS (menuargs), 0,
|
||||
menuargs, NULL);
|
||||
|
||||
gimp_install_procedure ("plug_in_image_rot90",
|
||||
|
@ -192,10 +190,10 @@ query (void)
|
|||
PLUG_IN_AUTHOR,
|
||||
PLUG_IN_COPYRIGHT,
|
||||
PLUG_IN_VERSION,
|
||||
N_("<Image>/Image/Transforms/Rotate/90 degrees"),
|
||||
N_("<Image>/Image/Transform/Rotate 90 degrees"),
|
||||
PLUG_IN_IMAGE_TYPES,
|
||||
GIMP_PLUGIN,
|
||||
nmenuargs, 0,
|
||||
G_N_ELEMENTS (menuargs), 0,
|
||||
menuargs, NULL);
|
||||
gimp_install_procedure ("plug_in_image_rot180",
|
||||
"Rotates the given image 180 degrees.",
|
||||
|
@ -203,10 +201,10 @@ query (void)
|
|||
PLUG_IN_AUTHOR,
|
||||
PLUG_IN_COPYRIGHT,
|
||||
PLUG_IN_VERSION,
|
||||
N_("<Image>/Image/Transforms/Rotate/180 degrees"),
|
||||
N_("<Image>/Image/Transform/Rotate 180 degrees"),
|
||||
PLUG_IN_IMAGE_TYPES,
|
||||
GIMP_PLUGIN,
|
||||
nmenuargs, 0,
|
||||
G_N_ELEMENTS (menuargs), 0,
|
||||
menuargs, NULL);
|
||||
gimp_install_procedure ("plug_in_image_rot270",
|
||||
"Rotates the given image 270 degrees clockwise.",
|
||||
|
@ -214,10 +212,10 @@ query (void)
|
|||
PLUG_IN_AUTHOR,
|
||||
PLUG_IN_COPYRIGHT,
|
||||
PLUG_IN_VERSION,
|
||||
N_("<Image>/Image/Transforms/Rotate/270 degrees"),
|
||||
N_("<Image>/Image/Transform/Rotate 270 degrees"),
|
||||
PLUG_IN_IMAGE_TYPES,
|
||||
GIMP_PLUGIN,
|
||||
nmenuargs, 0,
|
||||
G_N_ELEMENTS (menuargs), 0,
|
||||
menuargs, NULL);
|
||||
}
|
||||
|
||||
|
|
|
@ -40,12 +40,13 @@
|
|||
#define PROGRESS_UPDATE_NUM 100
|
||||
#define SCALE_WIDTH 120
|
||||
|
||||
static void query (void);
|
||||
static void run (gchar *name,
|
||||
gint nparams,
|
||||
GimpParam *param,
|
||||
gint *nreturn_vals,
|
||||
GimpParam **return_vals);
|
||||
|
||||
static void query (void);
|
||||
static void run (gchar *name,
|
||||
gint nparams,
|
||||
GimpParam *param,
|
||||
gint *nreturn_vals,
|
||||
GimpParam **return_vals);
|
||||
|
||||
static GimpPDBStatusType threshold_alpha (gint32 drawable_id);
|
||||
|
||||
|
@ -53,6 +54,7 @@ static gint threshold_alpha_dialog (void);
|
|||
static void threshold_alpha_ok_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
|
||||
|
||||
GimpPlugInInfo PLUG_IN_INFO =
|
||||
{
|
||||
NULL, /* init_proc */
|
||||
|
@ -93,7 +95,6 @@ query (void)
|
|||
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" },
|
||||
{ GIMP_PDB_INT32, "threshold", "Threshold" }
|
||||
};
|
||||
static gint nargs = sizeof (args) / sizeof (args[0]);
|
||||
|
||||
gimp_install_procedure (PLUG_IN_NAME,
|
||||
"",
|
||||
|
@ -101,10 +102,10 @@ query (void)
|
|||
"Shuji Narazaki (narazaki@InetQ.or.jp)",
|
||||
"Shuji Narazaki",
|
||||
"1997",
|
||||
N_("<Image>/Image/Alpha/Threshold Alpha..."),
|
||||
N_("<Image>/Layer/Alpha/Threshold Alpha..."),
|
||||
"RGBA,GRAYA",
|
||||
GIMP_PLUGIN,
|
||||
nargs, 0,
|
||||
G_N_ELEMENTS (args), 0,
|
||||
args, NULL);
|
||||
}
|
||||
|
||||
|
|
|
@ -28,10 +28,10 @@ static void run (gchar *name,
|
|||
GimpParam *param,
|
||||
gint *nreturn_vals,
|
||||
GimpParam **return_vals);
|
||||
|
||||
static inline gint colours_equal (guchar *col1,
|
||||
guchar *col2,
|
||||
gint bytes);
|
||||
|
||||
static void do_zcrop (GimpDrawable *drawable,
|
||||
gint32 image_id);
|
||||
|
||||
|
@ -58,7 +58,6 @@ query (void)
|
|||
{ GIMP_PDB_IMAGE, "image", "Input image" },
|
||||
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" }
|
||||
};
|
||||
static gint nargs = sizeof (args) / sizeof (args[0]);
|
||||
|
||||
gimp_install_procedure ("plug_in_zealouscrop",
|
||||
"Automagically crops unused space from the edges "
|
||||
|
@ -67,10 +66,10 @@ query (void)
|
|||
"Adam D. Moss",
|
||||
"Adam D. Moss",
|
||||
"1997",
|
||||
N_("<Image>/Image/Transforms/Zealous Crop"),
|
||||
N_("<Image>/Layer/Transform/Zealous Crop"),
|
||||
"RGB*, GRAY*, INDEXED*",
|
||||
GIMP_PLUGIN,
|
||||
nargs, 0,
|
||||
G_N_ELEMENTS (args), 0,
|
||||
args, NULL);
|
||||
}
|
||||
|
||||
|
|
|
@ -82,7 +82,6 @@ query (void)
|
|||
{ GIMP_PDB_IMAGE, "image", "Input image (used for indexed images)" },
|
||||
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" },
|
||||
};
|
||||
gint nargs = sizeof (args) / sizeof (args[0]);
|
||||
|
||||
gimp_install_procedure ("plug_in_filter_pack",
|
||||
"Allows the user to change H, S, or C with many previews",
|
||||
|
@ -90,10 +89,10 @@ query (void)
|
|||
"Pavel Grinfeld (pavel@ml.com)",
|
||||
"Pavel Grinfeld (pavel@ml.com)",
|
||||
"27th March 1997",
|
||||
N_("<Image>/Image/Colors/Filter Pack..."),
|
||||
N_("<Image>/Layer/Colors/Filter Pack..."),
|
||||
"RGB*",
|
||||
GIMP_PLUGIN,
|
||||
nargs, 0,
|
||||
G_N_ELEMENTS (args), 0,
|
||||
args, NULL);
|
||||
}
|
||||
|
||||
|
|
|
@ -102,24 +102,19 @@ query (void)
|
|||
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" },
|
||||
};
|
||||
|
||||
GimpParamDef *return_vals = NULL;
|
||||
int nargs = sizeof (args) / sizeof (args[0]);
|
||||
int nreturn_vals = 0;
|
||||
|
||||
INIT_I18N();
|
||||
gimp_install_procedure ("plug-in-rotate-colormap",
|
||||
"Colormap rotation as in xv",
|
||||
"Exchanges two color ranges. "
|
||||
"Based on code from Pavel Grinfeld (pavel@ml.com). "
|
||||
"This version written by Sven Anders (anderss@fmi.uni-passau.de).",
|
||||
"Based on code from Pavel Grinfeld (pavel@ml.com). "
|
||||
"This version written by Sven Anders (anderss@fmi.uni-passau.de).",
|
||||
"Sven Anders (anderss@fmi.uni-passau.de) and Pavel Grinfeld (pavel@ml.com)",
|
||||
"Sven Anders (anderss@fmi.uni-passau.de)",
|
||||
"04th April 1999",
|
||||
N_("<Image>/Image/Colors/Colormap Rotation..."),
|
||||
N_("<Image>/Layer/Colors/Colormap Rotation..."),
|
||||
"RGB*",
|
||||
GIMP_PLUGIN,
|
||||
nargs, nreturn_vals,
|
||||
args, return_vals);
|
||||
G_N_ELEMENTS (args), 0,
|
||||
args, NULL);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
|
Loading…
Reference in New Issue