removed...

2004-04-20  Michael Natterer  <mitch@gimp.org>

	* app/gui/*-commands.[ch]: removed...

	* app/actions/*-commands.[ch]: ...and added here.

	* app/gui/Makefile.am
	* app/gui/*-menu.c
	* app/gui/dialogs-constructors.c
	* app/gui/gui.c
	* app/gui/menus.c
	* app/actions/Makefile.am
	* app/actions/*-actions.c: changed accordingly.

	* app/actions/plug-in-actions.[ch]
	* app/actions/tools-actions.[ch]: new files.

	* app/Makefile.am: had to add more -u evilness because gui/
	and actions/ have cyclic dependencies.

	* menus/image-menu.xml: added some more items.
This commit is contained in:
Michael Natterer 2004-04-20 13:25:55 +00:00 committed by Michael Natterer
parent 5e3b9ec330
commit 661f6ddeb8
161 changed files with 630 additions and 10710 deletions

View File

@ -1,3 +1,25 @@
2004-04-20 Michael Natterer <mitch@gimp.org>
* app/gui/*-commands.[ch]: removed...
* app/actions/*-commands.[ch]: ...and added here.
* app/gui/Makefile.am
* app/gui/*-menu.c
* app/gui/dialogs-constructors.c
* app/gui/gui.c
* app/gui/menus.c
* app/actions/Makefile.am
* app/actions/*-actions.c: changed accordingly.
* app/actions/plug-in-actions.[ch]
* app/actions/tools-actions.[ch]: new files.
* app/Makefile.am: had to add more -u evilness because gui/
and actions/ have cyclic dependencies.
* menus/image-menu.xml: added some more items.
2004-04-20 Sven Neumann <sven@gimp.org>
* app/widgets/gimpwidgets-constructors.[ch]: added new function

View File

@ -76,10 +76,22 @@ INCLUDES = \
-I$(includedir)
gimp_2_1_LDFLAGS = \
$(mwindows) \
-u $(SYMPREFIX)gimp_container_filter \
-u $(SYMPREFIX)gimp_xml_parser_new \
-u $(SYMPREFIX)gimp_drawable_stroke_vectors
$(mwindows) \
-u $(SYMPREFIX)gimp_container_filter \
-u $(SYMPREFIX)gimp_xml_parser_new \
-u $(SYMPREFIX)gimp_drawable_stroke_vectors \
\
-u $(SYMPREFIX)convert_to_indexed \
-u $(SYMPREFIX)grid_dialog_new \
-u $(SYMPREFIX)info_dialog_new \
-u $(SYMPREFIX)info_window_create \
-u $(SYMPREFIX)offset_dialog_create \
-u $(SYMPREFIX)palette_import_dialog_show \
-u $(SYMPREFIX)resize_widget_new \
-u $(SYMPREFIX)stroke_dialog_new \
-u $(SYMPREFIX)file_open_dialog_show \
-u $(SYMPREFIX)file_save_dialog_show \
-u $(SYMPREFIX)color_notebook_new
gimp_2_1_LDADD = \
config/libappconfig.a \

View File

@ -9,58 +9,120 @@ libappactions_a_SOURCES = \
brushes-actions.h \
buffers-actions.c \
buffers-actions.h \
buffers-commands.c \
buffers-commands.h \
channels-actions.c \
channels-actions.h \
channels-commands.c \
channels-commands.h \
colormap-editor-actions.c \
colormap-editor-actions.h \
colormap-editor-commands.c \
colormap-editor-commands.h \
data-commands.c \
data-commands.h \
debug-actions.c \
debug-actions.h \
debug-commands.c \
debug-commands.h \
dialogs-actions.c \
dialogs-actions.h \
dialogs-commands.c \
dialogs-commands.h \
dockable-actions.c \
dockable-actions.h \
dockable-commands.c \
dockable-commands.h \
documents-actions.c \
documents-actions.h \
documents-commands.c \
documents-commands.h \
drawable-actions.c \
drawable-actions.h \
drawable-commands.c \
drawable-commands.h \
edit-actions.c \
edit-actions.h \
edit-commands.c \
edit-commands.h \
error-console-actions.c \
error-console-actions.h \
error-console-commands.c \
error-console-commands.h \
file-actions.c \
file-actions.h \
file-commands.c \
file-commands.h \
fonts-actions.c \
fonts-actions.h \
fonts-commands.c \
fonts-commands.h \
gradient-editor-actions.c \
gradient-editor-actions.h \
gradient-editor-commands.c \
gradient-editor-commands.h \
gradients-actions.c \
gradients-actions.h \
gradients-commands.c \
gradients-commands.h \
help-actions.c \
help-actions.h \
help-commands.c \
help-commands.h \
image-actions.c \
image-actions.h \
image-commands.c \
image-commands.h \
images-actions.c \
images-actions.h \
images-commands.c \
images-commands.h \
layers-actions.c \
layers-actions.h \
layers-commands.c \
layers-commands.h \
palette-editor-actions.c \
palette-editor-actions.h \
palette-editor-commands.c \
palette-editor-commands.h \
palettes-actions.c \
palettes-actions.h \
palettes-commands.c \
palettes-commands.h \
patterns-actions.c \
patterns-actions.h \
plug-in-actions.c \
plug-in-actions.h \
plug-in-commands.c \
plug-in-commands.h \
qmask-actions.c \
qmask-actions.h \
qmask-commands.c \
qmask-commands.h \
select-actions.c \
select-actions.h \
select-commands.c \
select-commands.h \
templates-actions.c \
templates-actions.h \
templates-commands.c \
templates-commands.h \
tool-options-actions.c \
tool-options-actions.h \
tool-options-commands.c \
tool-options-commands.h \
tools-actions.c \
tools-actions.h \
tools-commands.c \
tools-commands.h \
vectors-actions.c \
vectors-actions.h \
vectors-commands.c \
vectors-commands.h \
view-actions.c \
view-actions.h
view-actions.h \
view-commands.c \
view-commands.h
EXTRA_DIST = makefile.msc

View File

@ -34,7 +34,7 @@
#include "widgets/gimphelp-ids.h"
#include "brushes-actions.h"
#include "gui/data-commands.h"
#include "data-commands.h"
#include "gimp-intl.h"

View File

@ -32,7 +32,7 @@
#include "widgets/gimphelp-ids.h"
#include "buffers-actions.h"
#include "gui/buffers-commands.h"
#include "buffers-commands.h"
#include "gimp-intl.h"

View File

@ -20,7 +20,7 @@
#include <gtk/gtk.h>
#include "gui-types.h"
#include "actions-types.h"
#include "widgets/gimpbufferview.h"

View File

@ -33,7 +33,7 @@
#include "widgets/gimpitemtreeview.h"
#include "channels-actions.h"
#include "gui/channels-commands.h"
#include "channels-commands.h"
#include "gimp-intl.h"

View File

@ -25,7 +25,7 @@
#include "libgimpcolor/gimpcolor.h"
#include "libgimpwidgets/gimpwidgets.h"
#include "gui-types.h"
#include "actions-types.h"
#include "core/gimp.h"
#include "core/gimpchannel.h"

View File

@ -31,7 +31,7 @@
#include "widgets/gimphelp-ids.h"
#include "colormap-editor-actions.h"
#include "gui/colormap-editor-commands.h"
#include "colormap-editor-commands.h"
#include "gimp-intl.h"

View File

@ -22,7 +22,7 @@
#include "libgimpwidgets/gimpwidgets.h"
#include "gui-types.h"
#include "actions-types.h"
#include "widgets/gimpcolormapeditor.h"

View File

@ -31,7 +31,7 @@
#include "widgets/gimphelp-ids.h"
#include "colormap-editor-actions.h"
#include "gui/colormap-editor-commands.h"
#include "colormap-editor-commands.h"
#include "gimp-intl.h"

View File

@ -22,7 +22,7 @@
#include "libgimpwidgets/gimpwidgets.h"
#include "gui-types.h"
#include "actions-types.h"
#include "widgets/gimpcolormapeditor.h"

View File

@ -20,7 +20,7 @@
#include <gtk/gtk.h>
#include "gui-types.h"
#include "actions-types.h"
#include "widgets/gimpdatafactoryview.h"

View File

@ -27,7 +27,7 @@
#include "widgets/gimpactiongroup.h"
#include "debug-actions.h"
#include "gui/debug-commands.h"
#include "debug-commands.h"
static GimpActionEntry debug_actions[] =

View File

@ -24,7 +24,7 @@
#include "libgimpbase/gimpbase.h"
#include "gui-types.h"
#include "actions-types.h"
#include "core/gimpobject.h"
@ -32,7 +32,7 @@
#include "widgets/gimpmenufactory.h"
#include "debug-commands.h"
#include "menus.h"
#include "gui/menus.h"
#ifdef ENABLE_DEBUG_MENU

View File

@ -28,7 +28,7 @@
#include "widgets/gimphelp-ids.h"
#include "dialogs-actions.h"
#include "gui/dialogs-commands.h"
#include "dialogs-commands.h"
#include "gimp-intl.h"

View File

@ -24,14 +24,14 @@
#include "libgimpwidgets/gimpwidgets.h"
#include "gui-types.h"
#include "actions-types.h"
#include "widgets/gimpdialogfactory.h"
#include "widgets/gimpdockable.h"
#include "widgets/gimpdockbook.h"
#include "widgets/gimpimagedock.h"
#include "dialogs.h"
#include "gui/dialogs.h"
#include "dialogs-commands.h"

View File

@ -38,7 +38,7 @@
#include "dialogs-actions.h"
#include "dockable-actions.h"
#include "gui/dockable-commands.h"
#include "dockable-commands.h"
#include "gimp-intl.h"

View File

@ -24,7 +24,7 @@
#include "libgimpwidgets/gimpwidgets.h"
#include "gui-types.h"
#include "actions-types.h"
#include "widgets/gimpcontainerview.h"
#include "widgets/gimpcontainerview-utils.h"
@ -34,7 +34,7 @@
#include "widgets/gimpimagedock.h"
#include "widgets/gimpsessioninfo.h"
#include "dialogs.h"
#include "gui/dialogs.h"
#include "dockable-commands.h"

View File

@ -32,7 +32,7 @@
#include "widgets/gimphelp-ids.h"
#include "documents-actions.h"
#include "gui/documents-commands.h"
#include "documents-commands.h"
#include "gimp-intl.h"

View File

@ -22,7 +22,7 @@
#include "libgimpwidgets/gimpwidgets.h"
#include "gui-types.h"
#include "actions-types.h"
#include "widgets/gimpdocumentview.h"

View File

@ -37,7 +37,7 @@
#include "display/gimpdisplayshell.h"
#include "drawable-actions.h"
#include "gui/drawable-commands.h"
#include "drawable-commands.h"
#include "gimp-intl.h"

View File

@ -24,7 +24,7 @@
#include "libgimpwidgets/gimpwidgets.h"
#include "gui-types.h"
#include "actions-types.h"
#include "core/gimp.h"
#include "core/gimpcontext.h"
@ -42,7 +42,7 @@
#include "display/gimpdisplay.h"
#include "drawable-commands.h"
#include "offset-dialog.h"
#include "gui/offset-dialog.h"
#include "gimp-intl.h"

View File

@ -42,7 +42,7 @@
#include "display/gimpdisplayshell-selection.h"
#include "edit-actions.h"
#include "gui/edit-commands.h"
#include "edit-commands.h"
#include "gimp-intl.h"

View File

@ -24,7 +24,7 @@
#include "libgimpwidgets/gimpwidgets.h"
#include "gui-types.h"
#include "actions-types.h"
#include "core/gimp.h"
#include "core/gimp-edit.h"
@ -44,9 +44,10 @@
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpdialogfactory.h"
#include "dialogs.h"
#include "gui/dialogs.h"
#include "gui/stroke-dialog.h"
#include "edit-commands.h"
#include "stroke-dialog.h"
#include "gimp-intl.h"

View File

@ -29,7 +29,7 @@
#include "widgets/gimphelp-ids.h"
#include "error-console-actions.h"
#include "gui/error-console-commands.h"
#include "error-console-commands.h"
#include "gimp-intl.h"

View File

@ -22,7 +22,7 @@
#include "libgimpwidgets/gimpwidgets.h"
#include "gui-types.h"
#include "actions-types.h"
#include "widgets/gimperrorconsole.h"

View File

@ -39,7 +39,7 @@
#include "display/gimpdisplayshell.h"
#include "file-actions.h"
#include "gui/file-commands.h"
#include "file-commands.h"
#include "gimp-intl.h"

View File

@ -24,7 +24,7 @@
#include "libgimpwidgets/gimpwidgets.h"
#include "gui-types.h"
#include "actions-types.h"
#include "config/gimpguiconfig.h"
@ -48,12 +48,13 @@
#include "display/gimpdisplay-foreach.h"
#include "display/gimpdisplayshell.h"
#include "dialogs.h"
#include "gui/dialogs.h"
#include "gui/file-new-dialog.h"
#include "gui/file-open-dialog.h"
#include "gui/file-save-dialog.h"
#include "gui/menus.h"
#include "file-commands.h"
#include "file-new-dialog.h"
#include "file-open-dialog.h"
#include "file-save-dialog.h"
#include "menus.h"
#include "gimp-intl.h"

View File

@ -34,7 +34,7 @@
#include "widgets/gimphelp-ids.h"
#include "fonts-actions.h"
#include "gui/fonts-commands.h"
#include "fonts-commands.h"
#include "gimp-intl.h"

View File

@ -20,7 +20,7 @@
#include <gtk/gtk.h>
#include "gui-types.h"
#include "actions-types.h"
#include "widgets/gimpfontview.h"

View File

@ -35,7 +35,7 @@
#include "widgets/gimphelp-ids.h"
#include "gradient-editor-actions.h"
#include "gui/gradient-editor-commands.h"
#include "gradient-editor-commands.h"
#include "gimp-intl.h"

View File

@ -22,7 +22,7 @@
#include "libgimpwidgets/gimpwidgets.h"
#include "gui-types.h"
#include "actions-types.h"
#include "core/gimp.h"
#include "core/gimpcontext.h"
@ -33,8 +33,9 @@
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpviewabledialog.h"
#include "color-notebook.h"
#include "dialogs.h"
#include "gui/color-notebook.h"
#include "gui/dialogs.h"
#include "gradient-editor-commands.h"
#include "gimp-intl.h"

View File

@ -33,9 +33,9 @@
#include "widgets/gimpdatafactoryview.h"
#include "widgets/gimphelp-ids.h"
#include "gui/data-commands.h"
#include "data-commands.h"
#include "gradients-actions.h"
#include "gui/gradients-commands.h"
#include "gradients-commands.h"
#include "gimp-intl.h"

View File

@ -22,7 +22,7 @@
#include "libgimpwidgets/gimpwidgets.h"
#include "gui-types.h"
#include "actions-types.h"
#include "core/gimpgradient.h"
#include "core/gimpcontext.h"

View File

@ -28,7 +28,7 @@
#include "widgets/gimphelp-ids.h"
#include "help-actions.h"
#include "gui/help-commands.h"
#include "help-commands.h"
#include "gimp-intl.h"

View File

@ -22,7 +22,7 @@
#include "libgimpwidgets/gimpwidgets.h"
#include "gui-types.h"
#include "actions-types.h"
#include "help-commands.h"

View File

@ -38,7 +38,7 @@
#include "display/gimpdisplayshell.h"
#include "image-actions.h"
#include "gui/image-commands.h"
#include "image-commands.h"
#include "gimp-intl.h"

View File

@ -23,7 +23,7 @@
#include "libgimpbase/gimputils.h"
#include "libgimpwidgets/gimpwidgets.h"
#include "gui-types.h"
#include "actions-types.h"
#include "config/gimpguiconfig.h"
@ -49,10 +49,11 @@
#include "display/gimpdisplayshell.h"
#include "display/gimpprogress.h"
#include "convert-dialog.h"
#include "gui/convert-dialog.h"
#include "gui/grid-dialog.h"
#include "gui/resize-dialog.h"
#include "image-commands.h"
#include "grid-dialog.h"
#include "resize-dialog.h"
#include "gimp-intl.h"

View File

@ -32,7 +32,7 @@
#include "widgets/gimpcontainerview.h"
#include "images-actions.h"
#include "gui/images-commands.h"
#include "images-commands.h"
#include "gimp-intl.h"

View File

@ -20,7 +20,7 @@
#include <gtk/gtk.h>
#include "gui-types.h"
#include "actions-types.h"
#include "core/gimp.h"
#include "core/gimpimage.h"

View File

@ -38,7 +38,7 @@
#include "display/gimpdisplayshell.h"
#include "layers-actions.h"
#include "gui/layers-commands.h"
#include "layers-commands.h"
#include "gimp-intl.h"

View File

@ -26,7 +26,7 @@
#include "libgimpbase/gimpbase.h"
#include "libgimpwidgets/gimpwidgets.h"
#include "gui-types.h"
#include "actions-types.h"
#include "core/gimp.h"
#include "core/gimpchannel-select.h"
@ -58,9 +58,10 @@
#include "tools/gimptexttool.h"
#include "tools/tool_manager.h"
#include "gui/resize-dialog.h"
#include "layers-commands.h"
#include "image-commands.h"
#include "resize-dialog.h"
#include "gimp-intl.h"

View File

@ -29,7 +29,7 @@
#include "widgets/gimppaletteeditor.h"
#include "palette-editor-actions.h"
#include "gui/palette-editor-commands.h"
#include "palette-editor-commands.h"
#include "gimp-intl.h"

View File

@ -22,7 +22,7 @@
#include "libgimpwidgets/gimpwidgets.h"
#include "gui-types.h"
#include "actions-types.h"
#include "widgets/gimppaletteeditor.h"

View File

@ -33,9 +33,9 @@
#include "widgets/gimpdatafactoryview.h"
#include "widgets/gimphelp-ids.h"
#include "gui/data-commands.h"
#include "data-commands.h"
#include "palettes-actions.h"
#include "gui/palettes-commands.h"
#include "palettes-commands.h"
#include "gimp-intl.h"

View File

@ -22,7 +22,7 @@
#include "libgimpwidgets/gimpwidgets.h"
#include "gui-types.h"
#include "actions-types.h"
#include "core/gimppalette.h"
#include "core/gimpcontainer.h"
@ -33,7 +33,8 @@
#include "widgets/gimphelp-ids.h"
#include "widgets/gimppreview.h"
#include "palette-import-dialog.h"
#include "gui/palette-import-dialog.h"
#include "palettes-commands.h"
#include "gimp-intl.h"

View File

@ -33,7 +33,7 @@
#include "widgets/gimpdatafactoryview.h"
#include "widgets/gimphelp-ids.h"
#include "gui/data-commands.h"
#include "data-commands.h"
#include "patterns-actions.h"
#include "gimp-intl.h"

View File

@ -0,0 +1,109 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "actions-types.h"
#include "core/gimp.h"
#include "core/gimpchannel.h"
#include "core/gimpcontext.h"
#include "core/gimpimage.h"
#include "core/gimplayer.h"
#include "core/gimplist.h"
#include "core/gimptoolinfo.h"
#include "core/gimpundostack.h"
#include "plug-in/plug-ins.h"
#include "widgets/gimpactiongroup.h"
#include "widgets/gimphelp-ids.h"
#include "display/gimpdisplay.h"
#include "display/gimpdisplayshell.h"
#include "plug-in-actions.h"
#include "plug-in-commands.h"
#include "gimp-intl.h"
static GimpActionEntry plug_in_actions[] =
{
{ "plug-in-menu", NULL, N_("/Filte_rs") },
{ "plug-in-blur-menu", NULL, N_("_Blur") },
{ "plug-in-colors-menu", NULL, N_("_Colors") },
{ "plug-in-colors-map-menu", NULL, N_("Ma_p") },
{ "plug-in-noise-menu", NULL, N_("_Noise") },
{ "pluf-in-edge-detect-menu", NULL, N_("Edge-De_tect") },
{ "plug-in-enhance-menu", NULL, N_("En_hance") },
{ "plug-in-generic-menu", NULL, N_("_Generic") },
{ "plug-in-glass-effects-menu", NULL, N_("Gla_ss Effects") },
{ "plug-in-light-effects-menu", NULL, N_("_Light Effects") },
{ "plug-in-distorts-menu", NULL, N_("_Distorts") },
{ "plug-in-artistic-menu", NULL, N_("_Artistic") },
{ "plug-in-map-menu", NULL, N_("_Map") },
{ "plug-in-render-menu", NULL, N_("_Render") },
{ "plug-in-render-clouds-menu", NULL, N_("_Clouds") },
{ "plug-in-render-nature-menu", NULL, N_("_Nature") },
{ "plug-in-render-pattern-menu", NULL, N_("_Pattern") },
{ "plug-in-web-menu", NULL, N_("_Web") },
{ "plug-in-animation-menu", NULL, N_("An_imation") },
{ "plug-in-combine-menu", NULL, N_("C_ombine") },
{ "plug-in-toys-menu", NULL, N_("To_ys") }
};
static GimpEnumActionEntry plug_in_repeat_actions[] =
{
{ "plug-in-repeat", GTK_STOCK_EXECUTE,
N_("Repeat Last"), "<control>F", NULL,
FALSE,
GIMP_HELP_FILTER_REPEAT },
{ "plug-in-reshow", GIMP_STOCK_RESHOW_FILTER,
N_("Re-Show Last"), "<control><shift>F", NULL,
TRUE,
GIMP_HELP_FILTER_RESHOW }
};
void
plug_in_actions_setup (GimpActionGroup *group,
gpointer data)
{
gimp_action_group_add_actions (group,
plug_in_actions,
G_N_ELEMENTS (plug_in_actions),
data);
gimp_action_group_add_enum_actions (group,
plug_in_repeat_actions,
G_N_ELEMENTS (plug_in_repeat_actions),
G_CALLBACK (plug_in_repeat_cmd_callback),
data);
}
void
plug_in_actions_update (GimpActionGroup *group,
gpointer data)
{
}

View File

@ -16,14 +16,14 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __HELP_COMMANDS_H__
#define __HELP_COMMANDS_H__
#ifndef __PLUG_IN_ACTIONS_H__
#define __PLUG_IN_ACTIONS_H__
void help_help_cmd_callback (GtkWidget *widget,
gpointer data);
void help_context_help_cmd_callback (GtkWidget *widget,
gpointer data);
void plug_in_actions_setup (GimpActionGroup *group,
gpointer data);
void plug_in_actions_update (GimpActionGroup *group,
gpointer data);
#endif /* __HELP_COMMANDS_H__ */
#endif /* __PLUG_IN_ACTIONS_H__ */

