CtkStyle: CTK+ 3 Reference Manual

## CtkStyle CtkStyle — Object that holds style information for widgets |

## Functions

#define | CTK_STYLE_ATTACHED()
CtkStyle * | ctk_style_new ()
CtkStyle * | ctk_style_copy ()
CtkStyle * | ctk_style_attach ()
void | ctk_style_detach ()
gboolean | ctk_style_has_context ()
void | ctk_style_set_background ()
void | ctk_style_apply_default_background ()
gboolean | ctk_style_lookup_color ()
CtkIconSet * | ctk_style_lookup_icon_set ()
GdkPixbuf * | ctk_style_render_icon ()
void | ctk_style_get_style_property ()
void | ctk_style_get_valist ()
void | ctk_style_get ()
void | ctk_paint_arrow ()
void | ctk_paint_box ()
void | ctk_paint_box_gap ()
void | ctk_paint_check ()
void | ctk_paint_diamond ()
void | ctk_paint_extension ()
void | ctk_paint_flat_box ()
void | ctk_paint_focus ()
void | ctk_paint_handle ()
void | ctk_paint_hline ()
void | ctk_paint_option ()
void | ctk_paint_shadow ()
void | ctk_paint_shadow_gap ()
void | ctk_paint_slider ()
void | ctk_paint_spinner ()
void | ctk_paint_tab ()
void | ctk_paint_vline ()
void | ctk_paint_expander ()
void | ctk_paint_layout ()
void | ctk_paint_resize_grip ()
void | ctk_draw_insertion_cursor ()
gboolean | (*CtkRcPropertyParser) ()

## Properties

CtkStyleContext * | context | Read / Write / Construct Only

## Signals

void | realize | Run First
void | unrealize | Run First

## Types and Values

| CtkStyle
struct | CtkStyleClass
enum | CtkExpanderStyle
| CtkRcProperty

## Object Hierarchy

        GObject
        ╰── CtkStyle

## Includes

    #include <ctk/ctk.h>

## Description

A CtkStyle object encapsulates the information that provides the look and feel for a widget.

Each CtkWidget has an associated CtkStyle object that is used when rendering that widget. Also, a CtkStyle holds information for the five possible widget states though not every widget supports all five states; see CtkStateType.

Usually the CtkStyle for a widget is the same as the default style that is set by CTK+ and modified the theme engine.

Usually applications should not need to use or modify the CtkStyle of their widgets.

## Functions

### CTK_STYLE_ATTACHED()

    #define CTK_STYLE_ATTACHED(style)       (CTK_STYLE (style)->attach_count > 0)

#### Parameters

style | a CtkStyle. |

#### Returns

whether the style is attached to a window.

### ctk_style_new ()

    CtkStyle *
    ctk_style_new (void);

Creates a new CtkStyle.

#### Returns

a new CtkStyle.

### ctk_style_copy ()

    CtkStyle *
    ctk_style_copy (CtkStyle *style);

Creates a copy of the passed in CtkStyle object.

#### Parameters

style | a CtkStyle |

#### Returns

a copy of `style` .

[transfer full]

### ctk_style_attach ()

    CtkStyle *
    ctk_style_attach (CtkStyle *style,
                      CdkWindow *window);

Attaches a style to a window; this process allocates the colors and creates the GC’s for the style - it specializes it to a particular visual. The process may involve the creation of a new style if the style has already been attached to a window with a different style and visual.

Since this function may return a new object, you have to use it in the following way: `style = ctk_style_attach (style, window)`

[skip]

#### Parameters

style | a CtkStyle. |
window | a CdkWindow. |

#### Returns

Either `style` , or a newly-created CtkStyle. If the style is newly created, the style parameter will be unref'ed, and the new style will have a reference count belonging to the caller.

### ctk_style_detach ()

    void
    ctk_style_detach (CtkStyle *style);

Detaches a style from a window. If the style is not attached to any windows anymore, it is unrealized. See `ctk_style_attach()`.

#### Parameters

style | a CtkStyle |

### ctk_style_has_context ()

    gboolean
    ctk_style_has_context (CtkStyle *style);

Returns whether `style` has an associated CtkStyleContext.

#### Parameters

style | a CtkStyle |

#### Returns

`TRUE` if `style` has a CtkStyleContext

Since: 3.0

### ctk_style_set_background ()

    void
    ctk_style_set_background (CtkStyle *style,
                              CdkWindow *window,
                              CtkStateType state_type);

Sets the background of `window` to the background color or pixmap specified by `style` for the given state.

#### Parameters

style | a CtkStyle |
window | a CdkWindow |
state_type | a state |

### ctk_style_apply_default_background ()

    void
    ctk_style_apply_default_background (CtkStyle *style,
                                        cairo_t *cr,
                                        CdkWindow *window,
                                        CtkStateType state_type,
                                        gint x,
                                        gint y,
                                        gint width,
                                        gint height);

