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 / gimpwidgets.h < prev    next >
C/C++ Source or Header  |  2004-11-23  |  11KB  |  291 lines

  1. /* LIBGIMP - The GIMP Library
  2.  * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
  3.  *
  4.  * gimpwidgets.h
  5.  * Copyright (C) 2000 Michael Natterer <mitch@gimp.org>
  6.  *
  7.  * This library is free software; you can redistribute it and/or
  8.  * modify it under the terms of the GNU Lesser General Public
  9.  * License as published by the Free Software Foundation; either
  10.  * version 2 of the License, or (at your option) any later version.
  11.  *
  12.  * This library 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 GNU
  15.  * Lesser General Public License for more details.
  16.  *
  17.  * You should have received a copy of the GNU Lesser General Public
  18.  * License along with this library; if not, write to the
  19.  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  20.  * Boston, MA 02111-1307, USA.
  21.  */
  22.  
  23. #ifndef __GIMP_WIDGETS_H__
  24. #define __GIMP_WIDGETS_H__
  25.  
  26.  
  27. #include <libgimpwidgets/gimpwidgetstypes.h>
  28.  
  29. #include <libgimpwidgets/gimpbutton.h>
  30. #include <libgimpwidgets/gimpcellrenderercolor.h>
  31. #include <libgimpwidgets/gimpcellrenderertoggle.h>
  32. #include <libgimpwidgets/gimpchainbutton.h>
  33. #include <libgimpwidgets/gimpcolorarea.h>
  34. #include <libgimpwidgets/gimpcolorbutton.h>
  35. #include <libgimpwidgets/gimpcolordisplay.h>
  36. #include <libgimpwidgets/gimpcolordisplaystack.h>
  37. #include <libgimpwidgets/gimpcolorhexentry.h>
  38. #include <libgimpwidgets/gimpcolornotebook.h>
  39. #include <libgimpwidgets/gimpcolorscale.h>
  40. #include <libgimpwidgets/gimpcolorscales.h>
  41. #include <libgimpwidgets/gimpcolorselector.h>
  42. #include <libgimpwidgets/gimpcolorselect.h>
  43. #include <libgimpwidgets/gimpcolorselection.h>
  44. #include <libgimpwidgets/gimpdialog.h>
  45. #include <libgimpwidgets/gimpfileentry.h>
  46. #include <libgimpwidgets/gimpframe.h>
  47. #include <libgimpwidgets/gimphelpui.h>
  48. #include <libgimpwidgets/gimpintcombobox.h>
  49. #include <libgimpwidgets/gimpintstore.h>
  50. #include <libgimpwidgets/gimpmemsizeentry.h>
  51. #include <libgimpwidgets/gimpoffsetarea.h>
  52. #include <libgimpwidgets/gimppatheditor.h>
  53. #include <libgimpwidgets/gimppickbutton.h>
  54. #include <libgimpwidgets/gimppixmap.h>
  55. #include <libgimpwidgets/gimppreview.h>
  56. #include <libgimpwidgets/gimppreviewarea.h>
  57. #include <libgimpwidgets/gimpquerybox.h>
  58. #include <libgimpwidgets/gimpsizeentry.h>
  59. #include <libgimpwidgets/gimpstock.h>
  60. #include <libgimpwidgets/gimpunitmenu.h>
  61.  
  62. #include <libgimpwidgets/gimpoldwidgets.h>
  63.  
  64.  
  65. G_BEGIN_DECLS
  66.  
  67. /* For information look into the C source or the html documentation */
  68.  
  69.  
  70. /*
  71.  *  Widget Constructors
  72.  */
  73.  
  74. GtkWidget * gimp_int_radio_group_new (gboolean          in_frame,
  75.                       const gchar      *frame_title,
  76.                       GCallback         radio_button_callback,
  77.                       gpointer          radio_button_callback_data,
  78.                       gint              initial, /* item_data */
  79.  
  80.                       /* specify radio buttons as va_list:
  81.                        *  const gchar  *label,
  82.                        *  gint          item_data,
  83.                        *  GtkWidget   **widget_ptr,
  84.                        */
  85.  
  86.                       ...);
  87.  
  88. void        gimp_int_radio_group_set_active (GtkRadioButton *radio_button,
  89.                                              gint            item_data);
  90.  
  91.  
  92. GtkWidget * gimp_radio_group_new   (gboolean            in_frame,
  93.                     const gchar        *frame_title,
  94.  
  95.                     /* specify radio buttons as va_list:
  96.                      *  const gchar    *label,
  97.                      *  GCallback       callback,
  98.                      *  gpointer        callback_data,
  99.                      *  gpointer        item_data,
  100.                      *  GtkWidget     **widget_ptr,
  101.                      *  gboolean        active,
  102.                      */
  103.  
  104.                     ...);
  105. GtkWidget * gimp_radio_group_new2  (gboolean            in_frame,
  106.                     const gchar        *frame_title,
  107.                     GCallback           radio_button_callback,
  108.                     gpointer            radio_button_callback_data,
  109.                     gpointer            initial, /* item_data */
  110.  
  111.                     /* specify radio buttons as va_list:
  112.                      *  const gchar    *label,
  113.                      *  gpointer        item_data,
  114.                      *  GtkWidget     **widget_ptr,
  115.                      */
  116.  
  117.                     ...);
  118.  
  119. void   gimp_radio_group_set_active (GtkRadioButton     *radio_button,
  120.                                     gpointer            item_data);
  121.  
  122.  
  123. GtkWidget * gimp_spin_button_new   (/* return value: */
  124.                     GtkObject         **adjustment,
  125.  
  126.                     gdouble             value,
  127.                     gdouble             lower,
  128.                     gdouble             upper,
  129.                     gdouble             step_increment,
  130.                     gdouble             page_increment,
  131.                     gdouble             page_size,
  132.                     gdouble             climb_rate,
  133.                     guint               digits);
  134.  
  135. #define GIMP_SCALE_ENTRY_LABEL(adj) \
  136.         (g_object_get_data (G_OBJECT (adj), "label"))
  137.  
  138. #define GIMP_SCALE_ENTRY_SCALE(adj) \
  139.         (g_object_get_data (G_OBJECT (adj), "scale"))
  140. #define GIMP_SCALE_ENTRY_SCALE_ADJ(adj) \
  141.         gtk_range_get_adjustment \
  142.         (GTK_RANGE (g_object_get_data (G_OBJECT (adj), "scale")))
  143.  
  144. #define GIMP_SCALE_ENTRY_SPINBUTTON(adj) \
  145.         (g_object_get_data (G_OBJECT (adj), "spinbutton"))
  146. #define GIMP_SCALE_ENTRY_SPINBUTTON_ADJ(adj) \
  147.         gtk_spin_button_get_adjustment \
  148.         (GTK_SPIN_BUTTON (g_object_get_data (G_OBJECT (adj), "spinbutton")))
  149.  
  150. GtkObject * gimp_scale_entry_new       (GtkTable           *table,
  151.                                         gint                column,
  152.                                         gint                row,
  153.                                         const gchar        *text,
  154.                                         gint                scale_width,
  155.                                         gint                spinbutton_width,
  156.                                         gdouble             value,
  157.                                         gdouble             lower,
  158.                                         gdouble             upper,
  159.                                         gdouble             step_increment,
  160.                                         gdouble             page_increment,
  161.                                         guint               digits,
  162.                                         gboolean            constrain,
  163.                                         gdouble             unconstrained_lower,
  164.                                         gdouble             unconstrained_upper,
  165.                                         const gchar        *tooltip,
  166.                                         const gchar        *help_id);
  167.  
  168.  
  169. GtkObject * gimp_color_scale_entry_new (GtkTable           *table,
  170.                                         gint                column,
  171.                                         gint                row,
  172.                                         const gchar        *text,
  173.                                         gint                scale_width,
  174.                                         gint                spinbutton_width,
  175.                                         gdouble             value,
  176.                                         gdouble             lower,
  177.                                         gdouble             upper,
  178.                                         gdouble             step_increment,
  179.                                         gdouble             page_increment,
  180.                                         guint               digits,
  181.                                         const gchar        *tooltip,
  182.                                         const gchar        *help_id);
  183.  
  184. void     gimp_scale_entry_set_sensitive   (GtkObject       *adjustment,
  185.                                            gboolean         sensitive);
  186.  
  187. void     gimp_scale_entry_set_logarithmic (GtkObject       *adjustment,
  188.                                            gboolean         logarithmic);
  189. gboolean gimp_scale_entry_get_logarithmic (GtkObject       *adjustment);
  190.  
  191.  
  192. #define GIMP_RANDOM_SEED_SPINBUTTON(hbox) \
  193.         (g_object_get_data (G_OBJECT (hbox), "spinbutton"))
  194. #define GIMP_RANDOM_SEED_SPINBUTTON_ADJ(hbox) \
  195.         gtk_spin_button_get_adjustment \
  196.         (GTK_SPIN_BUTTON (g_object_get_data (G_OBJECT (hbox), "spinbutton")))
  197. #define GIMP_RANDOM_SEED_TOGGLE(hbox) \
  198.         (g_object_get_data (G_OBJECT(hbox), "toggle"))
  199.  
  200. GtkWidget * gimp_random_seed_new   (guint32            *seed,
  201.                     gboolean           *random_seed);
  202.  
  203. #define GIMP_COORDINATES_CHAINBUTTON(sizeentry) \
  204.         (g_object_get_data (G_OBJECT (sizeentry), "chainbutton"))
  205.  
  206. GtkWidget * gimp_coordinates_new   (GimpUnit            unit,
  207.                     const gchar        *unit_format,
  208.                     gboolean            menu_show_pixels,
  209.                     gboolean            menu_show_percent,
  210.                     gint                spinbutton_width,
  211.                     GimpSizeEntryUpdatePolicy  update_policy,
  212.  
  213.                     gboolean            chainbutton_active,
  214.                     gboolean            chain_constrains_ratio,
  215.  
  216.                     const gchar        *xlabel,
  217.                     gdouble             x,
  218.                     gdouble             xres,
  219.                     gdouble             lower_boundary_x,
  220.                     gdouble             upper_boundary_x,
  221.                     gdouble             xsize_0,   /* % */
  222.                     gdouble             xsize_100, /* % */
  223.  
  224.                     const gchar        *ylabel,
  225.                     gdouble             y,
  226.                     gdouble             yres,
  227.                     gdouble             lower_boundary_y,
  228.                     gdouble             upper_boundary_y,
  229.                     gdouble             ysize_0,   /* % */
  230.                     gdouble             ysize_100  /* % */);
  231.  
  232.  
  233. #ifndef GIMP_DISABLE_DEPRECATED
  234.  
  235. GtkWidget * gimp_pixmap_button_new  (gchar             **xpm_data,
  236.                      const gchar        *text);
  237.  
  238. #endif
  239.  
  240.  
  241. /*
  242.  *  Standard Callbacks
  243.  */
  244.  
  245. void gimp_toggle_button_sensitive_update (GtkToggleButton *toggle_button);
  246.  
  247. void gimp_toggle_button_update           (GtkWidget       *widget,
  248.                       gpointer         data);
  249.  
  250. void gimp_radio_button_update            (GtkWidget       *widget,
  251.                       gpointer         data);
  252.  
  253. void gimp_int_adjustment_update          (GtkAdjustment   *adjustment,
  254.                       gpointer         data);
  255.  
  256. void gimp_uint_adjustment_update         (GtkAdjustment   *adjustment,
  257.                       gpointer         data);
  258.  
  259. void gimp_float_adjustment_update        (GtkAdjustment   *adjustment,
  260.                       gpointer         data);
  261.  
  262. void gimp_double_adjustment_update       (GtkAdjustment   *adjustment,
  263.                       gpointer         data);
  264.  
  265. void gimp_unit_menu_update               (GtkWidget       *widget,
  266.                       gpointer         data);
  267.  
  268.  
  269. /*
  270.  *  Helper Functions
  271.  */
  272.  
  273. GtkWidget * gimp_table_attach_aligned    (GtkTable        *table,
  274.                       gint             column,
  275.                       gint             row,
  276.                       const gchar     *label_text,
  277.                       gfloat           xalign,
  278.                       gfloat           yalign,
  279.                       GtkWidget       *widget,
  280.                       gint             colspan,
  281.                       gboolean         left_align);
  282.  
  283.  
  284. void        gimp_label_set_attributes    (GtkLabel        *label,
  285.                                           ...);
  286.  
  287.  
  288. G_END_DECLS
  289.  
  290. #endif /* __GIMP_WIDGETS_H__ */
  291.