View File

@ -22,7 +22,7 @@
#include "libgimpwidgets/gimpwidgets.h"
#include "gui-types.h"
#include "actions-types.h"
#include "core/gimp.h"
#include "core/gimpcontext.h"
@ -38,8 +38,9 @@
#include "display/gimpdisplay.h"
#include "gui/plug-in-menus.h"
#include "plug-in-commands.h"
#include "plug-in-menus.h"
#define return_if_no_display(gdisp,data) \

View File

@ -33,7 +33,7 @@
#include "display/gimpdisplayshell.h"
#include "qmask-actions.h"
#include "gui/qmask-commands.h"
#include "qmask-commands.h"
#include "gimp-intl.h"

View File

@ -23,7 +23,7 @@
#include "libgimpcolor/gimpcolor.h"
#include "libgimpwidgets/gimpwidgets.h"
#include "gui-types.h"
#include "actions-types.h"
#include "core/gimp.h"
#include "core/gimpchannel.h"

View File

@ -33,7 +33,7 @@
#include "display/gimpdisplayshell.h"
#include "qmask-actions.h"
#include "gui/qmask-commands.h"
#include "qmask-commands.h"
#include "gimp-intl.h"

View File

@ -23,7 +23,7 @@
#include "libgimpcolor/gimpcolor.h"
#include "libgimpwidgets/gimpwidgets.h"
#include "gui-types.h"
#include "actions-types.h"
#include "core/gimp.h"
#include "core/gimpchannel.h"

