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 / gimpsizeentry.h < prev    next >
C/C++ Source or Header  |  2004-05-18  |  5KB  |  149 lines

  1. /* LIBGIMP - The GIMP Library
  2.  * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
  3.  *
  4.  * gimpsizeentry.h
  5.  * Copyright (C) 1999-2000 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. #ifndef __GIMP_SIZE_ENTRY_H__
  25. #define __GIMP_SIZE_ENTRY_H__
  26.  
  27. G_BEGIN_DECLS
  28.  
  29. /* For information look into the C source or the html documentation */
  30.  
  31.  
  32. #define GIMP_TYPE_SIZE_ENTRY            (gimp_size_entry_get_type ())
  33. #define GIMP_SIZE_ENTRY(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_SIZE_ENTRY, GimpSizeEntry))
  34. #define GIMP_SIZE_ENTRY_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_SIZE_ENTRY, GimpSizeEntryClass))
  35. #define GIMP_IS_SIZE_ENTRY(obj)         (G_TYPE_CHECK_INSTANCE_TYPE (obj, GIMP_TYPE_SIZE_ENTRY))
  36. #define GIMP_IS_SIZE_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_SIZE_ENTRY))
  37. #define GIMP_SIZE_ENTRY_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_SIZE_ENTRY, GimpSizeEntryClass))
  38.  
  39.  
  40. typedef struct _GimpSizeEntryClass  GimpSizeEntryClass;
  41.  
  42. typedef struct _GimpSizeEntryField  GimpSizeEntryField;
  43.  
  44. struct _GimpSizeEntry
  45. {
  46.   GtkTable   parent_instance;
  47.  
  48.   GSList    *fields;
  49.   gint       number_of_fields;
  50.  
  51.   GtkWidget *unitmenu;
  52.   GimpUnit   unit;
  53.   gboolean   menu_show_pixels;
  54.   gboolean   menu_show_percent;
  55.  
  56.   gboolean                   show_refval;
  57.   GimpSizeEntryUpdatePolicy  update_policy;
  58. };
  59.  
  60. struct _GimpSizeEntryClass
  61. {
  62.   GtkTableClass  parent_class;
  63.  
  64.   void (* value_changed)  (GimpSizeEntry *gse);
  65.   void (* refval_changed) (GimpSizeEntry *gse);
  66.   void (* unit_changed)   (GimpSizeEntry *gse);
  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. /* For information look into the C source or the html documentation */
  77.  
  78. GType       gimp_size_entry_get_type (void) G_GNUC_CONST;
  79.  
  80. GtkWidget * gimp_size_entry_new (gint                       number_of_fields,
  81.                  GimpUnit                   unit,
  82.                  const gchar               *unit_format,
  83.                  gboolean                   menu_show_pixels,
  84.                  gboolean                   menu_show_percent,
  85.                  gboolean                   show_refval,
  86.                  gint                       spinbutton_width,
  87.                  GimpSizeEntryUpdatePolicy  update_policy);
  88.  
  89. void        gimp_size_entry_add_field  (GimpSizeEntry   *gse,
  90.                     GtkSpinButton   *value_spinbutton,
  91.                     GtkSpinButton   *refval_spinbutton);
  92.  
  93. GtkWidget * gimp_size_entry_attach_label          (GimpSizeEntry *gse,
  94.                            const gchar   *text,
  95.                            gint           row,
  96.                            gint           column,
  97.                            gfloat         alignment);
  98.  
  99. void        gimp_size_entry_set_resolution        (GimpSizeEntry *gse,
  100.                                gint           field,
  101.                                gdouble        resolution,
  102.                            gboolean       keep_size);
  103.  
  104. void        gimp_size_entry_set_size              (GimpSizeEntry *gse,
  105.                                gint           field,
  106.                                gdouble        lower,
  107.                            gdouble        upper);
  108.  
  109. void        gimp_size_entry_set_value_boundaries  (GimpSizeEntry *gse,
  110.                            gint           field,
  111.                            gdouble        lower,
  112.                            gdouble        upper);
  113.  
  114. gdouble     gimp_size_entry_get_value             (GimpSizeEntry *gse,
  115.                                gint           field);
  116. void        gimp_size_entry_set_value             (GimpSizeEntry *gse,
  117.                                gint           field,
  118.                                gdouble        value);
  119.  
  120. void        gimp_size_entry_set_refval_boundaries (GimpSizeEntry *gse,
  121.                            gint           field,
  122.                            gdouble        lower,
  123.                            gdouble        upper);
  124. void        gimp_size_entry_set_refval_digits     (GimpSizeEntry *gse,
  125.                                gint           field,
  126.                                gint           digits);
  127.  
  128. gdouble     gimp_size_entry_get_refval            (GimpSizeEntry *gse,
  129.                                gint           field);
  130. void        gimp_size_entry_set_refval            (GimpSizeEntry *gse,
  131.                                gint           field,
  132.                                gdouble        refval);
  133.  
  134. GimpUnit    gimp_size_entry_get_unit              (GimpSizeEntry *gse);
  135. void        gimp_size_entry_set_unit              (GimpSizeEntry *gse,
  136.                                GimpUnit       unit);
  137.  
  138. void        gimp_size_entry_set_pixel_digits      (GimpSizeEntry *gse,
  139.                                                    gint           digits);
  140.  
  141. void        gimp_size_entry_grab_focus            (GimpSizeEntry *gse);
  142. GtkWidget * gimp_size_entry_get_help_widget       (GimpSizeEntry *gse,
  143.                                                    gint           field);
  144.  
  145.  
  146. G_END_DECLS
  147.  
  148. #endif /* __GIMP_SIZE_ENTRY_H__ */
  149.