gimp/app/actions/channels-commands.c

402 lines
12 KiB
C
Raw Normal View History

/* 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"
#define GETTEXT_PACKAGE 2001-03-28 Hans Breuer <hans@breuer.org> * config.h.win32 : #define GETTEXT_PACKAGE * makefile.msc : add theme rule * app/makefile.msc : gimp.exe depends on all the libs and general update * app/base/makefile.msc : updated * app/config/gimpconfig-serialize.c : #include <io.h> for win32 * app/config/gimpconfig-types.c : #include <string.h> * app/core/gimpcontext.c app/core/gimpcontainer.c app/core/gimptoolinfo.c : #include <string.h> * app/core/gimpdocuments.c (gimp_documents_save_func) : need to g_strescape() the filename to not make backslashes vanish during de-serialization * app/core/gimpimagefile.c : #define S_ISREG for G_OS_WIN32 * app/core/makefile.msc : add -DGIMP_COMPILATION required for cpercep.c build * app/display/gimpdisplayshell.c : #include <string.h> * app/display/makefile.msc : -FImsvc_recommended_pragmas.h, G_LOG_DOMAIN definition and object file update * app/file/makefile.msc : -FImsvc_recommended_pragmas.h, G_LOG_DOMAIN definition * app/file/file-open.c (file_open_with_proc_and_display) : use absolute filename for gimp_documents_add() * app/gui/channel-commands.c app/gui/colormap-editor-commands.c app/gui/edit-commands.c app/gui/vectors-commands.c : #include <string.h> * app/gui/makefile.msc : updated * app/gui/menus.c : use g_file_test() instead of access() to avoid inclusion <unistd.h> * app/paint/makefile.msc : updated * app/plug-in/plug-in-params.c : #include <string.h> * app/plug-in/makefile.msc : updated * app/plug-in/plug-in-def.h : #include <time.h> for time_t * app/plug-in/plug-in.c : remove definition of S_IFREG * app/plug-in/gap/gap_arr_dialog.c : include <config.h> before including libgimp/libgimp-intl.h * app/tools/makefile.msc : updated * app/vectors/makefile.msc : new file * app/widgets/makefile.msc : updated * libgimp/gimp.def : updated externals * libgimpwidgets/gimpwidgets.def : updated externals * modules/makefile.msc : updated and disabled colorsel_gtk. * plug-in/makefile.msc : don't define GETTEXT_PACKAGE * themes/Default/images/makefile.msc : moved makefile.msc from .. and adapted pathes to images
2002-03-28 08:10:56 +08:00
#include <string.h>
#include <gtk/gtk.h>
#include "libgimpcolor/gimpcolor.h"
#include "libgimpwidgets/gimpwidgets.h"
#include "actions-types.h"
#include "core/gimpchannel.h"
Treat changes to the selection like changes to any other drawable: 2003-10-06 Michael Natterer <mitch@gimp.org> Treat changes to the selection like changes to any other drawable: * app/core/gimpchannel.c * app/core/gimpchannel-combine.c: call gimp_drawable_update() after changing the channel. * app/core/gimpimage.[ch]: added struct GimpImageFlushAccumulator with one member "gboolean mask_changed". Connect to "update" of the selection and set accum.mask_changed to TRUE in the callback. Added default implementation for GimpImage::flush() and emit "mask_changed" there. Unrelated: * app/core/gimpimage.h: removed GimpGuide struct... * app/core/gimpimage-guides.h: ...and added it here. * app/core/gimpimage-undo-push.c (undo_pop_mask) (undo_pop_channel_mod): don't distinguish between selection and non-selection channels and just call gimp_drawable_update(). * app/core/gimpundo.h * app/core/gimpimage-undo.c: removed "gboolean mask_changed" from the GimpUndoAccumulator struct since we don't have to care about that signal explicitly any more. * app/display/gimpdisplay-foreach.[ch]: removed gimp_displays_flush(). * tools/pdbgen/pdb/display.pdb (displays_flush_invoker): call gimp_image_flush() on all images so the flush accumulator is honored. This generalization enables the removal of more special purpose code which was needed to treat the selection different: * app/core/gimpimage-mask-select.[ch]: removed... * app/core/gimpchannel-select.[ch]: ...and added under a new name because it's not selection specific any more. * app/core/gimpimage-mask.[ch]: removed... * app/core/gimpselection.[ch]: ...added the two remaining functions here. Removed all calls to gimp_image_mask_changed(). * app/core/Makefile.am * app/core/gimp-edit.c * app/core/gimpdrawable-transform.c * app/core/gimpimage-scale.c * app/core/gimpimage-snap.c * app/display/gimpdisplayshell.c * app/gui/channels-commands.c * app/gui/layers-commands.c * app/gui/select-commands.c * app/gui/vectors-commands.c * app/tools/gimpbycolorselecttool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpellipseselecttool.c * app/tools/gimpfreeselecttool.c * app/tools/gimpfuzzyselecttool.c * app/tools/gimpiscissorstool.c * app/tools/gimprectselecttool.c * app/tools/gimptransformtool.c * app/widgets/gimpchanneltreeview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpvectorstreeview.c * app/xcf/xcf-save.c * tools/pdbgen/pdb/paths.pdb * tools/pdbgen/pdb/selection.pdb * tools/pdbgen/pdb/selection_tools.pdb: changed accordingly. * app/core/gimpdrawable-bucket-fill.c * app/core/gimpimage-colormap.c * app/core/gimplayer-floating-sel.c * app/core/gimplayer.c * app/gui/image-menu.c * app/paint/gimppaintcore.c * app/tools/gimpcroptool.c * app/tools/gimpinkoptions.c * app/tools/gimpvectortool.c: removed useless and/or obsolete #includes. * app/pdb/display_cmds.c * app/pdb/paths_cmds.c * app/pdb/selection_cmds.c * app/pdb/selection_tools_cmds.c: regenerated.
2003-10-06 20:17:11 +08:00
#include "core/gimpchannel-select.h"
#include "core/gimpcontext.h"
#include "core/gimpimage.h"
#include "core/gimpimage-undo.h"
Ported the layers, channels and paths dialogs from 2004-10-16 Michael Natterer <mitch@gimp.org> Ported the layers, channels and paths dialogs from gimp_editor_add_button() to gimp_editor_add_action_button(), removing a massive amount of duplicated code, sensitivity logic and confusing utility functions. * app/actions/channels-actions.c * app/actions/channels-commands.[ch] * app/actions/layers-actions.c * app/actions/layers-commands.[ch] * app/actions/vectors-actions.c * app/actions/vectors-commands.[ch]: added "foo-new-default" actions and callbacks which create items without a dialog, optionally using default values from a passed template. Removed all public utility function that were passed as function pointers to widget construtors. Added tooltips to all actions which are now used for dialog buttons. * app/widgets/gimpeditor.c (gimp_editor_add_action_button): automatically create multi-line tooltips showing the modifiers for extended action buttons. Removes the need for lots of insane format strings that need to be translated correctly. * app/widgets/gimpitemtreeview.[ch] (struct GimpItemTreeViewClass): replaced tooltip and help_id strings by action names. (struct GimpItemTreeView) (gimp_item_tree_view_new): removed "edit", "new" and "activate" function pointers. (gimp_item_tree_view_constructor): create all buttons with gimp_editor_add_action_button(), using the action names from GimpItemTreeViewClass. Removed tons of "clicked" callbacks and all code which sets the buttons' sensitivity. They are not needed any longer. Require all subclasses to implement GimpItemTreeView::new_item(), a new virtual function which creates a plain new item without showing a dialog. * app/widgets/gimpdrawabletreeview.c * app/widgets/gimpchanneltreeview.c * app/widgets/gimplayertreeview.c * app/widgets/gimpvectorstreeview.c: fill in the action names and implement GimpItemTreeView::new_item(). Removed all button sensitivity logic. * app/dialogs/dialogs-constructors.c: changed accordingly. Doesn't include anything from actions/ any more.
2004-10-16 23:48:23 +08:00
#include "widgets/gimpaction.h"
#include "widgets/gimpcolorpanel.h"
#include "widgets/gimpcomponenteditor.h"
#include "widgets/gimpdock.h"
app/widgets/Makefile.am new file defining the available help topics. Work 2003-08-21 Michael Natterer <mitch@gimp.org> * app/widgets/Makefile.am * app/widgets/gimphelp-ids.h: new file defining the available help topics. Work in progress and totally unusable for matching to the help system. Stay tuned... * app/gui/about-dialog.c * app/gui/brushes-menu.c * app/gui/buffers-menu.c * app/gui/channels-commands.[ch] * app/gui/channels-menu.c * app/gui/edit-commands.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-open-dialog.c * app/gui/file-save-dialog.c * app/gui/gradients-commands.c * app/gui/gradients-menu.c * app/gui/image-menu.c * app/gui/layers-commands.[ch] * app/gui/layers-menu.c * app/gui/module-browser.c * app/gui/offset-dialog.c * app/gui/palettes-menu.c * app/gui/patterns-menu.c * app/gui/resize-dialog.c * app/gui/select-commands.c * app/gui/templates-menu.c * app/gui/tips-dialog.c * app/gui/toolbox-menu.c * app/gui/vectors-commands.[ch] * app/gui/vectors-menu.c: replaced literal HTML file paths by help IDs from gimphelp-ids.h. Renamed some menu callbacks to be consistent with similar ones. This is just an intermediate commit and not finished. While browsing all the menus, I noticed that our "x to selection" functions are not consistent at all. They should all offer the REPLACE,ADD,SUBTRACT,INTERSECT options: * app/core/gimpchannel.[ch]: added new function gimp_channel_new_from_alpha(). Removed gimp_channel_layer_alpha() and gimp_channel_layer_mask(). * app/core/gimpimage-mask.[ch]: added gimp_image_mask_select_alpha() and gimp_image_mask_select_component() which offer the full set of operation, feather and feather_radius parameters as the other selection functions. * app/core/gimpimage-mask-select.[ch]: removed gimp_image_mask_layer_alpha() and gimp_image_mask_layer_mask(). * app/gui/channels-commands.c (channels_channel_to_selection): use gimp_image_mask_select_component() instead of implementing it here. * app/gui/image-menu.c * app/gui/layers-commands.[ch]: offer the full choice of REPLACE,ADD,SUBTRACT,INTERSECT with "Alpha to Selection" and "Mask to Selection". * tools/pdbgen/pdb/selection.pdb: changed accordingly. * app/pdb/selection_cmds.c: regenerated.
2003-08-21 23:54:47 +08:00
#include "widgets/gimphelp-ids.h"
#include "dialogs/channel-options-dialog.h"
#include "actions.h"
#include "channels-commands.h"
#include "gimp-intl.h"
/* local function prototypes */
static void channels_new_channel_response (GtkWidget *widget,
gint response_id,
ChannelOptionsDialog *options);
static void channels_edit_channel_response (GtkWidget *widget,
gint response_id,
ChannelOptionsDialog *options);
/* private variables */
static gchar *channel_name = NULL;
static GimpRGB channel_color = { 0.0, 0.0, 0.0, 0.5 };
/* public functions */
void
channels_edit_attributes_cmd_callback (GtkAction *action,
gpointer data)
{
ChannelOptionsDialog *options;
GimpImage *gimage;
GimpChannel *channel;
GtkWidget *widget;
return_if_no_channel (gimage, channel, data);
return_if_no_widget (widget, data);
options = channel_options_dialog_new (gimage,
action_data_get_context (data),
channel,
widget,
&channel->color,
gimp_object_get_name (GIMP_OBJECT (channel)),
_("Channel Attributes"),
"gimp-channel-edit",
GIMP_STOCK_EDIT,
_("Edit Channel Attributes"),
GIMP_HELP_CHANNEL_EDIT,
_("Edit Channel Color"),
_("Fill Opacity:"));
g_signal_connect (options->dialog, "response",
Action code review and pre-release consistency cleanup: 2004-10-18 Michael Natterer <mitch@gimp.org> Action code review and pre-release consistency cleanup: * app/actions/*-actions.c: added some missing and resolved conflicting mnemonics, added missing help IDs. Cleaned up the *_actions_update() functions. * app/actions/channels-actions.c * app/actions/layers-actions.c * app/actions/vectors-actions.c (*_actions_update): simplified the code that figures the prev and next channel,layer,vectors. * app/actions/qmask-actions.c: use the same accelerator for "qmask-active" and "qmask-toggle". Fixed action sensitivity. * app/actions/channels-commands.c * app/actions/dockable-commands.c * app/actions/documents-commands.c * app/actions/gradients-commands.c * app/actions/layers-commands.c * app/actions/palettes-commands.c * app/actions/image-commands.c * app/actions/select-commands.c * app/actions/vectors-commands.c: folded tons of private utility functions into their only callers (they used to be public and called from outside before the switch to action based menus). Renamed functions and variables saying "query" or "qbox" to "dialog". Moved static functions to the end of the files. Misc minor cleanups. * app/actions/drawable-actions.c * app/actions/drawable-commands.c: made the "drawable-visible" and "drawable-linked" actions affect the layer if the active drawable is a layer mask. * app/actions/select-commands.c: added action to stroke with the last values used in an attempt to address bug #135746 but #if 0'ed it because the approach is too ugly. * app/tools/gimpiscissorstool.c: changed mnemonic from I to S. * menus/image-menu-xml.in: added more stuff to the (commented out) "context" menu.
2004-10-18 19:29:58 +08:00
G_CALLBACK (channels_edit_channel_response),
options);
gtk_widget_show (options->dialog);
}
void
Switch from GtkItemFactory to GtkUIManager. The migration is almost 2004-04-29 Michael Natterer <mitch@gimp.org> Switch from GtkItemFactory to GtkUIManager. The migration is almost complete, still stuff missing/incomplete, definitely added a bunch of new bugs... * app/actions/*-commands.[ch]: converted all callback from GtkItemFactory callbacks to GtkAction callbacks. * app/actions/debug-actions.c * app/actions/gradient-editor-actions.c * app/actions/help-actions.c * app/actions/plug-in-actions.c * app/actions/qmask-actions.c * app/actions/tool-options-actions.c: various fixes. * app/display/gimpdisplay.[ch] * app/display/gimpdisplayshell-appearance.[ch] * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell.[ch]: move everything from GtkItemFactory to GtkUIManager. * app/gui/dialogs.[ch]: added new function dialogs_get_toolbox(). Needed because the action callbacks don't have a widget parameter and sometimes we need a parent window for showing dialogs. * app/gui/Makefile.am * app/gui/brushes-menu.[ch] * app/gui/buffers-menu.[ch] * app/gui/channels-menu.[ch] * app/gui/colormap-editor-menu.[ch] * app/gui/dialogs-menu.[ch] * app/gui/documents-menu.[ch] * app/gui/error-console-menu.[ch] * app/gui/fonts-menu.[ch] * app/gui/gradient-editor-menu.[ch] * app/gui/gradients-menu.[ch] * app/gui/images-menu.[ch] * app/gui/layers-menu.[ch] * app/gui/palette-editor-menu.[ch] * app/gui/palettes-menu.[ch] * app/gui/patterns-menu.[ch] * app/gui/qmask-menu.[ch] * app/gui/templates-menu.[ch] * app/gui/vectors-menu.[ch]: removed these files. * app/gui/gui.c: create a global UI manager for the image popup menu and the toolbox menubar. * app/gui/menus.[ch]: removed all GtkItemFactory code. * app/gui/image-menu.[ch] * app/gui/toolbox-menu.[ch]: removed everything except the trivial setup_funcs. * app/gui/file-open-menu.c * app/gui/file-save-menu.c * app/gui/tool-options-menu.c: don't use the macros from menus.h any more, they are gone. * app/gui/gui-vtable.c * app/gui/plug-in-menus.[ch]: create/destroy the dynamic plug-in menu entries. * app/tools/gimpimagemaptool.c: s/gimp_item_factory_update/ gimp_ui_manager_update/g * app/widgets/gimpuimanager.[ch]: added API to get an action group by name. * app/widgets/gimpmenufactory.c: don't choke on the item_factory entries being NULL. * app/widgets/gimpactiongroup.c: make sure booleans set using g_object_set() only have TRUE or FALSE values. * app/widgets/gimpcolormapeditor.c * app/widgets/gimpcomponenteditor.c * app/widgets/gimpcontainereditor.[ch] * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainertreeview.c * app/widgets/gimpdockable.[ch] * app/widgets/gimpdocked.[ch] * app/widgets/gimpeditor.[ch] * app/widgets/gimperrorconsole.c * app/widgets/gimpgradienteditor.c * app/widgets/gimpitemtreeview.c * app/widgets/gimppaletteeditor.c * app/widgets/gimptoolbox.c * app/widgets/gimptooloptionseditor.c: removed all GtkItemFactory code and enable the #if 0'ed UI manager stuff. * menus/gradient-editor-menu.xml: fixed typos. * menus/image-menu.xml: duplicate everything so we have both an image menubar and an image popup menu. Badly cries for an XSL processor. * menus/toolbox-menu.xml: added an "Extensions" placeholder.
2004-04-29 20:52:29 +08:00
channels_new_cmd_callback (GtkAction *action,
app/widgets/Makefile.am new file defining the available help topics. Work 2003-08-21 Michael Natterer <mitch@gimp.org> * app/widgets/Makefile.am * app/widgets/gimphelp-ids.h: new file defining the available help topics. Work in progress and totally unusable for matching to the help system. Stay tuned... * app/gui/about-dialog.c * app/gui/brushes-menu.c * app/gui/buffers-menu.c * app/gui/channels-commands.[ch] * app/gui/channels-menu.c * app/gui/edit-commands.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-open-dialog.c * app/gui/file-save-dialog.c * app/gui/gradients-commands.c * app/gui/gradients-menu.c * app/gui/image-menu.c * app/gui/layers-commands.[ch] * app/gui/layers-menu.c * app/gui/module-browser.c * app/gui/offset-dialog.c * app/gui/palettes-menu.c * app/gui/patterns-menu.c * app/gui/resize-dialog.c * app/gui/select-commands.c * app/gui/templates-menu.c * app/gui/tips-dialog.c * app/gui/toolbox-menu.c * app/gui/vectors-commands.[ch] * app/gui/vectors-menu.c: replaced literal HTML file paths by help IDs from gimphelp-ids.h. Renamed some menu callbacks to be consistent with similar ones. This is just an intermediate commit and not finished. While browsing all the menus, I noticed that our "x to selection" functions are not consistent at all. They should all offer the REPLACE,ADD,SUBTRACT,INTERSECT options: * app/core/gimpchannel.[ch]: added new function gimp_channel_new_from_alpha(). Removed gimp_channel_layer_alpha() and gimp_channel_layer_mask(). * app/core/gimpimage-mask.[ch]: added gimp_image_mask_select_alpha() and gimp_image_mask_select_component() which offer the full set of operation, feather and feather_radius parameters as the other selection functions. * app/core/gimpimage-mask-select.[ch]: removed gimp_image_mask_layer_alpha() and gimp_image_mask_layer_mask(). * app/gui/channels-commands.c (channels_channel_to_selection): use gimp_image_mask_select_component() instead of implementing it here. * app/gui/image-menu.c * app/gui/layers-commands.[ch]: offer the full choice of REPLACE,ADD,SUBTRACT,INTERSECT with "Alpha to Selection" and "Mask to Selection". * tools/pdbgen/pdb/selection.pdb: changed accordingly. * app/pdb/selection_cmds.c: regenerated.
2003-08-21 23:54:47 +08:00
gpointer data)
{
ChannelOptionsDialog *options;
GimpImage *gimage;
GtkWidget *widget;
The unbelievable happened: a menu bar per display (optionally) 2002-12-10 Michael Natterer <mitch@gimp.org> The unbelievable happened: a menu bar per display (optionally) * app/widgets/gimpitemfactory.[ch]: Added the possibility to have more than one item factory per <Prefix>. Added gimp_item_factories_set_foobar() variants of all functions which set menu item properties (label, sensitive, ...). Removed the #ifndef ENABLE_NLS code since that's no longer possible. * app/widgets/gimptoolbox.c: made it robust againt the <Image> factory not existing at the time of toolbox creation. * app/config/gimpconfig-blurbs.h * app/config/gimpdisplayconfig.[ch]: added boolean "menu_bar_per_display" property. * app/gui/preferences-dialog.c: added a toggle for the new option. * app/gui/menus.[ch]: added menus_get_new_image_factory() as temporary solution. Will add a GimpMenuFactory which creates the item factories soon. * app/display/gimpdisplayshell.c: add the menu bar if requested. Changed widget packing slightly for the menu bar case. * app/display/gimpdisplayshell-callbacks.c: changed accordingly. Currently there is no right-click popup menu when we have a menu bar. This will change soon. * app/gui/file-dialog-utils.c * app/gui/gui.c: use gimp_item_factories_set_foo(). * app/gui/channels-commands.c * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.c * app/gui/drawable-commands.c * app/gui/edit-commands.c * app/gui/file-commands.c * app/gui/image-commands.c * app/gui/layers-commands.c * app/gui/plug-in-commands.c * app/gui/select-commands.c * app/gui/tools-commands.c * app/gui/vectors-commands.c * app/gui/view-commands.c: per-display item factories pass the GimpDisplay as user_data to callbacks, not a Gimp. Changed all return_if_no_foo() macros to handle both cases. Cleaned up the plug-in menu stuff: * app/plug-in/plug-in-types.h: removed PlugInMenuEntry type. * app/plug-in/plug-ins.[ch]: added plug_ins_proc_def_add() as counterpart to plug_ins_proc_def_remove(). Added plug_ins_locale_domain() as counterpart to plug_ins_help_path(). Remember the locale domains just as the help paths. Changed plug-in initialization so that their menus can be created multiple times. * app/plug-in/plug-in.[ch]: use plug_ins_proc_def_add() instead of doing it manually. * app/gui/plug-in-menus.[ch]: added plug_in_menus_init() which just registers the locale domains. Changed plug_in_make_menu() to take a list of proc_defs, not plug_ins_defs so it can be used after plug-in query.
2002-12-11 00:38:16 +08:00
return_if_no_image (gimage, data);
Switch from GtkItemFactory to GtkUIManager. The migration is almost 2004-04-29 Michael Natterer <mitch@gimp.org> Switch from GtkItemFactory to GtkUIManager. The migration is almost complete, still stuff missing/incomplete, definitely added a bunch of new bugs... * app/actions/*-commands.[ch]: converted all callback from GtkItemFactory callbacks to GtkAction callbacks. * app/actions/debug-actions.c * app/actions/gradient-editor-actions.c * app/actions/help-actions.c * app/actions/plug-in-actions.c * app/actions/qmask-actions.c * app/actions/tool-options-actions.c: various fixes. * app/display/gimpdisplay.[ch] * app/display/gimpdisplayshell-appearance.[ch] * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell.[ch]: move everything from GtkItemFactory to GtkUIManager. * app/gui/dialogs.[ch]: added new function dialogs_get_toolbox(). Needed because the action callbacks don't have a widget parameter and sometimes we need a parent window for showing dialogs. * app/gui/Makefile.am * app/gui/brushes-menu.[ch] * app/gui/buffers-menu.[ch] * app/gui/channels-menu.[ch] * app/gui/colormap-editor-menu.[ch] * app/gui/dialogs-menu.[ch] * app/gui/documents-menu.[ch] * app/gui/error-console-menu.[ch] * app/gui/fonts-menu.[ch] * app/gui/gradient-editor-menu.[ch] * app/gui/gradients-menu.[ch] * app/gui/images-menu.[ch] * app/gui/layers-menu.[ch] * app/gui/palette-editor-menu.[ch] * app/gui/palettes-menu.[ch] * app/gui/patterns-menu.[ch] * app/gui/qmask-menu.[ch] * app/gui/templates-menu.[ch] * app/gui/vectors-menu.[ch]: removed these files. * app/gui/gui.c: create a global UI manager for the image popup menu and the toolbox menubar. * app/gui/menus.[ch]: removed all GtkItemFactory code. * app/gui/image-menu.[ch] * app/gui/toolbox-menu.[ch]: removed everything except the trivial setup_funcs. * app/gui/file-open-menu.c * app/gui/file-save-menu.c * app/gui/tool-options-menu.c: don't use the macros from menus.h any more, they are gone. * app/gui/gui-vtable.c * app/gui/plug-in-menus.[ch]: create/destroy the dynamic plug-in menu entries. * app/tools/gimpimagemaptool.c: s/gimp_item_factory_update/ gimp_ui_manager_update/g * app/widgets/gimpuimanager.[ch]: added API to get an action group by name. * app/widgets/gimpmenufactory.c: don't choke on the item_factory entries being NULL. * app/widgets/gimpactiongroup.c: make sure booleans set using g_object_set() only have TRUE or FALSE values. * app/widgets/gimpcolormapeditor.c * app/widgets/gimpcomponenteditor.c * app/widgets/gimpcontainereditor.[ch] * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainertreeview.c * app/widgets/gimpdockable.[ch] * app/widgets/gimpdocked.[ch] * app/widgets/gimpeditor.[ch] * app/widgets/gimperrorconsole.c * app/widgets/gimpgradienteditor.c * app/widgets/gimpitemtreeview.c * app/widgets/gimppaletteeditor.c * app/widgets/gimptoolbox.c * app/widgets/gimptooloptionseditor.c: removed all GtkItemFactory code and enable the #if 0'ed UI manager stuff. * menus/gradient-editor-menu.xml: fixed typos. * menus/image-menu.xml: duplicate everything so we have both an image menubar and an image popup menu. Badly cries for an XSL processor. * menus/toolbox-menu.xml: added an "Extensions" placeholder.
2004-04-29 20:52:29 +08:00
return_if_no_widget (widget, data);
options = channel_options_dialog_new (gimage,
action_data_get_context (data),
NULL,
widget,
&channel_color,
channel_name ? channel_name :
_("New Channel"),
_("New Channel"),
"gimp-channel-new",
GIMP_STOCK_CHANNEL,
_("New Channel Options"),
GIMP_HELP_CHANNEL_NEW,
_("New Channel Color"),
_("Fill Opacity:"));
g_signal_connect (options->dialog, "response",
Action code review and pre-release consistency cleanup: 2004-10-18 Michael Natterer <mitch@gimp.org> Action code review and pre-release consistency cleanup: * app/actions/*-actions.c: added some missing and resolved conflicting mnemonics, added missing help IDs. Cleaned up the *_actions_update() functions. * app/actions/channels-actions.c * app/actions/layers-actions.c * app/actions/vectors-actions.c (*_actions_update): simplified the code that figures the prev and next channel,layer,vectors. * app/actions/qmask-actions.c: use the same accelerator for "qmask-active" and "qmask-toggle". Fixed action sensitivity. * app/actions/channels-commands.c * app/actions/dockable-commands.c * app/actions/documents-commands.c * app/actions/gradients-commands.c * app/actions/layers-commands.c * app/actions/palettes-commands.c * app/actions/image-commands.c * app/actions/select-commands.c * app/actions/vectors-commands.c: folded tons of private utility functions into their only callers (they used to be public and called from outside before the switch to action based menus). Renamed functions and variables saying "query" or "qbox" to "dialog". Moved static functions to the end of the files. Misc minor cleanups. * app/actions/drawable-actions.c * app/actions/drawable-commands.c: made the "drawable-visible" and "drawable-linked" actions affect the layer if the active drawable is a layer mask. * app/actions/select-commands.c: added action to stroke with the last values used in an attempt to address bug #135746 but #if 0'ed it because the approach is too ugly. * app/tools/gimpiscissorstool.c: changed mnemonic from I to S. * menus/image-menu-xml.in: added more stuff to the (commented out) "context" menu.
2004-10-18 19:29:58 +08:00
G_CALLBACK (channels_new_channel_response),
options);
gtk_widget_show (options->dialog);
Ported the layers, channels and paths dialogs from 2004-10-16 Michael Natterer <mitch@gimp.org> Ported the layers, channels and paths dialogs from gimp_editor_add_button() to gimp_editor_add_action_button(), removing a massive amount of duplicated code, sensitivity logic and confusing utility functions. * app/actions/channels-actions.c * app/actions/channels-commands.[ch] * app/actions/layers-actions.c * app/actions/layers-commands.[ch] * app/actions/vectors-actions.c * app/actions/vectors-commands.[ch]: added "foo-new-default" actions and callbacks which create items without a dialog, optionally using default values from a passed template. Removed all public utility function that were passed as function pointers to widget construtors. Added tooltips to all actions which are now used for dialog buttons. * app/widgets/gimpeditor.c (gimp_editor_add_action_button): automatically create multi-line tooltips showing the modifiers for extended action buttons. Removes the need for lots of insane format strings that need to be translated correctly. * app/widgets/gimpitemtreeview.[ch] (struct GimpItemTreeViewClass): replaced tooltip and help_id strings by action names. (struct GimpItemTreeView) (gimp_item_tree_view_new): removed "edit", "new" and "activate" function pointers. (gimp_item_tree_view_constructor): create all buttons with gimp_editor_add_action_button(), using the action names from GimpItemTreeViewClass. Removed tons of "clicked" callbacks and all code which sets the buttons' sensitivity. They are not needed any longer. Require all subclasses to implement GimpItemTreeView::new_item(), a new virtual function which creates a plain new item without showing a dialog. * app/widgets/gimpdrawabletreeview.c * app/widgets/gimpchanneltreeview.c * app/widgets/gimplayertreeview.c * app/widgets/gimpvectorstreeview.c: fill in the action names and implement GimpItemTreeView::new_item(). Removed all button sensitivity logic. * app/dialogs/dialogs-constructors.c: changed accordingly. Doesn't include anything from actions/ any more.
2004-10-16 23:48:23 +08:00
}
void
channels_new_last_vals_cmd_callback (GtkAction *action,
gpointer data)
Ported the layers, channels and paths dialogs from 2004-10-16 Michael Natterer <mitch@gimp.org> Ported the layers, channels and paths dialogs from gimp_editor_add_button() to gimp_editor_add_action_button(), removing a massive amount of duplicated code, sensitivity logic and confusing utility functions. * app/actions/channels-actions.c * app/actions/channels-commands.[ch] * app/actions/layers-actions.c * app/actions/layers-commands.[ch] * app/actions/vectors-actions.c * app/actions/vectors-commands.[ch]: added "foo-new-default" actions and callbacks which create items without a dialog, optionally using default values from a passed template. Removed all public utility function that were passed as function pointers to widget construtors. Added tooltips to all actions which are now used for dialog buttons. * app/widgets/gimpeditor.c (gimp_editor_add_action_button): automatically create multi-line tooltips showing the modifiers for extended action buttons. Removes the need for lots of insane format strings that need to be translated correctly. * app/widgets/gimpitemtreeview.[ch] (struct GimpItemTreeViewClass): replaced tooltip and help_id strings by action names. (struct GimpItemTreeView) (gimp_item_tree_view_new): removed "edit", "new" and "activate" function pointers. (gimp_item_tree_view_constructor): create all buttons with gimp_editor_add_action_button(), using the action names from GimpItemTreeViewClass. Removed tons of "clicked" callbacks and all code which sets the buttons' sensitivity. They are not needed any longer. Require all subclasses to implement GimpItemTreeView::new_item(), a new virtual function which creates a plain new item without showing a dialog. * app/widgets/gimpdrawabletreeview.c * app/widgets/gimpchanneltreeview.c * app/widgets/gimplayertreeview.c * app/widgets/gimpvectorstreeview.c: fill in the action names and implement GimpItemTreeView::new_item(). Removed all button sensitivity logic. * app/dialogs/dialogs-constructors.c: changed accordingly. Doesn't include anything from actions/ any more.
2004-10-16 23:48:23 +08:00
{
GimpImage *gimage;
GimpChannel *new_channel;
gint width, height;
GimpRGB color;
return_if_no_image (gimage, data);
if (GIMP_IS_CHANNEL (GIMP_ACTION (action)->viewable))
{
GimpChannel *template = GIMP_CHANNEL (GIMP_ACTION (action)->viewable);
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);
color = channel_color;
Ported the layers, channels and paths dialogs from 2004-10-16 Michael Natterer <mitch@gimp.org> Ported the layers, channels and paths dialogs from gimp_editor_add_button() to gimp_editor_add_action_button(), removing a massive amount of duplicated code, sensitivity logic and confusing utility functions. * app/actions/channels-actions.c * app/actions/channels-commands.[ch] * app/actions/layers-actions.c * app/actions/layers-commands.[ch] * app/actions/vectors-actions.c * app/actions/vectors-commands.[ch]: added "foo-new-default" actions and callbacks which create items without a dialog, optionally using default values from a passed template. Removed all public utility function that were passed as function pointers to widget construtors. Added tooltips to all actions which are now used for dialog buttons. * app/widgets/gimpeditor.c (gimp_editor_add_action_button): automatically create multi-line tooltips showing the modifiers for extended action buttons. Removes the need for lots of insane format strings that need to be translated correctly. * app/widgets/gimpitemtreeview.[ch] (struct GimpItemTreeViewClass): replaced tooltip and help_id strings by action names. (struct GimpItemTreeView) (gimp_item_tree_view_new): removed "edit", "new" and "activate" function pointers. (gimp_item_tree_view_constructor): create all buttons with gimp_editor_add_action_button(), using the action names from GimpItemTreeViewClass. Removed tons of "clicked" callbacks and all code which sets the buttons' sensitivity. They are not needed any longer. Require all subclasses to implement GimpItemTreeView::new_item(), a new virtual function which creates a plain new item without showing a dialog. * app/widgets/gimpdrawabletreeview.c * app/widgets/gimpchanneltreeview.c * app/widgets/gimplayertreeview.c * app/widgets/gimpvectorstreeview.c: fill in the action names and implement GimpItemTreeView::new_item(). Removed all button sensitivity logic. * app/dialogs/dialogs-constructors.c: changed accordingly. Doesn't include anything from actions/ any more.
2004-10-16 23:48:23 +08:00
}
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_EDIT_PASTE,
_("New Channel"));
new_channel = gimp_channel_new (gimage, width, height,
channel_name ? channel_name :
_("New Channel"), &color);
Ported the layers, channels and paths dialogs from 2004-10-16 Michael Natterer <mitch@gimp.org> Ported the layers, channels and paths dialogs from gimp_editor_add_button() to gimp_editor_add_action_button(), removing a massive amount of duplicated code, sensitivity logic and confusing utility functions. * app/actions/channels-actions.c * app/actions/channels-commands.[ch] * app/actions/layers-actions.c * app/actions/layers-commands.[ch] * app/actions/vectors-actions.c * app/actions/vectors-commands.[ch]: added "foo-new-default" actions and callbacks which create items without a dialog, optionally using default values from a passed template. Removed all public utility function that were passed as function pointers to widget construtors. Added tooltips to all actions which are now used for dialog buttons. * app/widgets/gimpeditor.c (gimp_editor_add_action_button): automatically create multi-line tooltips showing the modifiers for extended action buttons. Removes the need for lots of insane format strings that need to be translated correctly. * app/widgets/gimpitemtreeview.[ch] (struct GimpItemTreeViewClass): replaced tooltip and help_id strings by action names. (struct GimpItemTreeView) (gimp_item_tree_view_new): removed "edit", "new" and "activate" function pointers. (gimp_item_tree_view_constructor): create all buttons with gimp_editor_add_action_button(), using the action names from GimpItemTreeViewClass. Removed tons of "clicked" callbacks and all code which sets the buttons' sensitivity. They are not needed any longer. Require all subclasses to implement GimpItemTreeView::new_item(), a new virtual function which creates a plain new item without showing a dialog. * app/widgets/gimpdrawabletreeview.c * app/widgets/gimpchanneltreeview.c * app/widgets/gimplayertreeview.c * app/widgets/gimpvectorstreeview.c: fill in the action names and implement GimpItemTreeView::new_item(). Removed all button sensitivity logic. * app/dialogs/dialogs-constructors.c: changed accordingly. Doesn't include anything from actions/ any more.
2004-10-16 23:48:23 +08:00
gimp_drawable_fill_by_type (GIMP_DRAWABLE (new_channel),
action_data_get_context (data),
GIMP_TRANSPARENT_FILL);
gimp_image_add_channel (gimage, new_channel, -1);
gimp_image_undo_group_end (gimage);
gimp_image_flush (gimage);
}
void
Switch from GtkItemFactory to GtkUIManager. The migration is almost 2004-04-29 Michael Natterer <mitch@gimp.org> Switch from GtkItemFactory to GtkUIManager. The migration is almost complete, still stuff missing/incomplete, definitely added a bunch of new bugs... * app/actions/*-commands.[ch]: converted all callback from GtkItemFactory callbacks to GtkAction callbacks. * app/actions/debug-actions.c * app/actions/gradient-editor-actions.c * app/actions/help-actions.c * app/actions/plug-in-actions.c * app/actions/qmask-actions.c * app/actions/tool-options-actions.c: various fixes. * app/display/gimpdisplay.[ch] * app/display/gimpdisplayshell-appearance.[ch] * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell.[ch]: move everything from GtkItemFactory to GtkUIManager. * app/gui/dialogs.[ch]: added new function dialogs_get_toolbox(). Needed because the action callbacks don't have a widget parameter and sometimes we need a parent window for showing dialogs. * app/gui/Makefile.am * app/gui/brushes-menu.[ch] * app/gui/buffers-menu.[ch] * app/gui/channels-menu.[ch] * app/gui/colormap-editor-menu.[ch] * app/gui/dialogs-menu.[ch] * app/gui/documents-menu.[ch] * app/gui/error-console-menu.[ch] * app/gui/fonts-menu.[ch] * app/gui/gradient-editor-menu.[ch] * app/gui/gradients-menu.[ch] * app/gui/images-menu.[ch] * app/gui/layers-menu.[ch] * app/gui/palette-editor-menu.[ch] * app/gui/palettes-menu.[ch] * app/gui/patterns-menu.[ch] * app/gui/qmask-menu.[ch] * app/gui/templates-menu.[ch] * app/gui/vectors-menu.[ch]: removed these files. * app/gui/gui.c: create a global UI manager for the image popup menu and the toolbox menubar. * app/gui/menus.[ch]: removed all GtkItemFactory code. * app/gui/image-menu.[ch] * app/gui/toolbox-menu.[ch]: removed everything except the trivial setup_funcs. * app/gui/file-open-menu.c * app/gui/file-save-menu.c * app/gui/tool-options-menu.c: don't use the macros from menus.h any more, they are gone. * app/gui/gui-vtable.c * app/gui/plug-in-menus.[ch]: create/destroy the dynamic plug-in menu entries. * app/tools/gimpimagemaptool.c: s/gimp_item_factory_update/ gimp_ui_manager_update/g * app/widgets/gimpuimanager.[ch]: added API to get an action group by name. * app/widgets/gimpmenufactory.c: don't choke on the item_factory entries being NULL. * app/widgets/gimpactiongroup.c: make sure booleans set using g_object_set() only have TRUE or FALSE values. * app/widgets/gimpcolormapeditor.c * app/widgets/gimpcomponenteditor.c * app/widgets/gimpcontainereditor.[ch] * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainertreeview.c * app/widgets/gimpdockable.[ch] * app/widgets/gimpdocked.[ch] * app/widgets/gimpeditor.[ch] * app/widgets/gimperrorconsole.c * app/widgets/gimpgradienteditor.c * app/widgets/gimpitemtreeview.c * app/widgets/gimppaletteeditor.c * app/widgets/gimptoolbox.c * app/widgets/gimptooloptionseditor.c: removed all GtkItemFactory code and enable the #if 0'ed UI manager stuff. * menus/gradient-editor-menu.xml: fixed typos. * menus/image-menu.xml: duplicate everything so we have both an image menubar and an image popup menu. Badly cries for an XSL processor. * menus/toolbox-menu.xml: added an "Extensions" placeholder.
2004-04-29 20:52:29 +08:00
channels_raise_cmd_callback (GtkAction *action,
app/widgets/Makefile.am new file defining the available help topics. Work 2003-08-21 Michael Natterer <mitch@gimp.org> * app/widgets/Makefile.am * app/widgets/gimphelp-ids.h: new file defining the available help topics. Work in progress and totally unusable for matching to the help system. Stay tuned... * app/gui/about-dialog.c * app/gui/brushes-menu.c * app/gui/buffers-menu.c * app/gui/channels-commands.[ch] * app/gui/channels-menu.c * app/gui/edit-commands.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-open-dialog.c * app/gui/file-save-dialog.c * app/gui/gradients-commands.c * app/gui/gradients-menu.c * app/gui/image-menu.c * app/gui/layers-commands.[ch] * app/gui/layers-menu.c * app/gui/module-browser.c * app/gui/offset-dialog.c * app/gui/palettes-menu.c * app/gui/patterns-menu.c * app/gui/resize-dialog.c * app/gui/select-commands.c * app/gui/templates-menu.c * app/gui/tips-dialog.c * app/gui/toolbox-menu.c * app/gui/vectors-commands.[ch] * app/gui/vectors-menu.c: replaced literal HTML file paths by help IDs from gimphelp-ids.h. Renamed some menu callbacks to be consistent with similar ones. This is just an intermediate commit and not finished. While browsing all the menus, I noticed that our "x to selection" functions are not consistent at all. They should all offer the REPLACE,ADD,SUBTRACT,INTERSECT options: * app/core/gimpchannel.[ch]: added new function gimp_channel_new_from_alpha(). Removed gimp_channel_layer_alpha() and gimp_channel_layer_mask(). * app/core/gimpimage-mask.[ch]: added gimp_image_mask_select_alpha() and gimp_image_mask_select_component() which offer the full set of operation, feather and feather_radius parameters as the other selection functions. * app/core/gimpimage-mask-select.[ch]: removed gimp_image_mask_layer_alpha() and gimp_image_mask_layer_mask(). * app/gui/channels-commands.c (channels_channel_to_selection): use gimp_image_mask_select_component() instead of implementing it here. * app/gui/image-menu.c * app/gui/layers-commands.[ch]: offer the full choice of REPLACE,ADD,SUBTRACT,INTERSECT with "Alpha to Selection" and "Mask to Selection". * tools/pdbgen/pdb/selection.pdb: changed accordingly. * app/pdb/selection_cmds.c: regenerated.
2003-08-21 23:54:47 +08:00
gpointer data)
{
GimpImage *gimage;
GimpChannel *channel;
return_if_no_channel (gimage, channel, data);
gimp_image_raise_channel (gimage, channel);
Started to get rid of the gdisplays_foo() functions in 2002-05-08 Michael Natterer <mitch@gimp.org> Started to get rid of the gdisplays_foo() functions in app/display/gimpdisplay-foreach.[ch]. Work in progress... * app/core/gimp.[ch]: added the display list to the Gimp object (as a GimpList of GimpObjects). This way we get more independent from whether there is GUI or not, as gimp->displays will simply be an empty list for the --no-interface case. * app/display/gimpdisplay.[ch]: Removed the global "display_list" and "display_num" variables. Use gimp->displays instead. * app/display/gimpdisplay-foreach.[ch]: renamed most functions from gdisplays_foo() to gimp_displays_foo() and pass them a Gimp pointer. * app/core/gimpimage.[ch]: added a "flush" signal. * app/display/gimpdisplay-handlers.c: connect to "flush" and call gimp_display_flush() in the callback. * tools/pdbgen/pdb/display.pdb: use gimp_displays_flush(gimp) here and only here. * app/pdb/display_cmds.c: regenerated. * app/app_procs.c * app/gui/gui.c * app/gui/preferences-dialog.c: s/gdislays_foo()/gimp_displays_foo(gimp)/ * app/image_map.c * app/undo_history.c * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell-dnd.c * app/display/gimpdisplayshell-layer-select.c * app/display/gimpdisplayshell-scale.c * app/gui/channels-commands.c * app/gui/colormap-editor-commands.c * app/gui/convert-dialog.c * app/gui/drawable-commands.c * app/gui/edit-commands.c * app/gui/file-commands.c * app/gui/image-commands.c * app/gui/layers-commands.c * app/gui/offset-dialog.c * app/gui/qmask-commands.c * app/gui/select-commands.c * app/gui/vectors-commands.c * app/paint/gimpairbrush.c * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.c * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpbycolorselecttool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcurvestool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpfreeselecttool.c * app/tools/gimpfuzzyselecttool.c * app/tools/gimphuesaturationtool.c * app/tools/gimpinktool.c * app/tools/gimpiscissorstool.c * app/tools/gimplevelstool.c * app/tools/gimpmeasuretool.c * app/tools/gimpmovetool.c * app/tools/gimppainttool.c * app/tools/gimpposterizetool.c * app/tools/gimprectselecttool.c * app/tools/gimptexttool.c * app/tools/gimpthresholdtool.c * app/tools/gimptransformtool.c * app/tools/gimpvectortool.c * app/widgets/gimpbufferview.c * app/widgets/gimpchannellistview.c * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpdocumentview.c * app/widgets/gimpdrawablelistitem.c * app/widgets/gimpdrawablelistview.c * app/widgets/gimpimageview.c * app/widgets/gimpitemlistitem.c * app/widgets/gimpitemlistview.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplayerlistview.c * app/widgets/gimpvectorslistview.c: replaced gdisplays_flush() with calls to gimp_image_flush(gimage). Removed inclusion of "display/gimpdisplay-foreach.h" from most files.
2002-05-09 01:48:24 +08:00
gimp_image_flush (gimage);
}
More GtkAction stuff (still unused): 2004-04-19 Michael Natterer <mitch@gimp.org> More GtkAction stuff (still unused): * configure.in: added new directories menus/ and app/actions/ * Makefile.am: build menus/ * menus/.cvsignore * menus/Makefile.am * menus/*-menu.xml: new files: XML menu descriptions for each menu which is now defined in gui/*-menu.c. * app/widgets/widgets-types.h: some typedefs for GimpActionGroup. * app/widgets/gimpactiongroup.[ch]: added a "Gimp" construct-only property. Added APIs to set actions visible/sensitive/active and an unimplemented stub for setting the action's color. * app/Makefile.am: build actions/ and link libappactions.a * app/actions/.cvsignore * app/actions/Makefile.am * app/actions/*-actions.[ch]: new files: GtkActions for each *-commands.c file in gui/. Ported all "update" functions from the *-menu.c files. (everything completely unused, untested and partly #if 0'ed) * app/core/gimpimage.[ch]: for reasons of (action-) symmetry, added API to raise/lower channels/vectors to top/bottom. * app/gui/channels-commands.[ch] * app/gui/vectors-commands.[ch]: added callbacks for the new to top/bottom functions. * app/gui/Makefile.am * app/gui/dockable-commands.[ch]: new files split out of dialogs-commands.[ch]. * app/gui/dialogs-commands.[ch] * app/gui/dialogs-menu.c: changed accordingly. * app/gui/edit-commands.[ch]: added edit_paste_into_cmd_callback() and remove usage of "guint action". * app/gui/image-menu.c: changed accordingly. * app/gui/palette-editor-commands.[ch]: split +palette_editor_new_color_cmd_callback() into separate callbacks for adding from FG and BG. * app/gui/palette-editor-menu.c: changed accordingly.
2004-04-19 22:54:24 +08:00
void
Switch from GtkItemFactory to GtkUIManager. The migration is almost 2004-04-29 Michael Natterer <mitch@gimp.org> Switch from GtkItemFactory to GtkUIManager. The migration is almost complete, still stuff missing/incomplete, definitely added a bunch of new bugs... * app/actions/*-commands.[ch]: converted all callback from GtkItemFactory callbacks to GtkAction callbacks. * app/actions/debug-actions.c * app/actions/gradient-editor-actions.c * app/actions/help-actions.c * app/actions/plug-in-actions.c * app/actions/qmask-actions.c * app/actions/tool-options-actions.c: various fixes. * app/display/gimpdisplay.[ch] * app/display/gimpdisplayshell-appearance.[ch] * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell.[ch]: move everything from GtkItemFactory to GtkUIManager. * app/gui/dialogs.[ch]: added new function dialogs_get_toolbox(). Needed because the action callbacks don't have a widget parameter and sometimes we need a parent window for showing dialogs. * app/gui/Makefile.am * app/gui/brushes-menu.[ch] * app/gui/buffers-menu.[ch] * app/gui/channels-menu.[ch] * app/gui/colormap-editor-menu.[ch] * app/gui/dialogs-menu.[ch] * app/gui/documents-menu.[ch] * app/gui/error-console-menu.[ch] * app/gui/fonts-menu.[ch] * app/gui/gradient-editor-menu.[ch] * app/gui/gradients-menu.[ch] * app/gui/images-menu.[ch] * app/gui/layers-menu.[ch] * app/gui/palette-editor-menu.[ch] * app/gui/palettes-menu.[ch] * app/gui/patterns-menu.[ch] * app/gui/qmask-menu.[ch] * app/gui/templates-menu.[ch] * app/gui/vectors-menu.[ch]: removed these files. * app/gui/gui.c: create a global UI manager for the image popup menu and the toolbox menubar. * app/gui/menus.[ch]: removed all GtkItemFactory code. * app/gui/image-menu.[ch] * app/gui/toolbox-menu.[ch]: removed everything except the trivial setup_funcs. * app/gui/file-open-menu.c * app/gui/file-save-menu.c * app/gui/tool-options-menu.c: don't use the macros from menus.h any more, they are gone. * app/gui/gui-vtable.c * app/gui/plug-in-menus.[ch]: create/destroy the dynamic plug-in menu entries. * app/tools/gimpimagemaptool.c: s/gimp_item_factory_update/ gimp_ui_manager_update/g * app/widgets/gimpuimanager.[ch]: added API to get an action group by name. * app/widgets/gimpmenufactory.c: don't choke on the item_factory entries being NULL. * app/widgets/gimpactiongroup.c: make sure booleans set using g_object_set() only have TRUE or FALSE values. * app/widgets/gimpcolormapeditor.c * app/widgets/gimpcomponenteditor.c * app/widgets/gimpcontainereditor.[ch] * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainertreeview.c * app/widgets/gimpdockable.[ch] * app/widgets/gimpdocked.[ch] * app/widgets/gimpeditor.[ch] * app/widgets/gimperrorconsole.c * app/widgets/gimpgradienteditor.c * app/widgets/gimpitemtreeview.c * app/widgets/gimppaletteeditor.c * app/widgets/gimptoolbox.c * app/widgets/gimptooloptionseditor.c: removed all GtkItemFactory code and enable the #if 0'ed UI manager stuff. * menus/gradient-editor-menu.xml: fixed typos. * menus/image-menu.xml: duplicate everything so we have both an image menubar and an image popup menu. Badly cries for an XSL processor. * menus/toolbox-menu.xml: added an "Extensions" placeholder.
2004-04-29 20:52:29 +08:00
channels_raise_to_top_cmd_callback (GtkAction *action,
More GtkAction stuff (still unused): 2004-04-19 Michael Natterer <mitch@gimp.org> More GtkAction stuff (still unused): * configure.in: added new directories menus/ and app/actions/ * Makefile.am: build menus/ * menus/.cvsignore * menus/Makefile.am * menus/*-menu.xml: new files: XML menu descriptions for each menu which is now defined in gui/*-menu.c. * app/widgets/widgets-types.h: some typedefs for GimpActionGroup. * app/widgets/gimpactiongroup.[ch]: added a "Gimp" construct-only property. Added APIs to set actions visible/sensitive/active and an unimplemented stub for setting the action's color. * app/Makefile.am: build actions/ and link libappactions.a * app/actions/.cvsignore * app/actions/Makefile.am * app/actions/*-actions.[ch]: new files: GtkActions for each *-commands.c file in gui/. Ported all "update" functions from the *-menu.c files. (everything completely unused, untested and partly #if 0'ed) * app/core/gimpimage.[ch]: for reasons of (action-) symmetry, added API to raise/lower channels/vectors to top/bottom. * app/gui/channels-commands.[ch] * app/gui/vectors-commands.[ch]: added callbacks for the new to top/bottom functions. * app/gui/Makefile.am * app/gui/dockable-commands.[ch]: new files split out of dialogs-commands.[ch]. * app/gui/dialogs-commands.[ch] * app/gui/dialogs-menu.c: changed accordingly. * app/gui/edit-commands.[ch]: added edit_paste_into_cmd_callback() and remove usage of "guint action". * app/gui/image-menu.c: changed accordingly. * app/gui/palette-editor-commands.[ch]: split +palette_editor_new_color_cmd_callback() into separate callbacks for adding from FG and BG. * app/gui/palette-editor-menu.c: changed accordingly.
2004-04-19 22:54:24 +08:00
gpointer data)
{
GimpImage *gimage;
GimpChannel *channel;
return_if_no_channel (gimage, channel, data);
More GtkAction stuff (still unused): 2004-04-19 Michael Natterer <mitch@gimp.org> More GtkAction stuff (still unused): * configure.in: added new directories menus/ and app/actions/ * Makefile.am: build menus/ * menus/.cvsignore * menus/Makefile.am * menus/*-menu.xml: new files: XML menu descriptions for each menu which is now defined in gui/*-menu.c. * app/widgets/widgets-types.h: some typedefs for GimpActionGroup. * app/widgets/gimpactiongroup.[ch]: added a "Gimp" construct-only property. Added APIs to set actions visible/sensitive/active and an unimplemented stub for setting the action's color. * app/Makefile.am: build actions/ and link libappactions.a * app/actions/.cvsignore * app/actions/Makefile.am * app/actions/*-actions.[ch]: new files: GtkActions for each *-commands.c file in gui/. Ported all "update" functions from the *-menu.c files. (everything completely unused, untested and partly #if 0'ed) * app/core/gimpimage.[ch]: for reasons of (action-) symmetry, added API to raise/lower channels/vectors to top/bottom. * app/gui/channels-commands.[ch] * app/gui/vectors-commands.[ch]: added callbacks for the new to top/bottom functions. * app/gui/Makefile.am * app/gui/dockable-commands.[ch]: new files split out of dialogs-commands.[ch]. * app/gui/dialogs-commands.[ch] * app/gui/dialogs-menu.c: changed accordingly. * app/gui/edit-commands.[ch]: added edit_paste_into_cmd_callback() and remove usage of "guint action". * app/gui/image-menu.c: changed accordingly. * app/gui/palette-editor-commands.[ch]: split +palette_editor_new_color_cmd_callback() into separate callbacks for adding from FG and BG. * app/gui/palette-editor-menu.c: changed accordingly.
2004-04-19 22:54:24 +08:00
gimp_image_raise_channel_to_top (gimage, channel);
More GtkAction stuff (still unused): 2004-04-19 Michael Natterer <mitch@gimp.org> More GtkAction stuff (still unused): * configure.in: added new directories menus/ and app/actions/ * Makefile.am: build menus/ * menus/.cvsignore * menus/Makefile.am * menus/*-menu.xml: new files: XML menu descriptions for each menu which is now defined in gui/*-menu.c. * app/widgets/widgets-types.h: some typedefs for GimpActionGroup. * app/widgets/gimpactiongroup.[ch]: added a "Gimp" construct-only property. Added APIs to set actions visible/sensitive/active and an unimplemented stub for setting the action's color. * app/Makefile.am: build actions/ and link libappactions.a * app/actions/.cvsignore * app/actions/Makefile.am * app/actions/*-actions.[ch]: new files: GtkActions for each *-commands.c file in gui/. Ported all "update" functions from the *-menu.c files. (everything completely unused, untested and partly #if 0'ed) * app/core/gimpimage.[ch]: for reasons of (action-) symmetry, added API to raise/lower channels/vectors to top/bottom. * app/gui/channels-commands.[ch] * app/gui/vectors-commands.[ch]: added callbacks for the new to top/bottom functions. * app/gui/Makefile.am * app/gui/dockable-commands.[ch]: new files split out of dialogs-commands.[ch]. * app/gui/dialogs-commands.[ch] * app/gui/dialogs-menu.c: changed accordingly. * app/gui/edit-commands.[ch]: added edit_paste_into_cmd_callback() and remove usage of "guint action". * app/gui/image-menu.c: changed accordingly. * app/gui/palette-editor-commands.[ch]: split +palette_editor_new_color_cmd_callback() into separate callbacks for adding from FG and BG. * app/gui/palette-editor-menu.c: changed accordingly.
2004-04-19 22:54:24 +08:00
gimp_image_flush (gimage);
}
void
Switch from GtkItemFactory to GtkUIManager. The migration is almost 2004-04-29 Michael Natterer <mitch@gimp.org> Switch from GtkItemFactory to GtkUIManager. The migration is almost complete, still stuff missing/incomplete, definitely added a bunch of new bugs... * app/actions/*-commands.[ch]: converted all callback from GtkItemFactory callbacks to GtkAction callbacks. * app/actions/debug-actions.c * app/actions/gradient-editor-actions.c * app/actions/help-actions.c * app/actions/plug-in-actions.c * app/actions/qmask-actions.c * app/actions/tool-options-actions.c: various fixes. * app/display/gimpdisplay.[ch] * app/display/gimpdisplayshell-appearance.[ch] * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell.[ch]: move everything from GtkItemFactory to GtkUIManager. * app/gui/dialogs.[ch]: added new function dialogs_get_toolbox(). Needed because the action callbacks don't have a widget parameter and sometimes we need a parent window for showing dialogs. * app/gui/Makefile.am * app/gui/brushes-menu.[ch] * app/gui/buffers-menu.[ch] * app/gui/channels-menu.[ch] * app/gui/colormap-editor-menu.[ch] * app/gui/dialogs-menu.[ch] * app/gui/documents-menu.[ch] * app/gui/error-console-menu.[ch] * app/gui/fonts-menu.[ch] * app/gui/gradient-editor-menu.[ch] * app/gui/gradients-menu.[ch] * app/gui/images-menu.[ch] * app/gui/layers-menu.[ch] * app/gui/palette-editor-menu.[ch] * app/gui/palettes-menu.[ch] * app/gui/patterns-menu.[ch] * app/gui/qmask-menu.[ch] * app/gui/templates-menu.[ch] * app/gui/vectors-menu.[ch]: removed these files. * app/gui/gui.c: create a global UI manager for the image popup menu and the toolbox menubar. * app/gui/menus.[ch]: removed all GtkItemFactory code. * app/gui/image-menu.[ch] * app/gui/toolbox-menu.[ch]: removed everything except the trivial setup_funcs. * app/gui/file-open-menu.c * app/gui/file-save-menu.c * app/gui/tool-options-menu.c: don't use the macros from menus.h any more, they are gone. * app/gui/gui-vtable.c * app/gui/plug-in-menus.[ch]: create/destroy the dynamic plug-in menu entries. * app/tools/gimpimagemaptool.c: s/gimp_item_factory_update/ gimp_ui_manager_update/g * app/widgets/gimpuimanager.[ch]: added API to get an action group by name. * app/widgets/gimpmenufactory.c: don't choke on the item_factory entries being NULL. * app/widgets/gimpactiongroup.c: make sure booleans set using g_object_set() only have TRUE or FALSE values. * app/widgets/gimpcolormapeditor.c * app/widgets/gimpcomponenteditor.c * app/widgets/gimpcontainereditor.[ch] * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainertreeview.c * app/widgets/gimpdockable.[ch] * app/widgets/gimpdocked.[ch] * app/widgets/gimpeditor.[ch] * app/widgets/gimperrorconsole.c * app/widgets/gimpgradienteditor.c * app/widgets/gimpitemtreeview.c * app/widgets/gimppaletteeditor.c * app/widgets/gimptoolbox.c * app/widgets/gimptooloptionseditor.c: removed all GtkItemFactory code and enable the #if 0'ed UI manager stuff. * menus/gradient-editor-menu.xml: fixed typos. * menus/image-menu.xml: duplicate everything so we have both an image menubar and an image popup menu. Badly cries for an XSL processor. * menus/toolbox-menu.xml: added an "Extensions" placeholder.
2004-04-29 20:52:29 +08:00
channels_lower_cmd_callback (GtkAction *action,
app/widgets/Makefile.am new file defining the available help topics. Work 2003-08-21 Michael Natterer <mitch@gimp.org> * app/widgets/Makefile.am * app/widgets/gimphelp-ids.h: new file defining the available help topics. Work in progress and totally unusable for matching to the help system. Stay tuned... * app/gui/about-dialog.c * app/gui/brushes-menu.c * app/gui/buffers-menu.c * app/gui/channels-commands.[ch] * app/gui/channels-menu.c * app/gui/edit-commands.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-open-dialog.c * app/gui/file-save-dialog.c * app/gui/gradients-commands.c * app/gui/gradients-menu.c * app/gui/image-menu.c * app/gui/layers-commands.[ch] * app/gui/layers-menu.c * app/gui/module-browser.c * app/gui/offset-dialog.c * app/gui/palettes-menu.c * app/gui/patterns-menu.c * app/gui/resize-dialog.c * app/gui/select-commands.c * app/gui/templates-menu.c * app/gui/tips-dialog.c * app/gui/toolbox-menu.c * app/gui/vectors-commands.[ch] * app/gui/vectors-menu.c: replaced literal HTML file paths by help IDs from gimphelp-ids.h. Renamed some menu callbacks to be consistent with similar ones. This is just an intermediate commit and not finished. While browsing all the menus, I noticed that our "x to selection" functions are not consistent at all. They should all offer the REPLACE,ADD,SUBTRACT,INTERSECT options: * app/core/gimpchannel.[ch]: added new function gimp_channel_new_from_alpha(). Removed gimp_channel_layer_alpha() and gimp_channel_layer_mask(). * app/core/gimpimage-mask.[ch]: added gimp_image_mask_select_alpha() and gimp_image_mask_select_component() which offer the full set of operation, feather and feather_radius parameters as the other selection functions. * app/core/gimpimage-mask-select.[ch]: removed gimp_image_mask_layer_alpha() and gimp_image_mask_layer_mask(). * app/gui/channels-commands.c (channels_channel_to_selection): use gimp_image_mask_select_component() instead of implementing it here. * app/gui/image-menu.c * app/gui/layers-commands.[ch]: offer the full choice of REPLACE,ADD,SUBTRACT,INTERSECT with "Alpha to Selection" and "Mask to Selection". * tools/pdbgen/pdb/selection.pdb: changed accordingly. * app/pdb/selection_cmds.c: regenerated.
2003-08-21 23:54:47 +08:00
gpointer data)
{
GimpImage *gimage;
GimpChannel *channel;
return_if_no_channel (gimage, channel, data);
gimp_image_lower_channel (gimage, channel);
Started to get rid of the gdisplays_foo() functions in 2002-05-08 Michael Natterer <mitch@gimp.org> Started to get rid of the gdisplays_foo() functions in app/display/gimpdisplay-foreach.[ch]. Work in progress... * app/core/gimp.[ch]: added the display list to the Gimp object (as a GimpList of GimpObjects). This way we get more independent from whether there is GUI or not, as gimp->displays will simply be an empty list for the --no-interface case. * app/display/gimpdisplay.[ch]: Removed the global "display_list" and "display_num" variables. Use gimp->displays instead. * app/display/gimpdisplay-foreach.[ch]: renamed most functions from gdisplays_foo() to gimp_displays_foo() and pass them a Gimp pointer. * app/core/gimpimage.[ch]: added a "flush" signal. * app/display/gimpdisplay-handlers.c: connect to "flush" and call gimp_display_flush() in the callback. * tools/pdbgen/pdb/display.pdb: use gimp_displays_flush(gimp) here and only here. * app/pdb/display_cmds.c: regenerated. * app/app_procs.c * app/gui/gui.c * app/gui/preferences-dialog.c: s/gdislays_foo()/gimp_displays_foo(gimp)/ * app/image_map.c * app/undo_history.c * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell-dnd.c * app/display/gimpdisplayshell-layer-select.c * app/display/gimpdisplayshell-scale.c * app/gui/channels-commands.c * app/gui/colormap-editor-commands.c * app/gui/convert-dialog.c * app/gui/drawable-commands.c * app/gui/edit-commands.c * app/gui/file-commands.c * app/gui/image-commands.c * app/gui/layers-commands.c * app/gui/offset-dialog.c * app/gui/qmask-commands.c * app/gui/select-commands.c * app/gui/vectors-commands.c * app/paint/gimpairbrush.c * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.c * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpbycolorselecttool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcurvestool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpfreeselecttool.c * app/tools/gimpfuzzyselecttool.c * app/tools/gimphuesaturationtool.c * app/tools/gimpinktool.c * app/tools/gimpiscissorstool.c * app/tools/gimplevelstool.c * app/tools/gimpmeasuretool.c * app/tools/gimpmovetool.c * app/tools/gimppainttool.c * app/tools/gimpposterizetool.c * app/tools/gimprectselecttool.c * app/tools/gimptexttool.c * app/tools/gimpthresholdtool.c * app/tools/gimptransformtool.c * app/tools/gimpvectortool.c * app/widgets/gimpbufferview.c * app/widgets/gimpchannellistview.c * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpdocumentview.c * app/widgets/gimpdrawablelistitem.c * app/widgets/gimpdrawablelistview.c * app/widgets/gimpimageview.c * app/widgets/gimpitemlistitem.c * app/widgets/gimpitemlistview.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplayerlistview.c * app/widgets/gimpvectorslistview.c: replaced gdisplays_flush() with calls to gimp_image_flush(gimage). Removed inclusion of "display/gimpdisplay-foreach.h" from most files.
2002-05-09 01:48:24 +08:00
gimp_image_flush (gimage);
}
More GtkAction stuff (still unused): 2004-04-19 Michael Natterer <mitch@gimp.org> More GtkAction stuff (still unused): * configure.in: added new directories menus/ and app/actions/ * Makefile.am: build menus/ * menus/.cvsignore * menus/Makefile.am * menus/*-menu.xml: new files: XML menu descriptions for each menu which is now defined in gui/*-menu.c. * app/widgets/widgets-types.h: some typedefs for GimpActionGroup. * app/widgets/gimpactiongroup.[ch]: added a "Gimp" construct-only property. Added APIs to set actions visible/sensitive/active and an unimplemented stub for setting the action's color. * app/Makefile.am: build actions/ and link libappactions.a * app/actions/.cvsignore * app/actions/Makefile.am * app/actions/*-actions.[ch]: new files: GtkActions for each *-commands.c file in gui/. Ported all "update" functions from the *-menu.c files. (everything completely unused, untested and partly #if 0'ed) * app/core/gimpimage.[ch]: for reasons of (action-) symmetry, added API to raise/lower channels/vectors to top/bottom. * app/gui/channels-commands.[ch] * app/gui/vectors-commands.[ch]: added callbacks for the new to top/bottom functions. * app/gui/Makefile.am * app/gui/dockable-commands.[ch]: new files split out of dialogs-commands.[ch]. * app/gui/dialogs-commands.[ch] * app/gui/dialogs-menu.c: changed accordingly. * app/gui/edit-commands.[ch]: added edit_paste_into_cmd_callback() and remove usage of "guint action". * app/gui/image-menu.c: changed accordingly. * app/gui/palette-editor-commands.[ch]: split +palette_editor_new_color_cmd_callback() into separate callbacks for adding from FG and BG. * app/gui/palette-editor-menu.c: changed accordingly.
2004-04-19 22:54:24 +08:00
void
Switch from GtkItemFactory to GtkUIManager. The migration is almost 2004-04-29 Michael Natterer <mitch@gimp.org> Switch from GtkItemFactory to GtkUIManager. The migration is almost complete, still stuff missing/incomplete, definitely added a bunch of new bugs... * app/actions/*-commands.[ch]: converted all callback from GtkItemFactory callbacks to GtkAction callbacks. * app/actions/debug-actions.c * app/actions/gradient-editor-actions.c * app/actions/help-actions.c * app/actions/plug-in-actions.c * app/actions/qmask-actions.c * app/actions/tool-options-actions.c: various fixes. * app/display/gimpdisplay.[ch] * app/display/gimpdisplayshell-appearance.[ch] * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell.[ch]: move everything from GtkItemFactory to GtkUIManager. * app/gui/dialogs.[ch]: added new function dialogs_get_toolbox(). Needed because the action callbacks don't have a widget parameter and sometimes we need a parent window for showing dialogs. * app/gui/Makefile.am * app/gui/brushes-menu.[ch] * app/gui/buffers-menu.[ch] * app/gui/channels-menu.[ch] * app/gui/colormap-editor-menu.[ch] * app/gui/dialogs-menu.[ch] * app/gui/documents-menu.[ch] * app/gui/error-console-menu.[ch] * app/gui/fonts-menu.[ch] * app/gui/gradient-editor-menu.[ch] * app/gui/gradients-menu.[ch] * app/gui/images-menu.[ch] * app/gui/layers-menu.[ch] * app/gui/palette-editor-menu.[ch] * app/gui/palettes-menu.[ch] * app/gui/patterns-menu.[ch] * app/gui/qmask-menu.[ch] * app/gui/templates-menu.[ch] * app/gui/vectors-menu.[ch]: removed these files. * app/gui/gui.c: create a global UI manager for the image popup menu and the toolbox menubar. * app/gui/menus.[ch]: removed all GtkItemFactory code. * app/gui/image-menu.[ch] * app/gui/toolbox-menu.[ch]: removed everything except the trivial setup_funcs. * app/gui/file-open-menu.c * app/gui/file-save-menu.c * app/gui/tool-options-menu.c: don't use the macros from menus.h any more, they are gone. * app/gui/gui-vtable.c * app/gui/plug-in-menus.[ch]: create/destroy the dynamic plug-in menu entries. * app/tools/gimpimagemaptool.c: s/gimp_item_factory_update/ gimp_ui_manager_update/g * app/widgets/gimpuimanager.[ch]: added API to get an action group by name. * app/widgets/gimpmenufactory.c: don't choke on the item_factory entries being NULL. * app/widgets/gimpactiongroup.c: make sure booleans set using g_object_set() only have TRUE or FALSE values. * app/widgets/gimpcolormapeditor.c * app/widgets/gimpcomponenteditor.c * app/widgets/gimpcontainereditor.[ch] * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainertreeview.c * app/widgets/gimpdockable.[ch] * app/widgets/gimpdocked.[ch] * app/widgets/gimpeditor.[ch] * app/widgets/gimperrorconsole.c * app/widgets/gimpgradienteditor.c * app/widgets/gimpitemtreeview.c * app/widgets/gimppaletteeditor.c * app/widgets/gimptoolbox.c * app/widgets/gimptooloptionseditor.c: removed all GtkItemFactory code and enable the #if 0'ed UI manager stuff. * menus/gradient-editor-menu.xml: fixed typos. * menus/image-menu.xml: duplicate everything so we have both an image menubar and an image popup menu. Badly cries for an XSL processor. * menus/toolbox-menu.xml: added an "Extensions" placeholder.
2004-04-29 20:52:29 +08:00
channels_lower_to_bottom_cmd_callback (GtkAction *action,
More GtkAction stuff (still unused): 2004-04-19 Michael Natterer <mitch@gimp.org> More GtkAction stuff (still unused): * configure.in: added new directories menus/ and app/actions/ * Makefile.am: build menus/ * menus/.cvsignore * menus/Makefile.am * menus/*-menu.xml: new files: XML menu descriptions for each menu which is now defined in gui/*-menu.c. * app/widgets/widgets-types.h: some typedefs for GimpActionGroup. * app/widgets/gimpactiongroup.[ch]: added a "Gimp" construct-only property. Added APIs to set actions visible/sensitive/active and an unimplemented stub for setting the action's color. * app/Makefile.am: build actions/ and link libappactions.a * app/actions/.cvsignore * app/actions/Makefile.am * app/actions/*-actions.[ch]: new files: GtkActions for each *-commands.c file in gui/. Ported all "update" functions from the *-menu.c files. (everything completely unused, untested and partly #if 0'ed) * app/core/gimpimage.[ch]: for reasons of (action-) symmetry, added API to raise/lower channels/vectors to top/bottom. * app/gui/channels-commands.[ch] * app/gui/vectors-commands.[ch]: added callbacks for the new to top/bottom functions. * app/gui/Makefile.am * app/gui/dockable-commands.[ch]: new files split out of dialogs-commands.[ch]. * app/gui/dialogs-commands.[ch] * app/gui/dialogs-menu.c: changed accordingly. * app/gui/edit-commands.[ch]: added edit_paste_into_cmd_callback() and remove usage of "guint action". * app/gui/image-menu.c: changed accordingly. * app/gui/palette-editor-commands.[ch]: split +palette_editor_new_color_cmd_callback() into separate callbacks for adding from FG and BG. * app/gui/palette-editor-menu.c: changed accordingly.
2004-04-19 22:54:24 +08:00
gpointer data)
{
GimpImage *gimage;
GimpChannel *channel;
return_if_no_channel (gimage, channel, data);
More GtkAction stuff (still unused): 2004-04-19 Michael Natterer <mitch@gimp.org> More GtkAction stuff (still unused): * configure.in: added new directories menus/ and app/actions/ * Makefile.am: build menus/ * menus/.cvsignore * menus/Makefile.am * menus/*-menu.xml: new files: XML menu descriptions for each menu which is now defined in gui/*-menu.c. * app/widgets/widgets-types.h: some typedefs for GimpActionGroup. * app/widgets/gimpactiongroup.[ch]: added a "Gimp" construct-only property. Added APIs to set actions visible/sensitive/active and an unimplemented stub for setting the action's color. * app/Makefile.am: build actions/ and link libappactions.a * app/actions/.cvsignore * app/actions/Makefile.am * app/actions/*-actions.[ch]: new files: GtkActions for each *-commands.c file in gui/. Ported all "update" functions from the *-menu.c files. (everything completely unused, untested and partly #if 0'ed) * app/core/gimpimage.[ch]: for reasons of (action-) symmetry, added API to raise/lower channels/vectors to top/bottom. * app/gui/channels-commands.[ch] * app/gui/vectors-commands.[ch]: added callbacks for the new to top/bottom functions. * app/gui/Makefile.am * app/gui/dockable-commands.[ch]: new files split out of dialogs-commands.[ch]. * app/gui/dialogs-commands.[ch] * app/gui/dialogs-menu.c: changed accordingly. * app/gui/edit-commands.[ch]: added edit_paste_into_cmd_callback() and remove usage of "guint action". * app/gui/image-menu.c: changed accordingly. * app/gui/palette-editor-commands.[ch]: split +palette_editor_new_color_cmd_callback() into separate callbacks for adding from FG and BG. * app/gui/palette-editor-menu.c: changed accordingly.
2004-04-19 22:54:24 +08:00
gimp_image_lower_channel_to_bottom (gimage, channel);
More GtkAction stuff (still unused): 2004-04-19 Michael Natterer <mitch@gimp.org> More GtkAction stuff (still unused): * configure.in: added new directories menus/ and app/actions/ * Makefile.am: build menus/ * menus/.cvsignore * menus/Makefile.am * menus/*-menu.xml: new files: XML menu descriptions for each menu which is now defined in gui/*-menu.c. * app/widgets/widgets-types.h: some typedefs for GimpActionGroup. * app/widgets/gimpactiongroup.[ch]: added a "Gimp" construct-only property. Added APIs to set actions visible/sensitive/active and an unimplemented stub for setting the action's color. * app/Makefile.am: build actions/ and link libappactions.a * app/actions/.cvsignore * app/actions/Makefile.am * app/actions/*-actions.[ch]: new files: GtkActions for each *-commands.c file in gui/. Ported all "update" functions from the *-menu.c files. (everything completely unused, untested and partly #if 0'ed) * app/core/gimpimage.[ch]: for reasons of (action-) symmetry, added API to raise/lower channels/vectors to top/bottom. * app/gui/channels-commands.[ch] * app/gui/vectors-commands.[ch]: added callbacks for the new to top/bottom functions. * app/gui/Makefile.am * app/gui/dockable-commands.[ch]: new files split out of dialogs-commands.[ch]. * app/gui/dialogs-commands.[ch] * app/gui/dialogs-menu.c: changed accordingly. * app/gui/edit-commands.[ch]: added edit_paste_into_cmd_callback() and remove usage of "guint action". * app/gui/image-menu.c: changed accordingly. * app/gui/palette-editor-commands.[ch]: split +palette_editor_new_color_cmd_callback() into separate callbacks for adding from FG and BG. * app/gui/palette-editor-menu.c: changed accordingly.
2004-04-19 22:54:24 +08:00
gimp_image_flush (gimage);
}
void
Switch from GtkItemFactory to GtkUIManager. The migration is almost 2004-04-29 Michael Natterer <mitch@gimp.org> Switch from GtkItemFactory to GtkUIManager. The migration is almost complete, still stuff missing/incomplete, definitely added a bunch of new bugs... * app/actions/*-commands.[ch]: converted all callback from GtkItemFactory callbacks to GtkAction callbacks. * app/actions/debug-actions.c * app/actions/gradient-editor-actions.c * app/actions/help-actions.c * app/actions/plug-in-actions.c * app/actions/qmask-actions.c * app/actions/tool-options-actions.c: various fixes. * app/display/gimpdisplay.[ch] * app/display/gimpdisplayshell-appearance.[ch] * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell.[ch]: move everything from GtkItemFactory to GtkUIManager. * app/gui/dialogs.[ch]: added new function dialogs_get_toolbox(). Needed because the action callbacks don't have a widget parameter and sometimes we need a parent window for showing dialogs. * app/gui/Makefile.am * app/gui/brushes-menu.[ch] * app/gui/buffers-menu.[ch] * app/gui/channels-menu.[ch] * app/gui/colormap-editor-menu.[ch] * app/gui/dialogs-menu.[ch] * app/gui/documents-menu.[ch] * app/gui/error-console-menu.[ch] * app/gui/fonts-menu.[ch] * app/gui/gradient-editor-menu.[ch] * app/gui/gradients-menu.[ch] * app/gui/images-menu.[ch] * app/gui/layers-menu.[ch] * app/gui/palette-editor-menu.[ch] * app/gui/palettes-menu.[ch] * app/gui/patterns-menu.[ch] * app/gui/qmask-menu.[ch] * app/gui/templates-menu.[ch] * app/gui/vectors-menu.[ch]: removed these files. * app/gui/gui.c: create a global UI manager for the image popup menu and the toolbox menubar. * app/gui/menus.[ch]: removed all GtkItemFactory code. * app/gui/image-menu.[ch] * app/gui/toolbox-menu.[ch]: removed everything except the trivial setup_funcs. * app/gui/file-open-menu.c * app/gui/file-save-menu.c * app/gui/tool-options-menu.c: don't use the macros from menus.h any more, they are gone. * app/gui/gui-vtable.c * app/gui/plug-in-menus.[ch]: create/destroy the dynamic plug-in menu entries. * app/tools/gimpimagemaptool.c: s/gimp_item_factory_update/ gimp_ui_manager_update/g * app/widgets/gimpuimanager.[ch]: added API to get an action group by name. * app/widgets/gimpmenufactory.c: don't choke on the item_factory entries being NULL. * app/widgets/gimpactiongroup.c: make sure booleans set using g_object_set() only have TRUE or FALSE values. * app/widgets/gimpcolormapeditor.c * app/widgets/gimpcomponenteditor.c * app/widgets/gimpcontainereditor.[ch] * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainertreeview.c * app/widgets/gimpdockable.[ch] * app/widgets/gimpdocked.[ch] * app/widgets/gimpeditor.[ch] * app/widgets/gimperrorconsole.c * app/widgets/gimpgradienteditor.c * app/widgets/gimpitemtreeview.c * app/widgets/gimppaletteeditor.c * app/widgets/gimptoolbox.c * app/widgets/gimptooloptionseditor.c: removed all GtkItemFactory code and enable the #if 0'ed UI manager stuff. * menus/gradient-editor-menu.xml: fixed typos. * menus/image-menu.xml: duplicate everything so we have both an image menubar and an image popup menu. Badly cries for an XSL processor. * menus/toolbox-menu.xml: added an "Extensions" placeholder.
2004-04-29 20:52:29 +08:00
channels_duplicate_cmd_callback (GtkAction *action,
app/widgets/Makefile.am new file defining the available help topics. Work 2003-08-21 Michael Natterer <mitch@gimp.org> * app/widgets/Makefile.am * app/widgets/gimphelp-ids.h: new file defining the available help topics. Work in progress and totally unusable for matching to the help system. Stay tuned... * app/gui/about-dialog.c * app/gui/brushes-menu.c * app/gui/buffers-menu.c * app/gui/channels-commands.[ch] * app/gui/channels-menu.c * app/gui/edit-commands.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-open-dialog.c * app/gui/file-save-dialog.c * app/gui/gradients-commands.c * app/gui/gradients-menu.c * app/gui/image-menu.c * app/gui/layers-commands.[ch] * app/gui/layers-menu.c * app/gui/module-browser.c * app/gui/offset-dialog.c * app/gui/palettes-menu.c * app/gui/patterns-menu.c * app/gui/resize-dialog.c * app/gui/select-commands.c * app/gui/templates-menu.c * app/gui/tips-dialog.c * app/gui/toolbox-menu.c * app/gui/vectors-commands.[ch] * app/gui/vectors-menu.c: replaced literal HTML file paths by help IDs from gimphelp-ids.h. Renamed some menu callbacks to be consistent with similar ones. This is just an intermediate commit and not finished. While browsing all the menus, I noticed that our "x to selection" functions are not consistent at all. They should all offer the REPLACE,ADD,SUBTRACT,INTERSECT options: * app/core/gimpchannel.[ch]: added new function gimp_channel_new_from_alpha(). Removed gimp_channel_layer_alpha() and gimp_channel_layer_mask(). * app/core/gimpimage-mask.[ch]: added gimp_image_mask_select_alpha() and gimp_image_mask_select_component() which offer the full set of operation, feather and feather_radius parameters as the other selection functions. * app/core/gimpimage-mask-select.[ch]: removed gimp_image_mask_layer_alpha() and gimp_image_mask_layer_mask(). * app/gui/channels-commands.c (channels_channel_to_selection): use gimp_image_mask_select_component() instead of implementing it here. * app/gui/image-menu.c * app/gui/layers-commands.[ch]: offer the full choice of REPLACE,ADD,SUBTRACT,INTERSECT with "Alpha to Selection" and "Mask to Selection". * tools/pdbgen/pdb/selection.pdb: changed accordingly. * app/pdb/selection_cmds.c: regenerated.
2003-08-21 23:54:47 +08:00
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);
app/widgets/Makefile.am new file defining the available help topics. Work 2003-08-21 Michael Natterer <mitch@gimp.org> * app/widgets/Makefile.am * app/widgets/gimphelp-ids.h: new file defining the available help topics. Work in progress and totally unusable for matching to the help system. Stay tuned... * app/gui/about-dialog.c * app/gui/brushes-menu.c * app/gui/buffers-menu.c * app/gui/channels-commands.[ch] * app/gui/channels-menu.c * app/gui/edit-commands.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-open-dialog.c * app/gui/file-save-dialog.c * app/gui/gradients-commands.c * app/gui/gradients-menu.c * app/gui/image-menu.c * app/gui/layers-commands.[ch] * app/gui/layers-menu.c * app/gui/module-browser.c * app/gui/offset-dialog.c * app/gui/palettes-menu.c * app/gui/patterns-menu.c * app/gui/resize-dialog.c * app/gui/select-commands.c * app/gui/templates-menu.c * app/gui/tips-dialog.c * app/gui/toolbox-menu.c * app/gui/vectors-commands.[ch] * app/gui/vectors-menu.c: replaced literal HTML file paths by help IDs from gimphelp-ids.h. Renamed some menu callbacks to be consistent with similar ones. This is just an intermediate commit and not finished. While browsing all the menus, I noticed that our "x to selection" functions are not consistent at all. They should all offer the REPLACE,ADD,SUBTRACT,INTERSECT options: * app/core/gimpchannel.[ch]: added new function gimp_channel_new_from_alpha(). Removed gimp_channel_layer_alpha() and gimp_channel_layer_mask(). * app/core/gimpimage-mask.[ch]: added gimp_image_mask_select_alpha() and gimp_image_mask_select_component() which offer the full set of operation, feather and feather_radius parameters as the other selection functions. * app/core/gimpimage-mask-select.[ch]: removed gimp_image_mask_layer_alpha() and gimp_image_mask_layer_mask(). * app/gui/channels-commands.c (channels_channel_to_selection): use gimp_image_mask_select_component() instead of implementing it here. * app/gui/image-menu.c * app/gui/layers-commands.[ch]: offer the full choice of REPLACE,ADD,SUBTRACT,INTERSECT with "Alpha to Selection" and "Mask to Selection". * tools/pdbgen/pdb/selection.pdb: changed accordingly. * app/pdb/selection_cmds.c: regenerated.
2003-08-21 23:54:47 +08:00
/* 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);
app/widgets/Makefile.am new file defining the available help topics. Work 2003-08-21 Michael Natterer <mitch@gimp.org> * app/widgets/Makefile.am * app/widgets/gimphelp-ids.h: new file defining the available help topics. Work in progress and totally unusable for matching to the help system. Stay tuned... * app/gui/about-dialog.c * app/gui/brushes-menu.c * app/gui/buffers-menu.c * app/gui/channels-commands.[ch] * app/gui/channels-menu.c * app/gui/edit-commands.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-open-dialog.c * app/gui/file-save-dialog.c * app/gui/gradients-commands.c * app/gui/gradients-menu.c * app/gui/image-menu.c * app/gui/layers-commands.[ch] * app/gui/layers-menu.c * app/gui/module-browser.c * app/gui/offset-dialog.c * app/gui/palettes-menu.c * app/gui/patterns-menu.c * app/gui/resize-dialog.c * app/gui/select-commands.c * app/gui/templates-menu.c * app/gui/tips-dialog.c * app/gui/toolbox-menu.c * app/gui/vectors-commands.[ch] * app/gui/vectors-menu.c: replaced literal HTML file paths by help IDs from gimphelp-ids.h. Renamed some menu callbacks to be consistent with similar ones. This is just an intermediate commit and not finished. While browsing all the menus, I noticed that our "x to selection" functions are not consistent at all. They should all offer the REPLACE,ADD,SUBTRACT,INTERSECT options: * app/core/gimpchannel.[ch]: added new function gimp_channel_new_from_alpha(). Removed gimp_channel_layer_alpha() and gimp_channel_layer_mask(). * app/core/gimpimage-mask.[ch]: added gimp_image_mask_select_alpha() and gimp_image_mask_select_component() which offer the full set of operation, feather and feather_radius parameters as the other selection functions. * app/core/gimpimage-mask-select.[ch]: removed gimp_image_mask_layer_alpha() and gimp_image_mask_layer_mask(). * app/gui/channels-commands.c (channels_channel_to_selection): use gimp_image_mask_select_component() instead of implementing it here. * app/gui/image-menu.c * app/gui/layers-commands.[ch]: offer the full choice of REPLACE,ADD,SUBTRACT,INTERSECT with "Alpha to Selection" and "Mask to Selection". * tools/pdbgen/pdb/selection.pdb: changed accordingly. * app/pdb/selection_cmds.c: regenerated.
2003-08-21 23:54:47 +08:00
g_free (name);
}
else
{
GimpChannel *channel;
return_if_no_channel (gimage, channel, data);
new_channel =
GIMP_CHANNEL (gimp_item_duplicate (GIMP_ITEM (channel),
G_TYPE_FROM_INSTANCE (channel),
TRUE));
}
gimp_image_add_channel (gimage, new_channel, -1);
Started to get rid of the gdisplays_foo() functions in 2002-05-08 Michael Natterer <mitch@gimp.org> Started to get rid of the gdisplays_foo() functions in app/display/gimpdisplay-foreach.[ch]. Work in progress... * app/core/gimp.[ch]: added the display list to the Gimp object (as a GimpList of GimpObjects). This way we get more independent from whether there is GUI or not, as gimp->displays will simply be an empty list for the --no-interface case. * app/display/gimpdisplay.[ch]: Removed the global "display_list" and "display_num" variables. Use gimp->displays instead. * app/display/gimpdisplay-foreach.[ch]: renamed most functions from gdisplays_foo() to gimp_displays_foo() and pass them a Gimp pointer. * app/core/gimpimage.[ch]: added a "flush" signal. * app/display/gimpdisplay-handlers.c: connect to "flush" and call gimp_display_flush() in the callback. * tools/pdbgen/pdb/display.pdb: use gimp_displays_flush(gimp) here and only here. * app/pdb/display_cmds.c: regenerated. * app/app_procs.c * app/gui/gui.c * app/gui/preferences-dialog.c: s/gdislays_foo()/gimp_displays_foo(gimp)/ * app/image_map.c * app/undo_history.c * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell-dnd.c * app/display/gimpdisplayshell-layer-select.c * app/display/gimpdisplayshell-scale.c * app/gui/channels-commands.c * app/gui/colormap-editor-commands.c * app/gui/convert-dialog.c * app/gui/drawable-commands.c * app/gui/edit-commands.c * app/gui/file-commands.c * app/gui/image-commands.c * app/gui/layers-commands.c * app/gui/offset-dialog.c * app/gui/qmask-commands.c * app/gui/select-commands.c * app/gui/vectors-commands.c * app/paint/gimpairbrush.c * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.c * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpbycolorselecttool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcurvestool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpfreeselecttool.c * app/tools/gimpfuzzyselecttool.c * app/tools/gimphuesaturationtool.c * app/tools/gimpinktool.c * app/tools/gimpiscissorstool.c * app/tools/gimplevelstool.c * app/tools/gimpmeasuretool.c * app/tools/gimpmovetool.c * app/tools/gimppainttool.c * app/tools/gimpposterizetool.c * app/tools/gimprectselecttool.c * app/tools/gimptexttool.c * app/tools/gimpthresholdtool.c * app/tools/gimptransformtool.c * app/tools/gimpvectortool.c * app/widgets/gimpbufferview.c * app/widgets/gimpchannellistview.c * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpdocumentview.c * app/widgets/gimpdrawablelistitem.c * app/widgets/gimpdrawablelistview.c * app/widgets/gimpimageview.c * app/widgets/gimpitemlistitem.c * app/widgets/gimpitemlistview.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplayerlistview.c * app/widgets/gimpvectorslistview.c: replaced gdisplays_flush() with calls to gimp_image_flush(gimage). Removed inclusion of "display/gimpdisplay-foreach.h" from most files.
2002-05-09 01:48:24 +08:00
gimp_image_flush (gimage);
}
void
Switch from GtkItemFactory to GtkUIManager. The migration is almost 2004-04-29 Michael Natterer <mitch@gimp.org> Switch from GtkItemFactory to GtkUIManager. The migration is almost complete, still stuff missing/incomplete, definitely added a bunch of new bugs... * app/actions/*-commands.[ch]: converted all callback from GtkItemFactory callbacks to GtkAction callbacks. * app/actions/debug-actions.c * app/actions/gradient-editor-actions.c * app/actions/help-actions.c * app/actions/plug-in-actions.c * app/actions/qmask-actions.c * app/actions/tool-options-actions.c: various fixes. * app/display/gimpdisplay.[ch] * app/display/gimpdisplayshell-appearance.[ch] * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell.[ch]: move everything from GtkItemFactory to GtkUIManager. * app/gui/dialogs.[ch]: added new function dialogs_get_toolbox(). Needed because the action callbacks don't have a widget parameter and sometimes we need a parent window for showing dialogs. * app/gui/Makefile.am * app/gui/brushes-menu.[ch] * app/gui/buffers-menu.[ch] * app/gui/channels-menu.[ch] * app/gui/colormap-editor-menu.[ch] * app/gui/dialogs-menu.[ch] * app/gui/documents-menu.[ch] * app/gui/error-console-menu.[ch] * app/gui/fonts-menu.[ch] * app/gui/gradient-editor-menu.[ch] * app/gui/gradients-menu.[ch] * app/gui/images-menu.[ch] * app/gui/layers-menu.[ch] * app/gui/palette-editor-menu.[ch] * app/gui/palettes-menu.[ch] * app/gui/patterns-menu.[ch] * app/gui/qmask-menu.[ch] * app/gui/templates-menu.[ch] * app/gui/vectors-menu.[ch]: removed these files. * app/gui/gui.c: create a global UI manager for the image popup menu and the toolbox menubar. * app/gui/menus.[ch]: removed all GtkItemFactory code. * app/gui/image-menu.[ch] * app/gui/toolbox-menu.[ch]: removed everything except the trivial setup_funcs. * app/gui/file-open-menu.c * app/gui/file-save-menu.c * app/gui/tool-options-menu.c: don't use the macros from menus.h any more, they are gone. * app/gui/gui-vtable.c * app/gui/plug-in-menus.[ch]: create/destroy the dynamic plug-in menu entries. * app/tools/gimpimagemaptool.c: s/gimp_item_factory_update/ gimp_ui_manager_update/g * app/widgets/gimpuimanager.[ch]: added API to get an action group by name. * app/widgets/gimpmenufactory.c: don't choke on the item_factory entries being NULL. * app/widgets/gimpactiongroup.c: make sure booleans set using g_object_set() only have TRUE or FALSE values. * app/widgets/gimpcolormapeditor.c * app/widgets/gimpcomponenteditor.c * app/widgets/gimpcontainereditor.[ch] * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainertreeview.c * app/widgets/gimpdockable.[ch] * app/widgets/gimpdocked.[ch] * app/widgets/gimpeditor.[ch] * app/widgets/gimperrorconsole.c * app/widgets/gimpgradienteditor.c * app/widgets/gimpitemtreeview.c * app/widgets/gimppaletteeditor.c * app/widgets/gimptoolbox.c * app/widgets/gimptooloptionseditor.c: removed all GtkItemFactory code and enable the #if 0'ed UI manager stuff. * menus/gradient-editor-menu.xml: fixed typos. * menus/image-menu.xml: duplicate everything so we have both an image menubar and an image popup menu. Badly cries for an XSL processor. * menus/toolbox-menu.xml: added an "Extensions" placeholder.
2004-04-29 20:52:29 +08:00
channels_delete_cmd_callback (GtkAction *action,
app/widgets/Makefile.am new file defining the available help topics. Work 2003-08-21 Michael Natterer <mitch@gimp.org> * app/widgets/Makefile.am * app/widgets/gimphelp-ids.h: new file defining the available help topics. Work in progress and totally unusable for matching to the help system. Stay tuned... * app/gui/about-dialog.c * app/gui/brushes-menu.c * app/gui/buffers-menu.c * app/gui/channels-commands.[ch] * app/gui/channels-menu.c * app/gui/edit-commands.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-open-dialog.c * app/gui/file-save-dialog.c * app/gui/gradients-commands.c * app/gui/gradients-menu.c * app/gui/image-menu.c * app/gui/layers-commands.[ch] * app/gui/layers-menu.c * app/gui/module-browser.c * app/gui/offset-dialog.c * app/gui/palettes-menu.c * app/gui/patterns-menu.c * app/gui/resize-dialog.c * app/gui/select-commands.c * app/gui/templates-menu.c * app/gui/tips-dialog.c * app/gui/toolbox-menu.c * app/gui/vectors-commands.[ch] * app/gui/vectors-menu.c: replaced literal HTML file paths by help IDs from gimphelp-ids.h. Renamed some menu callbacks to be consistent with similar ones. This is just an intermediate commit and not finished. While browsing all the menus, I noticed that our "x to selection" functions are not consistent at all. They should all offer the REPLACE,ADD,SUBTRACT,INTERSECT options: * app/core/gimpchannel.[ch]: added new function gimp_channel_new_from_alpha(). Removed gimp_channel_layer_alpha() and gimp_channel_layer_mask(). * app/core/gimpimage-mask.[ch]: added gimp_image_mask_select_alpha() and gimp_image_mask_select_component() which offer the full set of operation, feather and feather_radius parameters as the other selection functions. * app/core/gimpimage-mask-select.[ch]: removed gimp_image_mask_layer_alpha() and gimp_image_mask_layer_mask(). * app/gui/channels-commands.c (channels_channel_to_selection): use gimp_image_mask_select_component() instead of implementing it here. * app/gui/image-menu.c * app/gui/layers-commands.[ch]: offer the full choice of REPLACE,ADD,SUBTRACT,INTERSECT with "Alpha to Selection" and "Mask to Selection". * tools/pdbgen/pdb/selection.pdb: changed accordingly. * app/pdb/selection_cmds.c: regenerated.
2003-08-21 23:54:47 +08:00
gpointer data)
{
GimpImage *gimage;
GimpChannel *channel;
return_if_no_channel (gimage, channel, data);
gimp_image_remove_channel (gimage, channel);
Started to get rid of the gdisplays_foo() functions in 2002-05-08 Michael Natterer <mitch@gimp.org> Started to get rid of the gdisplays_foo() functions in app/display/gimpdisplay-foreach.[ch]. Work in progress... * app/core/gimp.[ch]: added the display list to the Gimp object (as a GimpList of GimpObjects). This way we get more independent from whether there is GUI or not, as gimp->displays will simply be an empty list for the --no-interface case. * app/display/gimpdisplay.[ch]: Removed the global "display_list" and "display_num" variables. Use gimp->displays instead. * app/display/gimpdisplay-foreach.[ch]: renamed most functions from gdisplays_foo() to gimp_displays_foo() and pass them a Gimp pointer. * app/core/gimpimage.[ch]: added a "flush" signal. * app/display/gimpdisplay-handlers.c: connect to "flush" and call gimp_display_flush() in the callback. * tools/pdbgen/pdb/display.pdb: use gimp_displays_flush(gimp) here and only here. * app/pdb/display_cmds.c: regenerated. * app/app_procs.c * app/gui/gui.c * app/gui/preferences-dialog.c: s/gdislays_foo()/gimp_displays_foo(gimp)/ * app/image_map.c * app/undo_history.c * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell-dnd.c * app/display/gimpdisplayshell-layer-select.c * app/display/gimpdisplayshell-scale.c * app/gui/channels-commands.c * app/gui/colormap-editor-commands.c * app/gui/convert-dialog.c * app/gui/drawable-commands.c * app/gui/edit-commands.c * app/gui/file-commands.c * app/gui/image-commands.c * app/gui/layers-commands.c * app/gui/offset-dialog.c * app/gui/qmask-commands.c * app/gui/select-commands.c * app/gui/vectors-commands.c * app/paint/gimpairbrush.c * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.c * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpbycolorselecttool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcurvestool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpfreeselecttool.c * app/tools/gimpfuzzyselecttool.c * app/tools/gimphuesaturationtool.c * app/tools/gimpinktool.c * app/tools/gimpiscissorstool.c * app/tools/gimplevelstool.c * app/tools/gimpmeasuretool.c * app/tools/gimpmovetool.c * app/tools/gimppainttool.c * app/tools/gimpposterizetool.c * app/tools/gimprectselecttool.c * app/tools/gimptexttool.c * app/tools/gimpthresholdtool.c * app/tools/gimptransformtool.c * app/tools/gimpvectortool.c * app/widgets/gimpbufferview.c * app/widgets/gimpchannellistview.c * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpdocumentview.c * app/widgets/gimpdrawablelistitem.c * app/widgets/gimpdrawablelistview.c * app/widgets/gimpimageview.c * app/widgets/gimpitemlistitem.c * app/widgets/gimpitemlistview.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplayerlistview.c * app/widgets/gimpvectorslistview.c: replaced gdisplays_flush() with calls to gimp_image_flush(gimage). Removed inclusion of "display/gimpdisplay-foreach.h" from most files.
2002-05-09 01:48:24 +08:00
gimp_image_flush (gimage);
}
void
Switch from GtkItemFactory to GtkUIManager. The migration is almost 2004-04-29 Michael Natterer <mitch@gimp.org> Switch from GtkItemFactory to GtkUIManager. The migration is almost complete, still stuff missing/incomplete, definitely added a bunch of new bugs... * app/actions/*-commands.[ch]: converted all callback from GtkItemFactory callbacks to GtkAction callbacks. * app/actions/debug-actions.c * app/actions/gradient-editor-actions.c * app/actions/help-actions.c * app/actions/plug-in-actions.c * app/actions/qmask-actions.c * app/actions/tool-options-actions.c: various fixes. * app/display/gimpdisplay.[ch] * app/display/gimpdisplayshell-appearance.[ch] * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell.[ch]: move everything from GtkItemFactory to GtkUIManager. * app/gui/dialogs.[ch]: added new function dialogs_get_toolbox(). Needed because the action callbacks don't have a widget parameter and sometimes we need a parent window for showing dialogs. * app/gui/Makefile.am * app/gui/brushes-menu.[ch] * app/gui/buffers-menu.[ch] * app/gui/channels-menu.[ch] * app/gui/colormap-editor-menu.[ch] * app/gui/dialogs-menu.[ch] * app/gui/documents-menu.[ch] * app/gui/error-console-menu.[ch] * app/gui/fonts-menu.[ch] * app/gui/gradient-editor-menu.[ch] * app/gui/gradients-menu.[ch] * app/gui/images-menu.[ch] * app/gui/layers-menu.[ch] * app/gui/palette-editor-menu.[ch] * app/gui/palettes-menu.[ch] * app/gui/patterns-menu.[ch] * app/gui/qmask-menu.[ch] * app/gui/templates-menu.[ch] * app/gui/vectors-menu.[ch]: removed these files. * app/gui/gui.c: create a global UI manager for the image popup menu and the toolbox menubar. * app/gui/menus.[ch]: removed all GtkItemFactory code. * app/gui/image-menu.[ch] * app/gui/toolbox-menu.[ch]: removed everything except the trivial setup_funcs. * app/gui/file-open-menu.c * app/gui/file-save-menu.c * app/gui/tool-options-menu.c: don't use the macros from menus.h any more, they are gone. * app/gui/gui-vtable.c * app/gui/plug-in-menus.[ch]: create/destroy the dynamic plug-in menu entries. * app/tools/gimpimagemaptool.c: s/gimp_item_factory_update/ gimp_ui_manager_update/g * app/widgets/gimpuimanager.[ch]: added API to get an action group by name. * app/widgets/gimpmenufactory.c: don't choke on the item_factory entries being NULL. * app/widgets/gimpactiongroup.c: make sure booleans set using g_object_set() only have TRUE or FALSE values. * app/widgets/gimpcolormapeditor.c * app/widgets/gimpcomponenteditor.c * app/widgets/gimpcontainereditor.[ch] * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainertreeview.c * app/widgets/gimpdockable.[ch] * app/widgets/gimpdocked.[ch] * app/widgets/gimpeditor.[ch] * app/widgets/gimperrorconsole.c * app/widgets/gimpgradienteditor.c * app/widgets/gimpitemtreeview.c * app/widgets/gimppaletteeditor.c * app/widgets/gimptoolbox.c * app/widgets/gimptooloptionseditor.c: removed all GtkItemFactory code and enable the #if 0'ed UI manager stuff. * menus/gradient-editor-menu.xml: fixed typos. * menus/image-menu.xml: duplicate everything so we have both an image menubar and an image popup menu. Badly cries for an XSL processor. * menus/toolbox-menu.xml: added an "Extensions" placeholder.
2004-04-29 20:52:29 +08:00
channels_to_selection_cmd_callback (GtkAction *action,
gint value,
gpointer data)
{
GimpChannelOps op;
GimpImage *gimage;
Switch from GtkItemFactory to GtkUIManager. The migration is almost 2004-04-29 Michael Natterer <mitch@gimp.org> Switch from GtkItemFactory to GtkUIManager. The migration is almost complete, still stuff missing/incomplete, definitely added a bunch of new bugs... * app/actions/*-commands.[ch]: converted all callback from GtkItemFactory callbacks to GtkAction callbacks. * app/actions/debug-actions.c * app/actions/gradient-editor-actions.c * app/actions/help-actions.c * app/actions/plug-in-actions.c * app/actions/qmask-actions.c * app/actions/tool-options-actions.c: various fixes. * app/display/gimpdisplay.[ch] * app/display/gimpdisplayshell-appearance.[ch] * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell.[ch]: move everything from GtkItemFactory to GtkUIManager. * app/gui/dialogs.[ch]: added new function dialogs_get_toolbox(). Needed because the action callbacks don't have a widget parameter and sometimes we need a parent window for showing dialogs. * app/gui/Makefile.am * app/gui/brushes-menu.[ch] * app/gui/buffers-menu.[ch] * app/gui/channels-menu.[ch] * app/gui/colormap-editor-menu.[ch] * app/gui/dialogs-menu.[ch] * app/gui/documents-menu.[ch] * app/gui/error-console-menu.[ch] * app/gui/fonts-menu.[ch] * app/gui/gradient-editor-menu.[ch] * app/gui/gradients-menu.[ch] * app/gui/images-menu.[ch] * app/gui/layers-menu.[ch] * app/gui/palette-editor-menu.[ch] * app/gui/palettes-menu.[ch] * app/gui/patterns-menu.[ch] * app/gui/qmask-menu.[ch] * app/gui/templates-menu.[ch] * app/gui/vectors-menu.[ch]: removed these files. * app/gui/gui.c: create a global UI manager for the image popup menu and the toolbox menubar. * app/gui/menus.[ch]: removed all GtkItemFactory code. * app/gui/image-menu.[ch] * app/gui/toolbox-menu.[ch]: removed everything except the trivial setup_funcs. * app/gui/file-open-menu.c * app/gui/file-save-menu.c * app/gui/tool-options-menu.c: don't use the macros from menus.h any more, they are gone. * app/gui/gui-vtable.c * app/gui/plug-in-menus.[ch]: create/destroy the dynamic plug-in menu entries. * app/tools/gimpimagemaptool.c: s/gimp_item_factory_update/ gimp_ui_manager_update/g * app/widgets/gimpuimanager.[ch]: added API to get an action group by name. * app/widgets/gimpmenufactory.c: don't choke on the item_factory entries being NULL. * app/widgets/gimpactiongroup.c: make sure booleans set using g_object_set() only have TRUE or FALSE values. * app/widgets/gimpcolormapeditor.c * app/widgets/gimpcomponenteditor.c * app/widgets/gimpcontainereditor.[ch] * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainertreeview.c * app/widgets/gimpdockable.[ch] * app/widgets/gimpdocked.[ch] * app/widgets/gimpeditor.[ch] * app/widgets/gimperrorconsole.c * app/widgets/gimpgradienteditor.c * app/widgets/gimpitemtreeview.c * app/widgets/gimppaletteeditor.c * app/widgets/gimptoolbox.c * app/widgets/gimptooloptionseditor.c: removed all GtkItemFactory code and enable the #if 0'ed UI manager stuff. * menus/gradient-editor-menu.xml: fixed typos. * menus/image-menu.xml: duplicate everything so we have both an image menubar and an image popup menu. Badly cries for an XSL processor. * menus/toolbox-menu.xml: added an "Extensions" placeholder.
2004-04-29 20:52:29 +08:00
op = (GimpChannelOps) value;
if (GIMP_IS_COMPONENT_EDITOR (data))
{
GimpChannelType component;
return_if_no_image (gimage, data);
component = GIMP_COMPONENT_EDITOR (data)->clicked_component;
Treat changes to the selection like changes to any other drawable: 2003-10-06 Michael Natterer <mitch@gimp.org> Treat changes to the selection like changes to any other drawable: * app/core/gimpchannel.c * app/core/gimpchannel-combine.c: call gimp_drawable_update() after changing the channel. * app/core/gimpimage.[ch]: added struct GimpImageFlushAccumulator with one member "gboolean mask_changed". Connect to "update" of the selection and set accum.mask_changed to TRUE in the callback. Added default implementation for GimpImage::flush() and emit "mask_changed" there. Unrelated: * app/core/gimpimage.h: removed GimpGuide struct... * app/core/gimpimage-guides.h: ...and added it here. * app/core/gimpimage-undo-push.c (undo_pop_mask) (undo_pop_channel_mod): don't distinguish between selection and non-selection channels and just call gimp_drawable_update(). * app/core/gimpundo.h * app/core/gimpimage-undo.c: removed "gboolean mask_changed" from the GimpUndoAccumulator struct since we don't have to care about that signal explicitly any more. * app/display/gimpdisplay-foreach.[ch]: removed gimp_displays_flush(). * tools/pdbgen/pdb/display.pdb (displays_flush_invoker): call gimp_image_flush() on all images so the flush accumulator is honored. This generalization enables the removal of more special purpose code which was needed to treat the selection different: * app/core/gimpimage-mask-select.[ch]: removed... * app/core/gimpchannel-select.[ch]: ...and added under a new name because it's not selection specific any more. * app/core/gimpimage-mask.[ch]: removed... * app/core/gimpselection.[ch]: ...added the two remaining functions here. Removed all calls to gimp_image_mask_changed(). * app/core/Makefile.am * app/core/gimp-edit.c * app/core/gimpdrawable-transform.c * app/core/gimpimage-scale.c * app/core/gimpimage-snap.c * app/display/gimpdisplayshell.c * app/gui/channels-commands.c * app/gui/layers-commands.c * app/gui/select-commands.c * app/gui/vectors-commands.c * app/tools/gimpbycolorselecttool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpellipseselecttool.c * app/tools/gimpfreeselecttool.c * app/tools/gimpfuzzyselecttool.c * app/tools/gimpiscissorstool.c * app/tools/gimprectselecttool.c * app/tools/gimptransformtool.c * app/widgets/gimpchanneltreeview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpvectorstreeview.c * app/xcf/xcf-save.c * tools/pdbgen/pdb/paths.pdb * tools/pdbgen/pdb/selection.pdb * tools/pdbgen/pdb/selection_tools.pdb: changed accordingly. * app/core/gimpdrawable-bucket-fill.c * app/core/gimpimage-colormap.c * app/core/gimplayer-floating-sel.c * app/core/gimplayer.c * app/gui/image-menu.c * app/paint/gimppaintcore.c * app/tools/gimpcroptool.c * app/tools/gimpinkoptions.c * app/tools/gimpvectortool.c: removed useless and/or obsolete #includes. * app/pdb/display_cmds.c * app/pdb/paths_cmds.c * app/pdb/selection_cmds.c * app/pdb/selection_tools_cmds.c: regenerated.
2003-10-06 20:17:11 +08:00
gimp_channel_select_component (gimp_image_get_mask (gimage), component,
op, FALSE, 0.0, 0.0);
}
else
{
app/widgets/Makefile.am new file defining the available help topics. Work 2003-08-21 Michael Natterer <mitch@gimp.org> * app/widgets/Makefile.am * app/widgets/gimphelp-ids.h: new file defining the available help topics. Work in progress and totally unusable for matching to the help system. Stay tuned... * app/gui/about-dialog.c * app/gui/brushes-menu.c * app/gui/buffers-menu.c * app/gui/channels-commands.[ch] * app/gui/channels-menu.c * app/gui/edit-commands.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-open-dialog.c * app/gui/file-save-dialog.c * app/gui/gradients-commands.c * app/gui/gradients-menu.c * app/gui/image-menu.c * app/gui/layers-commands.[ch] * app/gui/layers-menu.c * app/gui/module-browser.c * app/gui/offset-dialog.c * app/gui/palettes-menu.c * app/gui/patterns-menu.c * app/gui/resize-dialog.c * app/gui/select-commands.c * app/gui/templates-menu.c * app/gui/tips-dialog.c * app/gui/toolbox-menu.c * app/gui/vectors-commands.[ch] * app/gui/vectors-menu.c: replaced literal HTML file paths by help IDs from gimphelp-ids.h. Renamed some menu callbacks to be consistent with similar ones. This is just an intermediate commit and not finished. While browsing all the menus, I noticed that our "x to selection" functions are not consistent at all. They should all offer the REPLACE,ADD,SUBTRACT,INTERSECT options: * app/core/gimpchannel.[ch]: added new function gimp_channel_new_from_alpha(). Removed gimp_channel_layer_alpha() and gimp_channel_layer_mask(). * app/core/gimpimage-mask.[ch]: added gimp_image_mask_select_alpha() and gimp_image_mask_select_component() which offer the full set of operation, feather and feather_radius parameters as the other selection functions. * app/core/gimpimage-mask-select.[ch]: removed gimp_image_mask_layer_alpha() and gimp_image_mask_layer_mask(). * app/gui/channels-commands.c (channels_channel_to_selection): use gimp_image_mask_select_component() instead of implementing it here. * app/gui/image-menu.c * app/gui/layers-commands.[ch]: offer the full choice of REPLACE,ADD,SUBTRACT,INTERSECT with "Alpha to Selection" and "Mask to Selection". * tools/pdbgen/pdb/selection.pdb: changed accordingly. * app/pdb/selection_cmds.c: regenerated.
2003-08-21 23:54:47 +08:00
GimpChannel *channel;
return_if_no_channel (gimage, channel, data);
app/widgets/Makefile.am new file defining the available help topics. Work 2003-08-21 Michael Natterer <mitch@gimp.org> * app/widgets/Makefile.am * app/widgets/gimphelp-ids.h: new file defining the available help topics. Work in progress and totally unusable for matching to the help system. Stay tuned... * app/gui/about-dialog.c * app/gui/brushes-menu.c * app/gui/buffers-menu.c * app/gui/channels-commands.[ch] * app/gui/channels-menu.c * app/gui/edit-commands.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-open-dialog.c * app/gui/file-save-dialog.c * app/gui/gradients-commands.c * app/gui/gradients-menu.c * app/gui/image-menu.c * app/gui/layers-commands.[ch] * app/gui/layers-menu.c * app/gui/module-browser.c * app/gui/offset-dialog.c * app/gui/palettes-menu.c * app/gui/patterns-menu.c * app/gui/resize-dialog.c * app/gui/select-commands.c * app/gui/templates-menu.c * app/gui/tips-dialog.c * app/gui/toolbox-menu.c * app/gui/vectors-commands.[ch] * app/gui/vectors-menu.c: replaced literal HTML file paths by help IDs from gimphelp-ids.h. Renamed some menu callbacks to be consistent with similar ones. This is just an intermediate commit and not finished. While browsing all the menus, I noticed that our "x to selection" functions are not consistent at all. They should all offer the REPLACE,ADD,SUBTRACT,INTERSECT options: * app/core/gimpchannel.[ch]: added new function gimp_channel_new_from_alpha(). Removed gimp_channel_layer_alpha() and gimp_channel_layer_mask(). * app/core/gimpimage-mask.[ch]: added gimp_image_mask_select_alpha() and gimp_image_mask_select_component() which offer the full set of operation, feather and feather_radius parameters as the other selection functions. * app/core/gimpimage-mask-select.[ch]: removed gimp_image_mask_layer_alpha() and gimp_image_mask_layer_mask(). * app/gui/channels-commands.c (channels_channel_to_selection): use gimp_image_mask_select_component() instead of implementing it here. * app/gui/image-menu.c * app/gui/layers-commands.[ch]: offer the full choice of REPLACE,ADD,SUBTRACT,INTERSECT with "Alpha to Selection" and "Mask to Selection". * tools/pdbgen/pdb/selection.pdb: changed accordingly. * app/pdb/selection_cmds.c: regenerated.
2003-08-21 23:54:47 +08:00
Treat changes to the selection like changes to any other drawable: 2003-10-06 Michael Natterer <mitch@gimp.org> Treat changes to the selection like changes to any other drawable: * app/core/gimpchannel.c * app/core/gimpchannel-combine.c: call gimp_drawable_update() after changing the channel. * app/core/gimpimage.[ch]: added struct GimpImageFlushAccumulator with one member "gboolean mask_changed". Connect to "update" of the selection and set accum.mask_changed to TRUE in the callback. Added default implementation for GimpImage::flush() and emit "mask_changed" there. Unrelated: * app/core/gimpimage.h: removed GimpGuide struct... * app/core/gimpimage-guides.h: ...and added it here. * app/core/gimpimage-undo-push.c (undo_pop_mask) (undo_pop_channel_mod): don't distinguish between selection and non-selection channels and just call gimp_drawable_update(). * app/core/gimpundo.h * app/core/gimpimage-undo.c: removed "gboolean mask_changed" from the GimpUndoAccumulator struct since we don't have to care about that signal explicitly any more. * app/display/gimpdisplay-foreach.[ch]: removed gimp_displays_flush(). * tools/pdbgen/pdb/display.pdb (displays_flush_invoker): call gimp_image_flush() on all images so the flush accumulator is honored. This generalization enables the removal of more special purpose code which was needed to treat the selection different: * app/core/gimpimage-mask-select.[ch]: removed... * app/core/gimpchannel-select.[ch]: ...and added under a new name because it's not selection specific any more. * app/core/gimpimage-mask.[ch]: removed... * app/core/gimpselection.[ch]: ...added the two remaining functions here. Removed all calls to gimp_image_mask_changed(). * app/core/Makefile.am * app/core/gimp-edit.c * app/core/gimpdrawable-transform.c * app/core/gimpimage-scale.c * app/core/gimpimage-snap.c * app/display/gimpdisplayshell.c * app/gui/channels-commands.c * app/gui/layers-commands.c * app/gui/select-commands.c * app/gui/vectors-commands.c * app/tools/gimpbycolorselecttool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpellipseselecttool.c * app/tools/gimpfreeselecttool.c * app/tools/gimpfuzzyselecttool.c * app/tools/gimpiscissorstool.c * app/tools/gimprectselecttool.c * app/tools/gimptransformtool.c * app/widgets/gimpchanneltreeview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpvectorstreeview.c * app/xcf/xcf-save.c * tools/pdbgen/pdb/paths.pdb * tools/pdbgen/pdb/selection.pdb * tools/pdbgen/pdb/selection_tools.pdb: changed accordingly. * app/core/gimpdrawable-bucket-fill.c * app/core/gimpimage-colormap.c * app/core/gimplayer-floating-sel.c * app/core/gimplayer.c * app/gui/image-menu.c * app/paint/gimppaintcore.c * app/tools/gimpcroptool.c * app/tools/gimpinkoptions.c * app/tools/gimpvectortool.c: removed useless and/or obsolete #includes. * app/pdb/display_cmds.c * app/pdb/paths_cmds.c * app/pdb/selection_cmds.c * app/pdb/selection_tools_cmds.c: regenerated.
2003-10-06 20:17:11 +08:00
gimp_channel_select_channel (gimp_image_get_mask (gimage),
_("Channel to Selection"),
channel, 0, 0,
op, FALSE, 0.0, 0.0);
}
Started to get rid of the gdisplays_foo() functions in 2002-05-08 Michael Natterer <mitch@gimp.org> Started to get rid of the gdisplays_foo() functions in app/display/gimpdisplay-foreach.[ch]. Work in progress... * app/core/gimp.[ch]: added the display list to the Gimp object (as a GimpList of GimpObjects). This way we get more independent from whether there is GUI or not, as gimp->displays will simply be an empty list for the --no-interface case. * app/display/gimpdisplay.[ch]: Removed the global "display_list" and "display_num" variables. Use gimp->displays instead. * app/display/gimpdisplay-foreach.[ch]: renamed most functions from gdisplays_foo() to gimp_displays_foo() and pass them a Gimp pointer. * app/core/gimpimage.[ch]: added a "flush" signal. * app/display/gimpdisplay-handlers.c: connect to "flush" and call gimp_display_flush() in the callback. * tools/pdbgen/pdb/display.pdb: use gimp_displays_flush(gimp) here and only here. * app/pdb/display_cmds.c: regenerated. * app/app_procs.c * app/gui/gui.c * app/gui/preferences-dialog.c: s/gdislays_foo()/gimp_displays_foo(gimp)/ * app/image_map.c * app/undo_history.c * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell-dnd.c * app/display/gimpdisplayshell-layer-select.c * app/display/gimpdisplayshell-scale.c * app/gui/channels-commands.c * app/gui/colormap-editor-commands.c * app/gui/convert-dialog.c * app/gui/drawable-commands.c * app/gui/edit-commands.c * app/gui/file-commands.c * app/gui/image-commands.c * app/gui/layers-commands.c * app/gui/offset-dialog.c * app/gui/qmask-commands.c * app/gui/select-commands.c * app/gui/vectors-commands.c * app/paint/gimpairbrush.c * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.c * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpbycolorselecttool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcurvestool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpfreeselecttool.c * app/tools/gimpfuzzyselecttool.c * app/tools/gimphuesaturationtool.c * app/tools/gimpinktool.c * app/tools/gimpiscissorstool.c * app/tools/gimplevelstool.c * app/tools/gimpmeasuretool.c * app/tools/gimpmovetool.c * app/tools/gimppainttool.c * app/tools/gimpposterizetool.c * app/tools/gimprectselecttool.c * app/tools/gimptexttool.c * app/tools/gimpthresholdtool.c * app/tools/gimptransformtool.c * app/tools/gimpvectortool.c * app/widgets/gimpbufferview.c * app/widgets/gimpchannellistview.c * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpdocumentview.c * app/widgets/gimpdrawablelistitem.c * app/widgets/gimpdrawablelistview.c * app/widgets/gimpimageview.c * app/widgets/gimpitemlistitem.c * app/widgets/gimpitemlistview.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplayerlistview.c * app/widgets/gimpvectorslistview.c: replaced gdisplays_flush() with calls to gimp_image_flush(gimage). Removed inclusion of "display/gimpdisplay-foreach.h" from most files.
2002-05-09 01:48:24 +08:00
gimp_image_flush (gimage);
}
/* private functions */
static void
channels_new_channel_response (GtkWidget *widget,
gint response_id,
ChannelOptionsDialog *options)
{
if (response_id == GTK_RESPONSE_OK)
{
GimpChannel *new_channel;
if (channel_name)
g_free (channel_name);
channel_name =
g_strdup (gtk_entry_get_text (GTK_ENTRY (options->name_entry)));
gimp_color_button_get_color (GIMP_COLOR_BUTTON (options->color_panel),
&channel_color);
new_channel = gimp_channel_new (options->gimage,
options->gimage->width,
options->gimage->height,
channel_name,
&channel_color);
gimp_drawable_fill_by_type (GIMP_DRAWABLE (new_channel),
options->context,
GIMP_TRANSPARENT_FILL);
gimp_image_add_channel (options->gimage, new_channel, -1);
gimp_image_flush (options->gimage);
}
gtk_widget_destroy (options->dialog);
}
static void
channels_edit_channel_response (GtkWidget *widget,
gint response_id,
ChannelOptionsDialog *options)
{
removed our own action_area API and use GtkDialog's one. Create all 2003-11-06 Michael Natterer <mitch@gimp.org> * libgimpwidgets/gimpdialog.[ch]: removed our own action_area API and use GtkDialog's one. Create all dialogs without separator. Changed almost everything else too. Fixes bug #125143. * libgimpwidgets/gimpquerybox.c * libgimpwidgets/gimpunitmenu.c: changed accordingly. * libgimp/gimpexport.[ch]: ditto. Renamed enum GimpExportReturnType to GimpExportReturn. * libgimp/gimpcompat.h: added a #define for the old name. * themes/Default/gtkrc: increased action_area border to 6 pixels. * app/display/gimpdisplayshell-filter-dialog.c * app/display/gimpdisplayshell-scale.c * app/display/gimpprogress.c * app/gui/brush-select.c * app/gui/channels-commands.c * app/gui/color-notebook.c * app/gui/convert-dialog.c * app/gui/file-new-dialog.c * app/gui/font-select.c * app/gui/gradient-editor-commands.c * app/gui/gradient-select.c * app/gui/grid-dialog.c * app/gui/image-commands.c * app/gui/info-window.c * app/gui/layers-commands.c * app/gui/module-browser.c * app/gui/offset-dialog.c * app/gui/palette-import-dialog.c * app/gui/palette-select.c * app/gui/pattern-select.c * app/gui/preferences-dialog.c * app/gui/qmask-commands.c * app/gui/resize-dialog.c * app/gui/resolution-calibrate-dialog.c * app/gui/stroke-dialog.c * app/gui/templates-commands.c * app/gui/user-install-dialog.c * app/gui/vectors-commands.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcroptool.c * app/tools/gimpimagemaptool.c * app/tools/gimpmeasuretool.c * app/tools/gimptransformtool.c * app/widgets/gimptexteditor.c * app/widgets/gimptooldialog.[ch] * app/widgets/gimpviewabledialog.[ch] * app/widgets/gimpwidgets-utils.c: changed accordingly and increased the dialogs' outer borders to 6 pixels all over the place. * plug-ins/*/*.c: changed accordingly. The plug-ins may be arbitrarily broken, I tested none of them.
2003-11-06 23:27:05 +08:00
if (response_id == GTK_RESPONSE_OK)
{
removed our own action_area API and use GtkDialog's one. Create all 2003-11-06 Michael Natterer <mitch@gimp.org> * libgimpwidgets/gimpdialog.[ch]: removed our own action_area API and use GtkDialog's one. Create all dialogs without separator. Changed almost everything else too. Fixes bug #125143. * libgimpwidgets/gimpquerybox.c * libgimpwidgets/gimpunitmenu.c: changed accordingly. * libgimp/gimpexport.[ch]: ditto. Renamed enum GimpExportReturnType to GimpExportReturn. * libgimp/gimpcompat.h: added a #define for the old name. * themes/Default/gtkrc: increased action_area border to 6 pixels. * app/display/gimpdisplayshell-filter-dialog.c * app/display/gimpdisplayshell-scale.c * app/display/gimpprogress.c * app/gui/brush-select.c * app/gui/channels-commands.c * app/gui/color-notebook.c * app/gui/convert-dialog.c * app/gui/file-new-dialog.c * app/gui/font-select.c * app/gui/gradient-editor-commands.c * app/gui/gradient-select.c * app/gui/grid-dialog.c * app/gui/image-commands.c * app/gui/info-window.c * app/gui/layers-commands.c * app/gui/module-browser.c * app/gui/offset-dialog.c * app/gui/palette-import-dialog.c * app/gui/palette-select.c * app/gui/pattern-select.c * app/gui/preferences-dialog.c * app/gui/qmask-commands.c * app/gui/resize-dialog.c * app/gui/resolution-calibrate-dialog.c * app/gui/stroke-dialog.c * app/gui/templates-commands.c * app/gui/user-install-dialog.c * app/gui/vectors-commands.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcroptool.c * app/tools/gimpimagemaptool.c * app/tools/gimpmeasuretool.c * app/tools/gimptransformtool.c * app/widgets/gimptexteditor.c * app/widgets/gimptooldialog.[ch] * app/widgets/gimpviewabledialog.[ch] * app/widgets/gimpwidgets-utils.c: changed accordingly and increased the dialogs' outer borders to 6 pixels all over the place. * plug-ins/*/*.c: changed accordingly. The plug-ins may be arbitrarily broken, I tested none of them.
2003-11-06 23:27:05 +08:00
GimpChannel *channel = options->channel;
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);
removed our own action_area API and use GtkDialog's one. Create all 2003-11-06 Michael Natterer <mitch@gimp.org> * libgimpwidgets/gimpdialog.[ch]: removed our own action_area API and use GtkDialog's one. Create all dialogs without separator. Changed almost everything else too. Fixes bug #125143. * libgimpwidgets/gimpquerybox.c * libgimpwidgets/gimpunitmenu.c: changed accordingly. * libgimp/gimpexport.[ch]: ditto. Renamed enum GimpExportReturnType to GimpExportReturn. * libgimp/gimpcompat.h: added a #define for the old name. * themes/Default/gtkrc: increased action_area border to 6 pixels. * app/display/gimpdisplayshell-filter-dialog.c * app/display/gimpdisplayshell-scale.c * app/display/gimpprogress.c * app/gui/brush-select.c * app/gui/channels-commands.c * app/gui/color-notebook.c * app/gui/convert-dialog.c * app/gui/file-new-dialog.c * app/gui/font-select.c * app/gui/gradient-editor-commands.c * app/gui/gradient-select.c * app/gui/grid-dialog.c * app/gui/image-commands.c * app/gui/info-window.c * app/gui/layers-commands.c * app/gui/module-browser.c * app/gui/offset-dialog.c * app/gui/palette-import-dialog.c * app/gui/palette-select.c * app/gui/pattern-select.c * app/gui/preferences-dialog.c * app/gui/qmask-commands.c * app/gui/resize-dialog.c * app/gui/resolution-calibrate-dialog.c * app/gui/stroke-dialog.c * app/gui/templates-commands.c * app/gui/user-install-dialog.c * app/gui/vectors-commands.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcroptool.c * app/tools/gimpimagemaptool.c * app/tools/gimpmeasuretool.c * app/tools/gimptransformtool.c * app/widgets/gimptexteditor.c * app/widgets/gimptooldialog.[ch] * app/widgets/gimpviewabledialog.[ch] * app/widgets/gimpwidgets-utils.c: changed accordingly and increased the dialogs' outer borders to 6 pixels all over the place. * plug-ins/*/*.c: changed accordingly. The plug-ins may be arbitrarily broken, I tested none of them.
2003-11-06 23:27:05 +08:00
if (name_changed || color_changed)
gimp_image_flush (options->gimage);
}
gtk_widget_destroy (options->dialog);
}