### ctk_style_lookup_color ()

    gboolean
    ctk_style_lookup_color (CtkStyle *style,
                            const gchar *color_name,
                            CdkColor *color);

Looks up `color_name` in the style’s logical color mappings, filling in `color` and returning `TRUE` if found, otherwise returning `FALSE`. Do not cache the found mapping, because it depends on the CtkStyle and might change when a theme switch occurs.

#### Parameters

style | a CtkStyle |
color_name | the name of the logical color to look up |
color | the CdkColor to fill in. | [out]

#### Returns

`TRUE` if the mapping was found.

Since: 2.10

### ctk_style_lookup_icon_set ()

    CtkIconSet *
    ctk_style_lookup_icon_set (CtkStyle *style,
                               const gchar *stock_id);

Looks up `stock_id` in the icon factories associated with `style` and the default icon factory, returning an icon set if found, otherwise `NULL`.

#### Parameters

style | a CtkStyle |
stock_id | an icon name |

#### Returns

icon set of `stock_id` .

[transfer none]

### ctk_style_render_icon ()

    GdkPixbuf *
    ctk_style_render_icon (CtkStyle *style,
                           const CtkIconSource *source,
                           CtkTextDirection direction,
                           CtkStateType state,
                           CtkIconSize size,
                           CtkWidget *widget,
                           const gchar *detail);

Renders the icon specified by `source` at the given `size` according to the given parameters and returns the result in a pixbuf.

#### Parameters

style | a CtkStyle |
source | the CtkIconSource specifying the icon to render |
direction | a text direction |
state | a state |
size | the size to render the icon at (CtkIconSize). A size of `(CtkIconSize)-1` means render at the size of the source and don’t scale. | [type int]
widget | the widget. | [allow-none]
detail | a style detail. | [allow-none]

#### Returns

a newly-created GdkPixbuf containing the rendered icon.

[transfer full]

### ctk_style_get_style_property ()

    void
    ctk_style_get_style_property (CtkStyle *style,
                                  GType widget_type,
                                  const gchar *property_name,
                                  GValue *value);

Queries the value of a style property corresponding to a widget class is in the given style.

#### Parameters

style | a CtkStyle |
widget_type | the GType of a descendant of CtkWidget |
property_name | the name of the style property to get |
value | a GValue where the value of the property being queried will be stored. | [out]

Since: 2.16

### ctk_style_get_valist ()

    void
    ctk_style_get_valist (CtkStyle *style,
                          GType widget_type,
                          const gchar *first_property_name,
                          va_list var_args);

Non-vararg variant of `ctk_style_get()`. Used primarily by language bindings.

#### Parameters

style | a CtkStyle |
widget_type | the GType of a descendant of CtkWidget |
first_property_name | the name of the first style property to get |
var_args | a va_list of pairs of property names and locations to return the property values, starting with the location for `first_property_name` . |

Since: 2.16

### ctk_style_get ()

    void
    ctk_style_get (CtkStyle *style,
                   GType widget_type,
                   const gchar *first_property_name,
                   ...);

Gets the values of a multiple style properties for `widget_type` from `style` .

#### Parameters

style | a CtkStyle |
widget_type | the GType of a descendant of CtkWidget |
first_property_name | the name of the first style property to get |
... | pairs of property names and locations to return the property values, starting with the location for `first_property_name` , terminated by `NULL`. |

Since: 2.16

### ctk_paint_arrow ()

    void
    ctk_paint_arrow (CtkStyle *style,
                     cairo_t *cr,
                     CtkStateType state_type,
                     CtkShadowType shadow_type,
                     CtkWidget *widget,
                     const gchar *detail,
                     CtkArrowType arrow_type,
                     gboolean fill,
                     gint x,
                     gint y,
                     gint width,
                     gint height);

Draws an arrow in the given rectangle on `cr` using the given parameters. `arrow_type` determines the direction of the arrow.

#### Parameters

style | a CtkStyle |
cr | a cairo_t |
state_type | a state |
shadow_type | the type of shadow to draw |
widget | the widget. | [allow-none]
detail | a style detail. | [allow-none]
arrow_type | the type of arrow to draw |
fill | `TRUE` if the arrow tip should be filled |
x | x origin of the rectangle to draw the arrow in |
y | y origin of the rectangle to draw the arrow in |
width | width of the rectangle to draw the arrow in |
height | height of the rectangle to draw the arrow in |

### ctk_paint_box ()

    void
    ctk_paint_box (CtkStyle *style,
                   cairo_t *cr,
                   CtkStateType state_type,
                   CtkShadowType shadow_type,
                   CtkWidget *widget,
                   const gchar *detail,
                   gint x,
                   gint y,
                   gint width,
                   gint height);

Draws a box on `cr` with the given parameters.

