![]() |
![]() |
![]() |
Awn Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties |
#include <libawn/libawn.h> AwnThemedIconPrivate; AwnThemedIcon; GtkWidget * awn_themed_icon_new (void
); void awn_themed_icon_set_state (AwnThemedIcon *icon
,const gchar *state
); const gchar * awn_themed_icon_get_state (AwnThemedIcon *icon
); void awn_themed_icon_set_size (AwnThemedIcon *icon
,gint size
); gint awn_themed_icon_get_size (AwnThemedIcon *icon
); const gchar * awn_themed_icon_get_default_theme_name (AwnThemedIcon *icon
); void awn_themed_icon_set_info (AwnThemedIcon *icon
,const gchar *applet_name
,const gchar *uid
,GStrv states
,GStrv icon_names
); void awn_themed_icon_set_info_simple (AwnThemedIcon *icon
,const gchar *applet_name
,const gchar *uid
,const gchar *icon_name
); void awn_themed_icon_set_info_append (AwnThemedIcon *icon
,const gchar *state
,const gchar *icon_name
); void awn_themed_icon_set_applet_info (AwnThemedIcon *icon
,const gchar *applet_name
,const gchar *uid
); void awn_themed_icon_override_gtk_theme (AwnThemedIcon *icon
,const gchar *theme_name
); GdkPixbuf * awn_themed_icon_get_icon_at_size (AwnThemedIcon *icon
,gint size
,const gchar *state
); void awn_themed_icon_clear_icons (AwnThemedIcon *icon
,gint scope
); void awn_themed_icon_clear_info (AwnThemedIcon *icon
); void awn_themed_icon_preload_icon (AwnThemedIcon *icon
,gchar *state
,gint size
); GtkIconTheme * awn_themed_icon_get_awn_theme (AwnThemedIcon *icon
); GtkWidget * awn_themed_icon_create_custom_icon_item (AwnThemedIcon *icon
,const gchar *icon_name
); GtkWidget * awn_themed_icon_create_remove_custom_icon_item (AwnThemedIcon *icon
,const gchar *icon_name
); void awn_themed_icon_drag_data_received (GtkWidget *widget
,GdkDragContext *context
,gint x
,gint y
,GtkSelectionData *selection_data
,guint info
,guint evt_time
);
GObject +----GInitiallyUnowned +----GtkObject +----GtkWidget +----GtkDrawingArea +----AwnIcon +----AwnThemedIcon
AwnThemedIcon implements AtkImplementorIface, GtkBuildable and AwnOverlayable.
"applet-name" gchar* : Read / Write / Construct "drag-and-drop" gboolean : Read / Write / Construct "rotate" GdkPixbufRotation : Read / Write / Construct
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.
typedef struct _AwnThemedIcon AwnThemedIcon;
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.
Returns : |
an 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.
|
A pointer to an AwnThemedIcon object. |
|
The icon state that is to be enabled. |
const gchar * awn_themed_icon_get_state (AwnThemedIcon *icon
);
Get the current icon state of the AwnThemedIcon.
|
A pointer to an AwnThemedIcon object. |
Returns : |
a pointer to the current icon state string. |
void awn_themed_icon_set_size (AwnThemedIcon *icon
,gint size
);
Set the Icon size.
|
A pointer to an AwnThemedIcon object. |
|
An icon size |
gint awn_themed_icon_get_size (AwnThemedIcon *icon
);
Get the current icon size.
|
A pointer to an AwnThemedIcon object. |
Returns : |
the current icon size. |
const gchar * awn_themed_icon_get_default_theme_name
(AwnThemedIcon *icon
);
Retrieve the default system icon theme name
|
A pointer to an AwnThemedIcon object. |
Returns : |
the current default 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.
|
A pointer to an AwnThemedIcon object. |
|
The applet name. |
|
The applet's UID. |
|
A NULL terminated list of icon states. |
|
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.
|
A pointer to an AwnThemedIcon object. |
|
The applet name. |
|
The applet's UID. |
|
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.
|
A pointer to an AwnThemedIcon object. |
|
An Icon state. |
|
A icon name. |
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.
|
A pointer to an AwnThemedIcon object. |
|
The applet name. |
|
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.
|
A pointer to an AwnThemedIcon object. |
|
A icon theme name. |
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.
|
A pointer to an AwnThemedIcon object. |
|
A icon theme name. |
|
The desired icon state. |
Returns : |
an GdkPixbuf for the requested state of the requested size. |
void awn_themed_icon_clear_icons (AwnThemedIcon *icon
,gint scope
);
Delete icons from the custom awn-theme in $HOME/.icons/awn-theme
|
A pointer to an AwnThemedIcon object. |
|
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.
|
A pointer to an AwnThemedIcon object. |
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()
.
|
A pointer to an AwnThemedIcon object. |
|
The icon state. |
|
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.
|
The themed icon. |
Returns : |
The current icon theme associated with the themed icon. |
GtkWidget * awn_themed_icon_create_custom_icon_item (AwnThemedIcon *icon
,const gchar *icon_name
);
Creates a "Customize Icon" menu item.
|
A pointer to an AwnThemedIcon object. |
|
The name of the customized icon. |
Returns : |
A GtkImageMenuItem for the Customize Icon that can be added to an applet icon's context menu. |
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.
|
A pointer to an AwnThemedIcon object. |
|
A custom icon or name or NULL if the default customer icons are to be used |
Returns : |
A GtkImageMenuItem for the Customize Icon that can be added to an applet icon's context menu. |
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.
|
An AwnThemedIcon object. |
|
The GDK drag context. |
|
The X position of the drop. |
|
The Y position of the drop. |
|
The received data. |
|
The info that has been registered with the target in the GtkTargetList. |
|
The drag event time. |
"applet-name"
property "applet-name" gchar* : Read / Write / Construct
The applet name.
Default value: NULL
"drag-and-drop"
property "drag-and-drop" gboolean : Read / Write / Construct
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".
Default value: TRUE