PlankDrawingDrawingService

PlankDrawingDrawingService — Utility service for loading icons and working with pixbufs.

Synopsis

#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;

Object Hierarchy

  GObject
   +----PlankDrawingDrawingService

Description

Details

PLANK_DRAWING_TYPE_DRAWING_SERVICE

#define PLANK_DRAWING_TYPE_DRAWING_SERVICE (plank_drawing_drawing_service_get_type ())

The type for PlankDrawingDrawingService.


plank_drawing_drawing_service_get_icon_from_file ()

gchar *             plank_drawing_drawing_service_get_icon_from_file
                                                        (GFile *file);

Gets the icon name from a GFile.

file :

 . the file to get the icon name for. [in]

Returns :

the icon name for the file, or null if none exists

plank_drawing_drawing_service_get_icon_from_gicon ()

gchar *             plank_drawing_drawing_service_get_icon_from_gicon
                                                        (GIcon *icon);

Gets an icon from a GIcon.

icon :

 . the icon to get the name for. [in][allow-none]

Returns :

the icon name, or null if none exists

plank_drawing_drawing_service_load_icon ()

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

names :

 . a delimited (with ";;") list of icon names, first one found is used. [in]

width :

 . the requested width of the icon. [in]

height :

 . the requested height of the icon. [in]

Returns :

the pixbuf representing the requested icon

plank_drawing_drawing_service_ar_scale ()

GdkPixbuf *         plank_drawing_drawing_service_ar_scale
                                                        (GdkPixbuf *source,
                                                         gint width,
                                                         gint height);

Scales a GdkPixbuf, maintaining the original aspect ratio.

source :

 . the pixbuf to scale. [in]

width :

 . the width of the scaled pixbuf. [in]

height :

 . the height of the scaled pixbuf. [in]

Returns :

the scaled pixbuf

plank_drawing_drawing_service_average_color ()

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.

source :

 . the pixbuf to use. [in]

Returns :

the average color of the pixbuf

struct PlankDrawingDrawingService

struct PlankDrawingDrawingService;

Utility service for loading icons and working with pixbufs.


struct PlankDrawingDrawingServiceClass

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 parent_class;

the parent class structure