View File

@ -35,9 +35,9 @@
#include "display/gimpdisplayshell.h"
#include "select-actions.h"
#include "gui/select-commands.h"
#include "gui/tools-commands.h"
#include "gui/vectors-commands.h"
#include "select-commands.h"
#include "tools-commands.h"
#include "vectors-commands.h"
#include "gimp-intl.h"

View File

@ -23,7 +23,7 @@
#include "libgimpmath/gimpmath.h"
#include "libgimpwidgets/gimpwidgets.h"
#include "gui-types.h"
#include "actions-types.h"
#include "core/gimp.h"
#include "core/gimpchannel.h"
@ -40,7 +40,8 @@
#include "display/gimpdisplay.h"
#include "display/gimpdisplayshell.h"
#include "dialogs.h"
#include "gui/dialogs.h"
#include "select-commands.h"
#include "gimp-intl.h"

View File

@ -32,7 +32,7 @@
#include "widgets/gimphelp-ids.h"
#include "templates-actions.h"
#include "gui/templates-commands.h"
#include "templates-commands.h"
#include "gimp-intl.h"

View File

@ -22,7 +22,7 @@
#include "libgimpwidgets/gimpwidgets.h"
#include "gui-types.h"
#include "actions-types.h"
#include "config/gimpconfig.h"
#include "config/gimpconfig-utils.h"
@ -39,8 +39,9 @@
#include "widgets/gimptemplateview.h"
#include "widgets/gimpviewabledialog.h"
#include "dialogs.h"
#include "file-new-dialog.h"
#include "gui/dialogs.h"
#include "gui/file-new-dialog.h"
#include "templates-commands.h"
#include "gimp-intl.h"

View File

@ -33,7 +33,7 @@
#include "widgets/gimphelp-ids.h"
#include "tool-options-actions.h"
#include "gui/tool-options-commands.h"
#include "tool-options-commands.h"
#include "gimp-intl.h"

View File

@ -24,7 +24,7 @@
#include "libgimpwidgets/gimpwidgets.h"
#include "gui-types.h"
#include "actions-types.h"
#include "config/gimpconfig.h"
#include "config/gimpconfig-utils.h"

114
app/actions/tools-actions.c Normal file
View File

@ -0,0 +1,114 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "actions-types.h"
#include "core/gimp.h"
#include "core/gimplist.h"
#include "core/gimptoolinfo.h"
#include "widgets/gimpactiongroup.h"
#include "widgets/gimphelp-ids.h"
#include "actions/tools-actions.h"
#include "actions/tools-commands.h"
#include "gimp-intl.h"
static GimpActionEntry tools_actions[] =
{
{ "tools-menu", NULL,
N_("_Tools") },
{ "tools-select-menu", NULL,
N_("_Selection Tools") },
{ "tools-paint-menu", NULL,
N_("_Paint Tools") },
{ "tools-transform-menu", NULL,
N_("/Tools/_Transform Tools") },
{ "tools-color-menu", NULL,
N_("_Color Tools") },
{ "tools-default-colors", GIMP_STOCK_DEFAULT_COLORS,
N_("_Default Colors"), "D", NULL,
G_CALLBACK (tools_default_colors_cmd_callback),
GIMP_HELP_TOOLBOX_DEFAULT_COLORS },
{ "tools-swap-colors", GIMP_STOCK_SWAP_COLORS,
N_("S_wap Colors"), "X", NULL,
G_CALLBACK (tools_swap_colors_cmd_callback),
GIMP_HELP_TOOLBOX_SWAP_COLORS }
};
void
tools_actions_setup (GimpActionGroup *group,
gpointer data)
{
GList *list;
gimp_action_group_add_actions (group,
tools_actions,
G_N_ELEMENTS (tools_actions),
data);
for (list = GIMP_LIST (group->gimp->tool_info_list)->list;
list;
list = g_list_next (list))
{
GimpToolInfo *tool_info = list->data;
if (tool_info->menu_path)
{
GimpStringActionEntry entry;
const gchar *stock_id;
const gchar *identifier;
stock_id = gimp_viewable_get_stock_id (GIMP_VIEWABLE (tool_info));
identifier = gimp_object_get_name (GIMP_OBJECT (tool_info));
entry.name = identifier; /* FIXME */
entry.stock_id = stock_id;
entry.label = tool_info->menu_path;
entry.accelerator = tool_info->menu_accel;
entry.tooltip = tool_info->blurb;
entry.value = identifier;
gimp_action_group_add_string_actions (group,
&entry, 1,
G_CALLBACK (tools_select_cmd_callback),
data);
}
}
}
void
tools_actions_update (GimpActionGroup *group,
gpointer data)
{
}

View File

@ -16,12 +16,14 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __FONTS_COMMANDS_H__
#define __FONTS_COMMANDS_H__
#ifndef __TOOLS_ACTIONS_H__
#define __TOOLS_ACTIONS_H__
void fonts_refresh_cmd_callback (GtkWidget *widget,
gpointer data);
void tools_actions_setup (GimpActionGroup *group,
gpointer data);
void tools_actions_update (GimpActionGroup *group,
gpointer data);
#endif /* __FONTS_COMMANDS_H__ */
#endif /* __TOOLS_ACTIONS_H__ */

View File

@ -20,7 +20,7 @@
#include <gtk/gtk.h>
#include "gui-types.h"
#include "actions-types.h"
#include "core/gimp.h"
#include "core/gimpcontainer.h"
@ -35,6 +35,8 @@
#include "tools/gimptool.h"
#include "tools/tool_manager.h"
#include "tools-commands.h"
#define return_if_no_gimp(gimp,data) \
if (GIMP_IS_DISPLAY (data)) \

View File

@ -33,7 +33,7 @@
#include "widgets/gimpitemtreeview.h"
#include "vectors-actions.h"
#include "gui/vectors-commands.h"
#include "vectors-commands.h"
#include "gimp-intl.h"

View File

@ -24,7 +24,7 @@
#include "libgimpwidgets/gimpwidgets.h"
#include "gui-types.h"
#include "actions-types.h"
#include "core/gimp.h"
#include "core/gimpchannel.h"
@ -54,7 +54,8 @@
#include "tools/gimpvectortool.h"
#include "tools/tool_manager.h"
#include "stroke-dialog.h"
#include "gui/stroke-dialog.h"
#include "vectors-commands.h"
#include "gimp-intl.h"

View File

@ -40,7 +40,7 @@
#include "display/gimpdisplayshell-selection.h"
#include "view-actions.h"
#include "gui/view-commands.h"
#include "view-commands.h"
#include "gimp-intl.h"

View File

@ -22,7 +22,7 @@
#include "libgimpwidgets/gimpwidgets.h"
#include "gui-types.h"
#include "actions-types.h"
#include "config/gimpguiconfig.h"
@ -41,9 +41,10 @@
#include "widgets/gimpdialogfactory.h"
#include "widgets/gimpitemfactory.h"
#include "dialogs.h"
#include "info-dialog.h"
#include "info-window.h"
#include "gui/dialogs.h"
#include "gui/info-dialog.h"
#include "gui/info-window.h"
#include "view-commands.h"

View File

@ -69,20 +69,21 @@
#include "display/gimpdisplayshell.h"
#include "display/gimpnavigationview.h"
#include "actions/channels-commands.h"
#include "actions/edit-commands.h"
#include "actions/file-commands.h"
#include "actions/images-commands.h"
#include "actions/layers-commands.h"
#include "actions/templates-commands.h"
#include "actions/vectors-commands.h"
#include "about-dialog.h"
#include "channels-commands.h"
#include "dialogs.h"
#include "dialogs-constructors.h"
#include "edit-commands.h"
#include "file-commands.h"
#include "file-new-dialog.h"
#include "images-commands.h"
#include "layers-commands.h"
#include "module-browser.h"
#include "preferences-dialog.h"
#include "templates-commands.h"
#include "tips-dialog.h"
#include "vectors-commands.h"
#include "gimp-intl.h"

View File

@ -61,112 +61,54 @@ dialogs_sources = \
menus_sources = \
brushes-menu.c \
brushes-menu.h \
buffers-commands.c \
buffers-commands.h \
buffers-menu.c \
buffers-menu.h \
channels-commands.c \
channels-commands.h \
channels-menu.c \
channels-menu.h \
colormap-editor-commands.c \
colormap-editor-commands.h \
colormap-editor-menu.c \
colormap-editor-menu.h \
data-commands.c \
data-commands.h \
debug-commands.c \
debug-commands.h \
dialogs-commands.c \
dialogs-commands.h \
dialogs-menu.c \
dialogs-menu.h \
dockable-commands.c \
dockable-commands.h \
documents-commands.c \
documents-commands.h \
documents-menu.c \
documents-menu.h \
drawable-commands.c \
drawable-commands.h \
edit-commands.c \
edit-commands.h \
error-console-commands.c \
error-console-commands.h \
error-console-menu.c \
error-console-menu.h \
file-commands.c \
file-commands.h \
file-open-menu.c \
file-open-menu.h \
file-save-menu.c \
file-save-menu.h \
fonts-commands.c \
fonts-commands.h \
fonts-menu.c \
fonts-menu.h \
gradient-editor-commands.c \
gradient-editor-commands.h \
gradient-editor-menu.c \
gradient-editor-menu.h \
gradients-commands.c \
gradients-commands.h \
gradients-menu.c \
gradients-menu.h \
help-commands.c \
help-commands.h \
image-commands.c \
image-commands.h \
image-menu.c \
image-menu.h \
images-commands.c \
images-commands.h \
images-menu.c \
images-menu.h \
layers-commands.c \
layers-commands.h \
layers-menu.c \
layers-menu.h \
menus.c \
menus.h \
palette-editor-commands.c \
palette-editor-commands.h \
palette-editor-menu.c \
palette-editor-menu.h \
palettes-commands.c \
palettes-commands.h \
palettes-menu.c \
palettes-menu.h \
patterns-menu.c \
patterns-menu.h \
plug-in-commands.c \
plug-in-commands.h \
plug-in-menus.c \
plug-in-menus.h \
qmask-commands.c \
qmask-commands.h \
qmask-menu.c \
qmask-menu.h \
select-commands.c \
select-commands.h \
templates-commands.c \
templates-commands.h \
templates-menu.c \
templates-menu.h \
tool-options-menu.c \
tool-options-menu.h \
tool-options-commands.c \
tool-options-commands.h \
toolbox-menu.c \
toolbox-menu.h \
tools-commands.c \
tools-commands.h \
vectors-commands.c \
vectors-commands.h \
vectors-menu.c \
vectors-menu.h \
view-commands.c \
view-commands.h
vectors-menu.h
libappgui_a_SOURCES = \
$(dialogs_sources) \

View File

