gimp/app/widgets/gimpdnd.h

289 lines
14 KiB
C
Raw Normal View History

/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995-1997 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 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 <https://www.gnu.org/licenses/>.
*/
#ifndef __GIMP_DND_H__
#define __GIMP_DND_H__
#define GIMP_TARGET_URI_LIST \
{ "text/uri-list", 0, GIMP_DND_TYPE_URI_LIST }
#define GIMP_TARGET_TEXT_PLAIN \
{ "text/plain", 0, GIMP_DND_TYPE_TEXT_PLAIN }
#define GIMP_TARGET_NETSCAPE_URL \
{ "_NETSCAPE_URL", 0, GIMP_DND_TYPE_NETSCAPE_URL }
#define GIMP_TARGET_XDS \
{ "XdndDirectSave0", 0, GIMP_DND_TYPE_XDS }
#define GIMP_TARGET_COLOR \
{ "application/x-color", 0, GIMP_DND_TYPE_COLOR }
#define GIMP_TARGET_SVG \
{ "image/svg", 0, GIMP_DND_TYPE_SVG }
#define GIMP_TARGET_SVG_XML \
{ "image/svg+xml", 0, GIMP_DND_TYPE_SVG_XML }
Implement dragging and dropping in any GdkPixbuf supported format. Fixes 2005-04-09 Michael Natterer <mitch@gimp.org> Implement dragging and dropping in any GdkPixbuf supported format. Fixes bug #172794 and bug #172795. * app/core/gimplayer.[ch] (gimp_layer_new_from_region): new function which contains all stuff that was in gimp_layer_new_from_tiles(). (gimp_layer_new_from_tiles): use above function. (gimp_layer_new_from_pixbuf): new function. * app/widgets/Makefile.am * app/widgets/gimppixbuf.[ch]: new files containing GdkPixbuf utility functions for clipboard and DnD. * app/widgets/gimpselectiondata.[ch]: removed gimp_selection_data_set,get_pixbuf(), GTK+ provides the same API. Also removed GdkAtom parameters all over the place because it's always the same as selection_data->target. * app/widgets/gimpclipboard.c: use the new pixbuf utility functions and gtk_selection_data_set,get_pixbuf(). * app/widgets/widgets-enums.h * app/widgets/gimpdnd.[ch]: removed never-implemented GIMP_DND_TYPE_PNG and added a generic GIMP_DND_TYPE_PIXBUF instead. Added API to drag and drop GdkPixbufs which transparently converts from/to and GdkPixbuf-supported image format. Removed passing around of GdkAtoms, since they were always the same as selection_data->target. * app/widgets/gimpdnd-xds.[ch]: follow GdkAtom parameter removal. * app/widgets/gimpcontainertreeview.[ch]: added virtual function GimpContainerTreeView::drop_pixbuf(). * app/widgets/gimpcontainertreeview-dnd.c: dispatch drop_pixbuf(). * app/widgets/gimplayertreeview.c: implement drop_pixbuf(). * app/widgets/gimpdrawabletreeview.c: allow to drag all drawables as pixbufs. * app/display/gimpdisplayshell-dnd.c: allow dropping of pixbufs.
2005-04-10 01:56:04 +08:00
/* just here for documentation purposes, the actual list of targets
* is created dynamically from available GdkPixbuf loaders
*/
#define GIMP_TARGET_PIXBUF \
{ NULL, 0, GIMP_DND_TYPE_PIXBUF }
#define GIMP_TARGET_IMAGE \
{ "application/x-gimp-image-id", GTK_TARGET_SAME_APP, GIMP_DND_TYPE_IMAGE }
#define GIMP_TARGET_COMPONENT \
{ "application/x-gimp-component", GTK_TARGET_SAME_APP, GIMP_DND_TYPE_COMPONENT }
#define GIMP_TARGET_LAYER \
{ "application/x-gimp-layer-id", GTK_TARGET_SAME_APP, GIMP_DND_TYPE_LAYER }
#define GIMP_TARGET_CHANNEL \
{ "application/x-gimp-channel-id", GTK_TARGET_SAME_APP, GIMP_DND_TYPE_CHANNEL }
#define GIMP_TARGET_LAYER_MASK \
{ "application/x-gimp-layer-mask-id", GTK_TARGET_SAME_APP, GIMP_DND_TYPE_LAYER_MASK }
app/core/Makefile.am app/core/core-types.h new base class for something 2002-02-25 Michael Natterer <mitch@gimp.org> * app/core/Makefile.am * app/core/core-types.h * app/core/gimpitem.[ch]: new base class for something which is a child of an image, has a PDB ID, a tattoo, parasites and emits a "removed" signal. * app/core/gimpdrawable.[ch] * app/vectors/gimpvectors.[ch]: derive from GimpItem. Removed lots of stuff from GimpDrawable. * app/core/gimp.[ch]: changed gimp->drawable_table and gimp->next_drawable_ID to gimp->item_table and gimp->next_item_id. * app/undo.[ch]: s/undo_push_drawable_parasite/undo_push_item_parasite/, minor cleanups. * app/core/gimplayer.[ch]: changed gimp_layer_new_from_tiles() and gimp_layer_new_from_drawable() to take the "dest_gimage" as second, not first parameter. * app/image_map.c * app/core/gimpchannel.c * app/core/gimpdrawable-blend.c * app/core/gimpdrawable-bucket-fill.c * app/core/gimpdrawable-histogram.c * app/core/gimpdrawable-offset.c * app/core/gimpdrawable-preview.c * app/core/gimpdrawable-transform.c * app/core/gimpedit.c * app/core/gimpimage-duplicate.c * app/core/gimpimage-mask.c * app/core/gimpimage-merge.c * app/core/gimpimage-pick-color.c * app/core/gimpimage.c * app/core/gimplayer-floating-sel.c * app/display/gimpdisplayshell-dnd.c * app/file/file-save.c * app/gui/channels-commands.c * app/gui/file-save-dialog.c * app/gui/layers-commands.c * app/gui/offset-dialog.c * app/gui/paths-dialog.c * app/gui/toolbox.c * app/paint/gimpairbrush.c * app/paint/gimpclone.c * app/paint/gimpconvolve.c * app/paint/gimpdodgeburn.c * app/paint/gimperaser.c * app/paint/gimppaintbrush.c * app/paint/gimppaintcore.c * app/paint/gimppencil.c * app/paint/gimpsmudge.c * app/plug-in/plug-in.c * app/tools/gimpbezierselecttool.c * app/tools/gimpbycolorselecttool.c * app/tools/gimpinktool.c * app/tools/gimppainttool.c * app/xcf/xcf-load.c * app/xcf/xcf-save.c * app/widgets/gimpdrawablepreview.c: changed accordingly. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpitemlistview.[ch]: new widget implementing most of the stuff formerly done by GimpDrawableListView. * app/widgets/gimpchannellistview.c * app/widgets/gimpdrawablelistitem.c * app/widgets/gimpdrawablelistview.[ch] * app/widgets/gimplayerlistview.c: changed accordingly. * app/widgets/gimpdnd.[ch]: added a vectors DND type. * app/gui/menus.c * app/gui/dialogs.c * app/gui/dialogs-constructors.[ch]: added a vectors dialog and a vectors item_factory. * app/gui/Makefile.am * app/gui/vectors-commands.[ch]: new files implementing the callbacks for the new vectors dialog and item_factory. * app/pdb/pdb_glue.h: some more ugly hacks to keep intermediate perl code working... * tools/pdbgen/pdb.pl: added a vectors type, use GimpItem for all ID lookups. * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/color.pdb * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/misc_tools.pdb * tools/pdbgen/pdb/parasite.pdb * tools/pdbgen/pdb/selection.pdb * tools/pdbgen/pdb/selection_tools.pdb: misc changes according to stuff above. * app/pdb/channel_cmds.c * app/pdb/color_cmds.c * app/pdb/drawable_cmds.c * app/pdb/edit_cmds.c * app/pdb/floating_sel_cmds.c * app/pdb/image_cmds.c * app/pdb/layer_cmds.c * app/pdb/misc_tools_cmds.c * app/pdb/paint_tools_cmds.c * app/pdb/parasite_cmds.c * app/pdb/selection_cmds.c * app/pdb/selection_tools_cmds.c * app/pdb/text_tool_cmds.c * app/pdb/transform_tools_cmds.c: regenerated.
2002-02-26 01:58:50 +08:00
#define GIMP_TARGET_VECTORS \
{ "application/x-gimp-vectors-id", GTK_TARGET_SAME_APP, GIMP_DND_TYPE_VECTORS }
1999-09-04 22:56:50 +08:00
#define GIMP_TARGET_BRUSH \
{ "application/x-gimp-brush-name", 0, GIMP_DND_TYPE_BRUSH }
1999-09-04 22:56:50 +08:00
#define GIMP_TARGET_PATTERN \
{ "application/x-gimp-pattern-name", 0, GIMP_DND_TYPE_PATTERN }
1999-09-04 22:56:50 +08:00
#define GIMP_TARGET_GRADIENT \
{ "application/x-gimp-gradient-name", 0, GIMP_DND_TYPE_GRADIENT }
1999-09-04 22:56:50 +08:00
1999-10-28 23:05:49 +08:00
#define GIMP_TARGET_PALETTE \
{ "application/x-gimp-palette-name", 0, GIMP_DND_TYPE_PALETTE }
1999-10-28 23:05:49 +08:00
#define GIMP_TARGET_FONT \
{ "application/x-gimp-font-name", 0, GIMP_DND_TYPE_FONT }
app/Makefile.am removed. 2001-06-26 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/color_transfer.[ch]: removed. * app/tools/Makefile.am * app/tools/gimpcolorbalancetool-transfer.[ch]: added. * app/tools/gimpcolorbalancetool.c: changed accordingly. * app/base/Makefile.am * app/base/tile-manager-crop.[ch]: formerly known as crop_buffer(). * app/tools/gimptexttool.c: changed accordingly. * app/context_manager.[ch]: added the global clipboard and the named buffer list here. * app/app_procs.c: don't call color_transfer_init() and don't free the buffer stuff (done by the context manager now). * app/errorconsole.c: don't #include "gui/commands.h" * app/global_edit.[ch]: removed lots of stuff which is now done by gui/edit-commands.* or the new GimpBuffer object. The "paste named" dialog will go away and this file will be moved to core/ soon. * app/image_new.c: no need to declare the global_buffer extern any more. * app/qmask.c: don't #include "global_edit.h" * app/core/Makefile.am * app/core/core-types.h * app/core/gimpbuffer.[ch]: new object (aka named buffer) * app/core/gimpcontext.[ch]: added a GimpBuffer attribute. * app/core/gimpimage.[ch]: one s/int/gboolean/. * app/core/gimppattern.c: hmm... * app/gui/commands.[ch]: split up in small files: * app/gui/Makefile.am * app/gui/edit-commands.[ch] * app/gui/file-commands.[ch] * app/gui/image-commands.[ch] * app/gui/select-commands.[ch] * app/gui/view-commands.[ch]: new files. * app/gui/dialogs-constructors.[ch] * app/gui/dialogs.c: added the named buffer list & grid. * app/gui/file-new-dialog.[ch] * app/gui/menus.c * app/gui/palette-editor.c * app/gui/test-commands.c: changed accordingly. * app/pdb/edit_cmds.c * tools/pdbgen/pdb/edit.pdb: changed for the global_edit stuff. * app/widgets/Makefile.am * app/widgets/gimpbufferpreview.[ch] * app/widgets/gimpbufferview.[ch] * app/widgets/gimpcontainereditor.[ch]: new widgets. * app/widgets/gimpcontainerview-utils.c * app/widgets/gimpdatafactoryview.[ch] * app/widgets/gimpdnd.[ch] * app/widgets/gimpdrawablepreview.c * app/widgets/gimplayerlistview.c * app/widgets/gimppreview.c * app/widgets/widgets-types.h: changed accordingly for the new GimpBuffer object and it's views, misc. cleanups. * pixmaps/Makefile.am * pixmaps/paste-as-new.xpm * pixmaps/paste-into.xpm * pixmaps/paste.xpm: new pixmaps (they all look the same... Tigert? ;-) * po/POTFILES.in: added the new files.
2001-06-26 20:09:43 +08:00
#define GIMP_TARGET_BUFFER \
{ "application/x-gimp-buffer-name", GTK_TARGET_SAME_APP, GIMP_DND_TYPE_BUFFER }
app/Makefile.am removed. 2001-06-26 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/color_transfer.[ch]: removed. * app/tools/Makefile.am * app/tools/gimpcolorbalancetool-transfer.[ch]: added. * app/tools/gimpcolorbalancetool.c: changed accordingly. * app/base/Makefile.am * app/base/tile-manager-crop.[ch]: formerly known as crop_buffer(). * app/tools/gimptexttool.c: changed accordingly. * app/context_manager.[ch]: added the global clipboard and the named buffer list here. * app/app_procs.c: don't call color_transfer_init() and don't free the buffer stuff (done by the context manager now). * app/errorconsole.c: don't #include "gui/commands.h" * app/global_edit.[ch]: removed lots of stuff which is now done by gui/edit-commands.* or the new GimpBuffer object. The "paste named" dialog will go away and this file will be moved to core/ soon. * app/image_new.c: no need to declare the global_buffer extern any more. * app/qmask.c: don't #include "global_edit.h" * app/core/Makefile.am * app/core/core-types.h * app/core/gimpbuffer.[ch]: new object (aka named buffer) * app/core/gimpcontext.[ch]: added a GimpBuffer attribute. * app/core/gimpimage.[ch]: one s/int/gboolean/. * app/core/gimppattern.c: hmm... * app/gui/commands.[ch]: split up in small files: * app/gui/Makefile.am * app/gui/edit-commands.[ch] * app/gui/file-commands.[ch] * app/gui/image-commands.[ch] * app/gui/select-commands.[ch] * app/gui/view-commands.[ch]: new files. * app/gui/dialogs-constructors.[ch] * app/gui/dialogs.c: added the named buffer list & grid. * app/gui/file-new-dialog.[ch] * app/gui/menus.c * app/gui/palette-editor.c * app/gui/test-commands.c: changed accordingly. * app/pdb/edit_cmds.c * tools/pdbgen/pdb/edit.pdb: changed for the global_edit stuff. * app/widgets/Makefile.am * app/widgets/gimpbufferpreview.[ch] * app/widgets/gimpbufferview.[ch] * app/widgets/gimpcontainereditor.[ch]: new widgets. * app/widgets/gimpcontainerview-utils.c * app/widgets/gimpdatafactoryview.[ch] * app/widgets/gimpdnd.[ch] * app/widgets/gimpdrawablepreview.c * app/widgets/gimplayerlistview.c * app/widgets/gimppreview.c * app/widgets/widgets-types.h: changed accordingly for the new GimpBuffer object and it's views, misc. cleanups. * pixmaps/Makefile.am * pixmaps/paste-as-new.xpm * pixmaps/paste-into.xpm * pixmaps/paste.xpm: new pixmaps (they all look the same... Tigert? ;-) * po/POTFILES.in: added the new files.
2001-06-26 20:09:43 +08:00
#define GIMP_TARGET_IMAGEFILE \
{ "application/x-gimp-imagefile-name", GTK_TARGET_SAME_APP, GIMP_DND_TYPE_IMAGEFILE }
#define GIMP_TARGET_TEMPLATE \
{ "application/x-gimp-template-name", GTK_TARGET_SAME_APP, GIMP_DND_TYPE_TEMPLATE }
#define GIMP_TARGET_TOOL_ITEM \
{ "application/x-gimp-tool-item-name", GTK_TARGET_SAME_APP, GIMP_DND_TYPE_TOOL_ITEM }
#define GIMP_TARGET_NOTEBOOK_TAB \
{ "GTK_NOTEBOOK_TAB", GTK_TARGET_SAME_APP, GIMP_DND_TYPE_NOTEBOOK_TAB }
#define GIMP_TARGET_LAYER_LIST \
{ "application/x-gimp-layer-list", GTK_TARGET_SAME_APP, GIMP_DND_TYPE_LAYER_LIST }
/* dnd initialization */
void gimp_dnd_init (Gimp *gimp);
/* uri list dnd functions */
typedef GList * (* GimpDndDragUriListFunc) (GtkWidget *widget,
gpointer data);
typedef void (* GimpDndDropUriListFunc) (GtkWidget *widget,
gint x,
gint y,
GList *uri_list,
gpointer data);
void gimp_dnd_uri_list_source_add (GtkWidget *widget,
GimpDndDragUriListFunc get_uri_list_func,
gpointer data);
void gimp_dnd_uri_list_source_remove (GtkWidget *widget);
void gimp_dnd_uri_list_dest_add (GtkWidget *widget,
GimpDndDropUriListFunc set_uri_list_func,
gpointer data);
void gimp_dnd_uri_list_dest_remove (GtkWidget *widget);
/* color dnd functions */
typedef void (* GimpDndDragColorFunc) (GtkWidget *widget,
GimpRGB *color,
gpointer data);
typedef void (* GimpDndDropColorFunc) (GtkWidget *widget,
gint x,
gint y,
const GimpRGB *color,
gpointer data);
void gimp_dnd_color_source_add (GtkWidget *widget,
GimpDndDragColorFunc get_color_func,
gpointer data);
void gimp_dnd_color_source_remove (GtkWidget *widget);
DND cleanup part 1: 2002-09-02 Michael Natterer <mitch@gimp.org> DND cleanup part 1: * app/widgets/gimpdnd.[ch]: changed all gimp_dnd_*_dest_set() and _unset() functions to _dest_add() and _dest_remove(). Switch from using static arrays of GtkTargetEntries to dynamic GtkTargetLists. The _add() and _remove() functions configure the drag dest automatically if not already done, so there is no need to call gtk_drag_dest_set() on the widget any more. Drag source cleanup will follow... Renamed silly function names gimp_gtk_* to gimp_dnd_* * app/display/gimpdisplayshell.c * app/tools/gimpblendtool.c * app/widgets/gimpcolormapeditor.c * app/widgets/gimpcontainerview.c * app/widgets/gimpgradienteditor.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c * app/widgets/gimppreview.c * app/widgets/gimppaletteeditor.c * app/widgets/gimpselectioneditor.c * app/widgets/gimptoolbox-color-area.c * app/widgets/gimptoolbox-indicator-area.c * app/widgets/gimptoolbox.c * app/gui/about-dialog.c * app/gui/color-select.c * app/gui/device-status-dialog.c * app/gui/tool-options-dialog.c: changed accordingly. Removed all calls to gtk_drag_dest_set() and their GtkTargetEntry tables. * app/widgets/gimpchannellistitem.c: enabled some commented out dnd code (which will not work since dnd needs more love...) * app/widgets/gimpitemlistview.[ch]: added a third "gboolean interactive" parameter to GimpItemNewFunc. * app/gui/channels-commands.[ch] * app/gui/layers-commands.[ch] * app/gui/vectors-commands.[ch]: if the new_item_func is called with "interactive == FALSE", don't pop up a dialog but silently create a new item of the image's size. * app/widgets/gimpdrawablelistview.c: use the new feature to allow color and pattern drops to the "New" button, which creates a new layer/channel filled with the color/pattern. (special feature for drc ;-) * app/widgets/gimppaletteeditor.c: fixed event handling so we see the context menu again. Also, don't redraw on "expose", since GtkPreview does that for us.
2002-09-02 22:39:08 +08:00
void gimp_dnd_color_dest_add (GtkWidget *widget,
GimpDndDropColorFunc set_color_func,
gpointer data);
DND cleanup part 1: 2002-09-02 Michael Natterer <mitch@gimp.org> DND cleanup part 1: * app/widgets/gimpdnd.[ch]: changed all gimp_dnd_*_dest_set() and _unset() functions to _dest_add() and _dest_remove(). Switch from using static arrays of GtkTargetEntries to dynamic GtkTargetLists. The _add() and _remove() functions configure the drag dest automatically if not already done, so there is no need to call gtk_drag_dest_set() on the widget any more. Drag source cleanup will follow... Renamed silly function names gimp_gtk_* to gimp_dnd_* * app/display/gimpdisplayshell.c * app/tools/gimpblendtool.c * app/widgets/gimpcolormapeditor.c * app/widgets/gimpcontainerview.c * app/widgets/gimpgradienteditor.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c * app/widgets/gimppreview.c * app/widgets/gimppaletteeditor.c * app/widgets/gimpselectioneditor.c * app/widgets/gimptoolbox-color-area.c * app/widgets/gimptoolbox-indicator-area.c * app/widgets/gimptoolbox.c * app/gui/about-dialog.c * app/gui/color-select.c * app/gui/device-status-dialog.c * app/gui/tool-options-dialog.c: changed accordingly. Removed all calls to gtk_drag_dest_set() and their GtkTargetEntry tables. * app/widgets/gimpchannellistitem.c: enabled some commented out dnd code (which will not work since dnd needs more love...) * app/widgets/gimpitemlistview.[ch]: added a third "gboolean interactive" parameter to GimpItemNewFunc. * app/gui/channels-commands.[ch] * app/gui/layers-commands.[ch] * app/gui/vectors-commands.[ch]: if the new_item_func is called with "interactive == FALSE", don't pop up a dialog but silently create a new item of the image's size. * app/widgets/gimpdrawablelistview.c: use the new feature to allow color and pattern drops to the "New" button, which creates a new layer/channel filled with the color/pattern. (special feature for drc ;-) * app/widgets/gimppaletteeditor.c: fixed event handling so we see the context menu again. Also, don't redraw on "expose", since GtkPreview does that for us.
2002-09-02 22:39:08 +08:00
void gimp_dnd_color_dest_remove (GtkWidget *widget);
/* stream dnd functions */
typedef guchar * (* GimpDndDragStreamFunc) (GtkWidget *widget,
gsize *stream_len,
gpointer data);
typedef void (* GimpDndDropStreamFunc) (GtkWidget *widget,
gint x,
gint y,
const guchar *stream,
gsize stream_len,
gpointer data);
void gimp_dnd_svg_source_add (GtkWidget *widget,
GimpDndDragStreamFunc get_svg_func,
gpointer data);
void gimp_dnd_svg_source_remove (GtkWidget *widget);
void gimp_dnd_svg_dest_add (GtkWidget *widget,
GimpDndDropStreamFunc set_svg_func,
gpointer data);
void gimp_dnd_svg_dest_remove (GtkWidget *widget);
Implement dragging and dropping in any GdkPixbuf supported format. Fixes 2005-04-09 Michael Natterer <mitch@gimp.org> Implement dragging and dropping in any GdkPixbuf supported format. Fixes bug #172794 and bug #172795. * app/core/gimplayer.[ch] (gimp_layer_new_from_region): new function which contains all stuff that was in gimp_layer_new_from_tiles(). (gimp_layer_new_from_tiles): use above function. (gimp_layer_new_from_pixbuf): new function. * app/widgets/Makefile.am * app/widgets/gimppixbuf.[ch]: new files containing GdkPixbuf utility functions for clipboard and DnD. * app/widgets/gimpselectiondata.[ch]: removed gimp_selection_data_set,get_pixbuf(), GTK+ provides the same API. Also removed GdkAtom parameters all over the place because it's always the same as selection_data->target. * app/widgets/gimpclipboard.c: use the new pixbuf utility functions and gtk_selection_data_set,get_pixbuf(). * app/widgets/widgets-enums.h * app/widgets/gimpdnd.[ch]: removed never-implemented GIMP_DND_TYPE_PNG and added a generic GIMP_DND_TYPE_PIXBUF instead. Added API to drag and drop GdkPixbufs which transparently converts from/to and GdkPixbuf-supported image format. Removed passing around of GdkAtoms, since they were always the same as selection_data->target. * app/widgets/gimpdnd-xds.[ch]: follow GdkAtom parameter removal. * app/widgets/gimpcontainertreeview.[ch]: added virtual function GimpContainerTreeView::drop_pixbuf(). * app/widgets/gimpcontainertreeview-dnd.c: dispatch drop_pixbuf(). * app/widgets/gimplayertreeview.c: implement drop_pixbuf(). * app/widgets/gimpdrawabletreeview.c: allow to drag all drawables as pixbufs. * app/display/gimpdisplayshell-dnd.c: allow dropping of pixbufs.
2005-04-10 01:56:04 +08:00
/* pixbuf dnd functions */
typedef GdkPixbuf * (* GimpDndDragPixbufFunc) (GtkWidget *widget,
gpointer data);
typedef void (* GimpDndDropPixbufFunc) (GtkWidget *widget,
gint x,
gint y,
GdkPixbuf *pixbuf,
gpointer data);
void gimp_dnd_pixbuf_source_add (GtkWidget *widget,
GimpDndDragPixbufFunc get_pixbuf_func,
gpointer data);
void gimp_dnd_pixbuf_source_remove (GtkWidget *widget);
void gimp_dnd_pixbuf_dest_add (GtkWidget *widget,
GimpDndDropPixbufFunc set_pixbuf_func,
gpointer data);
void gimp_dnd_pixbuf_dest_remove (GtkWidget *widget);
/* component dnd functions */
typedef GimpImage * (* GimpDndDragComponentFunc) (GtkWidget *widget,
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
GimpContext **context,
GimpChannelType *channel,
gpointer data);
typedef void (* GimpDndDropComponentFunc) (GtkWidget *widget,
gint x,
gint y,
GimpImage *image,
GimpChannelType channel,
gpointer data);
void gimp_dnd_component_source_add (GtkWidget *widget,
GimpDndDragComponentFunc get_comp_func,
gpointer data);
void gimp_dnd_component_source_remove (GtkWidget *widget);
void gimp_dnd_component_dest_add (GtkWidget *widget,
GimpDndDropComponentFunc set_comp_func,
gpointer data);
void gimp_dnd_component_dest_remove (GtkWidget *widget);
/* GimpViewable (by GType) dnd functions */
typedef GimpViewable * (* GimpDndDragViewableFunc) (GtkWidget *widget,
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
GimpContext **context,
gpointer data);
typedef void (* GimpDndDropViewableFunc) (GtkWidget *widget,
gint x,
gint y,
GimpViewable *viewable,
gpointer data);
Reimplemented the undo history: 2003-02-20 Michael Natterer <mitch@gimp.org> Reimplemented the undo history: * app/Makefile.am * app/undo_history.[ch]: removed. Changes/cleanups to the undo system to enable/simplify the new undo history implementation: * app/core/core-types.h: removed enum undo_event_t. Removed the GimpImage parameter from GimpUndoPopFunc and GimpUndoFreeFunc because GimpUndo has a GimpImage pointer now (see below). * app/core/core-enums.[ch]: added enum GimpUndoEvent. Added an enum value for REDO_EXPIRED. * app/core/gimpimage.[ch]: added a GimpUndo pointer to the "undo_event" signal which needs to be passed for all events except UNDO_FREE. * app/display/gimpdisplayshell-handlers.c: changed accordingly. * app/core/gimpundo.[ch]: added a GimpImage pointer to the GimpUndo struct. Removed GimpImage parameters all over the place. Added preview stuff. The preview creation needs to be triggered explicitly using gimp_undo_create_preview() because the GimpUndo can't know when it's possible to create the preview. * app/core/gimpimage-undo-push.c * app/paint/gimppaintcore-undo.c * app/tools/gimptransformtool-undo.c: changed accordingly, cleanup. * app/core/gimpundostack.[ch]: ditto. Return the freed undo from gimp_undo_stack_free_bottom(). Removed unused container signal handlers. * app/core/gimpimage-undo.c: free the redo stack the same way old undos are freed (from bottom up). Emit "undo_event" with event == REDO_EXPIRED for each removed redo. * app/core/gimpmarshal.list: added new marshallers. New undo history implementation: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpundoeditor.[ch] * app/widgets/gimpundopreview.[ch]: new widgets for the undo step previews and the history itself. * app/widgets/gimppreview-utils.c: added GimpUndoPreview to the list of possible preview types. * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c * app/gui/image-menu.c * app/gui/toolbox-menu.c: removed the old and added the new undo history to the dialog factory and the various dialog menus. * app/widgets/gimpdnd.[ch]: don't warn if a GType has no corresponding DND type. Instead, return FALSE from the function that failed. * app/widgets/gimppreview.c: check the return value of gimpdnd functions. Not only add drag sources but also remove them when no longer needed. * app/widgets/gimpselectioneditor.h: removed unneeded inclusion of "gui/gui-types.h".
2003-02-20 20:47:42 +08:00
gboolean gimp_dnd_drag_source_set_by_type (GtkWidget *widget,
GdkModifierType start_button_mask,
GType type,
GdkDragAction actions);
gboolean gimp_dnd_viewable_source_add (GtkWidget *widget,
Reimplemented the undo history: 2003-02-20 Michael Natterer <mitch@gimp.org> Reimplemented the undo history: * app/Makefile.am * app/undo_history.[ch]: removed. Changes/cleanups to the undo system to enable/simplify the new undo history implementation: * app/core/core-types.h: removed enum undo_event_t. Removed the GimpImage parameter from GimpUndoPopFunc and GimpUndoFreeFunc because GimpUndo has a GimpImage pointer now (see below). * app/core/core-enums.[ch]: added enum GimpUndoEvent. Added an enum value for REDO_EXPIRED. * app/core/gimpimage.[ch]: added a GimpUndo pointer to the "undo_event" signal which needs to be passed for all events except UNDO_FREE. * app/display/gimpdisplayshell-handlers.c: changed accordingly. * app/core/gimpundo.[ch]: added a GimpImage pointer to the GimpUndo struct. Removed GimpImage parameters all over the place. Added preview stuff. The preview creation needs to be triggered explicitly using gimp_undo_create_preview() because the GimpUndo can't know when it's possible to create the preview. * app/core/gimpimage-undo-push.c * app/paint/gimppaintcore-undo.c * app/tools/gimptransformtool-undo.c: changed accordingly, cleanup. * app/core/gimpundostack.[ch]: ditto. Return the freed undo from gimp_undo_stack_free_bottom(). Removed unused container signal handlers. * app/core/gimpimage-undo.c: free the redo stack the same way old undos are freed (from bottom up). Emit "undo_event" with event == REDO_EXPIRED for each removed redo. * app/core/gimpmarshal.list: added new marshallers. New undo history implementation: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpundoeditor.[ch] * app/widgets/gimpundopreview.[ch]: new widgets for the undo step previews and the history itself. * app/widgets/gimppreview-utils.c: added GimpUndoPreview to the list of possible preview types. * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c * app/gui/image-menu.c * app/gui/toolbox-menu.c: removed the old and added the new undo history to the dialog factory and the various dialog menus. * app/widgets/gimpdnd.[ch]: don't warn if a GType has no corresponding DND type. Instead, return FALSE from the function that failed. * app/widgets/gimppreview.c: check the return value of gimpdnd functions. Not only add drag sources but also remove them when no longer needed. * app/widgets/gimpselectioneditor.h: removed unneeded inclusion of "gui/gui-types.h".
2003-02-20 20:47:42 +08:00
GType type,
GimpDndDragViewableFunc get_viewable_func,
gpointer data);
gboolean gimp_dnd_viewable_source_remove (GtkWidget *widget,
Reimplemented the undo history: 2003-02-20 Michael Natterer <mitch@gimp.org> Reimplemented the undo history: * app/Makefile.am * app/undo_history.[ch]: removed. Changes/cleanups to the undo system to enable/simplify the new undo history implementation: * app/core/core-types.h: removed enum undo_event_t. Removed the GimpImage parameter from GimpUndoPopFunc and GimpUndoFreeFunc because GimpUndo has a GimpImage pointer now (see below). * app/core/core-enums.[ch]: added enum GimpUndoEvent. Added an enum value for REDO_EXPIRED. * app/core/gimpimage.[ch]: added a GimpUndo pointer to the "undo_event" signal which needs to be passed for all events except UNDO_FREE. * app/display/gimpdisplayshell-handlers.c: changed accordingly. * app/core/gimpundo.[ch]: added a GimpImage pointer to the GimpUndo struct. Removed GimpImage parameters all over the place. Added preview stuff. The preview creation needs to be triggered explicitly using gimp_undo_create_preview() because the GimpUndo can't know when it's possible to create the preview. * app/core/gimpimage-undo-push.c * app/paint/gimppaintcore-undo.c * app/tools/gimptransformtool-undo.c: changed accordingly, cleanup. * app/core/gimpundostack.[ch]: ditto. Return the freed undo from gimp_undo_stack_free_bottom(). Removed unused container signal handlers. * app/core/gimpimage-undo.c: free the redo stack the same way old undos are freed (from bottom up). Emit "undo_event" with event == REDO_EXPIRED for each removed redo. * app/core/gimpmarshal.list: added new marshallers. New undo history implementation: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpundoeditor.[ch] * app/widgets/gimpundopreview.[ch]: new widgets for the undo step previews and the history itself. * app/widgets/gimppreview-utils.c: added GimpUndoPreview to the list of possible preview types. * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c * app/gui/image-menu.c * app/gui/toolbox-menu.c: removed the old and added the new undo history to the dialog factory and the various dialog menus. * app/widgets/gimpdnd.[ch]: don't warn if a GType has no corresponding DND type. Instead, return FALSE from the function that failed. * app/widgets/gimppreview.c: check the return value of gimpdnd functions. Not only add drag sources but also remove them when no longer needed. * app/widgets/gimpselectioneditor.h: removed unneeded inclusion of "gui/gui-types.h".
2003-02-20 20:47:42 +08:00
GType type);
gboolean gimp_dnd_drag_dest_set_by_type (GtkWidget *widget,
GtkDestDefaults flags,
GType type,
gboolean list_accepted,
Reimplemented the undo history: 2003-02-20 Michael Natterer <mitch@gimp.org> Reimplemented the undo history: * app/Makefile.am * app/undo_history.[ch]: removed. Changes/cleanups to the undo system to enable/simplify the new undo history implementation: * app/core/core-types.h: removed enum undo_event_t. Removed the GimpImage parameter from GimpUndoPopFunc and GimpUndoFreeFunc because GimpUndo has a GimpImage pointer now (see below). * app/core/core-enums.[ch]: added enum GimpUndoEvent. Added an enum value for REDO_EXPIRED. * app/core/gimpimage.[ch]: added a GimpUndo pointer to the "undo_event" signal which needs to be passed for all events except UNDO_FREE. * app/display/gimpdisplayshell-handlers.c: changed accordingly. * app/core/gimpundo.[ch]: added a GimpImage pointer to the GimpUndo struct. Removed GimpImage parameters all over the place. Added preview stuff. The preview creation needs to be triggered explicitly using gimp_undo_create_preview() because the GimpUndo can't know when it's possible to create the preview. * app/core/gimpimage-undo-push.c * app/paint/gimppaintcore-undo.c * app/tools/gimptransformtool-undo.c: changed accordingly, cleanup. * app/core/gimpundostack.[ch]: ditto. Return the freed undo from gimp_undo_stack_free_bottom(). Removed unused container signal handlers. * app/core/gimpimage-undo.c: free the redo stack the same way old undos are freed (from bottom up). Emit "undo_event" with event == REDO_EXPIRED for each removed redo. * app/core/gimpmarshal.list: added new marshallers. New undo history implementation: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpundoeditor.[ch] * app/widgets/gimpundopreview.[ch]: new widgets for the undo step previews and the history itself. * app/widgets/gimppreview-utils.c: added GimpUndoPreview to the list of possible preview types. * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c * app/gui/image-menu.c * app/gui/toolbox-menu.c: removed the old and added the new undo history to the dialog factory and the various dialog menus. * app/widgets/gimpdnd.[ch]: don't warn if a GType has no corresponding DND type. Instead, return FALSE from the function that failed. * app/widgets/gimppreview.c: check the return value of gimpdnd functions. Not only add drag sources but also remove them when no longer needed. * app/widgets/gimpselectioneditor.h: removed unneeded inclusion of "gui/gui-types.h".
2003-02-20 20:47:42 +08:00
GdkDragAction actions);
gboolean gimp_dnd_viewable_dest_add (GtkWidget *widget,
GType type,
GimpDndDropViewableFunc set_viewable_func,
gpointer data);
gboolean gimp_dnd_viewable_dest_remove (GtkWidget *widget,
GType type);
GimpViewable * gimp_dnd_get_drag_viewable (GtkWidget *widget);
/* GimpViewable (by GType) GList dnd functions */
typedef GList * (* GimpDndDragViewableListFunc) (GtkWidget *widget,
GimpContext **context,
gpointer data);
typedef void (* GimpDndDropViewableListFunc) (GtkWidget *widget,
gint x,
gint y,
GList *viewables,
gpointer data);
gboolean gimp_dnd_viewable_list_source_add (GtkWidget *widget,
GType type,
GimpDndDragViewableListFunc get_viewable_list_func,
gpointer data);
gboolean gimp_dnd_viewable_list_source_remove (GtkWidget *widget,
GType type);
gboolean gimp_dnd_viewable_list_dest_add (GtkWidget *widget,
GType type,
GimpDndDropViewableListFunc set_viewable_func,
gpointer data);
gboolean gimp_dnd_viewable_list_dest_remove (GtkWidget *widget,
GType type);
GList * gimp_dnd_get_drag_list (GtkWidget *widget);
1999-10-28 23:05:49 +08:00
/* Direct Save Protocol (XDS) */
void gimp_dnd_xds_source_add (GtkWidget *widget,
GimpDndDragViewableFunc get_image_func,
gpointer data);
void gimp_dnd_xds_source_remove (GtkWidget *widget);
#endif /* __GIMP_DND_H__ */