1999-08-20 03:53:30 +08:00
|
|
|
/* The GIMP -- an 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 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
2000-12-17 05:37:03 +08:00
|
|
|
|
1999-08-20 03:53:30 +08:00
|
|
|
#ifndef __GIMP_DND_H__
|
|
|
|
#define __GIMP_DND_H__
|
|
|
|
|
1999-08-21 03:59:06 +08:00
|
|
|
|
1999-08-20 03:53:30 +08:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
GIMP_DND_TYPE_URI_LIST,
|
|
|
|
GIMP_DND_TYPE_TEXT_PLAIN,
|
|
|
|
GIMP_DND_TYPE_NETSCAPE_URL,
|
1999-08-21 03:59:06 +08:00
|
|
|
GIMP_DND_TYPE_IMAGE,
|
1999-08-20 03:53:30 +08:00
|
|
|
GIMP_DND_TYPE_LAYER,
|
|
|
|
GIMP_DND_TYPE_CHANNEL,
|
1999-08-21 03:59:06 +08:00
|
|
|
GIMP_DND_TYPE_LAYER_MASK,
|
|
|
|
GIMP_DND_TYPE_COMPONENT,
|
1999-08-22 19:45:31 +08:00
|
|
|
GIMP_DND_TYPE_PATH,
|
1999-09-04 22:56:50 +08:00
|
|
|
GIMP_DND_TYPE_COLOR,
|
|
|
|
GIMP_DND_TYPE_BRUSH,
|
|
|
|
GIMP_DND_TYPE_PATTERN,
|
1999-10-28 23:05:49 +08:00
|
|
|
GIMP_DND_TYPE_GRADIENT,
|
|
|
|
GIMP_DND_TYPE_PALETTE,
|
2001-06-26 20:09:43 +08:00
|
|
|
GIMP_DND_TYPE_BUFFER,
|
2001-04-11 00:03:40 +08:00
|
|
|
GIMP_DND_TYPE_TOOL,
|
|
|
|
GIMP_DND_TYPE_DIALOG
|
1999-08-20 03:53:30 +08:00
|
|
|
};
|
|
|
|
|
2001-02-10 05:49:47 +08:00
|
|
|
|
1999-08-20 03:53:30 +08: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 }
|
|
|
|
|
1999-08-21 03:59:06 +08:00
|
|
|
#define GIMP_TARGET_IMAGE \
|
|
|
|
{ "GIMP_IMAGE", GTK_TARGET_SAME_APP, GIMP_DND_TYPE_IMAGE }
|
|
|
|
|
1999-08-20 03:53:30 +08:00
|
|
|
#define GIMP_TARGET_LAYER \
|
|
|
|
{ "GIMP_LAYER", GTK_TARGET_SAME_APP, GIMP_DND_TYPE_LAYER }
|
|
|
|
|
|
|
|
#define GIMP_TARGET_CHANNEL \
|
|
|
|
{ "GIMP_CHANNEL", GTK_TARGET_SAME_APP, GIMP_DND_TYPE_CHANNEL }
|
|
|
|
|
|
|
|
#define GIMP_TARGET_LAYER_MASK \
|
|
|
|
{ "GIMP_LAYER_MASK", GTK_TARGET_SAME_APP, GIMP_DND_TYPE_LAYER_MASK }
|
|
|
|
|
1999-08-21 03:59:06 +08:00
|
|
|
#define GIMP_TARGET_COMPONENT \
|
|
|
|
{ "GIMP_COMPONENT", GTK_TARGET_SAME_APP, GIMP_DND_TYPE_COMPONENT }
|
|
|
|
|
|
|
|
#define GIMP_TARGET_PATH \
|
|
|
|
{ "GIMP_PATH", GTK_TARGET_SAME_APP, GIMP_DND_TYPE_PATH }
|
|
|
|
|
1999-08-22 19:45:31 +08:00
|
|
|
#define GIMP_TARGET_COLOR \
|
|
|
|
{ "application/x-color", 0, GIMP_DND_TYPE_COLOR }
|
|
|
|
|
1999-09-04 22:56:50 +08:00
|
|
|
#define GIMP_TARGET_BRUSH \
|
|
|
|
{ "GIMP_BRUSH", 0, GIMP_DND_TYPE_BRUSH }
|
|
|
|
|
|
|
|
#define GIMP_TARGET_PATTERN \
|
|
|
|
{ "GIMP_PATTERN", 0, GIMP_DND_TYPE_PATTERN }
|
|
|
|
|
|
|
|
#define GIMP_TARGET_GRADIENT \
|
|
|
|
{ "GIMP_GRADIENT", 0, GIMP_DND_TYPE_GRADIENT }
|
|
|
|
|
1999-10-28 23:05:49 +08:00
|
|
|
#define GIMP_TARGET_PALETTE \
|
|
|
|
{ "GIMP_PALETTE", 0, GIMP_DND_TYPE_PALETTE }
|
|
|
|
|
2001-06-26 20:09:43 +08:00
|
|
|
#define GIMP_TARGET_BUFFER \
|
|
|
|
{ "GIMP_BUFFER", 0, GIMP_DND_TYPE_BUFFER }
|
|
|
|
|
1999-10-28 23:05:49 +08:00
|
|
|
#define GIMP_TARGET_TOOL \
|
|
|
|
{ "GIMP_TOOL", GTK_TARGET_SAME_APP, GIMP_DND_TYPE_TOOL }
|
|
|
|
|
2001-04-11 00:03:40 +08:00
|
|
|
#define GIMP_TARGET_DIALOG \
|
|
|
|
{ "GIMP_DIALOG", GTK_TARGET_SAME_APP, GIMP_DND_TYPE_DIALOG }
|
|
|
|
|
1999-08-21 03:59:06 +08:00
|
|
|
|
2001-05-01 22:58:13 +08:00
|
|
|
/* file / url dnd functions */
|
|
|
|
|
|
|
|
typedef void (* GimpDndDropFileFunc) (GtkWidget *widget,
|
|
|
|
GList *files,
|
|
|
|
gpointer data);
|
|
|
|
|
|
|
|
void gimp_dnd_file_dest_set (GtkWidget *widget,
|
|
|
|
GimpDndDropFileFunc set_file_func,
|
|
|
|
gpointer data);
|
|
|
|
void gimp_dnd_file_dest_unset (GtkWidget *widget);
|
|
|
|
|
|
|
|
/* standard callback */
|
|
|
|
void gimp_dnd_open_files (GtkWidget *widget,
|
|
|
|
GList *files,
|
|
|
|
gpointer data);
|
|
|
|
|
|
|
|
|
1999-08-23 22:19:26 +08:00
|
|
|
/* color dnd functions */
|
|
|
|
|
2001-01-20 23:37:26 +08:00
|
|
|
typedef void (* GimpDndDropColorFunc) (GtkWidget *widget,
|
|
|
|
const GimpRGB *color,
|
|
|
|
gpointer data);
|
|
|
|
typedef void (* GimpDndDragColorFunc) (GtkWidget *widget,
|
|
|
|
GimpRGB *color,
|
|
|
|
gpointer data);
|
2000-04-01 02:10:25 +08:00
|
|
|
|
|
|
|
void gimp_dnd_color_source_set (GtkWidget *widget,
|
|
|
|
GimpDndDragColorFunc get_color_func,
|
|
|
|
gpointer data);
|
|
|
|
void gimp_dnd_color_dest_set (GtkWidget *widget,
|
|
|
|
GimpDndDropColorFunc set_color_func,
|
|
|
|
gpointer data);
|
2001-02-10 05:49:47 +08:00
|
|
|
void gimp_dnd_color_dest_unset (GtkWidget *widget);
|
|
|
|
|
|
|
|
|
|
|
|
/* GimpViewable (by GtkType) dnd functions */
|
|
|
|
|
2001-02-19 03:44:28 +08:00
|
|
|
typedef void (* GimpDndDropViewableFunc) (GtkWidget *widget,
|
|
|
|
GimpViewable *viewable,
|
|
|
|
gpointer data);
|
|
|
|
typedef GimpViewable * (* GimpDndDragViewableFunc) (GtkWidget *widget,
|
|
|
|
gpointer data);
|
|
|
|
|
|
|
|
void gimp_gtk_drag_source_set_by_type (GtkWidget *widget,
|
|
|
|
GdkModifierType start_button_mask,
|
|
|
|
GtkType type,
|
|
|
|
GdkDragAction actions);
|
|
|
|
void gimp_gtk_drag_dest_set_by_type (GtkWidget *widget,
|
|
|
|
GtkDestDefaults flags,
|
|
|
|
GtkType type,
|
|
|
|
GdkDragAction actions);
|
|
|
|
|
|
|
|
void gimp_dnd_viewable_source_set (GtkWidget *widget,
|
|
|
|
GtkType type,
|
|
|
|
GimpDndDragViewableFunc get_viewable_func,
|
|
|
|
gpointer data);
|
2001-03-05 06:07:19 +08:00
|
|
|
void gimp_dnd_viewable_source_unset (GtkWidget *widget,
|
|
|
|
GtkType type);
|
2001-02-19 03:44:28 +08:00
|
|
|
void gimp_dnd_viewable_dest_set (GtkWidget *widget,
|
|
|
|
GtkType type,
|
|
|
|
GimpDndDropViewableFunc set_viewable_func,
|
|
|
|
gpointer data);
|
|
|
|
void gimp_dnd_viewable_dest_unset (GtkWidget *widget,
|
|
|
|
GtkType type);
|
2001-02-10 05:49:47 +08:00
|
|
|
|
2001-03-04 07:23:36 +08:00
|
|
|
GimpViewable * gimp_dnd_get_drag_data (GtkWidget *widget);
|
|
|
|
|
1999-10-28 23:05:49 +08:00
|
|
|
|
1999-08-20 03:53:30 +08:00
|
|
|
#endif /* __GIMP_DND_H__ */
|