home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2002 April / pcpro0402.iso / essentials / graphics / Gimp / gimp-src-20001226.exe / src / gimp / app / gimpdnd.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-12-17  |  6.7 KB  |  207 lines

  1. /* The GIMP -- an image manipulation program
  2.  * Copyright (C) 1995-1997 Spencer Kimball and Peter Mattis
  3.  *
  4.  * This program is free software; you can redistribute it and/or modify
  5.  * it under the terms of the GNU General Public License as published by
  6.  * the Free Software Foundation; either version 2 of the License, or
  7.  * (at your option) any later version.
  8.  *
  9.  * This program is distributed in the hope that it will be useful,
  10.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12.  * GNU General Public License for more details.
  13.  *
  14.  * You should have received a copy of the GNU General Public License
  15.  * along with this program; if not, write to the Free Software
  16.  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17.  */
  18.  
  19. #ifndef __GIMP_DND_H__
  20. #define __GIMP_DND_H__
  21.  
  22.  
  23. #include "gimpbrush.h"
  24. #include "gimpdrawable.h"
  25. #include "palette_entries.h"
  26. #include "patterns.h"
  27. #include "gradient.h"
  28. #include "toolsF.h"
  29.  
  30. enum
  31. {
  32.   GIMP_DND_TYPE_URI_LIST,
  33.   GIMP_DND_TYPE_TEXT_PLAIN,
  34.   GIMP_DND_TYPE_NETSCAPE_URL,
  35.   GIMP_DND_TYPE_IMAGE,
  36.   GIMP_DND_TYPE_LAYER,
  37.   GIMP_DND_TYPE_CHANNEL,
  38.   GIMP_DND_TYPE_LAYER_MASK,
  39.   GIMP_DND_TYPE_COMPONENT,
  40.   GIMP_DND_TYPE_PATH,
  41.   GIMP_DND_TYPE_COLOR,
  42.   GIMP_DND_TYPE_BRUSH,
  43.   GIMP_DND_TYPE_PATTERN,
  44.   GIMP_DND_TYPE_GRADIENT,
  45.   GIMP_DND_TYPE_PALETTE,
  46.   GIMP_DND_TYPE_TOOL
  47. };
  48.  
  49. #define GIMP_TARGET_URI_LIST \
  50.         { "text/uri-list", 0, GIMP_DND_TYPE_URI_LIST }
  51.  
  52. #define GIMP_TARGET_TEXT_PLAIN \
  53.         { "text/plain", 0, GIMP_DND_TYPE_TEXT_PLAIN }
  54.  
  55. #define GIMP_TARGET_NETSCAPE_URL \
  56.         { "_NETSCAPE_URL", 0, GIMP_DND_TYPE_NETSCAPE_URL }
  57.  
  58. #define GIMP_TARGET_IMAGE \
  59.         { "GIMP_IMAGE", GTK_TARGET_SAME_APP, GIMP_DND_TYPE_IMAGE }
  60.  
  61. #define GIMP_TARGET_LAYER \
  62.         { "GIMP_LAYER", GTK_TARGET_SAME_APP, GIMP_DND_TYPE_LAYER }
  63.  
  64. #define GIMP_TARGET_CHANNEL \
  65.         { "GIMP_CHANNEL", GTK_TARGET_SAME_APP, GIMP_DND_TYPE_CHANNEL }
  66.  
  67. #define GIMP_TARGET_LAYER_MASK \
  68.         { "GIMP_LAYER_MASK", GTK_TARGET_SAME_APP, GIMP_DND_TYPE_LAYER_MASK }
  69.  
  70. #define GIMP_TARGET_COMPONENT \
  71.         { "GIMP_COMPONENT", GTK_TARGET_SAME_APP, GIMP_DND_TYPE_COMPONENT }
  72.  
  73. #define GIMP_TARGET_PATH \
  74.         { "GIMP_PATH", GTK_TARGET_SAME_APP, GIMP_DND_TYPE_PATH }
  75.  
  76. #define GIMP_TARGET_COLOR \
  77.         { "application/x-color", 0, GIMP_DND_TYPE_COLOR }
  78.  
  79. #define GIMP_TARGET_BRUSH \
  80.         { "GIMP_BRUSH", 0, GIMP_DND_TYPE_BRUSH }
  81.  
  82. #define GIMP_TARGET_PATTERN \
  83.         { "GIMP_PATTERN", 0, GIMP_DND_TYPE_PATTERN }
  84.  
  85. #define GIMP_TARGET_GRADIENT \
  86.         { "GIMP_GRADIENT", 0, GIMP_DND_TYPE_GRADIENT }
  87.  
  88. #define GIMP_TARGET_PALETTE \
  89.         { "GIMP_PALETTE", 0, GIMP_DND_TYPE_PALETTE }
  90.  
  91. #define GIMP_TARGET_TOOL \
  92.         { "GIMP_TOOL", GTK_TARGET_SAME_APP, GIMP_DND_TYPE_TOOL }
  93.  
  94. typedef enum
  95. {
  96.   GIMP_DROP_NONE,
  97.   GIMP_DROP_ABOVE,
  98.   GIMP_DROP_BELOW
  99. } GimpDropType;
  100.  
  101. /*  color dnd functions  */
  102.  
  103. typedef void (* GimpDndDropColorFunc) (GtkWidget *widget,
  104.                        guchar     r,
  105.                        guchar     g,
  106.                        guchar     b,
  107.                        gpointer   data);
  108. typedef void (* GimpDndDragColorFunc) (GtkWidget *widget,
  109.                        guchar    *r,
  110.                        guchar    *g,
  111.                        guchar    *b,
  112.                        gpointer   data);
  113.  
  114. void  gimp_dnd_color_source_set    (GtkWidget            *widget,
  115.                     GimpDndDragColorFunc  get_color_func,
  116.                     gpointer              data);
  117. void  gimp_dnd_color_dest_set      (GtkWidget            *widget,
  118.                     GimpDndDropColorFunc  set_color_func,
  119.                     gpointer              data);
  120.  
  121. /*  brush dnd functions  */
  122.  
  123. typedef void        (* GimpDndDropBrushFunc) (GtkWidget *widget,
  124.                           GimpBrush *brush,
  125.                           gpointer   data);
  126. typedef GimpBrush * (* GimpDndDragBrushFunc) (GtkWidget *widget,
  127.                           gpointer   data);
  128.  
  129. void  gimp_dnd_brush_source_set    (GtkWidget            *widget,
  130.                     GimpDndDragBrushFunc  get_brush_func,
  131.                     gpointer              data);
  132. void  gimp_dnd_brush_dest_set      (GtkWidget            *widget,
  133.                     GimpDndDropBrushFunc  set_brush_func,
  134.                     gpointer              data);
  135.  
  136. /*  pattern dnd functions  */
  137.  
  138. typedef void       (* GimpDndDropPatternFunc) (GtkWidget *widget,
  139.                            GPattern  *pattern,
  140.                            gpointer   data);
  141. typedef GPattern * (* GimpDndDragPatternFunc) (GtkWidget *widget,
  142.                            gpointer   data);
  143.  
  144. void  gimp_dnd_pattern_source_set  (GtkWidget              *widget,
  145.                     GimpDndDragPatternFunc  get_pattern_func,
  146.                     gpointer                data);
  147. void  gimp_dnd_pattern_dest_set    (GtkWidget              *widget,
  148.                     GimpDndDropPatternFunc  set_pattern_func,
  149.                     gpointer                data);
  150.  
  151. /*  gradient dnd functions  */
  152.  
  153. typedef void         (* GimpDndDropGradientFunc) (GtkWidget  *widget,
  154.                           gradient_t *gradient,
  155.                           gpointer    data);
  156. typedef gradient_t * (* GimpDndDragGradientFunc) (GtkWidget  *widget,
  157.                           gpointer    data);
  158.  
  159. void  gimp_dnd_gradient_source_set (GtkWidget               *widget,
  160.                     GimpDndDragGradientFunc  get_gradient_func,
  161.                     gpointer                 data);
  162. void  gimp_dnd_gradient_dest_set   (GtkWidget               *widget,
  163.                     GimpDndDropGradientFunc  set_gradient_func,
  164.                     gpointer                 data);
  165.  
  166. /*  palette dnd functions  */
  167.  
  168. typedef void             (* GimpDndDropPaletteFunc) (GtkWidget      *widget,
  169.                              PaletteEntries *palette,
  170.                              gpointer        data);
  171. typedef PaletteEntries * (* GimpDndDragPaletteFunc) (GtkWidget      *widget,
  172.                              gpointer        data);
  173.  
  174. void  gimp_dnd_palette_source_set  (GtkWidget              *widget,
  175.                     GimpDndDragPaletteFunc  get_palette_func,
  176.                     gpointer                data);
  177. void  gimp_dnd_palette_dest_set    (GtkWidget              *widget,
  178.                     GimpDndDropPaletteFunc  set_palette_func,
  179.                     gpointer                data);
  180.  
  181. /*  tool dnd functions  */
  182.  
  183. typedef void     (* GimpDndDropToolFunc) (GtkWidget *widget,
  184.                       ToolType   tool,
  185.                       gpointer   data);
  186. typedef ToolType (* GimpDndDragToolFunc) (GtkWidget *widget,
  187.                       gpointer   data); 
  188.  
  189. void  gimp_dnd_tool_source_set     (GtkWidget           *widget,
  190.                     GimpDndDragToolFunc  get_tool_func,
  191.                     gpointer             data);
  192. void  gimp_dnd_tool_dest_set       (GtkWidget           *widget,
  193.                     GimpDndDropToolFunc  set_tool_func,
  194.                     gpointer             data);
  195.  
  196. /*  drawable dnd functions  */
  197.  
  198. void  gimp_dnd_set_drawable_preview_icon (GtkWidget      *widget,
  199.                       GdkDragContext *context,
  200.                       GimpDrawable   *drawable);
  201.  
  202. /*  file / url dnd functions  */
  203.  
  204. void  gimp_dnd_file_dest_set (GtkWidget *widget);
  205.  
  206. #endif /* __GIMP_DND_H__ */
  207.