gimpwidgets-utils

gimpwidgets-utils

Synopsis

void                gimp_menu_position                  (GtkMenu *menu,
                                                         gint *x,
                                                         gint *y);
void                gimp_button_menu_position           (GtkWidget *button,
                                                         GtkMenu *menu,
                                                         GtkPositionType position,
                                                         gint *x,
                                                         gint *y);
void                gimp_table_attach_stock             (GtkTable *table,
                                                         gint row,
                                                         const gchar *stock_id,
                                                         GtkWidget *widget,
                                                         gint colspan,
                                                         gboolean left_align);
void                gimp_enum_radio_box_add             (GtkBox *box,
                                                         GtkWidget *widget,
                                                         gint enum_value,
                                                         gboolean below);
void                gimp_enum_radio_frame_add           (GtkFrame *frame,
                                                         GtkWidget *widget,
                                                         gint enum_value,
                                                         gboolean below);
GtkIconSize         gimp_get_icon_size                  (GtkWidget *widget,
                                                         const gchar *stock_id,
                                                         GtkIconSize max_size,
                                                         gint width,
                                                         gint height);
GimpTabStyle        gimp_preview_tab_style_to_icon      (GimpTabStyle tab_style);
const gchar *       gimp_get_mod_string                 (GdkModifierType modifiers);
gchar *             gimp_suggest_modifiers              (const gchar *message,
                                                         GdkModifierType modifiers,
                                                         const gchar *shift_format,
                                                         const gchar *control_format,
                                                         const gchar *alt_format);
GimpChannelOps      gimp_modifiers_to_channel_op        (GdkModifierType modifiers);
GdkModifierType     gimp_replace_virtual_modifiers      (GdkModifierType modifiers);
GdkModifierType     gimp_get_extend_selection_mask      (void);
GdkModifierType     gimp_get_modify_selection_mask      (void);
GdkModifierType     gimp_get_toggle_behavior_mask       (void);
GdkModifierType     gimp_get_constrain_behavior_mask    (void);
GdkModifierType     gimp_get_all_modifiers_mask         (void);
void                gimp_get_screen_resolution          (GdkScreen *screen,
                                                         gdouble *xres,
                                                         gdouble *yres);
void                gimp_rgb_get_gdk_color              (const GimpRGB *rgb,
                                                         GdkColor *gdk_color);
void                gimp_rgb_set_gdk_color              (GimpRGB *rgb,
                                                         const GdkColor *gdk_color);
void                gimp_window_set_hint                (GtkWindow *window,
                                                         GimpWindowHint hint);
guint32             gimp_window_get_native_id           (GtkWindow *window);
void                gimp_window_set_transient_for       (GtkWindow *window,
                                                         guint32 parent_ID);
void                gimp_toggle_button_set_visible      (GtkToggleButton *toggle,
                                                         GtkWidget *widget);
void                gimp_widget_set_accel_help          (GtkWidget *widget,
                                                         GtkAction *action);
const gchar *       gimp_get_message_stock_id           (GimpMessageSeverity severity);
void                gimp_pango_layout_set_scale         (PangoLayout *layout,
                                                         double scale);
void                gimp_pango_layout_set_weight        (PangoLayout *layout,
                                                         PangoWeight weight);
void                gimp_highlight_widget               (GtkWidget *widget,
                                                         gboolean highlight);
GtkWidget *         gimp_dock_with_window_new           (GimpDialogFactory *factory,
                                                         GdkScreen *screen,
                                                         gboolean toolbox);
GtkWidget *         gimp_tools_get_tool_options_gui     (GimpToolOptions *tool_options);
void                gimp_tools_set_tool_options_gui     (GimpToolOptions *tool_options,
                                                         GtkWidget *widget);
void                gimp_widget_flush_expose            (GtkWidget *widget);
const gchar *       gimp_print_event                    (const GdkEvent *event);
void                gimp_session_write_position         (GimpConfigWriter *writer,
                                                         gint position);

