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 / gimppreviewarea.h < prev    next >
C/C++ Source or Header  |  2004-11-04  |  6KB  |  130 lines

  1. /* LIBGIMP - The GIMP Library
  2.  * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
  3.  *
  4.  * This library is free software; you can redistribute it and/or
  5.  * modify it under the terms of the GNU Lesser General Public
  6.  * License as published by the Free Software Foundation; either
  7.  * version 2 of the License, or (at your option) any later version.
  8.  *
  9.  * This library 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 GNU
  12.  * Lesser General Public License for more details.
  13.  *
  14.  * You should have received a copy of the GNU Lesser General Public
  15.  * License along with this library; if not, write to the
  16.  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  17.  * Boston, MA 02111-1307, USA.
  18.  */
  19.  
  20. #ifndef __GIMP_PREVIEW_AREA_H__
  21. #define __GIMP_PREVIEW_AREA_H__
  22.  
  23. #include <gtk/gtkdrawingarea.h>
  24.  
  25. G_BEGIN_DECLS
  26.  
  27.  
  28. #define GIMP_TYPE_PREVIEW_AREA            (gimp_preview_area_get_type ())
  29. #define GIMP_PREVIEW_AREA(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_PREVIEW_AREA, GimpPreviewArea))
  30. #define GIMP_PREVIEW_AREA_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_PREVIEW_AREA, GimpPreviewAreaClass))
  31. #define GIMP_IS_PREVIEW_AREA(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_PREVIEW_AREA))
  32. #define GIMP_IS_PREVIEW_AREA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_PREVIEW_AREA))
  33. #define GIMP_PREVIEW_AREA_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_PREVIEW_AREA, GimpPreviewArea))
  34.  
  35.  
  36. typedef struct _GimpPreviewAreaClass  GimpPreviewAreaClass;
  37.  
  38. struct _GimpPreviewArea
  39. {
  40.   GtkDrawingArea   parent_instance;
  41.  
  42.   GimpCheckSize    check_size;
  43.   GimpCheckType    check_type;
  44.   gint             width;
  45.   gint             height;
  46.   gint             rowstride;
  47.   gint             offset_x;
  48.   gint             offset_y;
  49.   gint             max_width;
  50.   gint             max_height;
  51.   guchar          *buf;
  52.   guchar          *colormap;
  53. };
  54.  
  55. struct _GimpPreviewAreaClass
  56. {
  57.   GtkDrawingAreaClass  parent_class;
  58.  
  59.   /* Padding for future expansion */
  60.   void (* _gimp_reserved1) (void);
  61.   void (* _gimp_reserved2) (void);
  62.   void (* _gimp_reserved3) (void);
  63.   void (* _gimp_reserved4) (void);
  64. };
  65.  
  66.  
  67. GType       gimp_preview_area_get_type       (void) G_GNUC_CONST;
  68.  
  69. GtkWidget * gimp_preview_area_new            (void);
  70.  
  71. void        gimp_preview_area_draw           (GimpPreviewArea *area,
  72.                                               gint             x,
  73.                                               gint             y,
  74.                                               gint             width,
  75.                                               gint             height,
  76.                                               GimpImageType    type,
  77.                                               const guchar    *buf,
  78.                                               gint             rowstride);
  79. void        gimp_preview_area_blend          (GimpPreviewArea *area,
  80.                                               gint             x,
  81.                                               gint             y,
  82.                                               gint             width,
  83.                                               gint             height,
  84.                                               GimpImageType    type,
  85.                                               const guchar    *buf1,
  86.                                               gint             rowstride1,
  87.                                               const guchar    *buf2,
  88.                                               gint             rowstride2,
  89.                                               guchar           opacity);
  90. void        gimp_preview_area_mask           (GimpPreviewArea *area,
  91.                                               gint             x,
  92.                                               gint             y,
  93.                                               gint             width,
  94.                                               gint             height,
  95.                                               GimpImageType    type,
  96.                                               const guchar    *buf1,
  97.                                               gint             rowstride1,
  98.                                               const guchar    *buf2,
  99.                                               gint             rowstride2,
  100.                                               guchar          *mask,
  101.                                               gint             rowstride_mask);
  102. void        gimp_preview_area_fill           (GimpPreviewArea *area,
  103.                                               gint             x,
  104.                                               gint             y,
  105.                                               gint             width,
  106.                                               gint             height,
  107.                                               guchar           red,
  108.                                               guchar           green,
  109.                                               guchar           blue);
  110.  
  111. void        gimp_preview_area_set_offsets    (GimpPreviewArea *area,
  112.                                               gint             x,
  113.                                               gint             y);
  114.  
  115. void        gimp_preview_area_set_colormap   (GimpPreviewArea *area,
  116.                                               const guchar    *colormap,
  117.                                               gint             num_colors);
  118.  
  119. void        gimp_preview_area_set_max_size   (GimpPreviewArea *area,
  120.                                               gint             width,
  121.                                               gint             height);
  122.  
  123. void        gimp_preview_area_menu_popup     (GimpPreviewArea *area,
  124.                                               GdkEventButton  *event);
  125.  
  126.  
  127. G_END_DECLS
  128.  
  129. #endif /* __GIMP_PREVIEW_AREA_H__ */
  130.