Commit 2632cd8f authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

app/actions/documents-actions.c app/actions/documents-commands.c

2004-05-12  Michael Natterer  <mitch@gimp.org>

	* app/actions/documents-actions.c
	* app/actions/documents-commands.c
	* app/actions/edit-actions.c
	* app/actions/edit-commands.[ch]
	* app/actions/layers-actions.c
	* app/actions/layers-commands.c
	* app/actions/select-actions.c
	* app/actions/select-commands.[ch]
	* app/actions/vectors-actions.c
	* app/actions/vectors-commands.[ch]: added tooltips for actions
	which are now used for dialog buttons, added callback
	implementations which formerly lived in various widgets, moved
	some actions around and did some general cleanups.

	* menus/image-menu.xml.in: s/edit-stroke/select-stroke/

	* menus/Makefile.am
	* menus/selection-editor-menu.xml: new popup menu.

	* app/menus/menus.c: register <SelectionEditor> and <UndoEditor>
	UI managers.

	* app/widgets/gimpeditor.[ch]: added construct properties
	"menu-factory", "menu-identifier", "ui-path" and "popup-data".
	Implement GObject::constructor() and create the UI manager
	if all needed properties were set. Enables creating action
	buttons at widget construction time because they need a
	UI manager.

	(gimp_editor_add_action_button): changed to take a va_list of
	"extended" actions which are invoked if the resp. button emits
	"extended_clicked". Store the actions and their modifier masks in
	a list attached to the button.

	* app/widgets/gimpcontainerview.c
	(gimp_container_view_item_selected): if the view has container
	*and* context, simply change the context and return.

	(gimp_container_view_context_changed): don't emit "select_item"
	manually but simply call gimp_container_view_select_item().

	(gimp_container_view_viewable_dropped): use
	gimp_container_view_item_selected() instead of changing the
	context directly.

	* app/widgets/gimpcontainereditor.c
	(gimp_container_editor_select_item): update the UI manager.

	* app/widgets/gimpdockable.c: don't try to fiddle with the
	dialog's menu if it doesn't have a ui_path (happens if the UI
	manager is just a collection of actions for the dialog buttons and
	has no menu registered).

	* app/widgets/gimpimageeditor.c: connect to the image's "flush"
	signal and update the UI manager in the callback.

	* app/widgets/gimpitemtreeview.c: use GimpEditor's construct
	properties to create the UI manager so GimpItemTreeView subclasses
	can have action buttons. Update the UI manager in
	gimp_item_tree_view_select_item().

	* app/widgets/gimpbufferview.c
	* app/widgets/gimpcolormapeditor.c
	* app/widgets/gimpcontainergridview.c
	* app/widgets/gimpdatafactoryview.c
	* app/widgets/gimpfontview.c
	* app/widgets/gimpimageview.c
	* app/widgets/gimptemplateview.c
	* app/widgets/gimptoolview.c: changed calls to
	gimp_editor_add_action_button() accordingly and removed some
	unneeded select_item() implementations.

	* app/widgets/gimpchanneltreeview.c
	* app/widgets/gimpvectorstreeview.[ch]
	* app/widgets/gimpdocumentview.[ch]
	* app/widgets/gimplayertreeview.c
	* app/widgets/gimpselectioneditor.[ch]
	* app/widgets/gimpundoeditor.[ch]: use action buttons and removed
	lots of callbacks which went to the resp. action callbacks.

	* app/widgets/widgets-types.h: removed some now unneeded function
	prototypes.

	* app/gui/dialogs-constructors.c: changed (simplified) many dialog
	constructors accordingly.
