![]() | ![]() | ![]() | GPE Manual: libgpewidget Reference | ![]() |
---|
PixmapsPixmaps — Handling pixmaps for applications. |
struct gpe_icon; gboolean gpe_load_icons (struct gpe_icon*); GdkPixbuf* gpe_find_icon (const char *name); GdkPixbuf* gpe_find_icon_scaled (const char *name, GtkIconSize size); GdkPixbuf* gpe_try_find_icon (const char *name, gchar **error); gboolean gpe_find_icon_pixmap (const char *name, GdkPixmap **pixmap, GdkBitmap **bitmap); void gpe_set_window_icon (GtkWidget *window, gchar *icon);
GPE provides a set of functions for maintaining a shared icons to avoid loading icon sets multiple times. These icons are loaded into an internal storage list and identified by a name string.
struct gpe_icon { const char *shortname; const char *filename; GdkPixbuf *pixbuf; };
Struct defining a icon resource in GPE. It consists of three parts:
shortname: Short symbolic name to identify the icon.
filename: Image file with full path or file in theme location (PREFIX /share/gpe/pixmaps/<theme>).
pixbuf: GdkPixbuf with icon data.
gboolean gpe_load_icons (struct gpe_icon*);
This function is used to load a set of icons into memory and makes them accessible for the applications. Usually you will have a fixed set of pixmaps to load for each application on startup. The function will display an error message if loading of an icon fails.
Param1 : | List of icon defintions, terminated by NULL. |
Returns : | TRUE on success. |
GdkPixbuf* gpe_find_icon (const char *name);
Get an icon by name from storage list.
name : | Icon name to find. |
Returns : | Pixbuf pointer on success, NULL on failure. |
GdkPixbuf* gpe_find_icon_scaled (const char *name, GtkIconSize size);
As GTK uses icons in several sizes for different purposes this function renders a given icon to one of the common GTK icon sizes.
name : | Icon to use. |
size : | GTK icon size to use. |
Returns : | A new allocated pixbuf containing the icon of the desired size. |
GdkPixbuf* gpe_try_find_icon (const char *name, gchar **error);
This function is used to get an icon which is not necessarily loaded when the function is called. The icon is taken from internal storage if it is already available and tried to load from a file with the same name like the name passed to the function otherwise.
name : | Icon name to get. |
error : | Retuned error information if function fails. |
Returns : | Pixbuf of icon or NULL on failure. |
gboolean gpe_find_icon_pixmap (const char *name, GdkPixmap **pixmap, GdkBitmap **bitmap);
[Deprecated - do not use.]
name : | |
pixmap : | |
bitmap : | |
Returns : |
<< Init | Question >> |