@ -33,8 +33,9 @@
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpitemfactory.h"
#include "actions/data-commands.h"
#include "brushes-menu.h"
#include "data-commands.h"
#include "menus.h"
#include "gimp-intl.h"

View File

@ -1,68 +0,0 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "gui-types.h"
#include "widgets/gimpbufferview.h"
#include "buffers-commands.h"
#include "gimp-intl.h"
/* public functionss */
void
buffers_paste_buffer_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpBufferView *view = GIMP_BUFFER_VIEW (data);
gtk_button_clicked (GTK_BUTTON (view->paste_button));
}
void
buffers_paste_buffer_into_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpBufferView *view = GIMP_BUFFER_VIEW (data);
gtk_button_clicked (GTK_BUTTON (view->paste_into_button));
}
void
buffers_paste_buffer_as_new_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpBufferView *view = GIMP_BUFFER_VIEW (data);
gtk_button_clicked (GTK_BUTTON (view->paste_as_new_button));
}
void
buffers_delete_buffer_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpBufferView *view = GIMP_BUFFER_VIEW (data);
gtk_button_clicked (GTK_BUTTON (view->delete_button));
}

View File

@ -1,33 +0,0 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __BUFFERS_COMMANDS_H__
#define __BUFFERS_COMMANDS_H__
void buffers_paste_buffer_cmd_callback (GtkWidget *widget,
gpointer data);
void buffers_paste_buffer_into_cmd_callback (GtkWidget *widget,
gpointer data);
void buffers_paste_buffer_as_new_cmd_callback (GtkWidget *widget,
gpointer data);
void buffers_delete_buffer_cmd_callback (GtkWidget *widget,
gpointer data);
#endif /* __BUFFERS_COMMANDS_H__ */

View File

@ -31,7 +31,8 @@
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpitemfactory.h"
#include "buffers-commands.h"
#include "actions/buffers-commands.h"
#include "buffers-menu.h"
#include "gimp-intl.h"

View File

@ -1,630 +0,0 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <string.h>
#include <gtk/gtk.h>
#include "libgimpcolor/gimpcolor.h"
#include "libgimpwidgets/gimpwidgets.h"
#include "gui-types.h"
#include "core/gimp.h"
#include "core/gimpchannel.h"
#include "core/gimpchannel-select.h"
#include "core/gimpcontext.h"
#include "core/gimpimage.h"
#include "core/gimpimage-undo.h"
#include "widgets/gimpcolorpanel.h"
#include "widgets/gimpcomponenteditor.h"
#include "widgets/gimpdock.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpitemtreeview.h"
#include "widgets/gimpviewabledialog.h"
#include "display/gimpdisplay.h"
#include "channels-commands.h"
#include "gimp-intl.h"
/* local function prototypes */
static void channels_opacity_update (GtkAdjustment *adjustment,
gpointer data);
static void channels_color_changed (GimpColorButton *button,
gpointer data);
#define return_if_no_image(gimage,data) \
if (GIMP_IS_DISPLAY (data)) \
gimage = ((GimpDisplay *) data)->gimage; \
else if (GIMP_IS_GIMP (data)) \
gimage = gimp_context_get_image (gimp_get_user_context (GIMP (data))); \
else if (GIMP_IS_DOCK (data)) \
gimage = gimp_context_get_image (((GimpDock *) data)->context); \
else if (GIMP_IS_COMPONENT_EDITOR (data)) \
gimage = ((GimpImageEditor *) data)->gimage; \
else if (GIMP_IS_ITEM_TREE_VIEW (data)) \
gimage = ((GimpItemTreeView *) data)->gimage; \
else \
gimage = NULL; \
\
if (! gimage) \
return
#define return_if_no_channel(gimage,channel,data) \
return_if_no_image (gimage,data); \
channel = gimp_image_get_active_channel (gimage); \
if (! channel) \
return
/* public functions */
void
channels_new_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
return_if_no_image (gimage, data);
channels_new_channel_query (gimage, NULL, TRUE, widget);
}
void
channels_raise_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
GimpChannel *active_channel;
return_if_no_channel (gimage, active_channel, data);
gimp_image_raise_channel (gimage, active_channel);
gimp_image_flush (gimage);
}
void
channels_raise_to_top_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
GimpChannel *active_channel;
return_if_no_channel (gimage, active_channel, data);
gimp_image_raise_channel_to_top (gimage, active_channel);
gimp_image_flush (gimage);
}
void
channels_lower_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
GimpChannel *active_channel;
return_if_no_channel (gimage, active_channel, data);
gimp_image_lower_channel (gimage, active_channel);
gimp_image_flush (gimage);
}
void
channels_lower_to_bottom_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
GimpChannel *active_channel;
return_if_no_channel (gimage, active_channel, data);
gimp_image_lower_channel_to_bottom (gimage, active_channel);
gimp_image_flush (gimage);
}
void
channels_duplicate_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
GimpChannel *new_channel;
if (GIMP_IS_COMPONENT_EDITOR (data))
{
GimpRGB color;
GimpChannelType component;
GEnumClass *enum_class;
GEnumValue *enum_value;
gchar *name;
return_if_no_image (gimage, data);
gimp_rgba_set (&color, 0, 0, 0, 0.5);
component = GIMP_COMPONENT_EDITOR (data)->clicked_component;
enum_class = g_type_class_ref (GIMP_TYPE_CHANNEL_TYPE);
enum_value = g_enum_get_value (enum_class, component);
g_type_class_unref (enum_class);
name = g_strdup_printf (_("%s Channel Copy"),
gettext (enum_value->value_name));
new_channel = gimp_channel_new_from_component (gimage, component,
name, &color);
/* copied components are invisible by default so subsequent copies
* of components don't affect each other
*/
gimp_item_set_visible (GIMP_ITEM (new_channel), FALSE, FALSE);
g_free (name);
}
else
{
GimpChannel *active_channel;
return_if_no_channel (gimage, active_channel, data);
new_channel =
GIMP_CHANNEL (gimp_item_duplicate (GIMP_ITEM (active_channel),
G_TYPE_FROM_INSTANCE (active_channel),
TRUE));
}
gimp_image_add_channel (gimage, new_channel, -1);
gimp_image_flush (gimage);
}
void
channels_delete_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
GimpChannel *active_channel;
return_if_no_channel (gimage, active_channel, data);
gimp_image_remove_channel (gimage, active_channel);
gimp_image_flush (gimage);
}
void
channels_to_selection_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpChannelOps op;
GimpImage *gimage;
op = (GimpChannelOps) action;
if (GIMP_IS_COMPONENT_EDITOR (data))
{
GimpChannelType component;
return_if_no_image (gimage, data);
component = GIMP_COMPONENT_EDITOR (data)->clicked_component;
gimp_channel_select_component (gimp_image_get_mask (gimage), component,
op, FALSE, 0.0, 0.0);
}
else
{
GimpChannel *channel;
return_if_no_channel (gimage, channel, data);
gimp_channel_select_channel (gimp_image_get_mask (gimage),
_("Channel to Selection"),
channel, 0, 0,
op, FALSE, 0.0, 0.0);
}
gimp_image_flush (gimage);
}
void
channels_edit_attributes_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
GimpChannel *active_channel;
return_if_no_channel (gimage, active_channel, data);
channels_edit_channel_query (active_channel, widget);
}
/**********************************/
/* The new channel query dialog */
/**********************************/
typedef struct _NewChannelOptions NewChannelOptions;
struct _NewChannelOptions
{
GtkWidget *query_box;
GtkWidget *name_entry;
GtkWidget *color_panel;
GimpImage *gimage;
};
static gchar *channel_name = NULL;
static GimpRGB channel_color = { 0.0, 0.0, 0.0, 0.5 };
static void
new_channel_query_response (GtkWidget *widget,
gint response_id,
NewChannelOptions *options)
{
if (response_id == GTK_RESPONSE_OK)
{
GimpChannel *new_channel;
GimpImage *gimage;
if (channel_name)
g_free (channel_name);
channel_name =
g_strdup (gtk_entry_get_text (GTK_ENTRY (options->name_entry)));
if ((gimage = options->gimage))
{
gimp_color_button_get_color (GIMP_COLOR_BUTTON (options->color_panel),
&channel_color);
new_channel = gimp_channel_new (gimage, gimage->width, gimage->height,
channel_name,
&channel_color);
gimp_drawable_fill_by_type (GIMP_DRAWABLE (new_channel),
gimp_get_user_context (gimage->gimp),
GIMP_TRANSPARENT_FILL);
gimp_image_add_channel (gimage, new_channel, -1);
gimp_image_flush (gimage);
}
}
gtk_widget_destroy (options->query_box);
}
void
channels_new_channel_query (GimpImage *gimage,
GimpChannel *template,
gboolean interactive,
GtkWidget *parent)
{
NewChannelOptions *options;
GtkWidget *hbox;
GtkWidget *vbox;
GtkWidget *table;
GtkObject *opacity_scale_data;
g_return_if_fail (GIMP_IS_IMAGE (gimage));
g_return_if_fail (! template || GIMP_IS_CHANNEL (template));
if (template || ! interactive)
{
GimpChannel *new_channel;
gint width, height;
GimpRGB color;
if (template)
{
width = gimp_item_width (GIMP_ITEM (template));
height = gimp_item_height (GIMP_ITEM (template));
color = template->color;
}
else
{
width = gimp_image_get_width (gimage);
height = gimp_image_get_height (gimage);
gimp_rgba_set (&color, 0.0, 0.0, 0.0, 0.5);
}
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_EDIT_PASTE,
_("New Channel"));
new_channel = gimp_channel_new (gimage,
width, height,
_("Empty Channel"),
&color);
gimp_drawable_fill_by_type (GIMP_DRAWABLE (new_channel),
gimp_get_user_context (gimage->gimp),
GIMP_TRANSPARENT_FILL);
gimp_image_add_channel (gimage, new_channel, -1);
gimp_image_undo_group_end (gimage);
return;
}
/* the new options structure */
options = g_new (NewChannelOptions, 1);
options->gimage = gimage;
options->color_panel = gimp_color_panel_new (_("New Channel Color"),
&channel_color,
GIMP_COLOR_AREA_LARGE_CHECKS,
48, 64);
gimp_color_panel_set_context (GIMP_COLOR_PANEL (options->color_panel),
gimp_get_user_context (gimage->gimp));
/* The dialog */
options->query_box =
gimp_viewable_dialog_new (GIMP_VIEWABLE (gimage),
_("New Channel"), "gimp-channel-new",
GIMP_STOCK_CHANNEL,
_("New Channel Options"),
parent,
gimp_standard_help_func,
GIMP_HELP_CHANNEL_NEW,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
NULL);
g_object_weak_ref (G_OBJECT (options->query_box),
(GWeakNotify) g_free,
options);
g_signal_connect (options->query_box, "response",
G_CALLBACK (new_channel_query_response),
options);
/* The main hbox */
hbox = gtk_hbox_new (FALSE, 4);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 6);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (options->query_box)->vbox),
hbox);
/* The vbox */
vbox = gtk_vbox_new (FALSE, 2);
gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
/* The table */
table = gtk_table_new (2, 3, FALSE);
gtk_table_set_col_spacings (GTK_TABLE (table), 2);
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
/* The name entry */
options->name_entry = gtk_entry_new ();
gtk_entry_set_text (GTK_ENTRY (options->name_entry),
(channel_name ? channel_name : _("New Channel")));
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
_("Channel Name:"), 1.0, 0.5,
options->name_entry, 2, FALSE);
/* The opacity scale */
opacity_scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
_("Fill Opacity:"), 100, -1,
channel_color.a * 100.0,
0.0, 100.0, 1.0, 10.0, 1,
TRUE, 0.0, 0.0,
NULL, NULL);
g_signal_connect (opacity_scale_data, "value_changed",
G_CALLBACK (channels_opacity_update),
options->color_panel);
/* The color panel */
gtk_box_pack_start (GTK_BOX (hbox), options->color_panel,
TRUE, TRUE, 0);
gtk_widget_show (options->color_panel);
g_signal_connect (options->color_panel, "color_changed",
G_CALLBACK (channels_color_changed),
opacity_scale_data);
gtk_widget_show (table);
gtk_widget_show (vbox);
gtk_widget_show (hbox);
gtk_widget_show (options->query_box);
}
/****************************************/
/* The edit channel attributes dialog */
/****************************************/
typedef struct _EditChannelOptions EditChannelOptions;
struct _EditChannelOptions
{
GtkWidget *query_box;
GtkWidget *name_entry;
GtkWidget *color_panel;
GimpChannel *channel;
GimpImage *gimage;
};
static void
edit_channel_query_response (GtkWidget *widget,
gint response_id,
EditChannelOptions *options)
{
if (response_id == GTK_RESPONSE_OK)
{
GimpChannel *channel = options->channel;
if (options->gimage)
{
const gchar *new_name;
GimpRGB color;
gboolean name_changed = FALSE;
gboolean color_changed = FALSE;
new_name = gtk_entry_get_text (GTK_ENTRY (options->name_entry));
gimp_color_button_get_color (GIMP_COLOR_BUTTON (options->color_panel),
&color);
if (strcmp (new_name, gimp_object_get_name (GIMP_OBJECT (channel))))
name_changed = TRUE;
if (gimp_rgba_distance (&color, &channel->color) > 0.0001)
color_changed = TRUE;
if (name_changed && color_changed)
gimp_image_undo_group_start (options->gimage,
GIMP_UNDO_GROUP_ITEM_PROPERTIES,
_("Channel Attributes"));
if (name_changed)
gimp_item_rename (GIMP_ITEM (channel), new_name);
if (color_changed)
gimp_channel_set_color (channel, &color, TRUE);
if (name_changed && color_changed)
gimp_image_undo_group_end (options->gimage);
if (name_changed || color_changed)
gimp_image_flush (options->gimage);
}
}
gtk_widget_destroy (options->query_box);
}
void
channels_edit_channel_query (GimpChannel *channel,
GtkWidget *parent)
{
EditChannelOptions *options;
GtkWidget *hbox;
GtkWidget *vbox;
GtkWidget *table;
GtkObject *opacity_scale_data;
options = g_new0 (EditChannelOptions, 1);
options->channel = channel;
options->gimage = gimp_item_get_image (GIMP_ITEM (channel));
channel_color = channel->color;
options->color_panel = gimp_color_panel_new (_("Edit Channel Color"),
&channel_color,
GIMP_COLOR_AREA_LARGE_CHECKS,
48, 64);
gimp_color_panel_set_context (GIMP_COLOR_PANEL (options->color_panel),
gimp_get_user_context (options->gimage->gimp));
/* The dialog */
options->query_box =
gimp_viewable_dialog_new (GIMP_VIEWABLE (channel),
_("Channel Attributes"), "gimp-channel-edit",
GIMP_STOCK_EDIT,
_("Edit Channel Attributes"),
parent,
gimp_standard_help_func,
GIMP_HELP_CHANNEL_EDIT,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
NULL);
g_object_weak_ref (G_OBJECT (options->query_box),
(GWeakNotify) g_free,
options);
g_signal_connect (options->query_box, "response",
G_CALLBACK (edit_channel_query_response),
options);
/* The main hbox */
hbox = gtk_hbox_new (FALSE, 4);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 6);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (options->query_box)->vbox),
hbox);
/* The vbox */
vbox = gtk_vbox_new (FALSE, 2);
gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
/* The table */
table = gtk_table_new (2, 3, FALSE);
gtk_table_set_col_spacings (GTK_TABLE (table), 2);
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
/* The name entry */
options->name_entry = gtk_entry_new ();
gtk_entry_set_text (GTK_ENTRY (options->name_entry),
gimp_object_get_name (GIMP_OBJECT (channel)));
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
_("Channel Name:"), 1.0, 0.5,
options->name_entry, 2, FALSE);
/* The opacity scale */
opacity_scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
_("Fill Opacity:"), 100, -1,
channel_color.a * 100.0,
0.0, 100.0, 1.0, 10.0, 1,
TRUE, 0.0, 0.0,
NULL, NULL);
g_signal_connect (opacity_scale_data, "value_changed",
G_CALLBACK (channels_opacity_update),
options->color_panel);
/* The color panel */
gtk_box_pack_start (GTK_BOX (hbox), options->color_panel,
TRUE, TRUE, 0);
gtk_widget_show (options->color_panel);
g_signal_connect (options->color_panel, "color_changed",
G_CALLBACK (channels_color_changed),
opacity_scale_data);
gtk_widget_show (table);
gtk_widget_show (vbox);
gtk_widget_show (hbox);
gtk_widget_show (options->query_box);
}
/* private functions */
static void
channels_opacity_update (GtkAdjustment *adjustment,
gpointer data)
{
GimpRGB color;
gimp_color_button_get_color (GIMP_COLOR_BUTTON (data), &color);
gimp_rgb_set_alpha (&color, adjustment->value / 100.0);
gimp_color_button_set_color (GIMP_COLOR_BUTTON (data), &color);
}
static void
channels_color_changed (GimpColorButton *button,
gpointer data)
{
GtkAdjustment *adj = GTK_ADJUSTMENT (data);
GimpRGB color;
gimp_color_button_get_color (button, &color);
gtk_adjustment_set_value (adj, color.a * 100.0);
}