Description

Details

gimp_menu_position ()

void                gimp_menu_position                  (GtkMenu *menu,
                                                         gint *x,
                                                         gint *y);

Positions a GtkMenu so that it pops up on screen. This function takes care of the preferred popup direction (taken from the widget render direction) and it handles multiple monitors representing a single GdkScreen (Xinerama).

You should call this function with x and y initialized to the origin of the menu. This is typically the center of the widget the menu is popped up from. gimp_menu_position() will then decide if and how these initial values need to be changed.

menu :

a GtkMenu widget

x :

pointer to horizontal position

y :

pointer to vertical position

gimp_button_menu_position ()

void                gimp_button_menu_position           (GtkWidget *button,
                                                         GtkMenu *menu,
                                                         GtkPositionType position,
                                                         gint *x,
                                                         gint *y);

Utility function to position a menu that pops up from a button.

button :

a button widget to popup the menu from

menu :

the menu to position

position :

the preferred popup direction for the menu (left or right)

x :

return location for x coordinate

y :

return location for y coordinate

gimp_table_attach_stock ()

void                gimp_table_attach_stock             (GtkTable *table,
                                                         gint row,
                                                         const gchar *stock_id,
                                                         GtkWidget *widget,
                                                         gint colspan,
                                                         gboolean left_align);


gimp_enum_radio_box_add ()

void                gimp_enum_radio_box_add             (GtkBox *box,
                                                         GtkWidget *widget,
                                                         gint enum_value,
                                                         gboolean below);


gimp_enum_radio_frame_add ()

void                gimp_enum_radio_frame_add           (GtkFrame *frame,
                                                         GtkWidget *widget,
                                                         gint enum_value,
                                                         gboolean below);


gimp_get_icon_size ()

GtkIconSize         gimp_get_icon_size                  (GtkWidget *widget,
                                                         const gchar *stock_id,
                                                         GtkIconSize max_size,
                                                         gint width,
                                                         gint height);


gimp_preview_tab_style_to_icon ()

GimpTabStyle        gimp_preview_tab_style_to_icon      (GimpTabStyle tab_style);


gimp_get_mod_string ()

const gchar *       gimp_get_mod_string                 (GdkModifierType modifiers);


gimp_suggest_modifiers ()

gchar *             gimp_suggest_modifiers              (const gchar *message,
                                                         GdkModifierType modifiers,
                                                         const gchar *shift_format,
                                                         const gchar *control_format,
                                                         const gchar *alt_format);

Utility function to build a message suggesting to use some modifiers for performing different actions (only Shift, Ctrl and Alt are currently supported). If some of these modifiers are already active, they will not be suggested. The optional format strings shift_format, control_format and alt_format may be used to describe what the modifier will do. They must contain a single '%s' which will be replaced by the name of the modifier. They can also be NULL if the modifier name should be left alone.

message :

initial text for the message

modifiers :

bit mask of modifiers that should be suggested

shift_format :

optional format string for the Shift modifier

control_format :

optional format string for the Ctrl modifier

alt_format :

optional format string for the Alt modifier

Returns :

a newly allocated string containing the message.

gimp_modifiers_to_channel_op ()

GimpChannelOps      gimp_modifiers_to_channel_op        (GdkModifierType modifiers);


gimp_replace_virtual_modifiers ()

GdkModifierType     gimp_replace_virtual_modifiers      (GdkModifierType modifiers);


gimp_get_extend_selection_mask ()

GdkModifierType     gimp_get_extend_selection_mask      (void);


gimp_get_modify_selection_mask ()

GdkModifierType     gimp_get_modify_selection_mask      (void);


gimp_get_toggle_behavior_mask ()

GdkModifierType     gimp_get_toggle_behavior_mask       (void);


gimp_get_constrain_behavior_mask ()

GdkModifierType     gimp_get_constrain_behavior_mask    (void);


gimp_get_all_modifiers_mask ()