#### Parameters

style | a CtkStyle |
cr | a cairo_t |
state_type | a state |
shadow_type | the type of shadow to draw |
widget | the widget. | [allow-none]
detail | a style detail. | [allow-none]
x | x origin of the box |
y | y origin of the box |
width | the width of the box |
height | the height of the box |

### ctk_paint_box_gap ()

    void
    ctk_paint_box_gap (CtkStyle *style,
                       cairo_t *cr,
                       CtkStateType state_type,
                       CtkShadowType shadow_type,
                       CtkWidget *widget,
                       const gchar *detail,
                       gint x,
                       gint y,
                       gint width,
                       gint height,
                       CtkPositionType gap_side,
                       gint gap_x,
                       gint gap_width);

Draws a box in `cr` using the given style and state and shadow type, leaving a gap in one side.

#### Parameters

style | a CtkStyle |
cr | a cairo_t |
state_type | a state |
shadow_type | type of shadow to draw |
widget | the widget. | [allow-none]
detail | a style detail. | [allow-none]
x | x origin of the rectangle |
y | y origin of the rectangle |
width | width of the rectangle |
height | width of the rectangle |
gap_side | side in which to leave the gap |
gap_x | starting position of the gap |
gap_width | width of the gap |

### ctk_paint_check ()

    void
    ctk_paint_check (CtkStyle *style,
                     cairo_t *cr,
                     CtkStateType state_type,
                     CtkShadowType shadow_type,
                     CtkWidget *widget,
                     const gchar *detail,
                     gint x,
                     gint y,
                     gint width,
                     gint height);

Draws a check button indicator in the given rectangle on `cr` with the given parameters.

#### Parameters

style | a CtkStyle |
cr | a cairo_t |
state_type | a state |
shadow_type | the type of shadow to draw |
widget | the widget. | [allow-none]
detail | a style detail. | [allow-none]
x | x origin of the rectangle to draw the check in |
y | y origin of the rectangle to draw the check in |
width | the width of the rectangle to draw the check in |
height | the height of the rectangle to draw the check in |

### ctk_paint_diamond ()

    void
    ctk_paint_diamond (CtkStyle *style,
                       cairo_t *cr,
                       CtkStateType state_type,
                       CtkShadowType shadow_type,
                       CtkWidget *widget,
                       const gchar *detail,
                       gint x,
                       gint y,
                       gint width,
                       gint height);

Draws a diamond in the given rectangle on `window` using the given parameters.

#### Parameters

style | a CtkStyle |
cr | a cairo_t |
state_type | a state |
shadow_type | the type of shadow to draw |
widget | the widget. | [allow-none]
detail | a style detail. | [allow-none]
x | x origin of the rectangle to draw the diamond in |
y | y origin of the rectangle to draw the diamond in |
width | width of the rectangle to draw the diamond in |
height | height of the rectangle to draw the diamond in |

### ctk_paint_extension ()

    void
    ctk_paint_extension (CtkStyle *style,
                         cairo_t *cr,
                         CtkStateType state_type,
                         CtkShadowType shadow_type,
                         CtkWidget *widget,
                         const gchar *detail,
                         gint x,
                         gint y,
                         gint width,
                         gint height,
                         CtkPositionType gap_side);

Draws an extension, i.e. a notebook tab.

#### Parameters

style | a CtkStyle |
cr | a cairo_t |
state_type | a state |
shadow_type | type of shadow to draw |
widget | the widget. | [allow-none]
detail | a style detail. | [allow-none]
x | x origin of the extension |
y | y origin of the extension |
width | width of the extension |
height | width of the extension |
gap_side | the side on to which the extension is attached |

### ctk_paint_flat_box ()

    void
    ctk_paint_flat_box (CtkStyle *style,
                        cairo_t *cr,
                        CtkStateType state_type,
                        CtkShadowType shadow_type,
                        CtkWidget *widget,
                        const gchar *detail,
                        gint x,
                        gint y,
                        gint width,
                        gint height);

Draws a flat box on `cr` with the given parameters.

#### Parameters

style | a CtkStyle |
cr | a cairo_t |
state_type | a state |
shadow_type | the type of shadow to draw |
widget | the widget. | [allow-none]
detail | a style detail. | [allow-none]
x | x origin of the box |
y | y origin of the box |
width | the width of the box |
height | the height of the box |

### ctk_paint_focus ()

    void
    ctk_paint_focus (CtkStyle *style,
                     cairo_t *cr,
                     CtkStateType state_type,
                     CtkWidget *widget,
                     const gchar *detail,
                     gint x,
                     gint y,
                     gint width,
                     gint height);

Draws a focus indicator around the given rectangle on `cr` using the given style.

#### Parameters

