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

  1. /* The GIMP -- an image manipulation program
  2.  * Copyright (C) 1995 Spencer Kimball and Peter Mattis
  3.  *
  4.  * GimpContextPreview Widget
  5.  * Copyright (C) 1999 Sven Neumann
  6.  *
  7.  * This program is free software; you can redistribute it and/or modify
  8.  * it under the terms of the GNU General Public License as published by
  9.  * the Free Software Foundation; either version 2 of the License, or
  10.  * (at your option) any later version.
  11.  *
  12.  * This program is distributed in the hope that it will be useful,
  13.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15.  * GNU General Public License for more details.
  16.  *
  17.  * You should have received a copy of the GNU General Public License
  18.  * along with this program; if not, write to the Free Software
  19.  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  20.  */
  21.  
  22. #ifndef __GIMP_CONTEXT_PREVIEW_H__
  23. #define __GIMP_CONTEXT_PREVIEW_H_
  24.  
  25. #include "gimpbrush.h"
  26. #include "gradient.h"
  27. #include "patterns.h"
  28.  
  29.  
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif /* __cplusplus */
  33.  
  34. #define GIMP_TYPE_CONTEXT_PREVIEW            (gimp_context_preview_get_type ())
  35. #define GIMP_CONTEXT_PREVIEW(obj)            (GTK_CHECK_CAST ((obj), GIMP_TYPE_CONTEXT_PREVIEW, GimpContextPreview))
  36. #define GIMP_CONTEXT_PREVIEW_CLASS(klass)    (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_CONTEXT_PREVIEW, GimpContextPreviewClass))
  37. #define GIMP_IS_CONTEXT_PREVIEW(obj)         (GTK_CHECK_TYPE (obj, GIMP_TYPE_CONTEXT_PREVIEW))
  38. #define GIMP_IS_CONTEXT_PREVIEW_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_CONTEXT_PREVIEW))
  39.  
  40. typedef struct _GimpContextPreview       GimpContextPreview;
  41. typedef struct _GimpContextPreviewClass  GimpContextPreviewClass;
  42.  
  43. typedef enum
  44. {
  45.   GCP_BRUSH = 0,
  46.   GCP_PATTERN,
  47.   GCP_GRADIENT,
  48.   GCP_LAST
  49. } GimpContextPreviewType;
  50.  
  51. struct _GimpContextPreview
  52. {
  53.   GtkPreview               preview;            /*  parent                              */
  54.  
  55.   gpointer                 data;               /*  brush|pattern|gradient              */
  56.   GimpContextPreviewType   type;               /*  GCP_BRUSH|GCP_PATTERN|GCP_GRADIENT  */
  57.   gint                     width;              /*  preview width                       */
  58.   gint                     height;             /*  preview_height                      */
  59.   gint                     popup_width;        /*  popup preview width                 */
  60.   gint                     popup_height;       /*  popup preview_height                */
  61.   gboolean                 show_popup;         /*  popup a larger preview on press     */
  62.   gboolean                 show_tooltips;      /*  install tooltips showing the name   */
  63. };
  64.  
  65. struct _GimpContextPreviewClass
  66. {
  67.   GtkPreviewClass parent_class;
  68.  
  69.   void (* clicked)  (GimpContextPreview *gbp);
  70. };
  71.  
  72. GtkType     gimp_context_preview_get_type (void);
  73. GtkWidget*  gimp_context_preview_new      (GimpContextPreviewType type,
  74.                        gint           width,
  75.                        gint           height,
  76.                        gboolean       show_popup,
  77.                        gboolean       show_tooltips,
  78.                        GtkSignalFunc  drop_data_callback,
  79.                        gpointer       drop_data_data);
  80.  
  81. void        gimp_context_preview_update   (GimpContextPreview *gcp,
  82.                        gpointer            data);
  83.  
  84. /*  TODO: move to another file (gimpdatapreview.[ch] ??)
  85.  *
  86.  *        finally, the contextpreview and dnd stuff should live in libgimp
  87.  *        and link to different data drawing functions when used from the
  88.  *        app and plugins.
  89.  */
  90.  
  91. void        draw_brush    (GtkPreview *preview,
  92.                GimpBrush  *brush,
  93.                gint        width,
  94.                gint        height,
  95.                gboolean    is_popup);
  96. void        draw_pattern  (GtkPreview *preview,
  97.                GPattern   *pattern,
  98.                gint        width,
  99.                gint        height);
  100. void        draw_gradient (GtkPreview *preview,
  101.                gradient_t *gradient,
  102.                gint        width,
  103.                gint        height);
  104.  
  105. #ifdef __cplusplus
  106. }
  107. #endif /* __cplusplus */
  108.  
  109. #endif /* __GIMP_CONTEXT_PREVIEW_H__ */
  110.