gimpwidgets

Name

gimpwidgets -- A collection of convenient widget constructors, standard callbacks and helper functions.

Synopsis



GtkWidget*  gimp_option_menu_new            (gboolean menu_only,
                                             ...);
GtkWidget*  gimp_option_menu_new2           (gboolean menu_only,
                                             GCallback menu_item_callback,
                                             gpointer menu_item_callback_data,
                                             gpointer initial,
                                             ...);
void        gimp_option_menu_set_history    (GtkOptionMenu *option_menu,
                                             gpointer item_data);
GtkWidget*  gimp_radio_group_new            (gboolean in_frame,
                                             const gchar *frame_title,
                                             ...);
GtkWidget*  gimp_radio_group_new2           (gboolean in_frame,
                                             const gchar *frame_title,
                                             GCallback radio_button_callback,
                                             gpointer radio_button_callback_data,
                                             gpointer initial,
                                             ...);
GtkWidget*  gimp_spin_button_new            (GtkObject **adjustment,
                                             gfloat value,
                                             gfloat lower,
                                             gfloat upper,
                                             gfloat step_increment,
                                             gfloat page_increment,
                                             gfloat page_size,
                                             gfloat climb_rate,
                                             guint digits);
#define     GIMP_SCALE_ENTRY_LABEL          (adj)
#define     GIMP_SCALE_ENTRY_SCALE          (adj)
#define     GIMP_SCALE_ENTRY_SCALE_ADJ      (adj)
#define     GIMP_SCALE_ENTRY_SPINBUTTON     (adj)
#define     GIMP_SCALE_ENTRY_SPINBUTTON_ADJ (adj)
GtkObject*  gimp_scale_entry_new            (GtkTable *table,
                                             gint column,
                                             gint row,
                                             const gchar *text,
                                             gint scale_width,
                                             gint spinbutton_width,
                                             gfloat value,
                                             gfloat lower,
                                             gfloat upper,
                                             gfloat step_increment,
                                             gfloat page_increment,
                                             guint digits,
                                             gboolean constrain,
                                             gfloat unconstrained_lower,
                                             gfloat unconstrained_upper,
                                             const gchar *tooltip,
                                             const gchar *help_data);
#define     GIMP_RANDOM_SEED_SPINBUTTON     (hbox)
#define     GIMP_RANDOM_SEED_SPINBUTTON_ADJ (hbox)
#define     GIMP_RANDOM_SEED_TOGGLEBUTTON   (hbox)
GtkWidget*  gimp_random_seed_new            (gint *seed,
                                             gint *use_time,
                                             gint time_true,
                                             gint time_false);
#define     GIMP_COORDINATES_CHAINBUTTON    (sizeentry)
GtkWidget*  gimp_coordinates_new            (GimpUnit unit,
                                             const gchar *unit_format,
                                             gboolean menu_show_pixels,
                                             gboolean menu_show_percent,
                                             gint spinbutton_width,
                                             GimpSizeEntryUpdatePolicy update_policy,
                                             gboolean chainbutton_active,
                                             gboolean chain_constrains_ratio,
                                             const gchar *xlabel,
                                             gdouble x,
                                             gdouble xres,
                                             gdouble lower_boundary_x,
                                             gdouble upper_boundary_x,
                                             gdouble xsize_0,
                                             gdouble xsize_100,
                                             const gchar *ylabel,
                                             gdouble y,
                                             gdouble yres,
                                             gdouble lower_boundary_y,
                                             gdouble upper_boundary_y,
                                             gdouble ysize_0,
                                             gdouble ysize_100);
#define     GIMP_MEM_SIZE_ENTRY_SPINBUTTON  (memsize)
#define     GIMP_MEM_SIZE_ENTRY_SPINBUTTON_ADJ(memsize)
#define     GIMP_MEM_SIZE_ENTRY_OPTIONMENU  (memsize)
GtkWidget*  gimp_mem_size_entry_new         (GtkAdjustment *adjustment);
GtkWidget*  gimp_pixmap_button_new          (gchar **xpm_data,
                                             const gchar *text);