style | a CtkStyle |
cr | a cairo_t |
state_type | a state |
widget | the widget. | [allow-none]
detail | a style detail. | [allow-none]
x | the x origin of the rectangle around which to draw a focus indicator |
y | the y origin of the rectangle around which to draw a focus indicator |
width | the width of the rectangle around which to draw a focus indicator |
height | the height of the rectangle around which to draw a focus indicator |

### ctk_paint_handle ()

    void
    ctk_paint_handle (CtkStyle *style,
                      cairo_t *cr,
                      CtkStateType state_type,
                      CtkShadowType shadow_type,
                      CtkWidget *widget,
                      const gchar *detail,
                      gint x,
                      gint y,
                      gint width,
                      gint height,
                      CtkOrientation orientation);

Draws a handle as used in CtkHandleBox and CtkPaned.

#### Parameters

style | a CtkStyle |
cr | a cairo_t |
state_type | a state |
shadow_type | type of shadow to draw |
widget | the widget. | [allow-none]
detail | a style detail. | [allow-none]
x | x origin of the handle |
y | y origin of the handle |
width | with of the handle |
height | height of the handle |
orientation | the orientation of the handle |

### ctk_paint_hline ()

    void
    ctk_paint_hline (CtkStyle *style,
                     cairo_t *cr,
                     CtkStateType state_type,
                     CtkWidget *widget,
                     const gchar *detail,
                     gint x1,
                     gint x2,
                     gint y);

Draws a horizontal line from (`x1` , `y` ) to (`x2` , `y` ) in `cr` using the given style and state.

#### Parameters

style | a CtkStyle |
cr | a caio_t |
state_type | a state |
widget | the widget. | [allow-none]
detail | a style detail. | [allow-none]
x1 | the starting x coordinate |
x2 | the ending x coordinate |
y | the y coordinate |

### ctk_paint_option ()

    void
    ctk_paint_option (CtkStyle *style,
                      cairo_t *cr,
                      CtkStateType state_type,
                      CtkShadowType shadow_type,
                      CtkWidget *widget,
                      const gchar *detail,
                      gint x,
                      gint y,
                      gint width,
                      gint height);

Draws a radio button indicator in the given rectangle on `cr` with the given parameters.

#### Parameters

style | a CtkStyle |
cr | a cairo_t |
state_type | a state |
shadow_type | the type of shadow to draw |
widget | the widget. | [allow-none]
detail | a style detail. | [allow-none]
x | x origin of the rectangle to draw the option in |
y | y origin of the rectangle to draw the option in |
width | the width of the rectangle to draw the option in |
height | the height of the rectangle to draw the option in |

### ctk_paint_shadow ()

    void
    ctk_paint_shadow (CtkStyle *style,
                      cairo_t *cr,
                      CtkStateType state_type,
                      CtkShadowType shadow_type,
                      CtkWidget *widget,
                      const gchar *detail,
                      gint x,
                      gint y,
                      gint width,
                      gint height);

Draws a shadow around the given rectangle in `cr` using the given style and state and shadow type.

#### Parameters

style | a CtkStyle |
cr | a cairo_t |
state_type | a state |
shadow_type | type of shadow to draw |
widget | the widget. | [allow-none]
detail | a style detail. | [allow-none]
x | x origin of the rectangle |
y | y origin of the rectangle |
width | width of the rectangle |
height | width of the rectangle |

### ctk_paint_shadow_gap ()

    void
    ctk_paint_shadow_gap (CtkStyle *style,
                          cairo_t *cr,
                          CtkStateType state_type,
                          CtkShadowType shadow_type,
                          CtkWidget *widget,
                          const gchar *detail,
                          gint x,
                          gint y,
                          gint width,
                          gint height,
                          CtkPositionType gap_side,
                          gint gap_x,
                          gint gap_width);

Draws a shadow around the given rectangle in `cr` using the given style and state and shadow type, leaving a gap in one side.

#### Parameters

style | a CtkStyle |
cr | a cairo_t |
state_type | a state |
shadow_type | type of shadow to draw |
widget | the widget. | [allow-none]
detail | a style detail. | [allow-none]
x | x origin of the rectangle |
y | y origin of the rectangle |
width | width of the rectangle |
height | width of the rectangle |
gap_side | side in which to leave the gap |
gap_x | starting position of the gap |
gap_width | width of the gap |

### ctk_paint_slider ()

    void
    ctk_paint_slider (CtkStyle *style,
                      cairo_t *cr,
                      CtkStateType state_type,
                      CtkShadowType shadow_type,
                      CtkWidget *widget,
                      const gchar *detail,
                      gint x,
                      gint y,
                      gint width,
                      gint height,
                      CtkOrientation orientation);

Draws a slider in the given rectangle on `cr` using the given style and orientation.

#### Parameters

