home *** CD-ROM | disk | FTP | other *** search
/ Chip 2005 February / CMCD0205.ISO / Linux / gimp-2.2.0.tar.gz / gimp-2.2.0.tar / gimp-2.2.0 / libgimpwidgets / gimpcolorscale.h < prev    next >
C/C++ Source or Header  |  2004-01-28  |  3KB  |  90 lines

  1. /* LIBGIMP - The GIMP Library
  2.  * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
  3.  *
  4.  * gimpcolorscale.h
  5.  * Copyright (C) 2002  Sven Neumann <sven@gimp.org>
  6.  *                     Michael Natterer <mitch@gimp.org>
  7.  *
  8.  * This library is free software; you can redistribute it and/or
  9.  * modify it under the terms of the GNU Lesser General Public
  10.  * License as published by the Free Software Foundation; either
  11.  * version 2 of the License, or (at your option) any later version.
  12.  *
  13.  * This library is distributed in the hope that it will be useful,
  14.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  16.  * Lesser General Public License for more details.
  17.  *
  18.  * You should have received a copy of the GNU Lesser General Public
  19.  * License along with this library; if not, write to the
  20.  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  21.  * Boston, MA 02111-1307, USA.
  22.  */
  23.  
  24. /* This provides a color preview area. The preview
  25.  * can handle transparency by showing the checkerboard and
  26.  * handles drag'n'drop.
  27.  */
  28.  
  29. #ifndef __GIMP_COLOR_SCALE_H__
  30. #define __GIMP_COLOR_SCALE_H__
  31.  
  32. #include <gtk/gtkscale.h>
  33.  
  34. G_BEGIN_DECLS
  35.  
  36.  
  37. #define GIMP_TYPE_COLOR_SCALE            (gimp_color_scale_get_type ())
  38. #define GIMP_COLOR_SCALE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_COLOR_SCALE, GimpColorScale))
  39. #define GIMP_COLOR_SCALE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_COLOR_SCALE, GimpColorScaleClass))
  40. #define GIMP_IS_COLOR_SCALE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_COLOR_SCALE))
  41. #define GIMP_IS_COLOR_SCALE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_COLOR_SCALE))
  42. #define GIMP_COLOR_SCALE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_COLOR_SCALE, GimpColorScaleClass))
  43.  
  44.  
  45. typedef struct _GimpColorScaleClass  GimpColorScaleClass;
  46.  
  47. struct _GimpColorScale
  48. {
  49.   GtkScale                  parent_instance;
  50.  
  51.   /*< private >*/
  52.   GimpColorSelectorChannel  channel;
  53.   GimpRGB                   rgb;
  54.   GimpHSV                   hsv;
  55.  
  56.   guchar                   *buf;
  57.   guint                     width;
  58.   guint                     height;
  59.   guint                     rowstride;
  60.  
  61.   gboolean                  needs_render;
  62. };
  63.  
  64. struct _GimpColorScaleClass
  65. {
  66.   GtkScaleClass             parent_class;
  67.  
  68.   /* Padding for future expansion */
  69.   void (* _gimp_reserved1) (void);
  70.   void (* _gimp_reserved2) (void);
  71.   void (* _gimp_reserved3) (void);
  72.   void (* _gimp_reserved4) (void);
  73. };
  74.  
  75.  
  76. GType       gimp_color_scale_get_type    (void) G_GNUC_CONST;
  77. GtkWidget * gimp_color_scale_new         (GtkOrientation            orientation,
  78.                                           GimpColorSelectorChannel  channel);
  79.  
  80. void        gimp_color_scale_set_channel (GimpColorScale           *scale,
  81.                                           GimpColorSelectorChannel  channel);
  82. void        gimp_color_scale_set_color   (GimpColorScale           *scale,
  83.                                           const GimpRGB            *rgb,
  84.                                           const GimpHSV            *hsv);
  85.  
  86.  
  87. G_END_DECLS
  88.  
  89. #endif /* __GIMP_COLOR_SCALE_H__ */
  90.