void        gimp_toggle_button_sensitive_update
                                            (GtkToggleButton *toggle_button);
void        gimp_toggle_button_update       (GtkWidget *widget,
                                             gpointer data);
void        gimp_radio_button_update        (GtkWidget *widget,
                                             gpointer data);
void        gimp_menu_item_update           (GtkWidget *widget,
                                             gpointer data);
void        gimp_int_adjustment_update      (GtkAdjustment *adjustment,
                                             gpointer data);
void        gimp_uint_adjustment_update     (GtkAdjustment *adjustment,
                                             gpointer data);
void        gimp_float_adjustment_update    (GtkAdjustment *adjustment,
                                             gpointer data);
void        gimp_double_adjustment_update   (GtkAdjustment *adjustment,
                                             gpointer data);
void        gimp_unit_menu_update           (GtkWidget *widget,
                                             gpointer data);
GtkWidget*  gimp_table_attach_aligned       (GtkTable *table,
                                             gint column,
                                             gint row,
                                             const gchar *label_text,
                                             gfloat xalign,
                                             gfloat yalign,
                                             GtkWidget *widget,
                                             gint colspan,
                                             gboolean left_align);

Description

Details

gimp_option_menu_new ()

GtkWidget*  gimp_option_menu_new            (gboolean menu_only,
                                             ...);

The va_list describing the GtkMenuItem's has the following format:


gimp_option_menu_new2 ()

GtkWidget*  gimp_option_menu_new2           (gboolean menu_only,
                                             GCallback menu_item_callback,
                                             gpointer menu_item_callback_data,
                                             gpointer initial,
                                             ...);

The va_list describing the GtkMenuItem's has the following format:


gimp_option_menu_set_history ()

void        gimp_option_menu_set_history    (GtkOptionMenu *option_menu,
                                             gpointer item_data);


gimp_radio_group_new ()

GtkWidget*  gimp_radio_group_new            (gboolean in_frame,
                                             const gchar *frame_title,
                                             ...);

The va_list describing the GtkRadioButton's has the following format:


gimp_radio_group_new2 ()

GtkWidget*  gimp_radio_group_new2           (gboolean in_frame,
                                             const gchar *frame_title,
                                             GCallback radio_button_callback,
                                             gpointer radio_button_callback_data,
                                             gpointer initial,
                                             ...);

The va_list describing the GtkRadioButton's has the following format:


gimp_spin_button_new ()

GtkWidget*  gimp_spin_button_new            (GtkObject **adjustment,
                                             gfloat value,
                                             gfloat lower,
                                             gfloat upper,
                                             gfloat step_increment,
                                             gfloat page_increment,
                                             gfloat page_size,
                                             gfloat climb_rate,
                                             guint digits);

This function is a shortcut for gtk_adjustment_new() and a subsequent gtk_spin_button_new() and does some more initialisation stuff like setting a standard minimun horizontal size.


GIMP_SCALE_ENTRY_LABEL()

#define     GIMP_SCALE_ENTRY_LABEL(adj)

Returns the scale_entry's GtkLabel.


GIMP_SCALE_ENTRY_SCALE()

#define     GIMP_SCALE_ENTRY_SCALE(adj)

Returns the scale_entry's GtkHScale.


GIMP_SCALE_ENTRY_SCALE_ADJ()

#define     GIMP_SCALE_ENTRY_SCALE_ADJ(adj)

Returns the GtkAdjustment of the scale_entry's GtkHScale.


GIMP_SCALE_ENTRY_SPINBUTTON()

#define     GIMP_SCALE_ENTRY_SPINBUTTON(adj)

Returns the scale_entry's GtkSpinButton.


GIMP_SCALE_ENTRY_SPINBUTTON_ADJ()

#define     GIMP_SCALE_ENTRY_SPINBUTTON_ADJ(adj)

Returns the GtkAdjustment of the scale_entry's GtkSpinButton.