View File

@ -1,51 +0,0 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __CHANNELS_COMMANDS_H__
#define __CHANNELS_COMMANDS_H__
void channels_new_cmd_callback (GtkWidget *widget,
gpointer data);
void channels_raise_cmd_callback (GtkWidget *widget,
gpointer data);
void channels_raise_to_top_cmd_callback (GtkWidget *widget,
gpointer data);
void channels_lower_cmd_callback (GtkWidget *widget,
gpointer data);
void channels_lower_to_bottom_cmd_callback (GtkWidget *widget,
gpointer data);
void channels_duplicate_cmd_callback (GtkWidget *widget,
gpointer data);
void channels_delete_cmd_callback (GtkWidget *widget,
gpointer data);
void channels_to_selection_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void channels_edit_attributes_cmd_callback (GtkWidget *widget,
gpointer data);
void channels_new_channel_query (GimpImage *gimage,
GimpChannel *template,
gboolean interactive,
GtkWidget *parent);
void channels_edit_channel_query (GimpChannel *channel,
GtkWidget *parent);
#endif /* __CHANNELS_COMMANDS_H__ */

View File

@ -32,7 +32,8 @@
#include "widgets/gimpitemfactory.h"
#include "widgets/gimpitemtreeview.h"
#include "channels-commands.h"
#include "actions/channels-commands.h"
#include "channels-menu.h"
#include "menus.h"

View File

@ -1,54 +0,0 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "gui-types.h"
#include "widgets/gimpcolormapeditor.h"
#include "colormap-editor-commands.h"
/* public functions */
void
colormap_editor_edit_color_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpColormapEditor *editor = GIMP_COLORMAP_EDITOR (data);
if (GTK_WIDGET_SENSITIVE (editor->edit_button))
gtk_button_clicked (GTK_BUTTON (editor->edit_button));
}
void
colormap_editor_add_color_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpColormapEditor *editor = GIMP_COLORMAP_EDITOR (data);
if (GTK_WIDGET_SENSITIVE (editor->add_button))
gimp_button_extended_clicked (GIMP_BUTTON (editor->add_button),
action ? GDK_CONTROL_MASK : 0);
}

View File

@ -1,30 +0,0 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __COLORMAP_EDITOR_COMMANDS_H__
#define __COLORMAP_EDITOR_COMMANDS_H__
void colormap_editor_edit_color_cmd_callback (GtkWidget *widget,
gpointer data);
void colormap_editor_add_color_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
#endif /* __COLORMAP_EDITOR_COMMANDS_H__ */

View File

@ -30,7 +30,8 @@
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpitemfactory.h"
#include "colormap-editor-commands.h"
#include "actions/colormap-editor-commands.h"
#include "colormap-editor-menu.h"
#include "gimp-intl.h"

View File

@ -1,80 +0,0 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "gui-types.h"
#include "widgets/gimpdatafactoryview.h"
#include "data-commands.h"
#include "gimp-intl.h"
void
data_new_data_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDataFactoryView *view = GIMP_DATA_FACTORY_VIEW (data);
if (GTK_WIDGET_SENSITIVE (view->new_button))
gtk_button_clicked (GTK_BUTTON (view->new_button));
}
void
data_duplicate_data_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDataFactoryView *view = GIMP_DATA_FACTORY_VIEW (data);
if (GTK_WIDGET_SENSITIVE (view->duplicate_button))
gtk_button_clicked (GTK_BUTTON (view->duplicate_button));
}
void
data_edit_data_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDataFactoryView *view = GIMP_DATA_FACTORY_VIEW (data);
if (GTK_WIDGET_SENSITIVE (view->edit_button))
gtk_button_clicked (GTK_BUTTON (view->edit_button));
}
void
data_delete_data_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDataFactoryView *view = GIMP_DATA_FACTORY_VIEW (data);
if (GTK_WIDGET_SENSITIVE (view->delete_button))
gtk_button_clicked (GTK_BUTTON (view->delete_button));
}
void
data_refresh_data_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDataFactoryView *view = GIMP_DATA_FACTORY_VIEW (data);
if (GTK_WIDGET_SENSITIVE (view->refresh_button))
gtk_button_clicked (GTK_BUTTON (view->refresh_button));
}

View File

@ -1,35 +0,0 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __DATA_COMMANDS_H__
#define __DATA_COMMANDS_H__
void data_new_data_cmd_callback (GtkWidget *widget,
gpointer data);
void data_duplicate_data_cmd_callback (GtkWidget *widget,
gpointer data);
void data_edit_data_cmd_callback (GtkWidget *widget,
gpointer data);
void data_delete_data_cmd_callback (GtkWidget *widget,
gpointer data);
void data_refresh_data_cmd_callback (GtkWidget *widget,
gpointer data);
#endif /* __DATA_COMMANDS_H__ */

View File

