PlankDrawingTheme

PlankDrawingTheme — A themed renderer for windows.

Synopsis

#define             PLANK_DRAWING_TYPE_THEME
void                plank_drawing_theme_load            (PlankDrawingTheme *self,
                                                         const gchar *type);
gint                plank_drawing_theme_get_top_offset  (PlankDrawingTheme *self);
gint                plank_drawing_theme_get_bottom_offset
                                                        (PlankDrawingTheme *self);
void                plank_drawing_theme_draw_background (PlankDrawingTheme *self,
                                                         PlankDrawingDockSurface *surface);
void                plank_drawing_theme_draw_inner_rect (PlankDrawingTheme *self,
                                                         cairo_t *cr,
                                                         gint width,
                                                         gint height);
#define             PLANK_DRAWING_THEME_DEFAULT_NAME
gint                plank_drawing_theme_get_TopRoundness
                                                        (PlankDrawingTheme *self);
void                plank_drawing_theme_set_TopRoundness
                                                        (PlankDrawingTheme *self,
                                                         gint value);
gint                plank_drawing_theme_get_BottomRoundness
                                                        (PlankDrawingTheme *self);
void                plank_drawing_theme_set_BottomRoundness
                                                        (PlankDrawingTheme *self,
                                                         gint value);
gint                plank_drawing_theme_get_LineWidth   (PlankDrawingTheme *self);
void                plank_drawing_theme_set_LineWidth   (PlankDrawingTheme *self,
                                                         gint value);
void                plank_drawing_theme_get_OuterStrokeColor
                                                        (PlankDrawingTheme *self,
                                                         PlankDrawingColor *result);
void                plank_drawing_theme_set_OuterStrokeColor
                                                        (PlankDrawingTheme *self,
                                                         PlankDrawingColor *value);
void                plank_drawing_theme_get_FillStartColor
                                                        (PlankDrawingTheme *self,
                                                         PlankDrawingColor *result);
void                plank_drawing_theme_set_FillStartColor
                                                        (PlankDrawingTheme *self,
                                                         PlankDrawingColor *value);
void                plank_drawing_theme_get_FillEndColor
                                                        (PlankDrawingTheme *self,
                                                         PlankDrawingColor *result);
void                plank_drawing_theme_set_FillEndColor
                                                        (PlankDrawingTheme *self,
                                                         PlankDrawingColor *value);
void                plank_drawing_theme_get_InnerStrokeColor
                                                        (PlankDrawingTheme *self,
                                                         PlankDrawingColor *result);
void                plank_drawing_theme_set_InnerStrokeColor
                                                        (PlankDrawingTheme *self,
                                                         PlankDrawingColor *value);
void                plank_drawing_theme_draw_rounded_rect
                                                        (cairo_t *cr,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble width,
                                                         gdouble height,
                                                         gdouble top_radius,
                                                         gdouble bottom_radius,
                                                         gdouble line_width);
void                plank_drawing_theme_draw_rounded_line
                                                        (cairo_t *cr,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble width,
                                                         gdouble height,
                                                         gboolean is_round_left,
                                                         gboolean is_round_right,
                                                         cairo_pattern_t *stroke,
                                                         cairo_pattern_t *fill);
GeeArrayList *      plank_drawing_theme_get_theme_list  (void);
GFile *             plank_drawing_theme_get_theme_folder
                                                        (const gchar *name);
struct              PlankDrawingTheme;
struct              PlankDrawingThemeClass;

Object Hierarchy

  GObject
   +----PlankServicesPreferences
         +----PlankDrawingTheme
               +----PlankDrawingDockTheme
               +----PlankDrawingHoverTheme

Properties

  "BottomRoundness"          gint                  : Read / Write
  "FillEndColor"             PlankDrawingColor*    : Read / Write
  "FillStartColor"           PlankDrawingColor*    : Read / Write
  "InnerStrokeColor"         PlankDrawingColor*    : Read / Write
  "LineWidth"                gint                  : Read / Write
  "OuterStrokeColor"         PlankDrawingColor*    : Read / Write
  "TopRoundness"             gint                  : Read / Write

Description

Details

PLANK_DRAWING_TYPE_THEME

#define PLANK_DRAWING_TYPE_THEME (plank_drawing_theme_get_type ())

The type for PlankDrawingTheme.


plank_drawing_theme_load ()

void                plank_drawing_theme_load            (PlankDrawingTheme *self,
                                                         const gchar *type);

Loads a theme for the renderer to use.

self :

the PlankDrawingTheme instance

type :

 . the type of theme to load. [in]

plank_drawing_theme_get_top_offset ()

gint                plank_drawing_theme_get_top_offset  (PlankDrawingTheme *self);

Returns the top offset.

self :

the PlankDrawingTheme instance