style | a CtkStyle |
cr | a cairo_t |
state_type | a state |
shadow_type | a shadow |
widget | the widget. | [allow-none]
detail | a style detail. | [allow-none]
x | the x origin of the rectangle in which to draw a slider |
y | the y origin of the rectangle in which to draw a slider |
width | the width of the rectangle in which to draw a slider |
height | the height of the rectangle in which to draw a slider |
orientation | the orientation to be used |

### ctk_paint_spinner ()

    void
    ctk_paint_spinner (CtkStyle *style,
                       cairo_t *cr,
                       CtkStateType state_type,
                       CtkWidget *widget,
                       const gchar *detail,
                       guint step,
                       gint x,
                       gint y,
                       gint width,
                       gint height);

Draws a spinner on `window` using the given parameters.

#### Parameters

style | a CtkStyle |
cr | a cairo_t |
state_type | a state |
widget | the widget (may be `NULL`). | [allow-none]
detail | a style detail (may be `NULL`). | [allow-none]
step | the nth step |
x | the x origin of the rectangle in which to draw the spinner |
y | the y origin of the rectangle in which to draw the spinner |
width | the width of the rectangle in which to draw the spinner |
height | the height of the rectangle in which to draw the spinner |

### ctk_paint_tab ()

    void
    ctk_paint_tab (CtkStyle *style,
                   cairo_t *cr,
                   CtkStateType state_type,
                   CtkShadowType shadow_type,
                   CtkWidget *widget,
                   const gchar *detail,
                   gint x,
                   gint y,
                   gint width,
                   gint height);

Draws an option menu tab (i.e. the up and down pointing arrows) in the given rectangle on `cr` using the given parameters.

#### Parameters

style | a CtkStyle |
cr | a cairo_t |
state_type | a state |
shadow_type | the type of shadow to draw |
widget | the widget. | [allow-none]
detail | a style detail. | [allow-none]
x | x origin of the rectangle to draw the tab in |
y | y origin of the rectangle to draw the tab in |
width | the width of the rectangle to draw the tab in |
height | the height of the rectangle to draw the tab in |

### ctk_paint_vline ()

    void
    ctk_paint_vline (CtkStyle *style,
                     cairo_t *cr,
                     CtkStateType state_type,
                     CtkWidget *widget,
                     const gchar *detail,
                     gint y1_,
                     gint y2_,
                     gint x);

Draws a vertical line from (`x` , `y1_` ) to (`x` , `y2_` ) in `cr` using the given style and state.

#### Parameters

style | a CtkStyle |
cr | a cairo_t |
state_type | a state |
widget | the widget. | [allow-none]
detail | a style detail. | [allow-none]
y1_ | the starting y coordinate |
y2_ | the ending y coordinate |
x | the x coordinate |

### ctk_paint_expander ()

    void
    ctk_paint_expander (CtkStyle *style,
                        cairo_t *cr,
                        CtkStateType state_type,
                        CtkWidget *widget,
                        const gchar *detail,
                        gint x,
                        gint y,
                        CtkExpanderStyle expander_style);

