gimp/app/widgets/gimpvectorstreeview.c

282 lines
11 KiB
C
Raw Normal View History

/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
Added GtkTreeView versions of layers/channels/vectors: 2003-03-16 Michael Natterer <mitch@gimp.org> Added GtkTreeView versions of layers/channels/vectors: * app/core/core-enums.[ch]: renamed GIMP_UNDO_GROUP_LAYER_PROPERTIES to GIMP_UNDO_GROUP_ITEM_PROPERTIES. * app/core/gimpcontainer.c (gimp_container_reorder): don't try to reorder containers with num_children == 1. * app/core/gimpmarshal.list: added VOID: STRING, UINT marshaller. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpchanneltreeview.[ch] * app/widgets/gimpdrawabletreeview.[ch] * app/widgets/gimpitemtreeview.[ch] * app/widgets/gimplayertreeview.[ch] * app/widgets/gimpvectorstreeview.[ch]: new widgets. * app/widgets/gimpcellrenderertoggle.c: draw the frame only if the cell is prelit. * app/widgets/gimpcellrendererviewable.[ch]: added "clicked" signal, unref the renderer in finalize(). Set the renderer's border color to black if the cell is not selected (a hack that saves tons of code in GimpLayerTreeView). * app/widgets/gimpcomponenteditor.c: no need to gtk_list_store_set() stuff we just got from the store. * app/widgets/gimpcontainertreeview.[ch]: added lots of state used by the new subclasses to the GimpContainerTreeView struct. Create the GtkListStore/GtkTreeView in GObject::constructor() and only collect parameters in init() so subclasses can modify store/view creation. Do most of the button_press_event stuff manually and return TRUE from the handler. * app/widgets/gimpcontainerview.c: cleanup. * app/widgets/gimpitemlistview.h * app/widgets/gimpvectorslistview.h: temp hacks before they die. * app/widgets/gimppreviewrenderer.[ch]: added gimp_preview_renderer_update_idle() which idle-emits "update" without invalidating. * app/gui/dialogs-constructors.[ch] * app/gui/dialogs.c: added constructors for the new dialogs. * app/gui/channels-commands.c * app/gui/channels-menu.c * app/gui/layers-commands.c * app/gui/layers-menu.c * app/gui/vectors-commands.c * app/gui/vectors-menu.c: accept tree views as callback data.
2003-03-16 19:14:29 +08:00
* gimpvectorstreeview.c
Bring parent items to the public API in the core * app/core/gimpimage.[ch]: make the parent parameter public in add_layer(), add_layers(), add_channel() and add_vectors(). * app/vectors/gimpvectors-import.[ch]: add parent parameters to the vectors import functions. * app/core/gimpchannelundo.[ch] * app/core/gimplayerundo.[ch] * app/vectors/gimpvectorsundo.[ch] * app/core/gimpimage-undo-push.[ch]: remember the parent item when removing layers, channels and vectors. * app/actions/channels-commands.c * app/actions/debug-commands.c * app/actions/edit-commands.c * app/actions/layers-commands.c * app/actions/vectors-commands.c * app/core/gimp-edit.c * app/core/gimpimage-duplicate.c * app/core/gimpimage-merge.c * app/core/gimpimage-quick-mask.c * app/core/gimplayer-floating-sel.c * app/core/gimpselection.c * app/core/gimptemplate.c * app/dialogs/file-open-dialog.c * app/display/gimpdisplayshell-dnd.c * app/text/gimptext-compat.c * app/tools/gimptexttool.c * app/tools/gimpvectortool.c * app/widgets/gimptoolbox-dnd.c * app/xcf/xcf-load.c * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/paths.pdb * tools/pdbgen/pdb/vectors.pdb: pass NULL as parent item to above functions and add FIXMEs all over the place because there is some more hacking needed to make adding with index = -1 (on top of the current item) work again. * app/pdb/image-cmds.c * app/pdb/paths-cmds.c * app/pdb/vectors-cmds.c: regenerated. * app/core/gimpimage-duplicate.c: duplicate the original image's tree structure in the copy. * app/widgets/gimpitemtreeview.[ch]: add parent to GimpAddItemFunc, add utility function gimp_item_tree_view_get_drop_index() which figures where to add something dropped to an item tree. * app/widgets/gimpchanneltreeview.c * app/widgets/gimplayertreeview.c * app/widgets/gimpvectorstreeview.c: changed accordingly, using above new GimpItemTreeView API.
2009-08-04 01:21:51 +08:00
* Copyright (C) 2001-2009 Michael Natterer <mitch@gimp.org>
*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <string.h>
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "widgets-types.h"
added new virtual function GimpItem::stroke(). 2003-09-01 Michael Natterer <mitch@gimp.org> * app/core/gimpitem.[ch]: added new virtual function GimpItem::stroke(). * app/core/gimpchannel.c * app/vectors/gimpvectors.c: implement GimpItem::stroke(). * app/core/gimpimage-mask.[ch] (gimp_image_mask_stroke): changed signature to match gimp_item_stroke() (the selection mask *really* should be a GimpChannel subclass). Removed global variable "gboolean gimp_image_mask_stroking"... * app/core/gimpimage.[ch]: ...and added "gboolean mask_stroking" to the GimpImage struct. * app/gui/vectors-commands.[ch]: removed vectors_stroke_vectors(). * app/widgets/widgets-types.h: removed GimpStrokeItemFunc typedef. * app/widgets/gimpvectorstreeview.[ch]: removed "stroke_item_func" member and use gimp_item_stroke() instead. * app/gui/dialogs-constructors.c (dialogs_vectors_list_view_new) * app/gui/edit-commands.c (edit_stroke_cmd_callback) * app/gui/vectors-commands. (vectors_stroke_cmd_callback) * app/widgets/gimpselectioneditor.c (gimp_selection_editor_stroke_clicked) * tools/pdbgen/pdb/edit.pdb (gimp_edit_stroke): changed accordingly. * app/pdb/edit_cmds.c: regenerated. Note that there is no GUI for "stroke channel", although it would be utterly cool to have one, since currently slelection stroking cannot be masked by a selection (because we stroke the selection). Anyway, if anyone has an idea how to trigger "stroke channel" with another drawable active (the one to stroke to), please let me know...
2003-09-02 01:56:44 +08:00
#include "core/gimp.h"
#include "core/gimpcontainer.h"
added new virtual function GimpItem::stroke(). 2003-09-01 Michael Natterer <mitch@gimp.org> * app/core/gimpitem.[ch]: added new virtual function GimpItem::stroke(). * app/core/gimpchannel.c * app/vectors/gimpvectors.c: implement GimpItem::stroke(). * app/core/gimpimage-mask.[ch] (gimp_image_mask_stroke): changed signature to match gimp_item_stroke() (the selection mask *really* should be a GimpChannel subclass). Removed global variable "gboolean gimp_image_mask_stroking"... * app/core/gimpimage.[ch]: ...and added "gboolean mask_stroking" to the GimpImage struct. * app/gui/vectors-commands.[ch]: removed vectors_stroke_vectors(). * app/widgets/widgets-types.h: removed GimpStrokeItemFunc typedef. * app/widgets/gimpvectorstreeview.[ch]: removed "stroke_item_func" member and use gimp_item_stroke() instead. * app/gui/dialogs-constructors.c (dialogs_vectors_list_view_new) * app/gui/edit-commands.c (edit_stroke_cmd_callback) * app/gui/vectors-commands. (vectors_stroke_cmd_callback) * app/widgets/gimpselectioneditor.c (gimp_selection_editor_stroke_clicked) * tools/pdbgen/pdb/edit.pdb (gimp_edit_stroke): changed accordingly. * app/pdb/edit_cmds.c: regenerated. Note that there is no GUI for "stroke channel", although it would be utterly cool to have one, since currently slelection stroking cannot be masked by a selection (because we stroke the selection). Anyway, if anyone has an idea how to trigger "stroke channel" with another drawable active (the one to stroke to), please let me know...
2003-09-02 01:56:44 +08:00
#include "core/gimpcontext.h"
#include "core/gimpimage.h"
#include "vectors/gimpvectors.h"
#include "vectors/gimpvectors-export.h"
#include "vectors/gimpvectors-import.h"
#include "gimpactiongroup.h"
#include "gimpcontainerview.h"
#include "gimpdnd.h"
#include "gimphelp-ids.h"
#include "gimpuimanager.h"
#include "gimpvectorstreeview.h"
#include "gimpwidgets-utils.h"
#include "gimp-intl.h"
static void gimp_vectors_tree_view_view_iface_init (GimpContainerViewInterface *iface);
static void gimp_vectors_tree_view_constructed (GObject *object);
static void gimp_vectors_tree_view_set_container (GimpContainerView *view,
GimpContainer *container);
static void gimp_vectors_tree_view_drop_svg (GimpContainerTreeView *tree_view,
const gchar *svg_data,
gsize svg_data_len,
GimpViewable *dest_viewable,
GtkTreeViewDropPosition drop_pos);
static GimpItem * gimp_vectors_tree_view_item_new (GimpImage *image);
static guchar * gimp_vectors_tree_view_drag_svg (GtkWidget *widget,
gsize *svg_data_len,
gpointer data);
G_DEFINE_TYPE_WITH_CODE (GimpVectorsTreeView, gimp_vectors_tree_view,
GIMP_TYPE_ITEM_TREE_VIEW,
G_IMPLEMENT_INTERFACE (GIMP_TYPE_CONTAINER_VIEW,
gimp_vectors_tree_view_view_iface_init))
#define parent_class gimp_vectors_tree_view_parent_class
static GimpContainerViewInterface *parent_view_iface = NULL;
static void
Added GtkTreeView versions of layers/channels/vectors: 2003-03-16 Michael Natterer <mitch@gimp.org> Added GtkTreeView versions of layers/channels/vectors: * app/core/core-enums.[ch]: renamed GIMP_UNDO_GROUP_LAYER_PROPERTIES to GIMP_UNDO_GROUP_ITEM_PROPERTIES. * app/core/gimpcontainer.c (gimp_container_reorder): don't try to reorder containers with num_children == 1. * app/core/gimpmarshal.list: added VOID: STRING, UINT marshaller. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpchanneltreeview.[ch] * app/widgets/gimpdrawabletreeview.[ch] * app/widgets/gimpitemtreeview.[ch] * app/widgets/gimplayertreeview.[ch] * app/widgets/gimpvectorstreeview.[ch]: new widgets. * app/widgets/gimpcellrenderertoggle.c: draw the frame only if the cell is prelit. * app/widgets/gimpcellrendererviewable.[ch]: added "clicked" signal, unref the renderer in finalize(). Set the renderer's border color to black if the cell is not selected (a hack that saves tons of code in GimpLayerTreeView). * app/widgets/gimpcomponenteditor.c: no need to gtk_list_store_set() stuff we just got from the store. * app/widgets/gimpcontainertreeview.[ch]: added lots of state used by the new subclasses to the GimpContainerTreeView struct. Create the GtkListStore/GtkTreeView in GObject::constructor() and only collect parameters in init() so subclasses can modify store/view creation. Do most of the button_press_event stuff manually and return TRUE from the handler. * app/widgets/gimpcontainerview.c: cleanup. * app/widgets/gimpitemlistview.h * app/widgets/gimpvectorslistview.h: temp hacks before they die. * app/widgets/gimppreviewrenderer.[ch]: added gimp_preview_renderer_update_idle() which idle-emits "update" without invalidating. * app/gui/dialogs-constructors.[ch] * app/gui/dialogs.c: added constructors for the new dialogs. * app/gui/channels-commands.c * app/gui/channels-menu.c * app/gui/layers-commands.c * app/gui/layers-menu.c * app/gui/vectors-commands.c * app/gui/vectors-menu.c: accept tree views as callback data.
2003-03-16 19:14:29 +08:00
gimp_vectors_tree_view_class_init (GimpVectorsTreeViewClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GimpContainerTreeViewClass *view_class = GIMP_CONTAINER_TREE_VIEW_CLASS (klass);
GimpItemTreeViewClass *iv_class = GIMP_ITEM_TREE_VIEW_CLASS (klass);
object_class->constructed = gimp_vectors_tree_view_constructed;
view_class->drop_svg = gimp_vectors_tree_view_drop_svg;
iv_class->item_type = GIMP_TYPE_VECTORS;
iv_class->signal_name = "active-vectors-changed";
iv_class->get_container = gimp_image_get_vectors;
iv_class->get_active_item = (GimpGetItemFunc) gimp_image_get_active_vectors;
iv_class->set_active_item = (GimpSetItemFunc) gimp_image_set_active_vectors;
iv_class->add_item = (GimpAddItemFunc) gimp_image_add_vectors;
iv_class->remove_item = (GimpRemoveItemFunc) gimp_image_remove_vectors;
iv_class->new_item = gimp_vectors_tree_view_item_new;
iv_class->action_group = "vectors";
iv_class->activate_action = "vectors-edit";
iv_class->new_action = "vectors-new";
iv_class->new_default_action = "vectors-new-last-values";
iv_class->raise_action = "vectors-raise";
iv_class->raise_top_action = "vectors-raise-to-top";
iv_class->lower_action = "vectors-lower";
iv_class->lower_bottom_action = "vectors-lower-to-bottom";
iv_class->duplicate_action = "vectors-duplicate";
iv_class->delete_action = "vectors-delete";
iv_class->lock_content_icon_name = GIMP_ICON_TOOL_PATH;
iv_class->lock_content_tooltip = _("Lock path strokes");
iv_class->lock_content_help_id = GIMP_HELP_PATH_LOCK_STROKES;
iv_class->lock_position_icon_name = GIMP_ICON_TOOL_MOVE;
iv_class->lock_position_tooltip = _("Lock path position");
iv_class->lock_position_help_id = GIMP_HELP_PATH_LOCK_POSITION;
}
static void
gimp_vectors_tree_view_view_iface_init (GimpContainerViewInterface *iface)
{
parent_view_iface = g_type_interface_peek_parent (iface);
iface->set_container = gimp_vectors_tree_view_set_container;
}
Changed GimpViewable preview rendering to have a context to get 2006-08-29 Michael Natterer <mitch@gimp.org> Changed GimpViewable preview rendering to have a context to get FG/BG/whatever from. Use the context to enable dynamic FG/BG colors in gradients. Fixes bug #127676 and bug #352214. Addresses bug #128367 (doesn't fix it because there's no loading/saving and no GUI yet). * app/core/core-enums.[ch]: added enum GimpGradientColor to enable specifying gradient colors in terms of foreground and background. * app/core/gimpgradient.[ch]: added color_type members to the GimpGradientSegment struct and honor them in gimp_gradient_get_color_at(). Added GimpContext parameters to all functions which finally call get_color_at(). * app/core/gimp-gradients.c: use the new method to implement the builtin gradients. * app/core/gimpviewable.[ch]: added GimpContext parameters to all get_preview() and get_pixbuf() functions. * app/core/gimpbrush.c * app/core/gimpbuffer.c * app/core/gimpdrawable-preview.[ch] * app/core/gimpgradient.c * app/core/gimpimage-preview.[ch] * app/core/gimpimagefile.c * app/core/gimppalette.c * app/core/gimppattern.c * app/core/gimpundo.[ch] * app/text/gimpfont.c * app/vectors/gimpvectors-preview.[ch]: changed ::get_preview() and ::get_pixbuf() implementations accordingly. * app/core/gimpdrawable-blend.c * app/core/gimppalette-import.[ch] * app/dialogs/dialogs-constructors.c * app/dialogs/palette-import-dialog.c * app/dialogs/resize-dialog.c * app/display/gimpdisplayshell-layer-select.c * app/display/gimpdisplayshell.c * app/display/gimpnavigationeditor.c * app/paint/gimppaintoptions.c * app/tools/gimpeditselectiontool.c * app/tools/gimptexttool.c * app/actions/gradient-editor-commands.c * app/widgets/gimpaction.c * app/widgets/gimpbrusheditor.[ch] * app/widgets/gimpbufferview.c * app/widgets/gimpcellrendererviewable.c * app/widgets/gimpchanneltreeview.c * app/widgets/gimpclipboard.c * app/widgets/gimpcoloreditor.c * app/widgets/gimpcomponenteditor.c * app/widgets/gimpcontainerbox.c * app/widgets/gimpcontainercombobox.c * app/widgets/gimpcontainereditor.c * app/widgets/gimpcontainerentry.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainertreeview.[ch] * app/widgets/gimpdataeditor.[ch] * app/widgets/gimpdevicestatus.c * app/widgets/gimpdnd.[ch] * app/widgets/gimpdrawabletreeview.c * app/widgets/gimpfiledialog.c * app/widgets/gimpgradienteditor.[ch] * app/widgets/gimpgradientselect.c * app/widgets/gimpitemtreeview.c * app/widgets/gimplayertreeview.c * app/widgets/gimppaletteeditor.[ch] * app/widgets/gimppropwidgets.[ch] * app/widgets/gimpselectioneditor.c * app/widgets/gimpthumbbox.[ch] * app/widgets/gimptoolbox-image-area.c * app/widgets/gimptoolbox-indicator-area.c * app/widgets/gimptooloptionseditor.c * app/widgets/gimpundoeditor.c * app/widgets/gimpvectorstreeview.c * app/widgets/gimpview-popup.[ch] * app/widgets/gimpview.[ch] * app/widgets/gimpviewablebutton.c * app/widgets/gimpviewabledialog.c * app/widgets/gimpviewrenderer.[ch] * app/widgets/gimpviewrenderer-frame.c * app/widgets/gimpviewrendererbrush.c * app/widgets/gimpviewrendererbuffer.c * app/widgets/gimpviewrendererdrawable.c * app/widgets/gimpviewrenderergradient.c * app/widgets/gimpviewrendererimage.c * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/gradient.pdb * tools/pdbgen/pdb/gradients.pdb * tools/pdbgen/pdb/image.pdb: added tons of GimpContext members and parameters, implement GimpDocked::set_context() in many widgets. Pass these locally remembered contexts to GimpViewable functions. Did some minor cleanups on the way. There are still some minor FIXMEs around where the code uses a NULL context (which is allowed by the APIs) * app/pdb/drawable_cmds.c * app/pdb/gradient_cmds.c * app/pdb/gradients_cmds.c * app/pdb/image_cmds.c: regenerated.
2006-08-30 05:44:51 +08:00
static void
gimp_vectors_tree_view_init (GimpVectorsTreeView *view)
{
}
static void
gimp_vectors_tree_view_constructed (GObject *object)
app/actions/documents-actions.c app/actions/documents-commands.c 2004-05-12 Michael Natterer <mitch@gimp.org> * app/actions/documents-actions.c * app/actions/documents-commands.c * app/actions/edit-actions.c * app/actions/edit-commands.[ch] * app/actions/layers-actions.c * app/actions/layers-commands.c * app/actions/select-actions.c * app/actions/select-commands.[ch] * app/actions/vectors-actions.c * app/actions/vectors-commands.[ch]: added tooltips for actions which are now used for dialog buttons, added callback implementations which formerly lived in various widgets, moved some actions around and did some general cleanups. * menus/image-menu.xml.in: s/edit-stroke/select-stroke/ * menus/Makefile.am * menus/selection-editor-menu.xml: new popup menu. * app/menus/menus.c: register <SelectionEditor> and <UndoEditor> UI managers. * app/widgets/gimpeditor.[ch]: added construct properties "menu-factory", "menu-identifier", "ui-path" and "popup-data". Implement GObject::constructor() and create the UI manager if all needed properties were set. Enables creating action buttons at widget construction time because they need a UI manager. (gimp_editor_add_action_button): changed to take a va_list of "extended" actions which are invoked if the resp. button emits "extended_clicked". Store the actions and their modifier masks in a list attached to the button. * app/widgets/gimpcontainerview.c (gimp_container_view_item_selected): if the view has container *and* context, simply change the context and return. (gimp_container_view_context_changed): don't emit "select_item" manually but simply call gimp_container_view_select_item(). (gimp_container_view_viewable_dropped): use gimp_container_view_item_selected() instead of changing the context directly. * app/widgets/gimpcontainereditor.c (gimp_container_editor_select_item): update the UI manager. * app/widgets/gimpdockable.c: don't try to fiddle with the dialog's menu if it doesn't have a ui_path (happens if the UI manager is just a collection of actions for the dialog buttons and has no menu registered). * app/widgets/gimpimageeditor.c: connect to the image's "flush" signal and update the UI manager in the callback. * app/widgets/gimpitemtreeview.c: use GimpEditor's construct properties to create the UI manager so GimpItemTreeView subclasses can have action buttons. Update the UI manager in gimp_item_tree_view_select_item(). * app/widgets/gimpbufferview.c * app/widgets/gimpcolormapeditor.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpdatafactoryview.c * app/widgets/gimpfontview.c * app/widgets/gimpimageview.c * app/widgets/gimptemplateview.c * app/widgets/gimptoolview.c: changed calls to gimp_editor_add_action_button() accordingly and removed some unneeded select_item() implementations. * app/widgets/gimpchanneltreeview.c * app/widgets/gimpvectorstreeview.[ch] * app/widgets/gimpdocumentview.[ch] * app/widgets/gimplayertreeview.c * app/widgets/gimpselectioneditor.[ch] * app/widgets/gimpundoeditor.[ch]: use action buttons and removed lots of callbacks which went to the resp. action callbacks. * app/widgets/widgets-types.h: removed some now unneeded function prototypes. * app/gui/dialogs-constructors.c: changed (simplified) many dialog constructors accordingly.
2004-05-13 02:36:33 +08:00
{
GimpEditor *editor = GIMP_EDITOR (object);
GimpContainerTreeView *tree_view = GIMP_CONTAINER_TREE_VIEW (object);
GimpVectorsTreeView *view = GIMP_VECTORS_TREE_VIEW (object);
GdkModifierType extend_mask;
GdkModifierType modify_mask;
app/actions/documents-actions.c app/actions/documents-commands.c 2004-05-12 Michael Natterer <mitch@gimp.org> * app/actions/documents-actions.c * app/actions/documents-commands.c * app/actions/edit-actions.c * app/actions/edit-commands.[ch] * app/actions/layers-actions.c * app/actions/layers-commands.c * app/actions/select-actions.c * app/actions/select-commands.[ch] * app/actions/vectors-actions.c * app/actions/vectors-commands.[ch]: added tooltips for actions which are now used for dialog buttons, added callback implementations which formerly lived in various widgets, moved some actions around and did some general cleanups. * menus/image-menu.xml.in: s/edit-stroke/select-stroke/ * menus/Makefile.am * menus/selection-editor-menu.xml: new popup menu. * app/menus/menus.c: register <SelectionEditor> and <UndoEditor> UI managers. * app/widgets/gimpeditor.[ch]: added construct properties "menu-factory", "menu-identifier", "ui-path" and "popup-data". Implement GObject::constructor() and create the UI manager if all needed properties were set. Enables creating action buttons at widget construction time because they need a UI manager. (gimp_editor_add_action_button): changed to take a va_list of "extended" actions which are invoked if the resp. button emits "extended_clicked". Store the actions and their modifier masks in a list attached to the button. * app/widgets/gimpcontainerview.c (gimp_container_view_item_selected): if the view has container *and* context, simply change the context and return. (gimp_container_view_context_changed): don't emit "select_item" manually but simply call gimp_container_view_select_item(). (gimp_container_view_viewable_dropped): use gimp_container_view_item_selected() instead of changing the context directly. * app/widgets/gimpcontainereditor.c (gimp_container_editor_select_item): update the UI manager. * app/widgets/gimpdockable.c: don't try to fiddle with the dialog's menu if it doesn't have a ui_path (happens if the UI manager is just a collection of actions for the dialog buttons and has no menu registered). * app/widgets/gimpimageeditor.c: connect to the image's "flush" signal and update the UI manager in the callback. * app/widgets/gimpitemtreeview.c: use GimpEditor's construct properties to create the UI manager so GimpItemTreeView subclasses can have action buttons. Update the UI manager in gimp_item_tree_view_select_item(). * app/widgets/gimpbufferview.c * app/widgets/gimpcolormapeditor.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpdatafactoryview.c * app/widgets/gimpfontview.c * app/widgets/gimpimageview.c * app/widgets/gimptemplateview.c * app/widgets/gimptoolview.c: changed calls to gimp_editor_add_action_button() accordingly and removed some unneeded select_item() implementations. * app/widgets/gimpchanneltreeview.c * app/widgets/gimpvectorstreeview.[ch] * app/widgets/gimpdocumentview.[ch] * app/widgets/gimplayertreeview.c * app/widgets/gimpselectioneditor.[ch] * app/widgets/gimpundoeditor.[ch]: use action buttons and removed lots of callbacks which went to the resp. action callbacks. * app/widgets/widgets-types.h: removed some now unneeded function prototypes. * app/gui/dialogs-constructors.c: changed (simplified) many dialog constructors accordingly.
2004-05-13 02:36:33 +08:00
G_OBJECT_CLASS (parent_class)->constructed (object);
extend_mask = gtk_widget_get_modifier_mask (GTK_WIDGET (object),
GDK_MODIFIER_INTENT_EXTEND_SELECTION);
modify_mask = gtk_widget_get_modifier_mask (GTK_WIDGET (object),
GDK_MODIFIER_INTENT_MODIFY_SELECTION);
view->toselection_button =
app/actions/documents-actions.c app/actions/documents-commands.c 2004-05-12 Michael Natterer <mitch@gimp.org> * app/actions/documents-actions.c * app/actions/documents-commands.c * app/actions/edit-actions.c * app/actions/edit-commands.[ch] * app/actions/layers-actions.c * app/actions/layers-commands.c * app/actions/select-actions.c * app/actions/select-commands.[ch] * app/actions/vectors-actions.c * app/actions/vectors-commands.[ch]: added tooltips for actions which are now used for dialog buttons, added callback implementations which formerly lived in various widgets, moved some actions around and did some general cleanups. * menus/image-menu.xml.in: s/edit-stroke/select-stroke/ * menus/Makefile.am * menus/selection-editor-menu.xml: new popup menu. * app/menus/menus.c: register <SelectionEditor> and <UndoEditor> UI managers. * app/widgets/gimpeditor.[ch]: added construct properties "menu-factory", "menu-identifier", "ui-path" and "popup-data". Implement GObject::constructor() and create the UI manager if all needed properties were set. Enables creating action buttons at widget construction time because they need a UI manager. (gimp_editor_add_action_button): changed to take a va_list of "extended" actions which are invoked if the resp. button emits "extended_clicked". Store the actions and their modifier masks in a list attached to the button. * app/widgets/gimpcontainerview.c (gimp_container_view_item_selected): if the view has container *and* context, simply change the context and return. (gimp_container_view_context_changed): don't emit "select_item" manually but simply call gimp_container_view_select_item(). (gimp_container_view_viewable_dropped): use gimp_container_view_item_selected() instead of changing the context directly. * app/widgets/gimpcontainereditor.c (gimp_container_editor_select_item): update the UI manager. * app/widgets/gimpdockable.c: don't try to fiddle with the dialog's menu if it doesn't have a ui_path (happens if the UI manager is just a collection of actions for the dialog buttons and has no menu registered). * app/widgets/gimpimageeditor.c: connect to the image's "flush" signal and update the UI manager in the callback. * app/widgets/gimpitemtreeview.c: use GimpEditor's construct properties to create the UI manager so GimpItemTreeView subclasses can have action buttons. Update the UI manager in gimp_item_tree_view_select_item(). * app/widgets/gimpbufferview.c * app/widgets/gimpcolormapeditor.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpdatafactoryview.c * app/widgets/gimpfontview.c * app/widgets/gimpimageview.c * app/widgets/gimptemplateview.c * app/widgets/gimptoolview.c: changed calls to gimp_editor_add_action_button() accordingly and removed some unneeded select_item() implementations. * app/widgets/gimpchanneltreeview.c * app/widgets/gimpvectorstreeview.[ch] * app/widgets/gimpdocumentview.[ch] * app/widgets/gimplayertreeview.c * app/widgets/gimpselectioneditor.[ch] * app/widgets/gimpundoeditor.[ch]: use action buttons and removed lots of callbacks which went to the resp. action callbacks. * app/widgets/widgets-types.h: removed some now unneeded function prototypes. * app/gui/dialogs-constructors.c: changed (simplified) many dialog constructors accordingly.
2004-05-13 02:36:33 +08:00
gimp_editor_add_action_button (editor, "vectors",
"vectors-selection-replace",
"vectors-selection-add",
extend_mask,
"vectors-selection-subtract",
modify_mask,
"vectors-selection-intersect",
extend_mask | modify_mask,
app/actions/documents-actions.c app/actions/documents-commands.c 2004-05-12 Michael Natterer <mitch@gimp.org> * app/actions/documents-actions.c * app/actions/documents-commands.c * app/actions/edit-actions.c * app/actions/edit-commands.[ch] * app/actions/layers-actions.c * app/actions/layers-commands.c * app/actions/select-actions.c * app/actions/select-commands.[ch] * app/actions/vectors-actions.c * app/actions/vectors-commands.[ch]: added tooltips for actions which are now used for dialog buttons, added callback implementations which formerly lived in various widgets, moved some actions around and did some general cleanups. * menus/image-menu.xml.in: s/edit-stroke/select-stroke/ * menus/Makefile.am * menus/selection-editor-menu.xml: new popup menu. * app/menus/menus.c: register <SelectionEditor> and <UndoEditor> UI managers. * app/widgets/gimpeditor.[ch]: added construct properties "menu-factory", "menu-identifier", "ui-path" and "popup-data". Implement GObject::constructor() and create the UI manager if all needed properties were set. Enables creating action buttons at widget construction time because they need a UI manager. (gimp_editor_add_action_button): changed to take a va_list of "extended" actions which are invoked if the resp. button emits "extended_clicked". Store the actions and their modifier masks in a list attached to the button. * app/widgets/gimpcontainerview.c (gimp_container_view_item_selected): if the view has container *and* context, simply change the context and return. (gimp_container_view_context_changed): don't emit "select_item" manually but simply call gimp_container_view_select_item(). (gimp_container_view_viewable_dropped): use gimp_container_view_item_selected() instead of changing the context directly. * app/widgets/gimpcontainereditor.c (gimp_container_editor_select_item): update the UI manager. * app/widgets/gimpdockable.c: don't try to fiddle with the dialog's menu if it doesn't have a ui_path (happens if the UI manager is just a collection of actions for the dialog buttons and has no menu registered). * app/widgets/gimpimageeditor.c: connect to the image's "flush" signal and update the UI manager in the callback. * app/widgets/gimpitemtreeview.c: use GimpEditor's construct properties to create the UI manager so GimpItemTreeView subclasses can have action buttons. Update the UI manager in gimp_item_tree_view_select_item(). * app/widgets/gimpbufferview.c * app/widgets/gimpcolormapeditor.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpdatafactoryview.c * app/widgets/gimpfontview.c * app/widgets/gimpimageview.c * app/widgets/gimptemplateview.c * app/widgets/gimptoolview.c: changed calls to gimp_editor_add_action_button() accordingly and removed some unneeded select_item() implementations. * app/widgets/gimpchanneltreeview.c * app/widgets/gimpvectorstreeview.[ch] * app/widgets/gimpdocumentview.[ch] * app/widgets/gimplayertreeview.c * app/widgets/gimpselectioneditor.[ch] * app/widgets/gimpundoeditor.[ch]: use action buttons and removed lots of callbacks which went to the resp. action callbacks. * app/widgets/widgets-types.h: removed some now unneeded function prototypes. * app/gui/dialogs-constructors.c: changed (simplified) many dialog constructors accordingly.
2004-05-13 02:36:33 +08:00
NULL);
gimp_container_view_enable_dnd (GIMP_CONTAINER_VIEW (editor),
GTK_BUTTON (view->toselection_button),
GIMP_TYPE_VECTORS);
gtk_box_reorder_child (gimp_editor_get_button_box (editor),
view->toselection_button, 4);
view->tovectors_button =
app/actions/documents-actions.c app/actions/documents-commands.c 2004-05-12 Michael Natterer <mitch@gimp.org> * app/actions/documents-actions.c * app/actions/documents-commands.c * app/actions/edit-actions.c * app/actions/edit-commands.[ch] * app/actions/layers-actions.c * app/actions/layers-commands.c * app/actions/select-actions.c * app/actions/select-commands.[ch] * app/actions/vectors-actions.c * app/actions/vectors-commands.[ch]: added tooltips for actions which are now used for dialog buttons, added callback implementations which formerly lived in various widgets, moved some actions around and did some general cleanups. * menus/image-menu.xml.in: s/edit-stroke/select-stroke/ * menus/Makefile.am * menus/selection-editor-menu.xml: new popup menu. * app/menus/menus.c: register <SelectionEditor> and <UndoEditor> UI managers. * app/widgets/gimpeditor.[ch]: added construct properties "menu-factory", "menu-identifier", "ui-path" and "popup-data". Implement GObject::constructor() and create the UI manager if all needed properties were set. Enables creating action buttons at widget construction time because they need a UI manager. (gimp_editor_add_action_button): changed to take a va_list of "extended" actions which are invoked if the resp. button emits "extended_clicked". Store the actions and their modifier masks in a list attached to the button. * app/widgets/gimpcontainerview.c (gimp_container_view_item_selected): if the view has container *and* context, simply change the context and return. (gimp_container_view_context_changed): don't emit "select_item" manually but simply call gimp_container_view_select_item(). (gimp_container_view_viewable_dropped): use gimp_container_view_item_selected() instead of changing the context directly. * app/widgets/gimpcontainereditor.c (gimp_container_editor_select_item): update the UI manager. * app/widgets/gimpdockable.c: don't try to fiddle with the dialog's menu if it doesn't have a ui_path (happens if the UI manager is just a collection of actions for the dialog buttons and has no menu registered). * app/widgets/gimpimageeditor.c: connect to the image's "flush" signal and update the UI manager in the callback. * app/widgets/gimpitemtreeview.c: use GimpEditor's construct properties to create the UI manager so GimpItemTreeView subclasses can have action buttons. Update the UI manager in gimp_item_tree_view_select_item(). * app/widgets/gimpbufferview.c * app/widgets/gimpcolormapeditor.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpdatafactoryview.c * app/widgets/gimpfontview.c * app/widgets/gimpimageview.c * app/widgets/gimptemplateview.c * app/widgets/gimptoolview.c: changed calls to gimp_editor_add_action_button() accordingly and removed some unneeded select_item() implementations. * app/widgets/gimpchanneltreeview.c * app/widgets/gimpvectorstreeview.[ch] * app/widgets/gimpdocumentview.[ch] * app/widgets/gimplayertreeview.c * app/widgets/gimpselectioneditor.[ch] * app/widgets/gimpundoeditor.[ch]: use action buttons and removed lots of callbacks which went to the resp. action callbacks. * app/widgets/widgets-types.h: removed some now unneeded function prototypes. * app/gui/dialogs-constructors.c: changed (simplified) many dialog constructors accordingly.
2004-05-13 02:36:33 +08:00
gimp_editor_add_action_button (editor, "vectors",
"vectors-selection-to-vectors",
"vectors-selection-to-vectors-advanced",
GDK_SHIFT_MASK,
NULL);
gtk_box_reorder_child (gimp_editor_get_button_box (editor),
view->tovectors_button, 5);
view->stroke_button =
app/actions/documents-actions.c app/actions/documents-commands.c 2004-05-12 Michael Natterer <mitch@gimp.org> * app/actions/documents-actions.c * app/actions/documents-commands.c * app/actions/edit-actions.c * app/actions/edit-commands.[ch] * app/actions/layers-actions.c * app/actions/layers-commands.c * app/actions/select-actions.c * app/actions/select-commands.[ch] * app/actions/vectors-actions.c * app/actions/vectors-commands.[ch]: added tooltips for actions which are now used for dialog buttons, added callback implementations which formerly lived in various widgets, moved some actions around and did some general cleanups. * menus/image-menu.xml.in: s/edit-stroke/select-stroke/ * menus/Makefile.am * menus/selection-editor-menu.xml: new popup menu. * app/menus/menus.c: register <SelectionEditor> and <UndoEditor> UI managers. * app/widgets/gimpeditor.[ch]: added construct properties "menu-factory", "menu-identifier", "ui-path" and "popup-data". Implement GObject::constructor() and create the UI manager if all needed properties were set. Enables creating action buttons at widget construction time because they need a UI manager. (gimp_editor_add_action_button): changed to take a va_list of "extended" actions which are invoked if the resp. button emits "extended_clicked". Store the actions and their modifier masks in a list attached to the button. * app/widgets/gimpcontainerview.c (gimp_container_view_item_selected): if the view has container *and* context, simply change the context and return. (gimp_container_view_context_changed): don't emit "select_item" manually but simply call gimp_container_view_select_item(). (gimp_container_view_viewable_dropped): use gimp_container_view_item_selected() instead of changing the context directly. * app/widgets/gimpcontainereditor.c (gimp_container_editor_select_item): update the UI manager. * app/widgets/gimpdockable.c: don't try to fiddle with the dialog's menu if it doesn't have a ui_path (happens if the UI manager is just a collection of actions for the dialog buttons and has no menu registered). * app/widgets/gimpimageeditor.c: connect to the image's "flush" signal and update the UI manager in the callback. * app/widgets/gimpitemtreeview.c: use GimpEditor's construct properties to create the UI manager so GimpItemTreeView subclasses can have action buttons. Update the UI manager in gimp_item_tree_view_select_item(). * app/widgets/gimpbufferview.c * app/widgets/gimpcolormapeditor.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpdatafactoryview.c * app/widgets/gimpfontview.c * app/widgets/gimpimageview.c * app/widgets/gimptemplateview.c * app/widgets/gimptoolview.c: changed calls to gimp_editor_add_action_button() accordingly and removed some unneeded select_item() implementations. * app/widgets/gimpchanneltreeview.c * app/widgets/gimpvectorstreeview.[ch] * app/widgets/gimpdocumentview.[ch] * app/widgets/gimplayertreeview.c * app/widgets/gimpselectioneditor.[ch] * app/widgets/gimpundoeditor.[ch]: use action buttons and removed lots of callbacks which went to the resp. action callbacks. * app/widgets/widgets-types.h: removed some now unneeded function prototypes. * app/gui/dialogs-constructors.c: changed (simplified) many dialog constructors accordingly.
2004-05-13 02:36:33 +08:00
gimp_editor_add_action_button (editor, "vectors",
"vectors-stroke",
"vectors-stroke-last-values",
GDK_SHIFT_MASK,
NULL);
gimp_container_view_enable_dnd (GIMP_CONTAINER_VIEW (editor),
GTK_BUTTON (view->stroke_button),
GIMP_TYPE_VECTORS);
gtk_box_reorder_child (gimp_editor_get_button_box (editor),
view->stroke_button, 6);
gimp_dnd_svg_dest_add (GTK_WIDGET (tree_view->view), NULL, view);
}
static void
gimp_vectors_tree_view_set_container (GimpContainerView *view,
GimpContainer *container)
{
GimpContainerTreeView *tree_view = GIMP_CONTAINER_TREE_VIEW (view);
GimpContainer *old_container;
old_container = gimp_container_view_get_container (GIMP_CONTAINER_VIEW (view));
if (old_container && ! container)
{
gimp_dnd_svg_source_remove (GTK_WIDGET (tree_view->view));
}
parent_view_iface->set_container (view, container);
if (! old_container && container)
{
gimp_dnd_svg_source_add (GTK_WIDGET (tree_view->view),
gimp_vectors_tree_view_drag_svg,
tree_view);
}
}
static void
gimp_vectors_tree_view_drop_svg (GimpContainerTreeView *tree_view,
const gchar *svg_data,
gsize svg_data_len,
GimpViewable *dest_viewable,
GtkTreeViewDropPosition drop_pos)
{
Bring parent items to the public API in the core * app/core/gimpimage.[ch]: make the parent parameter public in add_layer(), add_layers(), add_channel() and add_vectors(). * app/vectors/gimpvectors-import.[ch]: add parent parameters to the vectors import functions. * app/core/gimpchannelundo.[ch] * app/core/gimplayerundo.[ch] * app/vectors/gimpvectorsundo.[ch] * app/core/gimpimage-undo-push.[ch]: remember the parent item when removing layers, channels and vectors. * app/actions/channels-commands.c * app/actions/debug-commands.c * app/actions/edit-commands.c * app/actions/layers-commands.c * app/actions/vectors-commands.c * app/core/gimp-edit.c * app/core/gimpimage-duplicate.c * app/core/gimpimage-merge.c * app/core/gimpimage-quick-mask.c * app/core/gimplayer-floating-sel.c * app/core/gimpselection.c * app/core/gimptemplate.c * app/dialogs/file-open-dialog.c * app/display/gimpdisplayshell-dnd.c * app/text/gimptext-compat.c * app/tools/gimptexttool.c * app/tools/gimpvectortool.c * app/widgets/gimptoolbox-dnd.c * app/xcf/xcf-load.c * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/paths.pdb * tools/pdbgen/pdb/vectors.pdb: pass NULL as parent item to above functions and add FIXMEs all over the place because there is some more hacking needed to make adding with index = -1 (on top of the current item) work again. * app/pdb/image-cmds.c * app/pdb/paths-cmds.c * app/pdb/vectors-cmds.c: regenerated. * app/core/gimpimage-duplicate.c: duplicate the original image's tree structure in the copy. * app/widgets/gimpitemtreeview.[ch]: add parent to GimpAddItemFunc, add utility function gimp_item_tree_view_get_drop_index() which figures where to add something dropped to an item tree. * app/widgets/gimpchanneltreeview.c * app/widgets/gimplayertreeview.c * app/widgets/gimpvectorstreeview.c: changed accordingly, using above new GimpItemTreeView API.
2009-08-04 01:21:51 +08:00
GimpItemTreeView *item_view = GIMP_ITEM_TREE_VIEW (tree_view);
GimpImage *image = gimp_item_tree_view_get_image (item_view);
GimpVectors *parent;
gint index;
GError *error = NULL;
if (image->gimp->be_verbose)
g_print ("%s: SVG dropped (len = %d)\n", G_STRFUNC, (gint) svg_data_len);
Bring parent items to the public API in the core * app/core/gimpimage.[ch]: make the parent parameter public in add_layer(), add_layers(), add_channel() and add_vectors(). * app/vectors/gimpvectors-import.[ch]: add parent parameters to the vectors import functions. * app/core/gimpchannelundo.[ch] * app/core/gimplayerundo.[ch] * app/vectors/gimpvectorsundo.[ch] * app/core/gimpimage-undo-push.[ch]: remember the parent item when removing layers, channels and vectors. * app/actions/channels-commands.c * app/actions/debug-commands.c * app/actions/edit-commands.c * app/actions/layers-commands.c * app/actions/vectors-commands.c * app/core/gimp-edit.c * app/core/gimpimage-duplicate.c * app/core/gimpimage-merge.c * app/core/gimpimage-quick-mask.c * app/core/gimplayer-floating-sel.c * app/core/gimpselection.c * app/core/gimptemplate.c * app/dialogs/file-open-dialog.c * app/display/gimpdisplayshell-dnd.c * app/text/gimptext-compat.c * app/tools/gimptexttool.c * app/tools/gimpvectortool.c * app/widgets/gimptoolbox-dnd.c * app/xcf/xcf-load.c * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/paths.pdb * tools/pdbgen/pdb/vectors.pdb: pass NULL as parent item to above functions and add FIXMEs all over the place because there is some more hacking needed to make adding with index = -1 (on top of the current item) work again. * app/pdb/image-cmds.c * app/pdb/paths-cmds.c * app/pdb/vectors-cmds.c: regenerated. * app/core/gimpimage-duplicate.c: duplicate the original image's tree structure in the copy. * app/widgets/gimpitemtreeview.[ch]: add parent to GimpAddItemFunc, add utility function gimp_item_tree_view_get_drop_index() which figures where to add something dropped to an item tree. * app/widgets/gimpchanneltreeview.c * app/widgets/gimplayertreeview.c * app/widgets/gimpvectorstreeview.c: changed accordingly, using above new GimpItemTreeView API.
2009-08-04 01:21:51 +08:00
index = gimp_item_tree_view_get_drop_index (item_view, dest_viewable,
drop_pos,
(GimpViewable **) &parent);
if (! gimp_vectors_import_buffer (image, svg_data, svg_data_len,
TRUE, FALSE, parent, index, NULL, &error))
{
bumped minimum required version of GLib to 2.18.0. 2008-11-04 Sven Neumann <sven@sven> * configure.in: bumped minimum required version of GLib to 2.18.0. * INSTALL: document the updated dependency. * app/core/gimp.[ch]: introduced gimp_message_literal(), a variant of gimp_message() that takes a literal string. * app/errors.[ch]: removed format arguments from gimp_fatal_error() and gimp_terminate() and let them take a literal string instead. * app/tools/gimptool.[ch]: introduced gimp_tool_message_literal(), a variant of gimp_tool_message() that takes a literal string. * app/actions/documents-commands.c * app/actions/drawable-commands.c * app/actions/edit-commands.c * app/actions/error-console-commands.c * app/actions/file-commands.c * app/actions/gradients-commands.c * app/actions/image-commands.c * app/actions/layers-commands.c * app/actions/palettes-commands.c * app/actions/plug-in-commands.c * app/actions/select-commands.c * app/actions/vectors-commands.c * app/config/gimprc.c * app/core/gimp-modules.c * app/core/gimp-parasites.c * app/core/gimp-templates.c * app/core/gimp-units.c * app/core/gimpchannel.c * app/core/gimpcontainer-filter.c * app/core/gimpdrawable-bucket-fill.c * app/core/gimpimage-convert.c * app/core/gimpimage-merge.c * app/core/gimpimage.c * app/core/gimpimagefile.c * app/core/gimplayer-floating-sel.c * app/core/gimplayer.c * app/core/gimpselection.c * app/dialogs/convert-dialog.c * app/dialogs/dialogs.c * app/dialogs/palette-import-dialog.c * app/dialogs/preferences-dialog.c * app/dialogs/quit-dialog.c * app/dialogs/stroke-dialog.c * app/display/gimpdisplayshell-dnd.c * app/file/file-open.c * app/file/file-procedure.c * app/file/file-save.c * app/file/file-utils.c * app/gegl/gimpcurvesconfig.c * app/gegl/gimplevelsconfig.c * app/gui/gui-message.c * app/gui/gui.c * app/gui/session.c * app/paint/gimpbrushcore.c * app/paint/gimpclone.c * app/paint/gimpheal.c * app/paint/gimpperspectiveclone.c * app/paint/gimpsourcecore.c * app/pdb/gimppdb-utils.c * app/pdb/gimpprocedure.c * app/plug-in/gimpplugin-message.c * app/plug-in/gimpplugin.c * app/plug-in/gimppluginmanager-restore.c * app/plug-in/gimppluginprocedure.c * app/text/gimptextlayer.c * app/tools/gimp-tools.c * app/tools/gimpaligntool.c * app/tools/gimpblendtool.c * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcurvestool.c * app/tools/gimpdesaturatetool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpforegroundselecttool.c * app/tools/gimpfreeselecttool.c * app/tools/gimpgegltool.c * app/tools/gimphuesaturationtool.c * app/tools/gimpimagemaptool-settings.c * app/tools/gimpiscissorstool.c * app/tools/gimplevelstool.c * app/tools/gimpmeasuretool.c * app/tools/gimppainttool.c * app/tools/gimpposterizetool.c * app/tools/gimpselectiontool.c * app/tools/gimpsourcetool.c * app/tools/gimpthresholdtool.c * app/tools/gimptransformtool.c * app/tools/gimpvectortool.c * app/widgets/gimpactionview.c * app/widgets/gimpcontrollerlist.c * app/widgets/gimpcontrollers.c * app/widgets/gimpdataeditor.c * app/widgets/gimpdevices.c * app/widgets/gimpdnd-xds.c * app/widgets/gimperrordialog.c * app/widgets/gimphelp.c * app/widgets/gimpitemtreeview.c * app/widgets/gimppdbdialog.c * app/widgets/gimpsettingsbox.c * app/widgets/gimpvectorstreeview.c * app/widgets/gimpwidgets-utils.c * app/xcf/xcf-load.c * tools/pdbgen/pdb/convert.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/pdb/floating_sel.pdb * tools/pdbgen/pdb/image.pdb: use the _literal variants for g_set_error(), gimp_message() and gimp_tool_message(). * app/pdb/convert-cmds.c * app/pdb/edit-cmds.c * app/pdb/floating-sel-cmds.c * app/pdb/image-cmds.c: regenerated. svn path=/trunk/; revision=27548
2008-11-04 20:33:09 +08:00
gimp_message_literal (image->gimp,
G_OBJECT (tree_view), GIMP_MESSAGE_ERROR,
error->message);
g_clear_error (&error);
}
else
{
gimp_image_flush (image);
}
}
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
static GimpItem *
gimp_vectors_tree_view_item_new (GimpImage *image)
{
GimpVectors *new_vectors;
new_vectors = gimp_vectors_new (image, _("Path"));
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_add_vectors (image, new_vectors,
GIMP_IMAGE_ACTIVE_PARENT, -1, TRUE);
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
return GIMP_ITEM (new_vectors);
}
static guchar *
gimp_vectors_tree_view_drag_svg (GtkWidget *widget,
gsize *svg_data_len,
gpointer data)
{
GimpItemTreeView *view = GIMP_ITEM_TREE_VIEW (data);
GimpImage *image = gimp_item_tree_view_get_image (view);
GimpItem *item;
gchar *svg_data = NULL;
item = GIMP_ITEM_TREE_VIEW_GET_CLASS (view)->get_active_item (image);
*svg_data_len = 0;
if (item)
{
svg_data = gimp_vectors_export_string (image, GIMP_VECTORS (item));
if (svg_data)
*svg_data_len = strlen (svg_data);
}
return (guchar *) svg_data;
}