awn-utils

awn-utils

Synopsis

void                awn_utils_ensure_transparent_bg     (GtkWidget *widget);
void                awn_utils_make_transparent_bg       (GtkWidget *widget);
gfloat              awn_utils_get_offset_modifier_by_path_type
                                                        (AwnPathType path_type,
                                                         GtkPositionType position,
                                                         gint offset,
                                                         gfloat offset_modifier,
                                                         gint pos_x,
                                                         gint pos_y,
                                                         gint width,
                                                         gint height);
GValueArray *       awn_utils_gslist_to_gvaluearray     (GSList *list);
void                awn_utils_show_menu_images          (GtkMenu *menu);
const gchar *       awn_utils_get_gtk_icon_theme_name   (GtkIconTheme *theme);
void                awn_utils_menu_set_position_widget_relative
                                                        (GtkMenu *menu,
                                                         gint *px,
                                                         gint *py,
                                                         gboolean *push_in,
                                                         gpointer data);

Description

Details

awn_utils_ensure_transparent_bg ()

void                awn_utils_ensure_transparent_bg     (GtkWidget *widget);

Ensures that the widget has transparent background all the time by connecting to the GtkWidget::realize and GtkWidget::style-set signals.

widget :

Widget which should have transparent background.

awn_utils_make_transparent_bg ()

void                awn_utils_make_transparent_bg       (GtkWidget *widget);

Modifies the background pixmap on the widget to be transparent if composited environment is used.

widget :

Widget which background will be modified.

awn_utils_get_offset_modifier_by_path_type ()

gfloat              awn_utils_get_offset_modifier_by_path_type
                                                        (AwnPathType path_type,
                                                         GtkPositionType position,
                                                         gint offset,
                                                         gfloat offset_modifier,
                                                         gint pos_x,
                                                         gint pos_y,
                                                         gint width,
                                                         gint height);

Computes modifier for offset value based on current path_type and position of a widget on the panel.

Returns :

Offset modifier, offset value should be multiplied by this modifier.

awn_utils_gslist_to_gvaluearray ()

GValueArray *       awn_utils_gslist_to_gvaluearray     (GSList *list);

Converts a GSList of strings to a GValueArray, suitable for use with a configuration client.

list :

The GSList of gchar pointers to convert.

Returns :

A newly allocated GValueArray (the GValue elements and their contents are also newly allocated).

awn_utils_show_menu_images ()

void                awn_utils_show_menu_images          (GtkMenu *menu);

Set all instances GtkImageMenuItem in the GtkMenu are set to visible. A null op for GTK+ < 2.16.0

menu :

A GtkMenu.

awn_utils_get_gtk_icon_theme_name ()

const gchar *       awn_utils_get_gtk_icon_theme_name   (GtkIconTheme *theme);


awn_utils_menu_set_position_widget_relative ()

void                awn_utils_menu_set_position_widget_relative
                                                        (GtkMenu *menu,
                                                         gint *px,
                                                         gint *py,
                                                         gboolean *push_in,
                                                         gpointer data);

This function (*GtkMenuPositionFunc) is used when calling gtk_menu_popup() which controls the positioning of the menu when it is displayed. We use this custom positioning to popup menu relative to an icon/applet. See for example "awn_icon_popup_gtk_menu" into awn-icon.c

menu :

a GtkMenu

px :

address of the gint representing the horizontal position where the menu shall be drawn. This is an output parameter.

py :

address of the gint representing the vertical position where the menu shall be drawn. This is an output parameter.

push_in :

This parameter controls how menus placed outside the monitor are handled. This doesn't work well.

data :

the data supplied by the user in the gtk_menu_popup() data parameter.