Top |
A GtkStyle object encapsulates the information that provides the look and feel for a widget.
In GTK+ 3.0, GtkStyle has been deprecated and replaced by GtkStyleContext.
Each GtkWidget has an associated GtkStyle object that is used when rendering that widget. Also, a GtkStyle holds information for the five possible widget states though not every widget supports all five states; see GtkStateType.
Usually the GtkStyle for a widget is the same as the default style that is set by GTK+ and modified the theme engine.
Usually applications should not need to use or modify the GtkStyle of their widgets.
GtkStyle *
gtk_style_new (void
);
gtk_style_new
has been deprecated since version 3.0 and should not be used in newly-written code.
Use GtkStyleContext
Creates a new GtkStyle.
GtkStyle *
gtk_style_copy (GtkStyle *style
);
gtk_style_copy
has been deprecated since version 3.0 and should not be used in newly-written code.
Use GtkStyleContext instead
Creates a copy of the passed in GtkStyle object.
GtkStyle * gtk_style_attach (GtkStyle *style
,GdkWindow *window
);
gtk_style_attach
has been deprecated since version 3.0 and should not be used in newly-written code.
Use gtk_widget_style_attach()
instead
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 = gtk_style_attach (style, window)
Either style
, or a newly-created GtkStyle.
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.
void
gtk_style_detach (GtkStyle *style
);
gtk_style_detach
has been deprecated since version 3.0 and should not be used in newly-written code.
Use GtkStyleContext instead
Detaches a style from a window. If the style is not attached
to any windows anymore, it is unrealized. See gtk_style_attach()
.
gboolean
gtk_style_has_context (GtkStyle *style
);
gtk_style_has_context
is deprecated and should not be used in newly-written code.
Returns whether style
has an associated GtkStyleContext.
Since 3.0
void gtk_style_set_background (GtkStyle *style
,GdkWindow *window
,GtkStateType state_type
);
gtk_style_set_background
has been deprecated since version 3.0 and should not be used in newly-written code.
Use gtk_style_context_set_background()
instead
Sets the background of window
to the background color or pixmap
specified by style
for the given state.
void gtk_style_apply_default_background (GtkStyle *style
,cairo_t *cr
,GdkWindow *window
,GtkStateType state_type
,gint x
,gint y
,gint width
,gint height
);
gtk_style_apply_default_background
has been deprecated since version 3.0 and should not be used in newly-written code.
Use GtkStyleContext instead
gboolean gtk_style_lookup_color (GtkStyle *style
,const gchar *color_name
,GdkColor *color
);
gtk_style_lookup_color
has been deprecated since version 3.0 and should not be used in newly-written code.
Use gtk_style_context_lookup_color()
instead
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 GtkStyle and might change when a theme
switch occurs.
Since 2.10
GtkIconSet * gtk_style_lookup_icon_set (GtkStyle *style
,const gchar *stock_id
);
gtk_style_lookup_icon_set
has been deprecated since version 3.0 and should not be used in newly-written code.
Use gtk_style_context_lookup_icon_set()
instead
Looks up stock_id
in the icon factories associated with style
and the default icon factory, returning an icon set if found,
otherwise NULL
.
GdkPixbuf * gtk_style_render_icon (GtkStyle *style
,const GtkIconSource *source
,GtkTextDirection direction
,GtkStateType state
,GtkIconSize size
,GtkWidget *widget
,const gchar *detail
);
gtk_style_render_icon
has been deprecated since version 3.0 and should not be used in newly-written code.
Use gtk_render_icon_pixbuf()
instead
Renders the icon specified by source
at the given size
according to the given parameters and returns the result in a
pixbuf.
style |
a GtkStyle |
|
source |
the GtkIconSource specifying the icon to render |
|
direction |
a text direction |
|
state |
a state |
|
size |
the size to render the icon at. A size of (GtkIconSize)-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] |
void gtk_style_get_style_property (GtkStyle *style
,GType widget_type
,const gchar *property_name
,GValue *value
);
gtk_style_get_style_property
is deprecated and should not be used in newly-written code.
Queries the value of a style property corresponding to a widget class is in the given style.
Since 2.16
void gtk_style_get_valist (GtkStyle *style
,GType widget_type
,const gchar *first_property_name
,va_list var_args
);
gtk_style_get_valist
is deprecated and should not be used in newly-written code.
Non-vararg variant of gtk_style_get()
.
Used primarily by language bindings.
Since 2.16
void gtk_style_get (GtkStyle *style
,GType widget_type
,const gchar *first_property_name
,...
);
gtk_style_get
is deprecated and should not be used in newly-written code.
Gets the values of a multiple style properties for widget_type
from style
.
Since 2.16
void gtk_paint_arrow (GtkStyle *style
,cairo_t *cr
,GtkStateType state_type
,GtkShadowType shadow_type
,GtkWidget *widget
,const gchar *detail
,GtkArrowType arrow_type
,gboolean fill
,gint x
,gint y
,gint width
,gint height
);
gtk_paint_arrow
has been deprecated since version 3.0 and should not be used in newly-written code.
Use gtk_render_arrow()
instead
Draws an arrow in the given rectangle on cr
using the given
parameters. arrow_type
determines the direction of the arrow.
style |
a GtkStyle |
|
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 |
|
|
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 |
void gtk_paint_box (GtkStyle *style
,cairo_t *cr
,GtkStateType state_type
,GtkShadowType shadow_type
,GtkWidget *widget
,const gchar *detail
,gint x
,gint y
,gint width
,gint height
);
gtk_paint_box
has been deprecated since version 3.0 and should not be used in newly-written code.
Use gtk_render_frame()
and gtk_render_background()
instead
Draws a box on cr
with the given parameters.
style |
a GtkStyle |
|
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 |
void gtk_paint_box_gap (GtkStyle *style
,cairo_t *cr
,GtkStateType state_type
,GtkShadowType shadow_type
,GtkWidget *widget
,const gchar *detail
,gint x
,gint y
,gint width
,gint height
,GtkPositionType gap_side
,gint gap_x
,gint gap_width
);
gtk_paint_box_gap
has been deprecated since version 3.0 and should not be used in newly-written code.
Use gtk_render_frame_gap()
instead
Draws a box in cr
using the given style and state and shadow type,
leaving a gap in one side.
style |
a GtkStyle |
|
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 |
void gtk_paint_check (GtkStyle *style
,cairo_t *cr
,GtkStateType state_type
,GtkShadowType shadow_type
,GtkWidget *widget
,const gchar *detail
,gint x
,gint y
,gint width
,gint height
);
gtk_paint_check
has been deprecated since version 3.0 and should not be used in newly-written code.
Use gtk_render_check()
instead
Draws a check button indicator in the given rectangle on cr
with
the given parameters.
style |
a GtkStyle |
|
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 |
void gtk_paint_diamond (GtkStyle *style
,cairo_t *cr
,GtkStateType state_type
,GtkShadowType shadow_type
,GtkWidget *widget
,const gchar *detail
,gint x
,gint y
,gint width
,gint height
);
gtk_paint_diamond
has been deprecated since version 3.0 and should not be used in newly-written code.
Use cairo instead
Draws a diamond in the given rectangle on window
using the given
parameters.
style |
a GtkStyle |
|
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 |
void gtk_paint_extension (GtkStyle *style
,cairo_t *cr
,GtkStateType state_type
,GtkShadowType shadow_type
,GtkWidget *widget
,const gchar *detail
,gint x
,gint y
,gint width
,gint height
,GtkPositionType gap_side
);
gtk_paint_extension
has been deprecated since version 3.0 and should not be used in newly-written code.
Use gtk_render_extension()
instead
Draws an extension, i.e. a notebook tab.
style |
a GtkStyle |
|
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 |
void gtk_paint_flat_box (GtkStyle *style
,cairo_t *cr
,GtkStateType state_type
,GtkShadowType shadow_type
,GtkWidget *widget
,const gchar *detail
,gint x
,gint y
,gint width
,gint height
);
gtk_paint_flat_box
has been deprecated since version 3.0 and should not be used in newly-written code.
Use gtk_render_frame()
and gtk_render_background()
instead
Draws a flat box on cr
with the given parameters.
style |
a GtkStyle |
|
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 |
void gtk_paint_focus (GtkStyle *style
,cairo_t *cr
,GtkStateType state_type
,GtkWidget *widget
,const gchar *detail
,gint x
,gint y
,gint width
,gint height
);
gtk_paint_focus
has been deprecated since version 3.0 and should not be used in newly-written code.
Use gtk_render_focus()
instead
Draws a focus indicator around the given rectangle on cr
using the
given style.
style |
a GtkStyle |
|
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 |
void gtk_paint_handle (GtkStyle *style
,cairo_t *cr
,GtkStateType state_type
,GtkShadowType shadow_type
,GtkWidget *widget
,const gchar *detail
,gint x
,gint y
,gint width
,gint height
,GtkOrientation orientation
);
gtk_paint_handle
has been deprecated since version 3.0 and should not be used in newly-written code.
Use gtk_render_handle()
instead
Draws a handle as used in GtkHandleBox and GtkPaned.
style |
a GtkStyle |
|
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 |
void gtk_paint_hline (GtkStyle *style
,cairo_t *cr
,GtkStateType state_type
,GtkWidget *widget
,const gchar *detail
,gint x1
,gint x2
,gint y
);
gtk_paint_hline
has been deprecated since version 3.0 and should not be used in newly-written code.
Use gtk_render_line()
instead
Draws a horizontal line from (x1
, y
) to (x2
, y
) in cr
using the given style and state.
style |
a GtkStyle |
|
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 |
void gtk_paint_option (GtkStyle *style
,cairo_t *cr
,GtkStateType state_type
,GtkShadowType shadow_type
,GtkWidget *widget
,const gchar *detail
,gint x
,gint y
,gint width
,gint height
);
gtk_paint_option
has been deprecated since version 3.0 and should not be used in newly-written code.
Use gtk_render_option()
instead
Draws a radio button indicator in the given rectangle on cr
with
the given parameters.
style |
a GtkStyle |
|
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 |
void gtk_paint_shadow (GtkStyle *style
,cairo_t *cr
,GtkStateType state_type
,GtkShadowType shadow_type
,GtkWidget *widget
,const gchar *detail
,gint x
,gint y
,gint width
,gint height
);
gtk_paint_shadow
has been deprecated since version 3.0 and should not be used in newly-written code.
Use gtk_render_frame()
instead
Draws a shadow around the given rectangle in cr
using the given style and state and shadow type.
style |
a GtkStyle |
|
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 |
void gtk_paint_shadow_gap (GtkStyle *style
,cairo_t *cr
,GtkStateType state_type
,GtkShadowType shadow_type
,GtkWidget *widget
,const gchar *detail
,gint x
,gint y
,gint width
,gint height
,GtkPositionType gap_side
,gint gap_x
,gint gap_width
);
gtk_paint_shadow_gap
has been deprecated since version 3.0 and should not be used in newly-written code.
Use gtk_render_frame_gap()
instead
Draws a shadow around the given rectangle in cr
using the given style and state and shadow type, leaving a
gap in one side.
style |
a GtkStyle |
|
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 |
void gtk_paint_slider (GtkStyle *style
,cairo_t *cr
,GtkStateType state_type
,GtkShadowType shadow_type
,GtkWidget *widget
,const gchar *detail
,gint x
,gint y
,gint width
,gint height
,GtkOrientation orientation
);
gtk_paint_slider
has been deprecated since version 3.0 and should not be used in newly-written code.
Use gtk_render_slider()
instead
Draws a slider in the given rectangle on cr
using the
given style and orientation.
style |
a GtkStyle |
|
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 |
void gtk_paint_spinner (GtkStyle *style
,cairo_t *cr
,GtkStateType state_type
,GtkWidget *widget
,const gchar *detail
,guint step
,gint x
,gint y
,gint width
,gint height
);
gtk_paint_spinner
has been deprecated since version 3.0 and should not be used in newly-written code.
Use gtk_render_activity()
instead
Draws a spinner on window
using the given parameters.
style |
a GtkStyle |
|
cr |
a cairo_t |
|
state_type |
a state |
|
widget |
the widget (may be |
[allow-none] |
detail |
a style detail (may be |
[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 |
void gtk_paint_tab (GtkStyle *style
,cairo_t *cr
,GtkStateType state_type
,GtkShadowType shadow_type
,GtkWidget *widget
,const gchar *detail
,gint x
,gint y
,gint width
,gint height
);
gtk_paint_tab
has been deprecated since version 3.0 and should not be used in newly-written code.
Use cairo instead
Draws an option menu tab (i.e. the up and down pointing arrows)
in the given rectangle on cr
using the given parameters.
style |
a GtkStyle |
|
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 |
void gtk_paint_vline (GtkStyle *style
,cairo_t *cr
,GtkStateType state_type
,GtkWidget *widget
,const gchar *detail
,gint y1_
,gint y2_
,gint x
);
gtk_paint_vline
has been deprecated since version 3.0 and should not be used in newly-written code.
Use gtk_render_line()
instead
Draws a vertical line from (x
, y1_
) to (x
, y2_
) in cr
using the given style and state.
style |
a GtkStyle |
|
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 |
void gtk_paint_expander (GtkStyle *style
,cairo_t *cr
,GtkStateType state_type
,GtkWidget *widget
,const gchar *detail
,gint x
,gint y
,GtkExpanderStyle expander_style
);
gtk_paint_expander
has been deprecated since version 3.0 and should not be used in newly-written code.
Use gtk_render_expander()
instead
Draws an expander as used in GtkTreeView. 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.
style |
a GtkStyle |
|
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. |
void gtk_paint_layout (GtkStyle *style
,cairo_t *cr
,GtkStateType state_type
,gboolean use_text
,GtkWidget *widget
,const gchar *detail
,gint x
,gint y
,PangoLayout *layout
);
gtk_paint_layout
has been deprecated since version 3.0 and should not be used in newly-written code.
Use gtk_render_layout()
instead
Draws a layout on cr
using the given parameters.
style |
a GtkStyle |
|
cr |
a cairo_t |
|
state_type |
a state |
|
use_text |
whether to use the text or foreground
graphics context of |
|
widget |
the widget. |
[allow-none] |
detail |
a style detail. |
[allow-none] |
x |
x origin |
|
y |
y origin |
|
layout |
the layout to draw |
void gtk_paint_resize_grip (GtkStyle *style
,cairo_t *cr
,GtkStateType state_type
,GtkWidget *widget
,const gchar *detail
,GdkWindowEdge edge
,gint x
,gint y
,gint width
,gint height
);
gtk_paint_resize_grip
has been deprecated since version 3.0 and should not be used in newly-written code.
Use gtk_render_handle()
instead
Draws a resize grip in the given rectangle on cr
using the given
parameters.
style |
a GtkStyle |
|
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 |
void gtk_draw_insertion_cursor (GtkWidget *widget
,cairo_t *cr
,const GdkRectangle *location
,gboolean is_primary
,GtkTextDirection direction
,gboolean draw_arrow
);
gtk_draw_insertion_cursor
has been deprecated since version 3.4 and should not be used in newly-written code.
Use gtk_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.
widget |
||
cr |
cairo context to draw to |
|
location |
location where to draw the cursor ( |
|
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 GTK_TEXT_DIR_NONE |
|
draw_arrow |
|
Since 3.0
gboolean (*GtkRcPropertyParser) (const GParamSpec *pspec
,const GString *rc_string
,GValue *property_value
);
typedef struct { GdkColor fg[5]; GdkColor bg[5]; GdkColor light[5]; GdkColor dark[5]; GdkColor mid[5]; GdkColor text[5]; GdkColor base[5]; GdkColor text_aa[5]; /* Halfway between text/base */ GdkColor black; GdkColor white; PangoFontDescription *font_desc; gint xthickness; gint ythickness; cairo_pattern_t *background[5]; } GtkStyle;
GdkColor |
Set of foreground GdkColor |
|
GdkColor |
Set of background GdkColor |
|
GdkColor |
Set of light GdkColor |
|
GdkColor |
Set of dark GdkColor |
|
GdkColor |
Set of mid GdkColor |
|
GdkColor |
Set of text GdkColor |
|
GdkColor |
Set of base GdkColor |
|
GdkColor |
Color halfway between text/base |
|
GdkColor |
GdkColor to use for black |
|
GdkColor |
GdkColor to use for white |
|
PangoFontDescription * |
||
gint |
Thickness in X direction |
|
gint |
Thickness in Y direction |
|
Set of background cairo_pattern_t |
struct GtkStyleClass { GObjectClass parent_class; /* Initialize for a particular visual. style->visual * will have been set at this point. Will typically chain * to parent. */ void (*realize) (GtkStyle *style); /* Clean up for a particular visual. Will typically chain * to parent. */ void (*unrealize) (GtkStyle *style); /* Make style an exact duplicate of src. */ void (*copy) (GtkStyle *style, GtkStyle *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. */ GtkStyle *(*clone) (GtkStyle *style); /* Initialize the GtkStyle with the values in the GtkRcStyle. * should chain to the parent implementation. */ void (*init_from_rc) (GtkStyle *style, GtkRcStyle *rc_style); void (*set_background) (GtkStyle *style, GdkWindow *window, GtkStateType state_type); GdkPixbuf * (* render_icon) (GtkStyle *style, const GtkIconSource *source, GtkTextDirection direction, GtkStateType state, GtkIconSize size, GtkWidget *widget, const gchar *detail); /* Drawing functions */ void (*draw_hline) (GtkStyle *style, cairo_t *cr, GtkStateType state_type, GtkWidget *widget, const gchar *detail, gint x1, gint x2, gint y); void (*draw_vline) (GtkStyle *style, cairo_t *cr, GtkStateType state_type, GtkWidget *widget, const gchar *detail, gint y1_, gint y2_, gint x); void (*draw_shadow) (GtkStyle *style, cairo_t *cr, GtkStateType state_type, GtkShadowType shadow_type, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height); void (*draw_arrow) (GtkStyle *style, cairo_t *cr, GtkStateType state_type, GtkShadowType shadow_type, GtkWidget *widget, const gchar *detail, GtkArrowType arrow_type, gboolean fill, gint x, gint y, gint width, gint height); void (*draw_diamond) (GtkStyle *style, cairo_t *cr, GtkStateType state_type, GtkShadowType shadow_type, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height); void (*draw_box) (GtkStyle *style, cairo_t *cr, GtkStateType state_type, GtkShadowType shadow_type, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height); void (*draw_flat_box) (GtkStyle *style, cairo_t *cr, GtkStateType state_type, GtkShadowType shadow_type, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height); void (*draw_check) (GtkStyle *style, cairo_t *cr, GtkStateType state_type, GtkShadowType shadow_type, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height); void (*draw_option) (GtkStyle *style, cairo_t *cr, GtkStateType state_type, GtkShadowType shadow_type, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height); void (*draw_tab) (GtkStyle *style, cairo_t *cr, GtkStateType state_type, GtkShadowType shadow_type, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height); void (*draw_shadow_gap) (GtkStyle *style, cairo_t *cr, GtkStateType state_type, GtkShadowType shadow_type, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height, GtkPositionType gap_side, gint gap_x, gint gap_width); void (*draw_box_gap) (GtkStyle *style, cairo_t *cr, GtkStateType state_type, GtkShadowType shadow_type, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height, GtkPositionType gap_side, gint gap_x, gint gap_width); void (*draw_extension) (GtkStyle *style, cairo_t *cr, GtkStateType state_type, GtkShadowType shadow_type, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height, GtkPositionType gap_side); void (*draw_focus) (GtkStyle *style, cairo_t *cr, GtkStateType state_type, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height); void (*draw_slider) (GtkStyle *style, cairo_t *cr, GtkStateType state_type, GtkShadowType shadow_type, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height, GtkOrientation orientation); void (*draw_handle) (GtkStyle *style, cairo_t *cr, GtkStateType state_type, GtkShadowType shadow_type, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height, GtkOrientation orientation); void (*draw_expander) (GtkStyle *style, cairo_t *cr, GtkStateType state_type, GtkWidget *widget, const gchar *detail, gint x, gint y, GtkExpanderStyle expander_style); void (*draw_layout) (GtkStyle *style, cairo_t *cr, GtkStateType state_type, gboolean use_text, GtkWidget *widget, const gchar *detail, gint x, gint y, PangoLayout *layout); void (*draw_resize_grip) (GtkStyle *style, cairo_t *cr, GtkStateType state_type, GtkWidget *widget, const gchar *detail, GdkWindowEdge edge, gint x, gint y, gint width, gint height); void (*draw_spinner) (GtkStyle *style, cairo_t *cr, GtkStateType state_type, GtkWidget *widget, const gchar *detail, guint step, gint x, gint y, gint width, gint height); };
typedef struct { /* quark-ified property identifier like “GtkScrollbar::spacing” */ GQuark type_name; GQuark property_name; /* fields similar to GtkSettingsValue */ gchar *origin; GValue value; } GtkRcProperty;
Deprecated
GQuark |
quark-ified type identifier |
|
GQuark |
quark-ified property identifier like “GtkScrollbar::spacing” |
|
gchar * |
field similar to one found in GtkSettingsValue |
|
GValue |
field similar to one found in GtkSettingsValue |
“context”
property“context” GtkStyleContext *
GtkStyleContext to get style from.
Flags: Read / Write / Construct Only
“realize”
signalvoid user_function (GtkStyle *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.
style |
the object which received the signal |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
Since 2.4
“unrealize”
signalvoid user_function (GtkStyle *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 GtkStyle. This signal provides a convenient place to free such cached objects.
style |
the object which received the signal |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
Since 2.4