gimp_scale_entry_new ()

GtkObject*  gimp_scale_entry_new            (GtkTable *table,
                                             gint column,
                                             gint row,
                                             const gchar *text,
                                             gint scale_width,
                                             gint spinbutton_width,
                                             gfloat value,
                                             gfloat lower,
                                             gfloat upper,
                                             gfloat step_increment,
                                             gfloat page_increment,
                                             guint digits,
                                             gboolean constrain,
                                             gfloat unconstrained_lower,
                                             gfloat unconstrained_upper,
                                             const gchar *tooltip,
                                             const gchar *help_data);

This function creates a GtkLabel, a GtkHScale and a GtkSpinButton and attaches them to a 3-column GtkTable.

Note that if you pass a tooltip or help_data to this function you'll have to initialize GIMP's help system with gimp_help_init() before using it.


GIMP_RANDOM_SEED_SPINBUTTON()

#define     GIMP_RANDOM_SEED_SPINBUTTON(hbox)

Returns the random_seed's GtkSpinButton.


GIMP_RANDOM_SEED_SPINBUTTON_ADJ()

#define     GIMP_RANDOM_SEED_SPINBUTTON_ADJ(hbox)

Returns the GtkAdjustment of the random_seed's GtkSpinButton.


GIMP_RANDOM_SEED_TOGGLEBUTTON()

#define     GIMP_RANDOM_SEED_TOGGLEBUTTON(hbox)

Returns the random_seed's GtkToggleButton.


gimp_random_seed_new ()

GtkWidget*  gimp_random_seed_new            (gint *seed,
                                             gint *use_time,
                                             gint time_true,
                                             gint time_false);

Note that this widget automatically sets tooltips with gimp_help_set_help_data(), so you'll have to initialize GIMP's help system with gimp_help_init() before using it.


GIMP_COORDINATES_CHAINBUTTON()

#define     GIMP_COORDINATES_CHAINBUTTON(sizeentry)

Returns the GimpChainButton which is attached to the GimpSizeEntry.


gimp_coordinates_new ()

GtkWidget*  gimp_coordinates_new            (GimpUnit unit,
                                             const gchar *unit_format,
                                             gboolean menu_show_pixels,
                                             gboolean menu_show_percent,
                                             gint spinbutton_width,
                                             GimpSizeEntryUpdatePolicy update_policy,
                                             gboolean chainbutton_active,
                                             gboolean chain_constrains_ratio,
                                             const gchar *xlabel,
                                             gdouble x,
                                             gdouble xres,
                                             gdouble lower_boundary_x,
                                             gdouble upper_boundary_x,
                                             gdouble xsize_0,
                                             gdouble xsize_100,
                                             const gchar *ylabel,
                                             gdouble y,
                                             gdouble yres,
                                             gdouble lower_boundary_y,
                                             gdouble upper_boundary_y,
                                             gdouble ysize_0,
                                             gdouble ysize_100);

unit : The initial unit of the GimpUnitMenu.
unit_format : The unit format string as passed to gimp_size_entry_new().
menu_show_pixels : TRUE if the GimpUnitMenu should contain an item for GIMP_UNIT_PIXEL.
menu_show_percent : TRUE if the GimpUnitMenu should contain an item for GIMP_UNIT_PERCENT.
spinbutton_width : The horizontal size of the GimpSizeEntry's GtkSpinButton's.
update_policy : The update policy for the GimpSizeEntry.
chainbutton_active : TRUE if the attached GimpChainButton should be active.
chain_constrains_ratio : TRUE if the chainbutton should constrain the fields' aspect ratio. If FALSE, the values will be constrained.
xlabel : The label for the X coordinate.
x : The initial value of the X coordinate.
xres : The horizontal resolution in DPI.
lower_boundary_x : The lower boundary of the X coordinate.
upper_boundary_x : The upper boundary of the X coordinate.
xsize_0 : The X value which will be treated as 0%.
xsize_100 : The X value which will be treated as 100%.
ylabel : The label for the Y coordinate.
y : The initial value of the Y coordinate.
yres : The vertical resolution in DPI.
lower_boundary_y : The lower boundary of the Y coordinate.
upper_boundary_y : The upper boundary of the Y coordinate.
ysize_0 : The Y value which will be treated as 0%.
ysize_100 : The Y value which will be treated as 100%.
Returns : A GimpSizeEntry with two fields for x/y coordinates/sizes with a GimpChainButton attached to constrain either the two fields' values or the ratio between them.