parent 6750667d
2004-05-12 Michael Natterer <mitch@gimp.org>
* app/actions/documents-actions.c
* app/actions/documents-commands.c
* app/actions/edit-actions.c
* app/actions/edit-commands.[ch]
* app/actions/layers-actions.c
* app/actions/layers-commands.c
* app/actions/select-actions.c
* app/actions/select-commands.[ch]
* app/actions/vectors-actions.c
* app/actions/vectors-commands.[ch]: added tooltips for actions
which are now used for dialog buttons, added callback
implementations which formerly lived in various widgets, moved
some actions around and did some general cleanups.
* menus/image-menu.xml.in: s/edit-stroke/select-stroke/
* menus/Makefile.am
* menus/selection-editor-menu.xml: new popup menu.
* app/menus/menus.c: register <SelectionEditor> and <UndoEditor>
UI managers.
* app/widgets/gimpeditor.[ch]: added construct properties
"menu-factory", "menu-identifier", "ui-path" and "popup-data".
Implement GObject::constructor() and create the UI manager
if all needed properties were set. Enables creating action
buttons at widget construction time because they need a
UI manager.
(gimp_editor_add_action_button): extended to take a va_list of
"extended" actions which are invoked if the resp. button emits
"extended_clicked". Store the actions and their modifier masks in
a list attached to the button.
* app/widgets/gimpcontainerview.c
(gimp_container_view_item_selected): if the view has container
*and* context, simply change the context and return.
(gimp_container_view_context_changed): don't emit "select_item"
manually but simply call gimp_container_view_select_item().
(gimp_container_view_viewable_dropped): use
gimp_container_view_item_selected() instead of changing the
context directly.
* app/widgets/gimpcontainereditor.c
(gimp_container_editor_select_item): update the UI manager.
* app/widgets/gimpdockable.c: don't try to fiddle with the
dialog's menu if it doesn't have a ui_path (happens if the UI
manager is just a collection of actions for the dialog buttons and
has no menu registered).
* app/widgets/gimpimageeditor.c: connect to the image's "flush"
signal and update the UI manager in the callback.
* app/widgets/gimpitemtreeview.c: use GimpEditor's construct
properties to create the UI manager so GimpItemTreeView subclasses
can have action buttons. Update the UI manager in
gimp_item_tree_view_select_item().
* app/widgets/gimpbufferview.c
* app/widgets/gimpcolormapeditor.c
* app/widgets/gimpcontainergridview.c
* app/widgets/gimpdatafactoryview.c
* app/widgets/gimpfontview.c
* app/widgets/gimpimageview.c
* app/widgets/gimptemplateview.c
* app/widgets/gimptoolview.c: changed calls to
gimp_editor_add_action_button() accordingly and removed some
unneeded select_item() implementations.
* app/widgets/gimpchanneltreeview.c
* app/widgets/gimpvectorstreeview.[ch]
* app/widgets/gimpdocumentview.[ch]
* app/widgets/gimplayertreeview.c
* app/widgets/gimpselectioneditor.[ch]
* app/widgets/gimpundoeditor.[ch]: use action buttons and removed
lots of callbacks which went to the resp. action callbacks.
* app/widgets/widgets-types.h: removed some now unneeded function
prototypes.
* app/gui/dialogs-constructors.c: changed (simplified) many dialog
constructors accordingly.
2004-05-12 Sven Neumann <sven@gimp.org>
* libgimpwidgets/gimpwidgets.c (gimp_scale_entry_new_internal)
......
......@@ -27,10 +27,9 @@
#include "core/gimpcontext.h"
#include "widgets/gimpactiongroup.h"
#include "widgets/gimpcontainereditor.h"
#include "widgets/gimpcontainerview.h"
#include "widgets/gimphelp-ids.h"
#include "actions.h"
#include "documents-actions.h"
#include "documents-commands.h"
......@@ -43,7 +42,8 @@ static GimpActionEntry documents_actions[] =
GIMP_HELP_DOCUMENT_DIALOG },
{ "documents-open", GTK_STOCK_OPEN,
N_("_Open Image"), "", NULL,
N_("_Open Image"), "",
N_("Open the selected entry"),
G_CALLBACK (documents_open_document_cmd_callback),
GIMP_HELP_DOCUMENT_OPEN },
......@@ -58,12 +58,14 @@ static GimpActionEntry documents_actions[] =
GIMP_HELP_DOCUMENT_OPEN },
{ "documents-remove", GTK_STOCK_REMOVE,
N_("Remove _Entry"), "", NULL,
N_("Remove _Entry"), "",
N_("Remove the selected entry"),
G_CALLBACK (documents_remove_document_cmd_callback),
GIMP_HELP_DOCUMENT_REMOVE },
{ "documents-recreate-preview", GTK_STOCK_REFRESH,
N_("Recreate _Preview"), "", NULL,
N_("Recreate _Preview"), "",
N_("Recreate preview"),
G_CALLBACK (documents_recreate_preview_cmd_callback),
GIMP_HELP_DOCUMENT_REFRESH },
......@@ -91,14 +93,13 @@ void
documents_actions_update (GimpActionGroup *group,
gpointer data)
{
GimpContainerEditor *editor;
GimpContext *context;
GimpImagefile *imagefile;
GimpContext *context;
GimpImagefile *imagefile = NULL;
editor = GIMP_CONTAINER_EDITOR (data);
context = gimp_container_view_get_context (editor->view);
context = action_data_get_context (data);
imagefile = gimp_context_get_imagefile (context);
if (context)
imagefile = gimp_context_get_imagefile (context);
#define SET_SENSITIVE(action,condition) \
gimp_action_group_set_action_sensitive (group, action, (condition) != 0)
......
......@@ -18,15 +18,39 @@
#include "config.h"
#include <string.h>
#include <gtk/gtk.h>
#include "libgimpthumb/gimpthumb.h"
#include "libgimpwidgets/gimpwidgets.h"
#include "actions-types.h"
#include "core/gimp.h"
#include "core/gimpcontainer.h"
#include "core/gimpcontext.h"
#include "core/gimpimagefile.h"
#include "file/file-open.h"
#include "file/file-utils.h"
#include "widgets/gimpcontainerview.h"
#include "widgets/gimpdocumentview.h"
#include "display/gimpdisplay.h"
#include "display/gimpdisplay-foreach.h"
#include "documents-commands.h"
#include "file-commands.h"
#include "gimp-intl.h"
/* local function prototypes */
static void documents_open_image (GimpContext *context,
GimpImagefile *imagefile);
/* public functions */
......@@ -35,66 +59,213 @@ void
documents_open_document_cmd_callback (GtkAction *action,
gpointer data)
{
GimpDocumentView *view = GIMP_DOCUMENT_VIEW (data);
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
GimpContext *context;
GimpContainer *container;
GimpImagefile *imagefile;
context = gimp_container_view_get_context (editor->view);
container = gimp_container_view_get_container (editor->view);
imagefile = gimp_context_get_imagefile (context);
if (imagefile && gimp_container_have (container, GIMP_OBJECT (imagefile)))
{
documents_open_image (context, imagefile);
}
else
{
file_file_open_dialog (context->gimp, NULL, GTK_WIDGET (editor));
}
}
typedef struct _RaiseClosure RaiseClosure;
struct _RaiseClosure
{
const gchar *name;
gboolean found;
};
static void
documents_raise_display (gpointer data,
gpointer user_data)
{
GimpDisplay *gdisp = (GimpDisplay *) data;
RaiseClosure *closure = (RaiseClosure *) user_data;
const gchar *uri;
uri = gimp_object_get_name (GIMP_OBJECT (gdisp->gimage));
gtk_button_clicked (GTK_BUTTON (view->open_button));
if (uri && ! strcmp (closure->name, uri))
{
closure->found = TRUE;
gtk_window_present (GTK_WINDOW (gdisp->shell));
}
}
void
documents_raise_or_open_document_cmd_callback (GtkAction *action,
gpointer data)
{
GimpDocumentView *view = GIMP_DOCUMENT_VIEW (data);
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
GimpContext *context;
GimpContainer *container;
GimpImagefile *imagefile;
gimp_button_extended_clicked (GIMP_BUTTON (view->open_button),
GDK_SHIFT_MASK);
context = gimp_container_view_get_context (editor->view);
container = gimp_container_view_get_container (editor->view);
imagefile = gimp_context_get_imagefile (context);
if (imagefile && gimp_container_have (container, GIMP_OBJECT (imagefile)))
{
RaiseClosure closure;
closure.name = gimp_object_get_name (GIMP_OBJECT (imagefile));
closure.found = FALSE;
gimp_container_foreach (context->gimp->displays,
documents_raise_display,
&closure);
if (! closure.found)
documents_open_image (context, imagefile);
}
}
void
documents_file_open_dialog_cmd_callback (GtkAction *action,
gpointer data)
{
GimpDocumentView *view = GIMP_DOCUMENT_VIEW (data);
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
GimpContext *context;
GimpContainer *container;
GimpImagefile *imagefile;
context = gimp_container_view_get_context (editor->view);
container = gimp_container_view_get_container (editor->view);
gimp_button_extended_clicked (GIMP_BUTTON (view->open_button),
GDK_CONTROL_MASK);
imagefile = gimp_context_get_imagefile (context);
if (imagefile && gimp_container_have (container, GIMP_OBJECT (imagefile)))
{
file_file_open_dialog (context->gimp,
gimp_object_get_name (GIMP_OBJECT (imagefile)),
GTK_WIDGET (editor));
}
}
void
documents_remove_document_cmd_callback (GtkAction *action,
gpointer data)
{
GimpDocumentView *view = GIMP_DOCUMENT_VIEW (data);
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
GimpContext *context;
GimpContainer *container;
GimpImagefile *imagefile;
gtk_button_clicked (GTK_BUTTON (view->remove_button));
}
context = gimp_container_view_get_context (editor->view);
container = gimp_container_view_get_container (editor->view);
imagefile = gimp_context_get_imagefile (context);
if (imagefile && gimp_container_have (container, GIMP_OBJECT (imagefile)))
{
gimp_container_remove (container, GIMP_OBJECT (imagefile));
}
}
void
documents_recreate_preview_cmd_callback (GtkAction *action,
gpointer data)
{
GimpDocumentView *view = GIMP_DOCUMENT_VIEW (data);
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
GimpContext *context;
GimpContainer *container;
GimpImagefile *imagefile;
context = gimp_container_view_get_context (editor->view);
container = gimp_container_view_get_container (editor->view);
imagefile = gimp_context_get_imagefile (context);
gtk_button_clicked (GTK_BUTTON (view->refresh_button));
if (imagefile && gimp_container_have (container, GIMP_OBJECT (imagefile)))
{
gint preview_size;
preview_size = gimp_container_view_get_preview_size (editor->view, NULL);
gimp_imagefile_create_thumbnail (imagefile, context, preview_size);
}
}
void
documents_reload_previews_cmd_callback (GtkAction *action,
gpointer data)
{
GimpDocumentView *view = GIMP_DOCUMENT_VIEW (data);
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
GimpContainer *container;
container = gimp_container_view_get_container (editor->view);
gimp_button_extended_clicked (GIMP_BUTTON (view->refresh_button),
GDK_SHIFT_MASK);
gimp_container_foreach (container,
(GFunc) gimp_imagefile_update,
editor->view);
}
static void
documents_delete_dangling_foreach (GimpImagefile *imagefile,
GimpContainer *container)
{
if (gimp_thumbnail_peek_image (imagefile->thumbnail) ==
GIMP_THUMB_STATE_NOT_FOUND)
{
gimp_container_remove (container, GIMP_OBJECT (imagefile));
}
}
void
documents_delete_dangling_documents_cmd_callback (GtkAction *action,
gpointer data)
{
GimpDocumentView *view = GIMP_DOCUMENT_VIEW (data);
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
GimpContainer *container;
container = gimp_container_view_get_container (editor->view);
gimp_container_foreach (container,
(GFunc) documents_delete_dangling_foreach,
container);
}
/* private functions */
static void
documents_open_image (GimpContext *context,
GimpImagefile *imagefile)
{
const gchar *uri;
GimpImage *gimage;
GimpPDBStatusType status;
GError *error = NULL;
uri = gimp_object_get_name (GIMP_OBJECT (imagefile));
gimage = file_open_with_display (context->gimp, context,
uri, &status, &error);
if (! gimage && status != GIMP_PDB_CANCEL)
{
gchar *filename;
filename = file_utils_uri_to_utf8_filename (uri);
g_message (_("Opening '%s' failed:\n\n%s"),
filename, error->message);
g_clear_error (&error);
gimp_button_extended_clicked (GIMP_BUTTON (view->refresh_button),
GDK_CONTROL_MASK);
g_free (filename);
}
}
......@@ -64,15 +64,23 @@ static GimpActionEntry edit_actions[] =
{ "edit-buffer-menu", NULL, N_("Buffer") },
{ "edit-undo", GTK_STOCK_UNDO,
N_("_Undo"), "<control>Z", NULL,
N_("_Undo"), "<control>Z",
N_("Undo"),
G_CALLBACK (edit_undo_cmd_callback),
GIMP_HELP_EDIT_UNDO },
{ "edit-redo", GTK_STOCK_REDO,
N_("_Redo"), "<control>Y", NULL,
N_("_Redo"), "<control>Y",
N_("Redo"),
G_CALLBACK (edit_redo_cmd_callback),
GIMP_HELP_EDIT_REDO },
{ "edit-undo-clear", GTK_STOCK_CLEAR,
N_("_Clear Undo History"), "",
N_("Clear undo history"),
G_CALLBACK (edit_undo_clear_cmd_callback),
GIMP_HELP_EDIT_UNDO_CLEAR },
{ "edit-cut", GTK_STOCK_CUT,
N_("Cu_t"), "<control>X", NULL,
G_CALLBACK (edit_cut_cmd_callback),
......@@ -116,12 +124,7 @@ static GimpActionEntry edit_actions[] =
{ "edit-clear", GTK_STOCK_CLEAR,
N_("Cl_ear"), "<control>K", NULL,
G_CALLBACK (edit_clear_cmd_callback),
GIMP_HELP_EDIT_CLEAR },
{ "edit-stroke", GIMP_STOCK_SELECTION_STROKE,
N_("_Stroke Selection..."), NULL, NULL,
G_CALLBACK (edit_stroke_cmd_callback),
GIMP_HELP_SELECTION_STROKE }
GIMP_HELP_EDIT_CLEAR }
};
static GimpEnumActionEntry edit_fill_actions[] =
......@@ -205,8 +208,9 @@ edit_actions_update (GimpActionGroup *group,
gimp_action_group_set_action_sensitive (group, action, (condition) != 0)
{
gchar *undo_name = NULL;
gchar *redo_name = NULL;
gchar *undo_name = NULL;
gchar *redo_name = NULL;
gboolean enabled = FALSE;
if (gimage && gimp_image_undo_is_enabled (gimage))
{
......@@ -216,6 +220,8 @@ edit_actions_update (GimpActionGroup *group,
undo = gimp_undo_stack_peek (gimage->undo_stack);
redo = gimp_undo_stack_peek (gimage->redo_stack);
enabled = TRUE;
if (undo)
undo_name =
g_strdup_printf (_("_Undo %s"),
......@@ -230,8 +236,9 @@ edit_actions_update (GimpActionGroup *group,
SET_LABEL ("edit-undo", undo_name ? undo_name : _("_Undo"));
SET_LABEL ("edit-redo", redo_name ? redo_name : _("_Redo"));
SET_SENSITIVE ("edit-undo", undo_name);
SET_SENSITIVE ("edit-redo", redo_name);
SET_SENSITIVE ("edit-undo", enabled && undo_name);
SET_SENSITIVE ("edit-redo", enabled && redo_name);
SET_SENSITIVE ("edit-undo-clear", enabled && (redo_name || redo_name));
g_free (undo_name);
g_free (redo_name);
......@@ -249,7 +256,6 @@ edit_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("edit-fill-fg", drawable);
SET_SENSITIVE ("edit-fill-bg", drawable);
SET_SENSITIVE ("edit-fill-pattern", drawable);
SET_SENSITIVE ("edit-stroke", drawable && sel);
#undef SET_LABEL
#undef SET_SENSITIVE
......
......@@ -33,7 +33,6 @@
#include "core/gimpdrawable.h"
#include "core/gimpimage.h"
#include "core/gimpimage-undo.h"
#include "core/gimptoolinfo.h"
#include "display/gimpdisplay.h"
#include "display/gimpdisplayshell.h"
......@@ -43,7 +42,6 @@
#include "widgets/gimpdialogfactory.h"
#include "gui/dialogs.h"
#include "gui/stroke-dialog.h"
#include "actions.h"
#include "edit-commands.h"
......@@ -85,6 +83,44 @@ edit_redo_cmd_callback (GtkAction *action,
gimp_image_flush (gimage);
}
static void
edit_undo_clear_callback (GtkWidget *widget,
gboolean clear,
gpointer data)
{
if (clear)
{
GimpImage *gimage = data;
gimp_image_undo_disable (gimage);
gimp_image_undo_enable (gimage);
gimp_image_flush (gimage);
}
}
void
edit_undo_clear_cmd_callback (GtkAction *action,
gpointer data)
{
GimpImage *gimage;
GtkWidget *widget;
GtkWidget *dialog;
return_if_no_image (gimage, data);
return_if_no_widget (widget, data);
dialog = gimp_query_boolean_box (_("Clear Undo History"), widget,
gimp_standard_help_func,
GIMP_HELP_EDIT_UNDO_CLEAR,
GIMP_STOCK_QUESTION,
_("Really clear image's undo history?"),
GTK_STOCK_CLEAR, GTK_STOCK_CANCEL,
G_OBJECT (gimage),
"disconnect",
edit_undo_clear_callback,
gimage);
gtk_widget_show (dialog);
}
void
edit_cut_cmd_callback (GtkAction *action,
gpointer data)
......@@ -245,46 +281,6 @@ edit_fill_cmd_callback (GtkAction *action,
gimp_image_flush (gimage);
}
void
edit_stroke_cmd_callback (GtkAction *action,
gpointer data)
{
GimpImage *gimage;
GimpDrawable *drawable;
GtkWidget *widget;
return_if_no_drawable (gimage, drawable, data);
return_if_no_widget (widget, data);
edit_stroke_selection (GIMP_ITEM (gimp_image_get_mask (gimage)), widget);
}
void
edit_stroke_selection (GimpItem *item,
GtkWidget *parent)
{
GimpImage *gimage;
GimpDrawable *active_drawable;
GtkWidget *dialog;
g_return_if_fail (GIMP_IS_ITEM (item));
g_return_if_fail (GTK_IS_WIDGET (parent));
gimage = gimp_item_get_image (item);
active_drawable = gimp_image_active_drawable (gimage);
if (! active_drawable)
{
g_message (_("There is no active layer or channel to stroke to."));
return;
}
dialog = stroke_dialog_new (item, GIMP_STOCK_SELECTION_STROKE,
GIMP_HELP_SELECTION_STROKE,
parent);
gtk_widget_show (dialog);
}
/* private functions */
......
......@@ -24,6 +24,8 @@ void edit_undo_cmd_callback (GtkAction *action,
gpointer data);
void edit_redo_cmd_callback (GtkAction *action,
gpointer data);
void edit_undo_clear_cmd_callback (GtkAction *action,
gpointer data);
void edit_cut_cmd_callback (GtkAction *action,
gpointer data);
void edit_copy_cmd_callback (GtkAction *action,
......@@ -45,11 +47,6 @@ void edit_clear_cmd_callback (GtkAction *action,
void edit_fill_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void edit_stroke_cmd_callback (GtkAction *action,
gpointer data);
void edit_stroke_selection (GimpItem *item,
GtkWidget *parent);
#endif /* __EDIT_COMMANDS_H__ */
......@@ -119,7 +119,8 @@ static GimpActionEntry layers_actions[] =
GIMP_HELP_LAYER_LOWER_TO_BOTTOM },
{ "layers-anchor", GIMP_STOCK_ANCHOR,
N_("_Anchor Layer"), NULL, NULL,
N_("_Anchor Layer"), NULL,
N_("Anchor floating layer"),
G_CALLBACK (layers_anchor_cmd_callback),
GIMP_HELP_LAYER_ANCHOR },
......
......@@ -177,10 +177,10 @@ layers_raise_cmd_callback (GtkAction *action,
gpointer data)
{
GimpImage *gimage;
GimpLayer *active_layer;
return_if_no_layer (gimage, active_layer, data);
GimpLayer *layer;
return_if_no_layer (gimage, layer, data);
gimp_image_raise_layer (gimage, active_layer);
gimp_image_raise_layer (gimage, layer);
gimp_image_flush (gimage);
}
......@@ -189,10 +189,10 @@ layers_lower_cmd_callback (GtkAction *action,
gpointer data)
{
GimpImage *gimage;
GimpLayer *active_layer;
return_if_no_layer (gimage, active_layer, data);
GimpLayer *layer;
return_if_no_layer (gimage, layer, data);
gimp_image_lower_layer (gimage, active_layer);
gimp_image_lower_layer (gimage, layer);
gimp_image_flush (gimage);
}
......@@ -201,10 +201,10 @@ layers_raise_to_top_cmd_callback (GtkAction *action,
gpointer data)
{
GimpImage *gimage;
GimpLayer *active_layer;
return_if_no_layer (gimage, active_layer, data);
GimpLayer *layer;
return_if_no_layer (gimage, layer, data);
gimp_image_raise_layer_to_top (gimage, active_layer);
gimp_image_raise_layer_to_top (gimage, layer);
gimp_image_flush (gimage);
}
......@@ -213,10 +213,10 @@ layers_lower_to_bottom_cmd_callback (GtkAction *action,
gpointer data)
{
GimpImage *gimage;
GimpLayer *active_layer;
return_if_no_layer (gimage, active_layer, data);
GimpLayer *layer;
return_if_no_layer (gimage, layer, data);
gimp_image_lower_layer_to_bottom (gimage, active_layer);
gimp_image_lower_layer_to_bottom (gimage, layer);
gimp_image_flush (gimage);
}
......@@ -237,13 +237,13 @@ layers_duplicate_cmd_callback (GtkAction *action,
gpointer data)
{
GimpImage *gimage;
GimpLayer *active_layer;
GimpLayer *layer;
GimpLayer *new_layer;
return_if_no_layer (gimage, active_layer, data);
return_if_no_layer (gimage, layer, data);
new_layer =
GIMP_LAYER (gimp_item_duplicate (GIMP_ITEM (active_layer),
G_TYPE_FROM_INSTANCE (active_layer),
GIMP_LAYER (gimp_item_duplicate (GIMP_ITEM (layer),
G_TYPE_FROM_INSTANCE (layer),
TRUE));
gimp_image_add_layer (gimage, new_layer, -1);
......@@ -255,12 +255,12 @@ layers_anchor_cmd_callback (GtkAction *action,
gpointer data)
{
GimpImage *gimage;
GimpLayer *active_layer;
return_if_no_layer (gimage, active_layer, data);
GimpLayer *layer;
return_if_no_layer (gimage, layer, data);
if (gimp_layer_is_floating_sel (active_layer))
if (gimp_layer_is_floating_sel (layer))
{
floating_sel_anchor (active_layer);
floating_sel_anchor (layer);
gimp_image_flush (gimage);
}
}
......@@ -270,11 +270,10 @@ layers_merge_down_cmd_callback (GtkAction *action,
gpointer data)
{