@ -1,146 +0,0 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <string.h>
#include <gtk/gtk.h>
#include "libgimpbase/gimpbase.h"
#include "gui-types.h"
#include "core/gimpobject.h"
#include "widgets/gimpitemfactory.h"
#include "widgets/gimpmenufactory.h"
#include "debug-commands.h"
#include "menus.h"
#ifdef ENABLE_DEBUG_MENU
/* local function prototypes */
static void debug_dump_menus_recurse_menu (GtkWidget *menu,
gint depth,
gchar *path);
/* public functions */
void
debug_dump_menus_cmd_callback (GtkWidget *widget,
gpointer data)
{
GList *list;
for (list = global_menu_factory->registered_menus;
list;
list = g_list_next (list))
{
GimpMenuFactoryEntry *entry;
GimpItemFactory *item_factory;
entry = list->data;
item_factory = gimp_item_factory_from_path (entry->identifier);
if (item_factory)
{
GtkWidget *menu_item;
g_print ("%s\n", entry->identifier);
menu_item = gtk_item_factory_get_item (GTK_ITEM_FACTORY (item_factory),
entry->entries[0].entry.path);
if (menu_item &&
menu_item->parent &&
GTK_IS_MENU (menu_item->parent))
debug_dump_menus_recurse_menu (menu_item->parent, 1,
entry->identifier);
g_print ("\n");
}
}
}
void
debug_mem_profile_cmd_callback (GtkWidget *widget,
gpointer data)
{
extern gboolean gimp_debug_memsize;
gimp_debug_memsize = TRUE;
gimp_object_get_memsize (GIMP_OBJECT (data), NULL);
gimp_debug_memsize = FALSE;
}
/* private functions */
static void
debug_dump_menus_recurse_menu (GtkWidget *menu,
gint depth,
gchar *path)
{
GtkItemFactory *item_factory;
GtkWidget *menu_item;
GList *list;
const gchar *label;
gchar *help_page;
gchar *full_path;
gchar *format_str;
for (list = GTK_MENU_SHELL (menu)->children; list; list = g_list_next (list))
{
menu_item = GTK_WIDGET (list->data);
if (GTK_IS_LABEL (GTK_BIN (menu_item)->child))
{
label = gtk_label_get_text (GTK_LABEL (GTK_BIN (menu_item)->child));
full_path = g_strconcat (path, "/", label, NULL);
item_factory = GTK_ITEM_FACTORY (gimp_item_factory_from_path (path));
help_page = g_object_get_data (G_OBJECT (menu_item),
"gimp-help-id");
help_page = g_strdup (help_page);
format_str = g_strdup_printf ("%%%ds%%%ds %%-20s %%s\n",
depth * 2, depth * 2 - 40);
g_print (format_str,
"", label, "", help_page ? help_page : "");
g_free (format_str);
g_free (help_page);
if (GTK_MENU_ITEM (menu_item)->submenu)
debug_dump_menus_recurse_menu (GTK_MENU_ITEM (menu_item)->submenu,
depth + 1, full_path);
g_free (full_path);
}
}
}
#endif /* ENABLE_DEBUG_MENU */

View File

@ -1,38 +0,0 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __DEBUG_COMMANDS_H__
#define __DEBUG_COMMANDS_H__
#ifdef GIMP_UNSTABLE
#define ENABLE_DEBUG_MENU 1
#endif
#ifdef ENABLE_DEBUG_MENU
void debug_dump_menus_cmd_callback (GtkWidget *widget,
gpointer data);
void debug_mem_profile_cmd_callback (GtkWidget *widget,
gpointer data);
#endif /* ENABLE_DEBUG_MENU */
#endif /* __DEBUG_COMMANDS_H__ */

View File

@ -1,200 +0,0 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <string.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "gui-types.h"
#include "widgets/gimpdialogfactory.h"
#include "widgets/gimpdockable.h"
#include "widgets/gimpdockbook.h"
#include "widgets/gimpimagedock.h"
#include "dialogs.h"
#include "dialogs-commands.h"
/* local function prototypes */
static void dialogs_create_dock (GdkScreen *screen,
gboolean show_image_menu,
const gchar *tabs[],
gint n_tabs);
/* public functions */
void
dialogs_show_toolbox_cmd_callback (GtkWidget *widget,
gpointer data)
{
dialogs_show_toolbox ();
}
void
dialogs_create_toplevel_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
if (action)
{
const gchar *identifier = g_quark_to_string ((GQuark) action);
if (identifier)
gimp_dialog_factory_dialog_new (global_dialog_factory,
gtk_widget_get_screen (widget),
identifier, -1);
}
}
void
dialogs_create_dockable_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
if (action)
{
const gchar *identifier = g_quark_to_string ((GQuark) action);
if (!identifier)
return;
gimp_dialog_factory_dialog_raise (global_dock_factory,
gtk_widget_get_screen (widget),
identifier, -1);
}
}
void
dialogs_create_lc_cmd_callback (GtkWidget *widget,
gpointer data)
{
static const gchar *tabs[] =
{
"gimp-layer-list",
"gimp-channel-list",
"gimp-vectors-list",
"gimp-undo-history"
};
dialogs_create_dock (gtk_widget_get_screen (widget), TRUE,
tabs, G_N_ELEMENTS (tabs));
}
void
dialogs_create_data_cmd_callback (GtkWidget *widget,
gpointer data)
{
static const gchar *tabs[] =
{
"gimp-brush-grid",
"gimp-pattern-grid",
"gimp-gradient-list",
"gimp-palette-list",
"gimp-font-list"
};
dialogs_create_dock (gtk_widget_get_screen (widget), FALSE,
tabs, G_N_ELEMENTS (tabs));
}
void
dialogs_create_stuff_cmd_callback (GtkWidget *widget,
gpointer data)
{
static const gchar *tabs[] =
{
"gimp-buffer-list",
"gimp-image-list",
"gimp-document-list",
"gimp-template-list"
};
dialogs_create_dock (gtk_widget_get_screen (widget), FALSE,
tabs, G_N_ELEMENTS (tabs));
}
void
dialogs_show_toolbox (void)
{
if (! global_toolbox_factory->open_dialogs)
{
GtkWidget *toolbox;
toolbox = gimp_dialog_factory_dock_new (global_toolbox_factory,
gdk_screen_get_default ());
gtk_widget_show (toolbox);
}
else
{
GList *list;
for (list = global_toolbox_factory->open_dialogs;
list;
list = g_list_next (list))
{
if (GTK_WIDGET_TOPLEVEL (list->data))
{
gtk_window_present (GTK_WINDOW (list->data));
break;
}
}
}
}
/* private functions */
static void
dialogs_create_dock (GdkScreen *screen,
gboolean show_image_menu,
const gchar *tabs[],
gint n_tabs)
{
GtkWidget *dock;
GtkWidget *dockbook;
GtkWidget *dockable;
gint i;
dock = gimp_dialog_factory_dock_new (global_dock_factory, screen);
gimp_image_dock_set_show_image_menu (GIMP_IMAGE_DOCK (dock), show_image_menu);
dockbook = gimp_dockbook_new (global_dock_factory->menu_factory);
gimp_dock_add_book (GIMP_DOCK (dock), GIMP_DOCKBOOK (dockbook), 0);
for (i = 0; i < n_tabs; i++)
{
dockable = gimp_dialog_factory_dialog_new (global_dock_factory,
screen,
tabs[i], -1);
if (dockable && ! GIMP_DOCKABLE (dockable)->dockbook)
gimp_dock_add (GIMP_DOCK (dock), GIMP_DOCKABLE (dockable), -1, -1);
}
gtk_widget_show (dock);
}

View File

@ -1,42 +0,0 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __DIALOGS_COMMANDS_H__
#define __DIALOGS_COMMANDS_H__
void dialogs_show_toolbox_cmd_callback (GtkWidget *widget,
gpointer data);
void dialogs_create_toplevel_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void dialogs_create_dockable_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void dialogs_create_lc_cmd_callback (GtkWidget *widget,
gpointer data);
void dialogs_create_data_cmd_callback (GtkWidget *widget,
gpointer data);
void dialogs_create_stuff_cmd_callback (GtkWidget *widget,
gpointer data);
void dialogs_show_toolbox (void);
#endif /* __DIALOGS_COMMANDS_H__ */

View File

@ -69,20 +69,21 @@
#include "display/gimpdisplayshell.h"
#include "display/gimpnavigationview.h"
#include "actions/channels-commands.h"
#include "actions/edit-commands.h"
#include "actions/file-commands.h"
#include "actions/images-commands.h"
#include "actions/layers-commands.h"
#include "actions/templates-commands.h"
#include "actions/vectors-commands.h"
#include "about-dialog.h"
#include "channels-commands.h"
#include "dialogs.h"
#include "dialogs-constructors.h"
#include "edit-commands.h"
#include "file-commands.h"
#include "file-new-dialog.h"
#include "images-commands.h"
#include "layers-commands.h"
#include "module-browser.h"
#include "preferences-dialog.h"
#include "templates-commands.h"
#include "tips-dialog.h"
#include "vectors-commands.h"
#include "gimp-intl.h"

View File

@ -36,7 +36,8 @@
#include "widgets/gimpimagedock.h"
#include "widgets/gimpitemfactory.h"
#include "dockable-commands.h"
#include "actions/dockable-commands.h"
#include "dialogs-menu.h"
#include "menus.h"

View File