Returns :

the top offset

plank_drawing_theme_get_bottom_offset ()

gint                plank_drawing_theme_get_bottom_offset
                                                        (PlankDrawingTheme *self);

Returns the bottom offset.

self :

the PlankDrawingTheme instance

Returns :

the bottom offset

plank_drawing_theme_draw_background ()

void                plank_drawing_theme_draw_background (PlankDrawingTheme *self,
                                                         PlankDrawingDockSurface *surface);

Draws a background onto the surface.

self :

the PlankDrawingTheme instance

surface :

 . the dock surface to draw on. [in]

plank_drawing_theme_draw_inner_rect ()

void                plank_drawing_theme_draw_inner_rect (PlankDrawingTheme *self,
                                                         cairo_t *cr,
                                                         gint width,
                                                         gint height);

Similar to draw_rounded_rect, but moves in to avoid a containing rounded rect's lines.

self :

the PlankDrawingTheme instance

cr :

 . the context to draw with. [in]

width :

 . the width of the rect. [in]

height :

 . the height of the rect. [in]

PLANK_DRAWING_THEME_DEFAULT_NAME

#define PLANK_DRAWING_THEME_DEFAULT_NAME "Default"

plank_drawing_theme_get_TopRoundness ()

gint                plank_drawing_theme_get_TopRoundness
                                                        (PlankDrawingTheme *self);

Get and return the current value of the "top-roundness" property.

self :

the PlankDrawingTheme instance to query

Returns :

the value of the "top-roundness" property

plank_drawing_theme_set_TopRoundness ()

void                plank_drawing_theme_set_TopRoundness
                                                        (PlankDrawingTheme *self,
                                                         gint value);

Set the value of the "top-roundness" property to value.

self :

the PlankDrawingTheme instance to modify

value :

the new value of the "top-roundness" property

plank_drawing_theme_get_BottomRoundness ()

gint                plank_drawing_theme_get_BottomRoundness
                                                        (PlankDrawingTheme *self);

Get and return the current value of the "bottom-roundness" property.

self :

the PlankDrawingTheme instance to query

Returns :

the value of the "bottom-roundness" property

plank_drawing_theme_set_BottomRoundness ()

void                plank_drawing_theme_set_BottomRoundness
                                                        (PlankDrawingTheme *self,
                                                         gint value);

Set the value of the "bottom-roundness" property to value.

self :

the PlankDrawingTheme instance to modify

value :

the new value of the "bottom-roundness" property

plank_drawing_theme_get_LineWidth ()

gint                plank_drawing_theme_get_LineWidth   (PlankDrawingTheme *self);

Get and return the current value of the "line-width" property.

self :

the PlankDrawingTheme instance to query

Returns :

the value of the "line-width" property

plank_drawing_theme_set_LineWidth ()

void                plank_drawing_theme_set_LineWidth   (PlankDrawingTheme *self,
                                                         gint value);

Set the value of the "line-width" property to value.

self :

the PlankDrawingTheme instance to modify

value :

the new value of the "line-width" property

plank_drawing_theme_get_OuterStrokeColor ()

void                plank_drawing_theme_get_OuterStrokeColor
                                                        (PlankDrawingTheme *self,
                                                         PlankDrawingColor *result);

Get and return the current value of the "outer-stroke-color" property.

self :

the PlankDrawingTheme instance to query

Returns :

the value of the "outer-stroke-color" property

plank_drawing_theme_set_OuterStrokeColor ()

void                plank_drawing_theme_set_OuterStrokeColor
                                                        (PlankDrawingTheme *self,
                                                         PlankDrawingColor *value);

Set the value of the "outer-stroke-color" property to value.

self :

the PlankDrawingTheme instance to modify

value :

the new value of the "outer-stroke-color" property

plank_drawing_theme_get_FillStartColor ()

void                plank_drawing_theme_get_FillStartColor
                                                        (PlankDrawingTheme *self,
                                                         PlankDrawingColor *result);

Get and return the current value of the "fill-start-color" property.

self :

the PlankDrawingTheme instance to query

Returns :

the value of the "fill-start-color" property

plank_drawing_theme_set_FillStartColor ()

void                plank_drawing_theme_set_FillStartColor
                                                        (PlankDrawingTheme *self,
                                                         PlankDrawingColor *value);

Set the value of the "fill-start-color" property to value.

self :

the PlankDrawingTheme instance to modify

value :

the new value of the "fill-start-color" property

plank_drawing_theme_get_FillEndColor ()

void                plank_drawing_theme_get_FillEndColor
                                                        (PlankDrawingTheme *self,
                                                         PlankDrawingColor *result);

Get and return the current value of the "fill-end-color" property.

self :

the PlankDrawingTheme instance to query

Returns :

