![]() |
![]() |
![]() |
plank Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy |
PlankDrawingDrawingServicePlankDrawingDrawingService — Utility service for loading icons and working with pixbufs. |
#define PLANK_DRAWING_TYPE_DRAWING_SERVICE gchar * plank_drawing_drawing_service_get_icon_from_file (GFile *file
); gchar * plank_drawing_drawing_service_get_icon_from_gicon (GIcon *icon
); GdkPixbuf * plank_drawing_drawing_service_load_icon (const gchar *names
,gint width
,gint height
); GdkPixbuf * plank_drawing_drawing_service_ar_scale (GdkPixbuf *source
,gint width
,gint height
); void plank_drawing_drawing_service_average_color (GdkPixbuf *source
,PlankDrawingColor *result
); struct PlankDrawingDrawingService; struct PlankDrawingDrawingServiceClass;
#define PLANK_DRAWING_TYPE_DRAWING_SERVICE (plank_drawing_drawing_service_get_type ())
The type for PlankDrawingDrawingService.
gchar * plank_drawing_drawing_service_get_icon_from_file
(GFile *file
);
Gets the icon name from a GFile.
|
. the file to get the icon name for. [in] |
Returns : |
the icon name for the file, or null if none exists |
gchar * plank_drawing_drawing_service_get_icon_from_gicon
(GIcon *icon
);
Gets an icon from a GIcon.
|
. the icon to get the name for. [in][allow-none] |
Returns : |
the icon name, or null if none exists |
GdkPixbuf * plank_drawing_drawing_service_load_icon (const gchar *names
,gint width
,gint height
);
Loads an icon based on names and the given width/height
|
. a delimited (with ";;") list of icon names, first one found is used. [in] |
|
. the requested width of the icon. [in] |
|
. the requested height of the icon. [in] |
Returns : |
the pixbuf representing the requested icon |
GdkPixbuf * plank_drawing_drawing_service_ar_scale (GdkPixbuf *source
,gint width
,gint height
);
Scales a GdkPixbuf, maintaining the original aspect ratio.
|
. the pixbuf to scale. [in] |
|
. the width of the scaled pixbuf. [in] |
|
. the height of the scaled pixbuf. [in] |
Returns : |
the scaled pixbuf |
void plank_drawing_drawing_service_average_color (GdkPixbuf *source
,PlankDrawingColor *result
);
Computes and returns the average color of a GdkPixbuf. The resulting color is the average of all pixels which aren't nearly transparent while saturated pixels are weighted more than "grey" ones.
|
. the pixbuf to use. [in] |
Returns : |
the average color of the pixbuf |
struct PlankDrawingDrawingService;
Utility service for loading icons and working with pixbufs.
struct PlankDrawingDrawingServiceClass { GObjectClass parent_class; };
The class structure for PLANK_DRAWING_TYPE_DRAWING_SERVICE
. All the fields in this structure are private and should never be accessed directly.
GObjectClass |
the parent class structure |