@ -1,351 +0,0 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <string.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "gui-types.h"
#include "widgets/gimpcontainerview.h"
#include "widgets/gimpcontainerview-utils.h"
#include "widgets/gimpdialogfactory.h"
#include "widgets/gimpdockable.h"
#include "widgets/gimpdockbook.h"
#include "widgets/gimpimagedock.h"
#include "widgets/gimpsessioninfo.h"
#include "dialogs.h"
#include "dockable-commands.h"
/* public functions */
void
dockable_add_tab_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpDockbook *dockbook = GIMP_DOCKBOOK (data);
if (action)
{
GtkWidget *dockable;
const gchar *identifier;
identifier = g_quark_to_string ((GQuark) action);
if (identifier)
{
dockable =
gimp_dialog_factory_dockable_new (dockbook->dock->dialog_factory,
dockbook->dock,
identifier,
-1);
/* Maybe gimp_dialog_factory_dockable_new() returned an already
* existing singleton dockable, so check if it already is
* attached to a dockbook.
*/
if (dockable && ! GIMP_DOCKABLE (dockable)->dockbook)
gimp_dockbook_add (dockbook, GIMP_DOCKABLE (dockable), -1);
}
}
}
void
dockable_close_tab_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDockbook *dockbook = GIMP_DOCKBOOK (data);
GimpDockable *dockable;
gint page_num;
page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (dockbook));
dockable = (GimpDockable *)
gtk_notebook_get_nth_page (GTK_NOTEBOOK (dockbook), page_num);
if (dockable)
gimp_dockbook_remove (dockbook, dockable);
}
void
dockable_detach_tab_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDockbook *dockbook = GIMP_DOCKBOOK (data);
GimpDockable *dockable;
gint page_num;
page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (dockbook));
dockable = (GimpDockable *)
gtk_notebook_get_nth_page (GTK_NOTEBOOK (dockbook), page_num);
if (dockable)
gimp_dockable_detach (dockable);
}
void
dockable_toggle_view_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpDockbook *dockbook = GIMP_DOCKBOOK (data);
GimpDockable *dockable;
GimpViewType view_type;
gint page_num;
if (! GTK_CHECK_MENU_ITEM (widget)->active)
return;
view_type = (GimpViewType) action;
page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (dockbook));
dockable = (GimpDockable *)
gtk_notebook_get_nth_page (GTK_NOTEBOOK (dockbook), page_num);
if (dockable)
{
GimpDialogFactoryEntry *entry;
gimp_dialog_factory_from_widget (GTK_WIDGET (dockable), &entry);
if (entry)
{
gchar *identifier;
gchar *substring = NULL;
identifier = g_strdup (entry->identifier);
substring = strstr (identifier, "grid");
if (substring && view_type == GIMP_VIEW_TYPE_GRID)
return;
if (! substring)
{
substring = strstr (identifier, "list");
if (substring && view_type == GIMP_VIEW_TYPE_LIST)
return;
}
if (substring)
{
GimpContainerView *old_view;
GtkWidget *new_dockable;
gint preview_size = -1;
if (view_type == GIMP_VIEW_TYPE_LIST)
memcpy (substring, "list", 4);
else if (view_type == GIMP_VIEW_TYPE_GRID)
memcpy (substring, "grid", 4);
old_view = gimp_container_view_get_by_dockable (dockable);
if (old_view)
preview_size = old_view->preview_size;
new_dockable =
gimp_dialog_factory_dockable_new (dockbook->dock->dialog_factory,
dockbook->dock,
identifier,
preview_size);
/* Maybe gimp_dialog_factory_dockable_new() returned
* an already existing singleton dockable, so check
* if it already is attached to a dockbook.
*/
if (new_dockable && ! GIMP_DOCKABLE (new_dockable)->dockbook)
{
gimp_dockbook_add (dockbook, GIMP_DOCKABLE (new_dockable),
page_num);
gimp_dockbook_remove (dockbook, dockable);
gtk_notebook_set_current_page (GTK_NOTEBOOK (dockbook),
page_num);
}
}
g_free (identifier);
}
}
}
void
dockable_preview_size_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpDockbook *dockbook = GIMP_DOCKBOOK (data);
GimpDockable *dockable;
gint preview_size;
gint page_num;
if (! GTK_CHECK_MENU_ITEM (widget)->active)
return;
preview_size = (gint) action;
page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (dockbook));
dockable = (GimpDockable *)
gtk_notebook_get_nth_page (GTK_NOTEBOOK (dockbook), page_num);
if (dockable)
{
GimpContainerView *view;
view = gimp_container_view_get_by_dockable (dockable);
if (view && view->preview_size != preview_size)
gimp_container_view_set_preview_size (view, preview_size,
view->preview_border_width);
}
}
void
dockable_tab_style_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpDockbook *dockbook = GIMP_DOCKBOOK (data);
GimpDockable *dockable;
GimpTabStyle tab_style;
gint page_num;
if (! GTK_CHECK_MENU_ITEM (widget)->active)
return;
tab_style = (gint) action;
page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (dockbook));
dockable = (GimpDockable *)
gtk_notebook_get_nth_page (GTK_NOTEBOOK (dockbook), page_num);
if (dockable && dockable->tab_style != tab_style)
{
GtkWidget *tab_widget;
dockable->tab_style = tab_style;
tab_widget = gimp_dockbook_get_tab_widget (dockbook, dockable);
gtk_notebook_set_tab_label (GTK_NOTEBOOK (dockbook),
GTK_WIDGET (dockable),
tab_widget);
}
}
void
dockable_toggle_image_menu_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDockbook *dockbook = GIMP_DOCKBOOK (data);
if (GIMP_IS_IMAGE_DOCK (dockbook->dock))
gimp_image_dock_set_show_image_menu (GIMP_IMAGE_DOCK (dockbook->dock),
GTK_CHECK_MENU_ITEM (widget)->active);
}
void
dockable_toggle_auto_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDockbook *dockbook = GIMP_DOCKBOOK (data);
if (GIMP_IS_IMAGE_DOCK (dockbook->dock))
gimp_image_dock_set_auto_follow_active (GIMP_IMAGE_DOCK (dockbook->dock),
GTK_CHECK_MENU_ITEM (widget)->active);
}
static void
dockable_change_screen_confirm_callback (GtkWidget *query_box,
gint value,
gpointer data)
{
GdkScreen *screen;
screen = gdk_display_get_screen (gtk_widget_get_display (GTK_WIDGET (data)),
value);
if (screen)
gtk_window_set_screen (GTK_WINDOW (data), screen);
}
static void
dockable_change_screen_destroy_callback (GtkWidget *query_box,
GtkWidget *dock)
{
g_object_set_data (G_OBJECT (dock), "gimp-change-screen-dialog", NULL);
}
void
dockable_change_screen_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDockbook *dockbook = GIMP_DOCKBOOK (data);
GtkWidget *dock;
GdkScreen *screen;
GdkDisplay *display;
gint cur_screen;
gint num_screens;
GtkWidget *qbox;
dock = GTK_WIDGET (dockbook->dock);
qbox = g_object_get_data (G_OBJECT (dock), "gimp-change-screen-dialog");
if (qbox)
{
gtk_window_present (GTK_WINDOW (qbox));
return;
}
screen = gtk_widget_get_screen (dock);
display = gtk_widget_get_display (dock);
cur_screen = gdk_screen_get_number (screen);
num_screens = gdk_display_get_n_screens (display);
qbox = gimp_query_int_box ("Move Dock to Screen",
dock,
NULL, 0,
"Enter destination screen",
cur_screen, 0, num_screens - 1,
G_OBJECT (dock), "destroy",
dockable_change_screen_confirm_callback,
dock);
g_object_set_data (G_OBJECT (dock), "gimp-change-screen-dialog", qbox);
g_signal_connect (qbox, "destroy",
G_CALLBACK (dockable_change_screen_destroy_callback),
dock);
gtk_widget_show (qbox);
}

View File

@ -1,49 +0,0 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __DOCKABLE_COMMANDS_H__
#define __DOCKABLE_COMMANDS_H__
void dockable_add_tab_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void dockable_close_tab_cmd_callback (GtkWidget *widget,
gpointer data);
void dockable_detach_tab_cmd_callback (GtkWidget *widget,
gpointer data);
void dockable_toggle_view_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void dockable_preview_size_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void dockable_tab_style_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void dockable_toggle_image_menu_cmd_callback (GtkWidget *widget,
gpointer data);
void dockable_toggle_auto_cmd_callback (GtkWidget *widget,
gpointer data);
void dockable_change_screen_cmd_callback (GtkWidget *widget,
gpointer data);
#endif /* __DOCKABLE_COMMANDS_H__ */

View File

@ -1,100 +0,0 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "gui-types.h"
#include "widgets/gimpdocumentview.h"
#include "documents-commands.h"
/* public functions */
void
documents_open_document_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDocumentView *view = GIMP_DOCUMENT_VIEW (data);
gtk_button_clicked (GTK_BUTTON (view->open_button));
}
void
documents_raise_or_open_document_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDocumentView *view = GIMP_DOCUMENT_VIEW (data);
gimp_button_extended_clicked (GIMP_BUTTON (view->open_button),
GDK_SHIFT_MASK);
}
void
documents_file_open_dialog_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDocumentView *view = GIMP_DOCUMENT_VIEW (data);
gimp_button_extended_clicked (GIMP_BUTTON (view->open_button),
GDK_CONTROL_MASK);
}
void
documents_remove_document_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDocumentView *view = GIMP_DOCUMENT_VIEW (data);
gtk_button_clicked (GTK_BUTTON (view->remove_button));
}
void
documents_recreate_preview_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDocumentView *view = GIMP_DOCUMENT_VIEW (data);
gtk_button_clicked (GTK_BUTTON (view->refresh_button));
}
void
documents_reload_previews_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDocumentView *view = GIMP_DOCUMENT_VIEW (data);
gimp_button_extended_clicked (GIMP_BUTTON (view->refresh_button),
GDK_SHIFT_MASK);
}
void
documents_delete_dangling_documents_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDocumentView *view = GIMP_DOCUMENT_VIEW (data);
gimp_button_extended_clicked (GIMP_BUTTON (view->refresh_button),
GDK_CONTROL_MASK);
}

View File

@ -1,39 +0,0 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __DOCUMENTS_COMMANDS_H__
#define __DOCUMENTS_COMMANDS_H__
void documents_open_document_cmd_callback (GtkWidget *widget,
gpointer data);
void documents_raise_or_open_document_cmd_callback (GtkWidget *widget,
gpointer data);
void documents_file_open_dialog_cmd_callback (GtkWidget *widget,
gpointer data);
void documents_remove_document_cmd_callback (GtkWidget *widget,
gpointer data);
void documents_recreate_preview_cmd_callback (GtkWidget *widget,
gpointer data);
void documents_reload_previews_cmd_callback (GtkWidget *widget,
gpointer data);
void documents_delete_dangling_documents_cmd_callback (GtkWidget *widget,
gpointer data);
#endif /* __DOCUMENTS_COMMANDS_H__ */

View File

@ -31,7 +31,8 @@
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpitemfactory.h"
#include "documents-commands.h"
#include "actions/documents-commands.h"
#include "documents-menu.h"
#include "menus.h"

View File

@ -1,225 +0,0 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <string.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "gui-types.h"
#include "core/gimp.h"
#include "core/gimpcontext.h"
#include "core/gimpdrawable.h"
#include "core/gimpdrawable-desaturate.h"
#include "core/gimpdrawable-equalize.h"
#include "core/gimpdrawable-invert.h"
#include "core/gimpimage.h"
#include "core/gimpimage-undo.h"
#include "core/gimpitem-linked.h"
#include "widgets/gimpdock.h"
#include "widgets/gimpitemtreeview.h"
#include "display/gimpdisplay.h"
#include "drawable-commands.h"
#include "offset-dialog.h"
#include "gimp-intl.h"
#define return_if_no_image(gimage,data) \
if (GIMP_IS_DISPLAY (data)) \
gimage = ((GimpDisplay *) data)->gimage; \
else if (GIMP_IS_GIMP (data)) \
gimage = gimp_context_get_image (gimp_get_user_context (GIMP (data))); \
else if (GIMP_IS_DOCK (data)) \
gimage = gimp_context_get_image (((GimpDock *) data)->context); \
else if (GIMP_IS_ITEM_TREE_VIEW (data)) \
gimage = ((GimpItemTreeView *) data)->gimage; \
else \
gimage = NULL; \
\
if (! gimage) \
return
#define return_if_no_drawable(gimage,drawable,data) \
return_if_no_image (gimage,data); \
drawable = gimp_image_active_drawable (gimage); \
if (! drawable) \
return
/* public functions */
void
drawable_desaturate_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
GimpDrawable *active_drawable;
return_if_no_drawable (gimage, active_drawable, data);
if (! gimp_drawable_is_rgb (active_drawable))
{
g_message (_("Desaturate operates only on RGB color layers."));
return;
}
gimp_drawable_desaturate (active_drawable);
gimp_image_flush (gimage);
}
void
drawable_invert_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
GimpDrawable *active_drawable;
return_if_no_drawable (gimage, active_drawable, data);
if (gimp_drawable_is_indexed (active_drawable))
{
g_message (_("Invert does not operate on indexed layers."));
return;
}
gimp_drawable_invert (active_drawable);
gimp_image_flush (gimage);
}
void
drawable_equalize_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
GimpDrawable *active_drawable;
return_if_no_drawable (gimage, active_drawable, data);
if (gimp_drawable_is_indexed (active_drawable))
{
g_message (_("Equalize does not operate on indexed layers."));
return;
}
gimp_drawable_equalize (active_drawable, TRUE);
gimp_image_flush (gimage);
}
void
drawable_flip_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpImage *gimage;
GimpDrawable *active_drawable;
GimpItem *item;
GimpContext *context;
gint off_x, off_y;
gdouble axis = 0.0;
return_if_no_drawable (gimage, active_drawable, data);
item = GIMP_ITEM (active_drawable);
gimp_item_offsets (item, &off_x, &off_y);
switch ((GimpOrientationType) action)
{
case GIMP_ORIENTATION_HORIZONTAL:
axis = ((gdouble) off_x + (gdouble) gimp_item_width (item) / 2.0);
break;
case GIMP_ORIENTATION_VERTICAL:
axis = ((gdouble) off_y + (gdouble) gimp_item_height (item) / 2.0);
break;
default:
break;
}
context = gimp_get_user_context (gimage->gimp);
if (gimp_item_get_linked (item))
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_TRANSFORM,
_("Flip Layer"));
gimp_item_flip (item, context, (GimpOrientationType) action, axis, FALSE);
if (gimp_item_get_linked (item))
{
gimp_item_linked_flip (item, context, (GimpOrientationType) action, axis,
FALSE);
gimp_image_undo_group_end (gimage);
}
gimp_image_flush (gimage);
}
void
drawable_rotate_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpImage *gimage;
GimpDrawable *active_drawable;
GimpItem *item;
GimpContext *context;
gint off_x, off_y;
gdouble center_x, center_y;
return_if_no_drawable (gimage, active_drawable, data);
item = GIMP_ITEM (active_drawable);
gimp_item_offsets (item, &off_x, &off_y);
center_x = ((gdouble) off_x + (gdouble) gimp_item_width (item) / 2.0);
center_y = ((gdouble) off_y + (gdouble) gimp_item_height (item) / 2.0);
context = gimp_get_user_context (gimage->gimp);
if (gimp_item_get_linked (item))
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_TRANSFORM,
_("Rotate Layer"));
gimp_item_rotate (item, context, (GimpRotationType) action,
center_x, center_y, FALSE);
if (gimp_item_get_linked (item))
{
gimp_item_linked_rotate (item, context, (GimpRotationType) action,
center_x, center_y, FALSE);
gimp_image_undo_group_end (gimage);
}
gimp_image_flush (gimage);
}
void
drawable_offset_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
GimpDrawable *drawable;
return_if_no_drawable (gimage, drawable, data);
offset_dialog_create (drawable, widget);
}