the value of the "fill-end-color" property

plank_drawing_theme_set_FillEndColor ()

void                plank_drawing_theme_set_FillEndColor
                                                        (PlankDrawingTheme *self,
                                                         PlankDrawingColor *value);

Set the value of the "fill-end-color" property to value.

self :

the PlankDrawingTheme instance to modify

value :

the new value of the "fill-end-color" property

plank_drawing_theme_get_InnerStrokeColor ()

void                plank_drawing_theme_get_InnerStrokeColor
                                                        (PlankDrawingTheme *self,
                                                         PlankDrawingColor *result);

Get and return the current value of the "inner-stroke-color" property.

self :

the PlankDrawingTheme instance to query

Returns :

the value of the "inner-stroke-color" property

plank_drawing_theme_set_InnerStrokeColor ()

void                plank_drawing_theme_set_InnerStrokeColor
                                                        (PlankDrawingTheme *self,
                                                         PlankDrawingColor *value);

Set the value of the "inner-stroke-color" property to value.

self :

the PlankDrawingTheme instance to modify

value :

the new value of the "inner-stroke-color" property

plank_drawing_theme_draw_rounded_rect ()

void                plank_drawing_theme_draw_rounded_rect
                                                        (cairo_t *cr,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble width,
                                                         gdouble height,
                                                         gdouble top_radius,
                                                         gdouble bottom_radius,
                                                         gdouble line_width);

Draws a rounded rectangle. If compositing is disabled, just draws a normal rectangle.

cr :

 . the context to draw with. [in]

x :

 . the x location of the rect. [in]

y :

 . the y location of the rect. [in]

width :

 . the width of the rect. [in]

height :

 . the height of the rect. [in]

top_radius :

 . the roundedness of the top edge. [in]

bottom_radius :

 . the roundedness of the bottom edge. [in]

line_width :

 . the line-width of the rect. [in]

plank_drawing_theme_draw_rounded_line ()

void                plank_drawing_theme_draw_rounded_line
                                                        (cairo_t *cr,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble width,
                                                         gdouble height,
                                                         gboolean is_round_left,
                                                         gboolean is_round_right,
                                                         cairo_pattern_t *stroke,
                                                         cairo_pattern_t *fill);

Draws a rounded horizontal line.

cr :

 . the context to draw with. [in]

x :

 . the x location of the line. [in]

y :

 . the y location of the line. [in]

width :

 . the width of the line. [in]

height :

 . the height of the line. [in]

is_round_left :

 . weather the left is round or not. [in]

is_round_right :

 . weather the right is round or not. [in]

stroke :

 . filling style of the outline. [in][allow-none]

fill :

 . filling style of the inner area. [in][allow-none]

plank_drawing_theme_get_theme_list ()

GeeArrayList *      plank_drawing_theme_get_theme_list  (void);

Get a sorted list of all available theme-names

Returns :

GeeArrayList the list of theme-names

plank_drawing_theme_get_theme_folder ()

GFile *             plank_drawing_theme_get_theme_folder
                                                        (const gchar *name);

Try to get an already existing folder located in the themes folder while prefering the user's themes folder. If there is no folder found we fallback to the "Default" theme. If even that folder doesn't exist return NULL (and use built-in defaults)

name :

 . the basename of the folder. [in]

Returns :

GFile the folder of the theme or NULL

struct PlankDrawingTheme

struct PlankDrawingTheme;

A themed renderer for windows.


struct PlankDrawingThemeClass

struct PlankDrawingThemeClass {
	PlankServicesPreferencesClass parent_class;
};

The class structure for PLANK_DRAWING_TYPE_THEME. All the fields in this structure are private and should never be accessed directly.

PlankServicesPreferencesClass parent_class;

the parent class structure

Property Details

The "BottomRoundness" property

  "BottomRoundness"          gint                  : Read / Write

The roundness of the bottom corners.

Default value: 0


The "FillEndColor" property

  "FillEndColor"             PlankDrawingColor*    : Read / Write

The ending color (RGBA) of the fill gradient.


The "FillStartColor" property

  "FillStartColor"           PlankDrawingColor*    : Read / Write

The starting color (RGBA) of the fill gradient.


The "InnerStrokeColor" property

  "InnerStrokeColor"         PlankDrawingColor*    : Read / Write

The color (RGBA) of the inner stroke.


The "LineWidth" property

  "LineWidth"                gint                  : Read / Write

The thickness (in pixels) of lines drawn.

Default value: 0


The "OuterStrokeColor" property

  "OuterStrokeColor"         PlankDrawingColor*    : Read / Write

The color (RGBA) of the outer stroke.


The "TopRoundness" property

  "TopRoundness"             gint                  : Read / Write

The roundness of the top corners.

Default value: 0