Draws an expander as used in CtkTreeView. `x` and `y` specify the center the expander. The size of the expander is determined by the “expander-size” style property of `widget` . (If widget is not specified or doesn’t have an “expander-size” property, an unspecified default size will be used, since the caller doesn't have sufficient information to position the expander, this is likely not useful.) The expander is expander_size pixels tall in the collapsed position and expander_size pixels wide in the expanded position.

#### Parameters

style | a CtkStyle |
cr | a cairo_t |
state_type | a state |
widget | the widget. | [allow-none]
detail | a style detail. | [allow-none]
x | the x position to draw the expander at |
y | the y position to draw the expander at |
expander_style | the style to draw the expander in; determines whether the expander is collapsed, expanded, or in an intermediate state. |

### ctk_paint_layout ()

    void
    ctk_paint_layout (CtkStyle *style,
                      cairo_t *cr,
                      CtkStateType state_type,
                      gboolean use_text,
                      CtkWidget *widget,
                      const gchar *detail,
                      gint x,
                      gint y,
                      PangoLayout *layout);

Draws a layout on `cr` using the given parameters.

#### Parameters

style | a CtkStyle |
cr | a cairo_t |
state_type | a state |
use_text | whether to use the text or foreground graphics context of `style` |
widget | the widget. | [allow-none]
detail | a style detail. | [allow-none]
x | x origin |
y | y origin |
layout | the layout to draw |

### ctk_paint_resize_grip ()

    void
    ctk_paint_resize_grip (CtkStyle *style,
                           cairo_t *cr,
                           CtkStateType state_type,
                           CtkWidget *widget,
                           const gchar *detail,
                           CdkWindowEdge edge,
                           gint x,
                           gint y,
                           gint width,
                           gint height);

Draws a resize grip in the given rectangle on `cr` using the given parameters.

#### Parameters

style | a CtkStyle |
cr | a cairo_t |
state_type | a state |
widget | the widget. | [allow-none]
detail | a style detail. | [allow-none]
edge | the edge in which to draw the resize grip |
x | the x origin of the rectangle in which to draw the resize grip |
y | the y origin of the rectangle in which to draw the resize grip |
width | the width of the rectangle in which to draw the resize grip |
height | the height of the rectangle in which to draw the resize grip |

### ctk_draw_insertion_cursor ()

    void
    ctk_draw_insertion_cursor (CtkWidget *widget,
                               cairo_t *cr,
                               const CdkRectangle *location,
                               gboolean is_primary,
                               CtkTextDirection direction,
                               gboolean draw_arrow);

`ctk_draw_insertion_cursor` has been deprecated since version 3.4 and should not be used in newly-written code.

Use `ctk_render_insertion_cursor()` instead.

Draws a text caret on `cr` at `location` . This is not a style function but merely a convenience function for drawing the standard cursor shape.

#### Parameters

widget | a CtkWidget |
cr | cairo context to draw to |
location | location where to draw the cursor (`location->width` is ignored) |
is_primary | if the cursor should be the primary cursor color. |
direction | whether the cursor is left-to-right or right-to-left. Should never be CTK_TEXT_DIR_NONE |
draw_arrow | `TRUE` to draw a directional arrow on the cursor. Should be `FALSE` unless the cursor is split. |

Since: 3.0

### CtkRcPropertyParser ()

    gboolean
    (*CtkRcPropertyParser) (const GParamSpec *pspec,
                            const GString *rc_string,
                            GValue *property_value);

## Types and Values

### CtkStyle

    typedef struct {
      CdkColor fg[5];
      CdkColor bg[5];
      CdkColor light[5];
      CdkColor dark[5];
      CdkColor mid[5];
      CdkColor text[5];
      CdkColor base[5];
      CdkColor text_aa[5];          /* Halfway between text/base */

      CdkColor black;
      CdkColor white;
      PangoFontDescription *font_desc;

      gint xthickness;
      gint ythickness;

      cairo_pattern_t *background[5];
    } CtkStyle;

#### Members

CdkColor `fg`[5]; | Set of foreground CdkColor |
CdkColor `bg`[5]; | Set of background CdkColor |
CdkColor `light`[5]; | Set of light CdkColor |
CdkColor `dark`[5]; | Set of dark CdkColor |
CdkColor `mid`[5]; | Set of mid CdkColor |
CdkColor `text`[5]; | Set of text CdkColor |
CdkColor `base`[5]; | Set of base CdkColor |
CdkColor `text_aa`[5]; | Color halfway between text/base |
CdkColor `black`; | CdkColor to use for black |
CdkColor `white`; | CdkColor to use for white |
PangoFontDescription *`font_desc`; | PangoFontDescription |
gint `xthickness`; | Thickness in X direction |
gint `ythickness`; | Thickness in Y direction |
cairo_pattern_t *`background`[5]; | Set of background cairo_pattern_t |

### struct CtkStyleClass

    struct CtkStyleClass {
      GObjectClass parent_class;

      /* Initialize for a particular visual. style->visual
       * will have been set at this point. Will typically chain
       * to parent.
       */
      void (*realize)               (CtkStyle               *style);

      /* Clean up for a particular visual. Will typically chain
       * to parent.
       */
      void (*unrealize)             (CtkStyle               *style);

      /* Make style an exact duplicate of src.
       */
      void (*copy)                  (CtkStyle               *style,
                                     CtkStyle               *src);

      /* Create an empty style of the same type as this style.
       * The default implementation, which does
       * g_object_new (G_OBJECT_TYPE (style), NULL);
       * should work in most cases.
       */
      CtkStyle *(*clone)             (CtkStyle               *style);

      /* Initialize the CtkStyle with the values in the CtkRcStyle.
       * should chain to the parent implementation.
       */
      void     (*init_from_rc)      (CtkStyle               *style,
                                     CtkRcStyle             *rc_style);

      void (*set_background)        (CtkStyle               *style,
                                     CdkWindow              *window,
                                     CtkStateType            state_type);

      GdkPixbuf * (* render_icon)   (CtkStyle               *style,
                                     const CtkIconSource    *source,
                                     CtkTextDirection        direction,
                                     CtkStateType            state,
                                     CtkIconSize             size,
                                     CtkWidget              *widget,
                                     const gchar            *detail);

      /* Drawing functions
       */

      void (*draw_hline)            (CtkStyle               *style,
                                     cairo_t                *cr,
                                     CtkStateType            state_type,
                                     CtkWidget              *widget,
                                     const gchar            *detail,
                                     gint                    x1,
                                     gint                    x2,
                                     gint                    y);
      void (*draw_vline)            (CtkStyle               *style,
                                     cairo_t                *cr,
                                     CtkStateType            state_type,
                                     CtkWidget              *widget,
                                     const gchar            *detail,
                                     gint                    y1_,
                                     gint                    y2_,
                                     gint                    x);
      void (*draw_shadow)           (CtkStyle               *style,
                                     cairo_t                *cr,
                                     CtkStateType            state_type,
                                     CtkShadowType           shadow_type,
                                     CtkWidget              *widget,
                                     const gchar            *detail,
                                     gint                    x,
                                     gint                    y,
                                     gint                    width,
                                     gint                    height);
      void (*draw_arrow)            (CtkStyle               *style,
                                     cairo_t                *cr,
                                     CtkStateType            state_type,
                                     CtkShadowType           shadow_type,
                                     CtkWidget              *widget,
                                     const gchar            *detail,
                                     CtkArrowType            arrow_type,
                                     gboolean                fill,
                                     gint                    x,
                                     gint                    y,
                                     gint                    width,
                                     gint                    height);
      void (*draw_diamond)          (CtkStyle               *style,
                                     cairo_t                *cr,
                                     CtkStateType            state_type,
                                     CtkShadowType           shadow_type,
                                     CtkWidget              *widget,
                                     const gchar            *detail,
                                     gint                    x,
                                     gint                    y,
                                     gint                    width,
                                     gint                    height);
      void (*draw_box)              (CtkStyle               *style,
                                     cairo_t                *cr,
                                     CtkStateType            state_type,
                                     CtkShadowType           shadow_type,
                                     CtkWidget              *widget,
                                     const gchar            *detail,
                                     gint                    x,
                                     gint                    y,
                                     gint                    width,
                                     gint                    height);
      void (*draw_flat_box)         (CtkStyle               *style,
                                     cairo_t                *cr,
                                     CtkStateType            state_type,
                                     CtkShadowType           shadow_type,
                                     CtkWidget              *widget,
                                     const gchar            *detail,
                                     gint                    x,
                                     gint                    y,
                                     gint                    width,
                                     gint                    height);
      void (*draw_check)            (CtkStyle               *style,
                                     cairo_t                *cr,
                                     CtkStateType            state_type,
                                     CtkShadowType           shadow_type,
                                     CtkWidget              *widget,
                                     const gchar            *detail,
                                     gint                    x,
                                     gint                    y,
                                     gint                    width,
                                     gint                    height);
      void (*draw_option)           (CtkStyle               *style,
                                     cairo_t                *cr,
                                     CtkStateType            state_type,
                                     CtkShadowType           shadow_type,
                                     CtkWidget              *widget,
                                     const gchar            *detail,
                                     gint                    x,
                                     gint                    y,
                                     gint                    width,
                                     gint                    height);
      void (*draw_tab)              (CtkStyle               *style,
                                     cairo_t                *cr,
                                     CtkStateType            state_type,
                                     CtkShadowType           shadow_type,
                                     CtkWidget              *widget,
                                     const gchar            *detail,
                                     gint                    x,
                                     gint                    y,
                                     gint                    width,
                                     gint                    height);
      void (*draw_shadow_gap)       (CtkStyle               *style,
                                     cairo_t                *cr,
                                     CtkStateType            state_type,
                                     CtkShadowType           shadow_type,
                                     CtkWidget              *widget,
                                     const gchar            *detail,
                                     gint                    x,
                                     gint                    y,
                                     gint                    width,
                                     gint                    height,
                                     CtkPositionType         gap_side,
                                     gint                    gap_x,
                                     gint                    gap_width);
      void (*draw_box_gap)          (CtkStyle               *style,
                                     cairo_t                *cr,
                                     CtkStateType            state_type,
                                     CtkShadowType           shadow_type,
                                     CtkWidget              *widget,
                                     const gchar            *detail,
                                     gint                    x,
                                     gint                    y,
                                     gint                    width,
                                     gint                    height,
                                     CtkPositionType         gap_side,
                                     gint                    gap_x,
                                     gint                    gap_width);
      void (*draw_extension)        (CtkStyle               *style,
                                     cairo_t                *cr,
                                     CtkStateType            state_type,
                                     CtkShadowType           shadow_type,
                                     CtkWidget              *widget,
                                     const gchar            *detail,
                                     gint                    x,
                                     gint                    y,
                                     gint                    width,
                                     gint                    height,
                                     CtkPositionType         gap_side);
      void (*draw_focus)            (CtkStyle               *style,
                                     cairo_t                *cr,
                                     CtkStateType            state_type,
                                     CtkWidget              *widget,
                                     const gchar            *detail,
                                     gint                    x,
                                     gint                    y,
                                     gint                    width,
                                     gint                    height);
      void (*draw_slider)           (CtkStyle               *style,
                                     cairo_t                *cr,
                                     CtkStateType            state_type,
                                     CtkShadowType           shadow_type,
                                     CtkWidget              *widget,
                                     const gchar            *detail,
                                     gint                    x,
                                     gint                    y,
                                     gint                    width,
                                     gint                    height,
                                     CtkOrientation          orientation);
      void (*draw_handle)           (CtkStyle               *style,
                                     cairo_t                *cr,
                                     CtkStateType            state_type,
                                     CtkShadowType           shadow_type,
                                     CtkWidget              *widget,
                                     const gchar            *detail,
                                     gint                    x,
                                     gint                    y,
                                     gint                    width,
                                     gint                    height,
                                     CtkOrientation          orientation);

      void (*draw_expander)         (CtkStyle               *style,
                                     cairo_t                *cr,
                                     CtkStateType            state_type,
                                     CtkWidget              *widget,
                                     const gchar            *detail,
                                     gint                    x,
                                     gint                    y,
                                     CtkExpanderStyle        expander_style);
      void (*draw_layout)           (CtkStyle               *style,
                                     cairo_t                *cr,
                                     CtkStateType            state_type,
                                     gboolean                use_text,
                                     CtkWidget              *widget,
                                     const gchar            *detail,
                                     gint                    x,
                                     gint                    y,
                                     PangoLayout            *layout);
      void (*draw_resize_grip)      (CtkStyle               *style,
                                     cairo_t                *cr,
                                     CtkStateType            state_type,
                                     CtkWidget              *widget,
                                     const gchar            *detail,
                                     CdkWindowEdge           edge,
                                     gint                    x,
                                     gint                    y,
                                     gint                    width,
                                     gint                    height);
      void (*draw_spinner)          (CtkStyle               *style,
                                     cairo_t                *cr,
                                     CtkStateType            state_type,
                                     CtkWidget              *widget,
                                     const gchar            *detail,
                                     guint                   step,
                                     gint                    x,
                                     gint                    y,
                                     gint                    width,
                                     gint                    height);
    };

#### Members

`realize` () |  |
`unrealize` () |  |
`copy` () |  |
`clone` () |  |
`init_from_rc` () |  |
`set_background` () |  |
`render_icon` () |  |
`draw_hline` () |  |
`draw_vline` () |  |
`draw_shadow` () |  |
`draw_arrow` () |  |
`draw_diamond` () |  |
`draw_box` () |  |
`draw_flat_box` () |  |
`draw_check` () |  |
`draw_option` () |  |
`draw_tab` () |  |
`draw_shadow_gap` () |  |
`draw_box_gap` () |  |
`draw_extension` () |  |
`draw_focus` () |  |
`draw_slider` () |  |
`draw_handle` () |  |
`draw_expander` () |  |
`draw_layout` () |  |
`draw_resize_grip` () |  |
`draw_spinner` () |  |

### enum CtkExpanderStyle

Used to specify the style of the expanders drawn by a CtkTreeView.

#### Members

CTK_EXPANDER_COLLAPSED | The style used for a collapsed subtree. |
CTK_EXPANDER_SEMI_COLLAPSED | Intermediate style used during animation. |
CTK_EXPANDER_SEMI_EXPANDED | Intermediate style used during animation. |
CTK_EXPANDER_EXPANDED | The style used for an expanded subtree. |

### CtkRcProperty

    typedef struct {
      /* quark-ified property identifier like “CtkScrollbar::spacing” */
      GQuark type_name;
      GQuark property_name;

      /* fields similar to CtkSettingsValue */
      gchar *origin;
      GValue value;
    } CtkRcProperty;

#### Members

GQuark `type_name`; | quark-ified type identifier |
GQuark `property_name`; | quark-ified property identifier like “CtkScrollbar::spacing” |
gchar *`origin`; | field similar to one found in CtkSettingsValue |
GValue `value`; | field similar to one found in CtkSettingsValue |

## Property Details

### The `“context”` property

      “context”                  CtkStyleContext *

CtkStyleContext to get style from.

Owner: CtkStyle

Flags: Read / Write / Construct Only

## Signal Details

### The `“realize”` signal

    void
    user_function (CtkStyle *style,
                   gpointer  user_data)

Emitted when the style has been initialized for a particular visual. Connecting to this signal is probably seldom useful since most of the time applications and widgets only deal with styles that have been already realized.

#### Parameters

style | the object which received the signal |
user_data | user data set when the signal handler was connected. |

Flags: Run First

Since: 2.4

### The `“unrealize”` signal

    void
    user_function (CtkStyle *style,
                   gpointer  user_data)

Emitted when the aspects of the style specific to a particular visual is being cleaned up. A connection to this signal can be useful if a widget wants to cache objects as object data on CtkStyle. This signal provides a convenient place to free such cached objects.

#### Parameters

style | the object which received the signal |
user_data | user data set when the signal handler was connected. |

Flags: Run First

Since: 2.4