GIMP_MEM_SIZE_ENTRY_SPINBUTTON()

#define     GIMP_MEM_SIZE_ENTRY_SPINBUTTON(memsize)


GIMP_MEM_SIZE_ENTRY_SPINBUTTON_ADJ()

#define     GIMP_MEM_SIZE_ENTRY_SPINBUTTON_ADJ(memsize)


GIMP_MEM_SIZE_ENTRY_OPTIONMENU()

#define     GIMP_MEM_SIZE_ENTRY_OPTIONMENU(memsize)


gimp_mem_size_entry_new ()

GtkWidget*  gimp_mem_size_entry_new         (GtkAdjustment *adjustment);


gimp_pixmap_button_new ()

GtkWidget*  gimp_pixmap_button_new          (gchar **xpm_data,
                                             const gchar *text);


gimp_toggle_button_sensitive_update ()

void        gimp_toggle_button_sensitive_update
                                            (GtkToggleButton *toggle_button);

If you attached a pointer to a GtkWidget with g_object_set_data() and the "set_sensitive" key to the GtkToggleButton, the sensitive state of the attached widget will be set according to the toggle button's "active" state.

You can attach an arbitrary list of widgets by attaching another "set_sensitive" data pointer to the first widget (and so on...).

This function can also set the sensitive state according to the toggle button's inverse "active" state by attaching widgets with the "inverse_sensitive" key.


gimp_toggle_button_update ()

void        gimp_toggle_button_update       (GtkWidget *widget,
                                             gpointer data);

Note that this function calls gimp_toggle_button_sensitive_update().


gimp_radio_button_update ()

void        gimp_radio_button_update        (GtkWidget *widget,
                                             gpointer data);

Note that this function calls gimp_toggle_button_sensitive_update().


gimp_menu_item_update ()

void        gimp_menu_item_update           (GtkWidget *widget,
                                             gpointer data);


gimp_int_adjustment_update ()

void        gimp_int_adjustment_update      (GtkAdjustment *adjustment,
                                             gpointer data);

Note that the GtkAdjustment's value (which is a gfloat) will be rounded with RINT().


gimp_uint_adjustment_update ()

void        gimp_uint_adjustment_update     (GtkAdjustment *adjustment,
                                             gpointer data);

Note that the GtkAdjustment's value (which is a gfloat) will be rounded with (guint) (value + 0.5).


gimp_float_adjustment_update ()

void        gimp_float_adjustment_update    (GtkAdjustment *adjustment,
                                             gpointer data);


gimp_double_adjustment_update ()

void        gimp_double_adjustment_update   (GtkAdjustment *adjustment,
                                             gpointer data);


gimp_unit_menu_update ()

void        gimp_unit_menu_update           (GtkWidget *widget,
                                             gpointer data);

This callback can set the number of decimal digits of an arbitrary number of GtkSpinButton's. To use this functionality, attach the spinbuttons as list of data pointers attached with g_object_set_data() with the "set_digits" key.

See gimp_toggle_button_sensitive_update() for a description of how to set up the list.


gimp_table_attach_aligned ()

GtkWidget*  gimp_table_attach_aligned       (GtkTable *table,
                                             gint column,
                                             gint row,
                                             const gchar *label_text,
                                             gfloat xalign,
                                             gfloat yalign,
                                             GtkWidget *widget,
                                             gint colspan,
                                             gboolean left_align);

Note that the label_text can be NULL and that the widget will be attached starting at (column + 1) in this case, too.