GdkModifierType     gimp_get_all_modifiers_mask         (void);


gimp_get_screen_resolution ()

void                gimp_get_screen_resolution          (GdkScreen *screen,
                                                         gdouble *xres,
                                                         gdouble *yres);

Retrieves the screen resolution from GDK. If screen is NULL, the default screen is used.

screen :

a GdkScreen or NULL

xres :

returns the horizontal screen resolution (in dpi)

yres :

returns the vertical screen resolution (in dpi)

gimp_rgb_get_gdk_color ()

void                gimp_rgb_get_gdk_color              (const GimpRGB *rgb,
                                                         GdkColor *gdk_color);

Initializes gdk_color from a GimpRGB. This function does not allocate the color for you. Depending on how you want to use it, you may have to call gdk_colormap_alloc_color().

rgb :

the source color as GimpRGB

gdk_color :

pointer to a GdkColor

gimp_rgb_set_gdk_color ()

void                gimp_rgb_set_gdk_color              (GimpRGB *rgb,
                                                         const GdkColor *gdk_color);

Initializes rgb from a GdkColor. This function does not touch the alpha value of rgb.

rgb :

a GimpRGB that is to be set

gdk_color :

pointer to the source GdkColor

gimp_window_set_hint ()

void                gimp_window_set_hint                (GtkWindow *window,
                                                         GimpWindowHint hint);


gimp_window_get_native_id ()

guint32             gimp_window_get_native_id           (GtkWindow *window);

This function is used to pass a window handle to plug-ins so that they can set their dialog windows transient to the parent window.

window :

a GtkWindow

Returns :

a native window ID of the window's GdkWindow or 0 if the window isn't realized yet

gimp_window_set_transient_for ()

void                gimp_window_set_transient_for       (GtkWindow *window,
                                                         guint32 parent_ID);


gimp_toggle_button_set_visible ()

void                gimp_toggle_button_set_visible      (GtkToggleButton *toggle,
                                                         GtkWidget *widget);


gimp_widget_set_accel_help ()

void                gimp_widget_set_accel_help          (GtkWidget *widget,
                                                         GtkAction *action);


gimp_get_message_stock_id ()

const gchar *       gimp_get_message_stock_id           (GimpMessageSeverity severity);


gimp_pango_layout_set_scale ()

void                gimp_pango_layout_set_scale         (PangoLayout *layout,
                                                         double scale);


gimp_pango_layout_set_weight ()

void                gimp_pango_layout_set_weight        (PangoLayout *layout,
                                                         PangoWeight weight);


gimp_highlight_widget ()

void                gimp_highlight_widget               (GtkWidget *widget,
                                                         gboolean highlight);

Calls gtk_drag_highlight() on widget if highlight is TRUE, calls gtk_drag_unhighlight() otherwise.


gimp_dock_with_window_new ()

GtkWidget *         gimp_dock_with_window_new           (GimpDialogFactory *factory,
                                                         GdkScreen *screen,
                                                         gboolean toolbox);

factory :

a GimpDialogFacotry

screen :

the GdkScreen the dock window should appear on

toolbox :

if TRUE; gives a "gimp-toolbox-window" with a "gimp-toolbox", "gimp-dock-window"+"gimp-dock" otherwise

Returns :

the newly created GimpDock with the GimpDockWindow

gimp_tools_get_tool_options_gui ()

GtkWidget *         gimp_tools_get_tool_options_gui     (GimpToolOptions *tool_options);


gimp_tools_set_tool_options_gui ()

void                gimp_tools_set_tool_options_gui     (GimpToolOptions *tool_options,
                                                         GtkWidget *widget);


gimp_widget_flush_expose ()

void                gimp_widget_flush_expose            (GtkWidget *widget);


gimp_print_event ()

const gchar *       gimp_print_event                    (const GdkEvent *event);


gimp_session_write_position ()

void                gimp_session_write_position         (GimpConfigWriter *writer,
                                                         gint position);