GimpWidgetsUtils

GimpWidgetsUtils — A collection of helper functions.

Functions

Description

A collection of helper functions.

Functions

gimp_grid_attach_aligned ()

GtkWidget *
gimp_grid_attach_aligned (GtkGrid *grid,
                          gint left,
                          gint top,
                          const gchar *label_text,
                          gfloat xalign,
                          gfloat yalign,
                          GtkWidget *widget,
                          gint columns);

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

Parameters

grid

The GtkGrid the widgets will be attached to.

 

left

The column to start with.

 

top

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.

 

columns

The number of columns the widget will use.

 

Returns

The created GtkLabel.

[transfer none]


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.

[skip]

Parameters

label

a GtkLabel

 

...

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

 

Since: 2.2


gimp_widget_get_monitor ()

GdkMonitor *
gimp_widget_get_monitor (GtkWidget *widget);

Parameters

widget

a GtkWidget.

 

Returns

the GdkMonitor where widget is current displayed on.

[transfer none]


gimp_get_monitor_at_pointer ()

GdkMonitor *
gimp_get_monitor_at_pointer (void);

Returns

the GdkMonitor where the pointer is.

[transfer none]


gimp_widget_track_monitor ()

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

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

 

user_data_destroy

destroy function for user_data .

 

Since: 2.10


gimp_monitor_get_color_profile ()

GimpColorProfile *
gimp_monitor_get_color_profile (GdkMonitor *monitor);

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

Parameters

monitor

a GdkMonitor

 

Returns

the monitor's GimpColorProfile, or NULL.

[nullable][transfer full]

Since: 3.0


gimp_widget_get_color_profile ()

GimpColorProfile *
gimp_widget_get_color_profile (GtkWidget *widget);

This function returns the GimpColorProfile of the monitor widget is currently displayed on, or NULL if there is no profile configured.

Parameters

widget

a GtkWidget

 

Returns

widget 's monitor's GimpColorProfile, or NULL.

[nullable][transfer full]

Since: 3.0


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);

This function returns the GimpColorTransform that transforms pixels from src_profile to the profile of the GdkMonitor the widget is displayed on.

Parameters

widget

a GtkWidget

 

config

a GimpColorConfig

 

src_profile

a GimpColorProfile

 

src_format

Babl format for the transform's source pixels

 

dest_format

Babl format for the transforms's destination pixels

 

Returns

the GimpColorTransform.

[nullable][transfer full]

Since: 2.10