Top | ![]() |
![]() |
![]() |
![]() |
GtkWidget * | awn_themed_icon_new () |
void | awn_themed_icon_set_state () |
const gchar * | awn_themed_icon_get_state () |
void | awn_themed_icon_set_size () |
gint | awn_themed_icon_get_size () |
const gchar * | awn_themed_icon_get_default_theme_name () |
void | awn_themed_icon_set_info () |
void | awn_themed_icon_set_info_simple () |
void | awn_themed_icon_set_info_append () |
void | awn_themed_icon_set_applet_info () |
void | awn_themed_icon_override_gtk_theme () |
GdkPixbuf * | awn_themed_icon_get_icon_at_size () |
void | awn_themed_icon_clear_icons () |
void | awn_themed_icon_clear_info () |
void | awn_themed_icon_preload_icon () |
GtkIconTheme * | awn_themed_icon_get_awn_theme () |
GtkWidget * | awn_themed_icon_create_custom_icon_item () |
GtkWidget * | awn_themed_icon_create_remove_custom_icon_item () |
void | awn_themed_icon_drag_data_received () |
gchar * | applet-name | Read / Write / Construct |
gboolean | drag-and-drop | Read / Write / Construct |
GdkPixbufRotation | rotate | Read / Write / Construct |
GObject ╰── GInitiallyUnowned ╰── GtkObject ╰── GtkWidget ╰── GtkDrawingArea ╰── AwnIcon ╰── AwnThemedIcon
AwnThemedIcon implements AtkImplementorIface, GtkBuildable and AwnOverlayable.
Provides convenient support for one or more themed icons using lists of of icon names / icon states. Includes support of transparent (to applet) modification of displayed icons through drag and drop. A subclass of AwnIcon.
GtkWidget *
awn_themed_icon_new (void
);
Creates a new instance of AwnThemedIcon.
void awn_themed_icon_set_state (AwnThemedIcon *icon
,const gchar *state
);
Switches to the icon state specificed. This will switch the displayed icon to the corresponding themed icon.
const gchar *
awn_themed_icon_get_state (AwnThemedIcon *icon
);
Get the current icon state of the AwnThemedIcon.
void awn_themed_icon_set_size (AwnThemedIcon *icon
,gint size
);
Set the Icon size.
gint
awn_themed_icon_get_size (AwnThemedIcon *icon
);
Get the current icon size.
const gchar *
awn_themed_icon_get_default_theme_name
(AwnThemedIcon *icon
);
Retrieve the default system icon theme name
void awn_themed_icon_set_info (AwnThemedIcon *icon
,const gchar *applet_name
,const gchar *uid
,GStrv states
,GStrv icon_names
);
Sets a list of Icon names and Icon states for the specific Applet name / UID instance.
icon |
A pointer to an AwnThemedIcon object. |
|
applet_name |
The applet name. |
|
uid |
The applet's UID. |
|
states |
A NULL terminated list of icon states. |
|
icon_names |
A NULL terminated list of theme icon names that corresponds to the states arra. |
void awn_themed_icon_set_info_simple (AwnThemedIcon *icon
,const gchar *applet_name
,const gchar *uid
,const gchar *icon_name
);
Sets icon name for a specific Applet name / UID instance. Used for Icons that only have one icon.
icon |
A pointer to an AwnThemedIcon object. |
|
applet_name |
The applet name. |
|
uid |
The applet's UID. |
|
icon_name |
A themed icon name. |
void awn_themed_icon_set_info_append (AwnThemedIcon *icon
,const gchar *state
,const gchar *icon_name
);
Appends a icon state/ icon name pair to the existing list of themed icons.
void awn_themed_icon_set_applet_info (AwnThemedIcon *icon
,const gchar *applet_name
,const gchar *uid
);
Sets the applet name / uid pair for the icon. If an existing applet name has previously been set then the value will not be modified.
icon |
A pointer to an AwnThemedIcon object. |
|
applet_name |
The applet name. |
|
uid |
The UID of the applet instance. |
void awn_themed_icon_override_gtk_theme (AwnThemedIcon *icon
,const gchar *theme_name
);
Overrides the default icon theme with a different icon theme.
GdkPixbuf * awn_themed_icon_get_icon_at_size (AwnThemedIcon *icon
,gint size
,const gchar *state
);
Retrieve an icon as a GdkPixbuf at a specific size and for a specific icon state. Note that this will not change the currently displayed icon. The caller is responsible of unreffing the pixbuf.
icon |
A pointer to an AwnThemedIcon object. |
|
size |
A icon theme name. |
|
state |
The desired icon state. |
void awn_themed_icon_clear_icons (AwnThemedIcon *icon
,gint scope
);
Delete icons from the custom awn-theme in $HOME/.icons/awn-theme
icon |
A pointer to an AwnThemedIcon object. |
|
scope |
Scope to clear. One of SCOPE_AWN_THEME, SCOPE_AWN_APPLET, SCOPE_AWN_UID. |
void
awn_themed_icon_clear_info (AwnThemedIcon *icon
);
Clears any icon names and icon states that have been set for the Icon.
void awn_themed_icon_preload_icon (AwnThemedIcon *icon
,gchar *state
,gint size
);
Queues a preload of an icon. The icon load and cache of the icon is
queued using g_idle_add()
.
icon |
A pointer to an AwnThemedIcon object. |
|
state |
The icon state. |
|
size |
The size of the icon. A value less than or equal to 0 indicates the current size should be used. |
GtkIconTheme *
awn_themed_icon_get_awn_theme (AwnThemedIcon *icon
);
A convenience method for bindings.
GtkWidget * awn_themed_icon_create_custom_icon_item (AwnThemedIcon *icon
,const gchar *icon_name
);
Creates a "Customize Icon" menu item.
GtkWidget * awn_themed_icon_create_remove_custom_icon_item (AwnThemedIcon *icon
,const gchar *icon_name
);
Creates a "Remove Customize Icon" menu item. Will only be visible when a custom icon is in use.
icon |
A pointer to an AwnThemedIcon object. |
|
icon_name |
A custom icon or name or NULL if the default customer icons are to be used |
void awn_themed_icon_drag_data_received (GtkWidget *widget
,GdkDragContext *context
,gint x
,gint y
,GtkSelectionData *selection_data
,guint info
,guint evt_time
);
This is exposed for applets that need to do their own drag and drop handling but still want to chain the this function so it can handle icons that are dropped. Use this by setting the drag_and_drop property of AwnThemedIcon and chaining to this function from the applet drag data received handler.
widget |
An AwnThemedIcon object. |
|
context |
The GDK drag context. |
|
x |
The X position of the drop. |
|
y |
The Y position of the drop. |
|
selection_data |
The received data. |
|
info |
The info that has been registered with the target in the GtkTargetList. |
|
evt_time |
The drag event time. |
“applet-name”
property “applet-name” gchar *
The applet name.
Flags: Read / Write / Construct
Default value: NULL
“drag-and-drop”
property “drag-and-drop” gboolean
Whether to enable the dragging and dropping of icons, so that a user can customize the icon via a user interface. One example of an applet that would not want this behavior enabled is a trash applet that allowed a user to drag and drop files onto it, in order to send them to the trash.
If this value is FALSE
, the icon customization behavior can be used as
a fallback by calling awn_themed_icon_drag_data_received in a custom
signal handler for “drag-data-received”.
Flags: Read / Write / Construct
Default value: TRUE