2006-12-09 21:33:38 +00:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
1999-08-19 19:53:30 +00:00
|
|
|
* Copyright (C) 1995-1997 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
2009-01-17 22:28:01 +00:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
1999-08-19 19:53:30 +00:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
2009-01-17 22:28:01 +00:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
1999-08-19 19:53:30 +00:00
|
|
|
* (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
|
2009-01-17 22:28:01 +00:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
1999-08-19 19:53:30 +00:00
|
|
|
*/
|
2000-12-16 21:37:03 +00:00
|
|
|
|
1999-08-19 19:53:30 +00:00
|
|
|
#ifndef __GIMP_DND_H__
|
|
|
|
#define __GIMP_DND_H__
|
|
|
|
|
1999-08-20 19:59:06 +00:00
|
|
|
|
1999-08-19 19:53:30 +00:00
|
|
|
#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 }
|
|
|
|
|
2005-03-25 14:23:35 +00:00
|
|
|
#define GIMP_TARGET_XDS \
|
|
|
|
{ "XdndDirectSave0", 0, GIMP_DND_TYPE_XDS }
|
|
|
|
|
2003-12-20 19:51:21 +00:00
|
|
|
#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 }
|
|
|
|
|
2005-04-09 17:56:04 +00: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 }
|
|
|
|
|
1999-08-20 19:59:06 +00:00
|
|
|
#define GIMP_TARGET_IMAGE \
|
2003-12-20 19:51:21 +00:00
|
|
|
{ "application/x-gimp-image-id", GTK_TARGET_SAME_APP, GIMP_DND_TYPE_IMAGE }
|
1999-08-20 19:59:06 +00:00
|
|
|
|
2005-01-15 02:24:38 +00:00
|
|
|
#define GIMP_TARGET_COMPONENT \
|
|
|
|
{ "application/x-gimp-component", GTK_TARGET_SAME_APP, GIMP_DND_TYPE_COMPONENT }
|
|
|
|
|
1999-08-19 19:53:30 +00:00
|
|
|
#define GIMP_TARGET_LAYER \
|
2003-12-20 19:51:21 +00:00
|
|
|
{ "application/x-gimp-layer-id", GTK_TARGET_SAME_APP, GIMP_DND_TYPE_LAYER }
|
1999-08-19 19:53:30 +00:00
|
|
|
|
|
|
|
#define GIMP_TARGET_CHANNEL \
|
2003-12-20 19:51:21 +00:00
|
|
|
{ "application/x-gimp-channel-id", GTK_TARGET_SAME_APP, GIMP_DND_TYPE_CHANNEL }
|
1999-08-19 19:53:30 +00:00
|
|
|
|
|
|
|
#define GIMP_TARGET_LAYER_MASK \
|
2003-12-20 19:51:21 +00:00
|
|
|
{ "application/x-gimp-layer-mask-id", GTK_TARGET_SAME_APP, GIMP_DND_TYPE_LAYER_MASK }
|
1999-08-19 19:53:30 +00:00
|
|
|
|
2002-02-25 17:58:50 +00:00
|
|
|
#define GIMP_TARGET_VECTORS \
|
2003-12-20 19:51:21 +00:00
|
|
|
{ "application/x-gimp-vectors-id", GTK_TARGET_SAME_APP, GIMP_DND_TYPE_VECTORS }
|
1999-08-22 11:45:31 +00:00
|
|
|
|
1999-09-04 14:56:50 +00:00
|
|
|
#define GIMP_TARGET_BRUSH \
|
2003-12-20 19:51:21 +00:00
|
|
|
{ "application/x-gimp-brush-name", 0, GIMP_DND_TYPE_BRUSH }
|
1999-09-04 14:56:50 +00:00
|
|
|
|
|
|
|
#define GIMP_TARGET_PATTERN \
|
2003-12-20 19:51:21 +00:00
|
|
|
{ "application/x-gimp-pattern-name", 0, GIMP_DND_TYPE_PATTERN }
|
1999-09-04 14:56:50 +00:00
|
|
|
|
|
|
|
#define GIMP_TARGET_GRADIENT \
|
2003-12-20 19:51:21 +00:00
|
|
|
{ "application/x-gimp-gradient-name", 0, GIMP_DND_TYPE_GRADIENT }
|
1999-09-04 14:56:50 +00:00
|
|
|
|
1999-10-28 15:05:49 +00:00
|
|
|
#define GIMP_TARGET_PALETTE \
|
2003-12-20 19:51:21 +00:00
|
|
|
{ "application/x-gimp-palette-name", 0, GIMP_DND_TYPE_PALETTE }
|
1999-10-28 15:05:49 +00:00
|
|
|
|
2003-03-26 01:27:23 +00:00
|
|
|
#define GIMP_TARGET_FONT \
|
2003-12-20 19:51:21 +00:00
|
|
|
{ "application/x-gimp-font-name", 0, GIMP_DND_TYPE_FONT }
|
2003-03-26 01:27:23 +00:00
|
|
|
|
2001-06-26 12:09:43 +00:00
|
|
|
#define GIMP_TARGET_BUFFER \
|
2003-12-20 19:51:21 +00:00
|
|
|
{ "application/x-gimp-buffer-name", GTK_TARGET_SAME_APP, GIMP_DND_TYPE_BUFFER }
|
2001-06-26 12:09:43 +00:00
|
|
|
|
2001-08-11 07:47:35 +00:00
|
|
|
#define GIMP_TARGET_IMAGEFILE \
|
2003-12-20 19:51:21 +00:00
|
|
|
{ "application/x-gimp-imagefile-name", GTK_TARGET_SAME_APP, GIMP_DND_TYPE_IMAGEFILE }
|
2001-08-11 07:47:35 +00:00
|
|
|
|
2003-04-05 19:56:38 +00:00
|
|
|
#define GIMP_TARGET_TEMPLATE \
|
2003-12-20 19:51:21 +00:00
|
|
|
{ "application/x-gimp-template-name", GTK_TARGET_SAME_APP, GIMP_DND_TYPE_TEMPLATE }
|
2003-04-05 19:56:38 +00:00
|
|
|
|
2005-07-25 13:53:00 +00:00
|
|
|
#define GIMP_TARGET_TOOL_INFO \
|
|
|
|
{ "application/x-gimp-tool-info-name", GTK_TARGET_SAME_APP, GIMP_DND_TYPE_TOOL_INFO }
|
2001-09-19 19:06:36 +00:00
|
|
|
|
2001-04-10 16:03:40 +00:00
|
|
|
#define GIMP_TARGET_DIALOG \
|
2003-12-20 19:51:21 +00:00
|
|
|
{ "application/x-gimp-dialog", GTK_TARGET_SAME_APP, GIMP_DND_TYPE_DIALOG }
|
2001-04-10 16:03:40 +00:00
|
|
|
|
1999-08-20 19:59:06 +00:00
|
|
|
|
2003-11-03 23:24:32 +00:00
|
|
|
/* dnd initialization */
|
|
|
|
|
|
|
|
void gimp_dnd_init (Gimp *gimp);
|
|
|
|
|
|
|
|
|
2005-03-25 14:23:35 +00:00
|
|
|
/* uri list dnd functions */
|
2004-06-30 14:47:23 +00:00
|
|
|
|
|
|
|
typedef GList * (* GimpDndDragUriListFunc) (GtkWidget *widget,
|
|
|
|
gpointer data);
|
|
|
|
typedef void (* GimpDndDropUriListFunc) (GtkWidget *widget,
|
2004-12-31 14:36:30 +00:00
|
|
|
gint x,
|
|
|
|
gint y,
|
2004-06-30 14:47:23 +00:00
|
|
|
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);
|
2001-05-01 14:58:13 +00:00
|
|
|
|
|
|
|
|
1999-08-23 14:19:26 +00:00
|
|
|
/* color dnd functions */
|
|
|
|
|
2001-01-20 15:37:26 +00:00
|
|
|
typedef void (* GimpDndDragColorFunc) (GtkWidget *widget,
|
2004-12-31 14:36:30 +00:00
|
|
|
GimpRGB *color,
|
|
|
|
gpointer data);
|
2003-11-20 16:26:15 +00:00
|
|
|
typedef void (* GimpDndDropColorFunc) (GtkWidget *widget,
|
2004-12-31 14:36:30 +00:00
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
const GimpRGB *color,
|
|
|
|
gpointer data);
|
2000-03-31 18:10:25 +00:00
|
|
|
|
2003-11-20 16:26:15 +00:00
|
|
|
void gimp_dnd_color_source_add (GtkWidget *widget,
|
2004-12-31 14:36:30 +00:00
|
|
|
GimpDndDragColorFunc get_color_func,
|
|
|
|
gpointer data);
|
2003-11-20 16:26:15 +00:00
|
|
|
void gimp_dnd_color_source_remove (GtkWidget *widget);
|
|
|
|
|
2002-09-02 14:39:08 +00:00
|
|
|
void gimp_dnd_color_dest_add (GtkWidget *widget,
|
2004-12-31 14:36:30 +00:00
|
|
|
GimpDndDropColorFunc set_color_func,
|
|
|
|
gpointer data);
|
2002-09-02 14:39:08 +00:00
|
|
|
void gimp_dnd_color_dest_remove (GtkWidget *widget);
|
2001-02-09 21:49:47 +00:00
|
|
|
|
|
|
|
|
2004-06-30 11:57:17 +00:00
|
|
|
/* stream dnd functions */
|
2003-12-20 19:51:21 +00:00
|
|
|
|
2004-06-30 11:57:17 +00:00
|
|
|
typedef guchar * (* GimpDndDragStreamFunc) (GtkWidget *widget,
|
|
|
|
gsize *stream_len,
|
|
|
|
gpointer data);
|
|
|
|
typedef void (* GimpDndDropStreamFunc) (GtkWidget *widget,
|
2004-12-31 14:36:30 +00:00
|
|
|
gint x,
|
|
|
|
gint y,
|
2004-06-30 11:57:17 +00:00
|
|
|
const guchar *stream,
|
|
|
|
gsize stream_len,
|
|
|
|
gpointer data);
|
2003-12-20 19:51:21 +00:00
|
|
|
|
2004-06-30 11:57:17 +00:00
|
|
|
void gimp_dnd_svg_source_add (GtkWidget *widget,
|
|
|
|
GimpDndDragStreamFunc get_svg_func,
|
|
|
|
gpointer data);
|
|
|
|
void gimp_dnd_svg_source_remove (GtkWidget *widget);
|
2003-12-20 19:51:21 +00:00
|
|
|
|
2004-06-30 11:57:17 +00:00
|
|
|
void gimp_dnd_svg_dest_add (GtkWidget *widget,
|
|
|
|
GimpDndDropStreamFunc set_svg_func,
|
|
|
|
gpointer data);
|
|
|
|
void gimp_dnd_svg_dest_remove (GtkWidget *widget);
|
2003-12-20 19:51:21 +00:00
|
|
|
|
|
|
|
|
2005-04-09 17:56:04 +00: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);
|
|
|
|
|
|
|
|
|
2005-01-15 02:24:38 +00:00
|
|
|
/* component dnd functions */
|
|
|
|
|
|
|
|
typedef GimpImage * (* GimpDndDragComponentFunc) (GtkWidget *widget,
|
2006-08-29 21:44:51 +00:00
|
|
|
GimpContext **context,
|
2005-01-15 02:24:38 +00:00
|
|
|
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);
|
|
|
|
|
|
|
|
|
2001-09-19 19:06:36 +00:00
|
|
|
/* GimpViewable (by GType) dnd functions */
|
2001-02-09 21:49:47 +00:00
|
|
|
|
2003-11-20 16:26:15 +00:00
|
|
|
typedef GimpViewable * (* GimpDndDragViewableFunc) (GtkWidget *widget,
|
2006-08-29 21:44:51 +00:00
|
|
|
GimpContext **context,
|
2004-12-31 14:36:30 +00:00
|
|
|
gpointer data);
|
2001-02-18 19:44:28 +00:00
|
|
|
typedef void (* GimpDndDropViewableFunc) (GtkWidget *widget,
|
2004-12-31 14:36:30 +00:00
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
GimpViewable *viewable,
|
|
|
|
gpointer data);
|
2001-02-18 19:44:28 +00:00
|
|
|
|
2001-09-19 19:06:36 +00:00
|
|
|
|
2003-02-20 12:47:42 +00:00
|
|
|
gboolean gimp_dnd_drag_source_set_by_type (GtkWidget *widget,
|
|
|
|
GdkModifierType start_button_mask,
|
|
|
|
GType type,
|
|
|
|
GdkDragAction actions);
|
2003-11-20 16:26:15 +00:00
|
|
|
gboolean gimp_dnd_viewable_source_add (GtkWidget *widget,
|
2003-02-20 12:47:42 +00:00
|
|
|
GType type,
|
|
|
|
GimpDndDragViewableFunc get_viewable_func,
|
|
|
|
gpointer data);
|
2003-11-20 16:26:15 +00:00
|
|
|
gboolean gimp_dnd_viewable_source_remove (GtkWidget *widget,
|
2003-02-20 12:47:42 +00:00
|
|
|
GType type);
|
|
|
|
|
|
|
|
gboolean gimp_dnd_drag_dest_set_by_type (GtkWidget *widget,
|
|
|
|
GtkDestDefaults flags,
|
|
|
|
GType type,
|
|
|
|
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_data (GtkWidget *widget);
|
2001-03-03 23:23:36 +00:00
|
|
|
|
1999-10-28 15:05:49 +00:00
|
|
|
|
2005-03-25 14:23:35 +00: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);
|
|
|
|
|
|
|
|
|
1999-08-19 19:53:30 +00:00
|
|
|
#endif /* __GIMP_DND_H__ */
|