GimpWidgetsUtils

GimpWidgetsUtils — A collection of helper functions.

Functions

Description

A collection of helper functions.

Functions

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.

Parameters

table

The GtkTable the widgets will be attached to.

 

column

The column to start with.

 

row

The row to attach the widgets.

 

label_text

The text for the GtkLabel which will be attached left of the widget.

 

xalign

The horizontal alignment of the GtkLabel.

 

yalign

The vertical alignment of the GtkLabel.

 

widget

The GtkWidget to attach right of the label.

 

colspan

The number of columns the widget will use.

 

left_align

TRUE if the widget should be left-aligned.

 

Returns

The created GtkLabel.


gimp_label_set_attributes ()

void
gimp_label_set_attributes (GtkLabel *label,
                           ...);

Sets Pango attributes on a GtkLabel in a more convenient way than gtk_label_set_attributes().

This function is useful if you want to change the font attributes of a GtkLabel. This is an alternative to using PangoMarkup which is slow to parse and awkward to handle in an i18n-friendly way.

The attributes are set on the complete label, from start to end. If you need to set attributes on part of the label, you will have to use the PangoAttributes API directly.

Parameters

label

a GtkLabel

 

...

a list of PangoAttrType and value pairs terminated by -1.

 

Since: 2.2


gimp_widget_get_monitor ()

gint
gimp_widget_get_monitor (GtkWidget *widget);

gimp_get_monitor_at_pointer ()

gint
gimp_get_monitor_at_pointer (GdkScreen **screen);

gimp_widget_track_monitor ()

void
gimp_widget_track_monitor (GtkWidget *widget,
                           GCallback monitor_changed_callback,
                           gpointer user_data);

This function behaves as if GtkWidget had a signal

GtkWidget::monitor_changed(GtkWidget *widget, gpointer user_data)

That is emitted whenever widget 's toplevel window is moved from one monitor to another. This function automatically connects to the right toplevel GtkWindow, even across moving widget between toplevel windows.

Note that this function tracks the toplevel, not widget itself, so all a window's widgets are always considered to be on the same monitor. This is because this function is mainly used for fetching the new monitor's color profile, and it makes little sense to use different profiles for the widgets of one window.

Parameters

widget

a GtkWidget

 

monitor_changed_callback

the callback when widget 's monitor changes

 

user_data

data passed to monitor_changed_callback

 

Since: 2.10


gimp_screen_get_color_profile ()

GimpColorProfile *
gimp_screen_get_color_profile (GdkScreen *screen,
                               gint monitor);

This function returns the GimpColorProfile of monitor number monitor of screen , or NULL if there is no profile configured.

Parameters

screen

a GdkScreen

 

monitor

the monitor number

 

Returns

the monitor's GimpColorProfile, or NULL.

Since: 2.10


gimp_widget_get_color_profile ()

GimpColorProfile *
gimp_widget_get_color_profile (GtkWidget *widget);

gimp_widget_get_color_transform ()

GimpColorTransform *
gimp_widget_get_color_transform (GtkWidget *widget,
                                 GimpColorConfig *config,
                                 GimpColorProfile *src_profile,
                                 const Babl *src_format,
                                 const Babl *dest_format);