View File

@ -1,39 +0,0 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __DRAWABLE_COMMANDS_H__
#define __DRAWABLE_COMMANDS_H__
void drawable_desaturate_cmd_callback (GtkWidget *widget,
gpointer data);
void drawable_invert_cmd_callback (GtkWidget *widget,
gpointer data);
void drawable_equalize_cmd_callback (GtkWidget *widget,
gpointer data);
void drawable_flip_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void drawable_rotate_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void drawable_offset_cmd_callback (GtkWidget *widget,
gpointer data);
#endif /* __DRAWABLE_COMMANDS_H__ */

View File

@ -1,389 +0,0 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <string.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "gui-types.h"
#include "core/gimp.h"
#include "core/gimp-edit.h"
#include "core/gimpbuffer.h"
#include "core/gimpcontainer.h"
#include "core/gimpcontext.h"
#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"
#include "display/gimpdisplayshell-transform.h"
#include "widgets/gimpdock.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpdialogfactory.h"
#include "dialogs.h"
#include "edit-commands.h"
#include "stroke-dialog.h"
#include "gimp-intl.h"
#define return_if_no_display(gdisp,data) \
if (GIMP_IS_DISPLAY (data)) \
gdisp = data; \
else if (GIMP_IS_GIMP (data)) \
gdisp = gimp_context_get_display (gimp_get_user_context (GIMP (data))); \
else if (GIMP_IS_DOCK (data)) \
gdisp = gimp_context_get_display (((GimpDock *) data)->context); \
else \
gdisp = NULL; \
if (! gdisp) \
return
#define return_if_no_image(gimage,data) \
if (GIMP_IS_DISPLAY (data)) \
gimage = ((GimpDisplay *) data)->gimage; \
else if (GIMP_IS_GIMP (data)) \
gimage = gimp_context_get_image (gimp_get_user_context (GIMP (data))); \
else if (GIMP_IS_DOCK (data)) \
gimage = gimp_context_get_image (((GimpDock *) data)->context); \
else \
gimage = NULL; \
if (! gimage) \
return
#define return_if_no_drawable(gimage,drawable,data) \
return_if_no_image (gimage, data); \
drawable = gimp_image_active_drawable (gimage); \
if (! drawable) \
return;
/* local function prototypes */
static void cut_named_buffer_callback (GtkWidget *widget,
const gchar *name,
gpointer data);
static void copy_named_buffer_callback (GtkWidget *widget,
const gchar *name,
gpointer data);
/* public functions */
void
edit_undo_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
return_if_no_image (gimage, data);
if (gimp_image_undo (gimage))
gimp_image_flush (gimage);
}
void
edit_redo_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
return_if_no_image (gimage, data);
if (gimp_image_redo (gimage))
gimp_image_flush (gimage);
}
void
edit_cut_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
GimpDrawable *drawable;
return_if_no_drawable (gimage, drawable, data);
if (gimp_edit_cut (gimage, drawable, gimp_get_user_context (gimage->gimp)))
gimp_image_flush (gimage);
}
void
edit_copy_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
GimpDrawable *drawable;
return_if_no_drawable (gimage, drawable, data);
if (gimp_edit_copy (gimage, drawable, gimp_get_user_context (gimage->gimp)))
gimp_image_flush (gimage);
}
static void
edit_paste (GimpDisplay *gdisp,
gboolean paste_into)
{
if (gdisp->gimage->gimp->global_buffer)
{
GimpDisplayShell *shell;
gint x, y, width, height;
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
gimp_display_shell_untransform_viewport (shell, &x, &y, &width, &height);
if (gimp_edit_paste (gdisp->gimage,
gimp_image_active_drawable (gdisp->gimage),
gdisp->gimage->gimp->global_buffer,
paste_into, x, y, width, height))
{
gimp_image_flush (gdisp->gimage);
}
}
}
void
edit_paste_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
return_if_no_display (gdisp, data);
edit_paste (gdisp, FALSE);
}
void
edit_paste_into_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
return_if_no_display (gdisp, data);
edit_paste (gdisp, TRUE);
}
void
edit_paste_as_new_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
return_if_no_display (gdisp, data);
if (gdisp->gimage->gimp->global_buffer)
{
gimp_edit_paste_as_new (gdisp->gimage->gimp,
gdisp->gimage,
gdisp->gimage->gimp->global_buffer);
}
}
void
edit_named_cut_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
GtkWidget *qbox;
return_if_no_display (gdisp, data);
qbox = gimp_query_string_box (_("Cut Named"),
gdisp->shell,
gimp_standard_help_func,
GIMP_HELP_BUFFER_CUT,
_("Enter a name for this buffer"),
NULL,
G_OBJECT (gdisp->gimage), "disconnect",
cut_named_buffer_callback, gdisp->gimage);
gtk_widget_show (qbox);
}
void
edit_named_copy_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
GtkWidget *qbox;
return_if_no_display (gdisp, data);
qbox = gimp_query_string_box (_("Copy Named"),
gdisp->shell,
gimp_standard_help_func,
GIMP_HELP_BUFFER_COPY,
_("Enter a name for this buffer"),
NULL,
G_OBJECT (gdisp->gimage), "disconnect",
copy_named_buffer_callback, gdisp->gimage);
gtk_widget_show (qbox);
}
void
edit_named_paste_cmd_callback (GtkWidget *widget,
gpointer data)
{
gimp_dialog_factory_dialog_raise (global_dock_factory,
gtk_widget_get_screen (widget),
"gimp-buffer-list|gimp-buffer-grid", -1);
}
void
edit_clear_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
GimpDrawable *drawable;
return_if_no_drawable (gimage, drawable, data);
gimp_edit_clear (gimage, drawable, gimp_get_user_context (gimage->gimp));
gimp_image_flush (gimage);
}
void
edit_fill_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpImage *gimage;
GimpDrawable *drawable;
GimpFillType fill_type;
return_if_no_drawable (gimage, drawable, data);
fill_type = (GimpFillType) action;
gimp_edit_fill (gimage, drawable, gimp_get_user_context (gimage->gimp),
fill_type);
gimp_image_flush (gimage);
}
void
edit_stroke_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
GimpDrawable *drawable;
return_if_no_drawable (gimage, drawable, 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));
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 */
static void
cut_named_buffer_callback (GtkWidget *widget,
const gchar *name,
gpointer data)
{
GimpImage *gimage = GIMP_IMAGE (data);
const GimpBuffer *cut_buffer;
GimpDrawable *active_drawable;
active_drawable = gimp_image_active_drawable (gimage);
if (! active_drawable)
{
g_message (_("There is no active layer or channel to cut from."));
return;
}
cut_buffer = gimp_edit_cut (gimage, active_drawable,
gimp_get_user_context (gimage->gimp));
if (cut_buffer)
{
GimpBuffer *new_buffer;
if (! (name && strlen (name)))
name = _("(Unnamed Buffer)");
new_buffer = gimp_buffer_new (cut_buffer->tiles, name, TRUE);
gimp_container_add (gimage->gimp->named_buffers,
GIMP_OBJECT (new_buffer));
g_object_unref (new_buffer);
gimp_image_flush (gimage);
}
}
static void
copy_named_buffer_callback (GtkWidget *widget,
const gchar *name,
gpointer data)
{
GimpImage *gimage = GIMP_IMAGE (data);
const GimpBuffer *copy_buffer;
GimpDrawable *active_drawable;
active_drawable = gimp_image_active_drawable (gimage);
if (! active_drawable)
{
g_message (_("There is no active layer or channel to copy from."));
return;
}
copy_buffer = gimp_edit_copy (gimage, active_drawable,
gimp_get_user_context (gimage->gimp));
if (copy_buffer)
{
GimpBuffer *new_buffer;
if (! (name && strlen (name)))
name = _("(Unnamed Buffer)");
new_buffer = gimp_buffer_new (copy_buffer->tiles, name, TRUE);
gimp_container_add (gimage->gimp->named_buffers,
GIMP_OBJECT (new_buffer));
g_object_unref (new_buffer);
gimp_image_flush (gimage);
}
}

View File

@ -1,55 +0,0 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __EDIT_COMMANDS_H__
#define __EDIT_COMMANDS_H__
void edit_undo_cmd_callback (GtkWidget *widget,
gpointer data);
void edit_redo_cmd_callback (GtkWidget *widget,
gpointer data);
void edit_cut_cmd_callback (GtkWidget *widget,
gpointer data);
void edit_copy_cmd_callback (GtkWidget *widget,
gpointer data);
void edit_paste_cmd_callback (GtkWidget *widget,
gpointer data);
void edit_paste_into_cmd_callback (GtkWidget *widget,
gpointer data);
void edit_paste_as_new_cmd_callback (GtkWidget *widget,
gpointer data);
void edit_named_cut_cmd_callback (GtkWidget *widget,
gpointer data);
void edit_named_copy_cmd_callback (GtkWidget *widget,
gpointer data);
void edit_named_paste_cmd_callback (GtkWidget *widget,
gpointer data);
void edit_clear_cmd_callback (GtkWidget *widget,
gpointer data);
void edit_fill_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void edit_stroke_cmd_callback (GtkWidget *widget,
gpointer data);
void edit_stroke_selection (GimpItem *item,
GtkWidget *parent);
#endif /* __EDIT_COMMANDS_H__ */

View File

@ -1,63 +0,0 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "gui-types.h"
#include "widgets/gimperrorconsole.h"
#include "error-console-commands.h"
/* public functions */
void
error_console_clear_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpErrorConsole *console = GIMP_ERROR_CONSOLE (data);
if (GTK_WIDGET_IS_SENSITIVE (console->clear_button))
gtk_button_clicked (GTK_BUTTON (console->clear_button));
}
void
error_console_save_all_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpErrorConsole *console = GIMP_ERROR_CONSOLE (data);
if (GTK_WIDGET_IS_SENSITIVE (console->save_button))
gtk_button_clicked (GTK_BUTTON (console->save_button));
}
void
error_console_save_selection_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpErrorConsole *console = GIMP_ERROR_CONSOLE (data);
if (GTK_WIDGET_IS_SENSITIVE (console->save_button))
gimp_button_extended_clicked (GIMP_BUTTON (console->save_button),
GDK_SHIFT_MASK);
}

View File

@ -1,31 +0,0 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __ERROR_CONSOLE_COMMANDS_H__
#define __ERROR_CONSOLE_COMMANDS_H__
void error_console_clear_cmd_callback (GtkWidget *widget,
gpointer data);
void error_console_save_all_cmd_callback (GtkWidget *widget,
gpointer data);
void error_console_save_selection_cmd_callback (GtkWidget *widget,
gpointer data);
#endif /* __ERROR_CONSOLE_COMMANDS_H__ */

View File

@ -28,7 +28,8 @@
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpitemfactory.h"
#include "error-console-commands.h"
#include "actions/error-console-commands.h"
#include "error-console-menu.h"
#include "gimp-intl.h"

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