## GtkStyleProvider

GtkStyleProvider — Interface to provide style information to GtkStyleContext

## Synopsis

    #include <gtk/gtk.h>

    struct              GtkStyleProviderIface;
                        GtkStyleProvider;
    #define             GTK_STYLE_PROVIDER_PRIORITY_FALLBACK
    #define             GTK_STYLE_PROVIDER_PRIORITY_THEME
    #define             GTK_STYLE_PROVIDER_PRIORITY_SETTINGS
    #define             GTK_STYLE_PROVIDER_PRIORITY_APPLICATION
    #define             GTK_STYLE_PROVIDER_PRIORITY_USER
    GtkIconFactory *    gtk_style_provider_get_icon_factory (GtkStyleProvider *provider,
                                                             GtkWidgetPath *path);
    GtkStyleProperties * gtk_style_provider_get_style       (GtkStyleProvider *provider,
                                                             GtkWidgetPath *path);
    gboolean            gtk_style_provider_get_style_property
                                                            (GtkStyleProvider *provider,
                                                             GtkWidgetPath *path,
                                                             GtkStateFlags state,
                                                             GParamSpec *pspec,
                                                             GValue *value);

## Object Hierarchy

      GInterface
       +----GtkStyleProvider

## Known Implementations

GtkStyleProvider is implemented by GtkCssProvider and GtkSettings.

## Description

GtkStyleProvider is an interface used to provide style information to a GtkStyleContext. See `gtk_style_context_add_provider()` and `gtk_style_context_add_provider_for_screen()`.

## Details

### struct GtkStyleProviderIface

    struct GtkStyleProviderIface {
      GTypeInterface g_iface;

      GtkStyleProperties * (* get_style) (GtkStyleProvider *provider,
                                          GtkWidgetPath    *path);

      gboolean (* get_style_property) (GtkStyleProvider *provider,
                                       GtkWidgetPath    *path,
                                       GtkStateFlags     state,
                                       GParamSpec       *pspec,
                                       GValue           *value);

      GtkIconFactory * (* get_icon_factory) (GtkStyleProvider *provider,
    					 GtkWidgetPath    *path);
    };

GTypeInterface `g_iface`; |
`get_style` () | Gets a set of style information that applies to a widget path.
`get_style_property` () | Gets the value of a widget style property that applies to a widget path.
`get_icon_factory` () | Gets the icon factory that applies to a widget path.

### GtkStyleProvider

    typedef struct _GtkStyleProvider GtkStyleProvider;

### GTK_STYLE_PROVIDER_PRIORITY_FALLBACK

    #define GTK_STYLE_PROVIDER_PRIORITY_FALLBACK      1

The priority used for default style information that is used in the absence of themes.

### GTK_STYLE_PROVIDER_PRIORITY_THEME

    #define GTK_STYLE_PROVIDER_PRIORITY_THEME     200

The priority used for style information provided by themes.

### GTK_STYLE_PROVIDER_PRIORITY_SETTINGS

    #define GTK_STYLE_PROVIDER_PRIORITY_SETTINGS    400

The priority used for style information provided via GtkSettings.

This priority is higher than GTK_STYLE_PROVIDER_PRIORITY_THEME to let settings override themes.

### GTK_STYLE_PROVIDER_PRIORITY_APPLICATION

    #define GTK_STYLE_PROVIDER_PRIORITY_APPLICATION 600

A priority that can be used when adding a GtkStyleProvider for application-specific style information.

### GTK_STYLE_PROVIDER_PRIORITY_USER

    #define GTK_STYLE_PROVIDER_PRIORITY_USER        800

The priority used for the style information from `~/.gtk-3.0.css`.

You should not use priorities higher than this, to give the user the last word.

### gtk_style_provider_get_icon_factory ()

    GtkIconFactory *    gtk_style_provider_get_icon_factory (GtkStyleProvider *provider,
                                                             GtkWidgetPath *path);

Returns the GtkIconFactory defined to be in use for `path`, or `NULL` if none is defined.

`provider` : | a GtkStyleProvider
`path` : | GtkWidgetPath to query
Returns : | The icon factory to use for `path`, or `NULL`. [transfer none]

Since 3.0

### gtk_style_provider_get_style ()

    GtkStyleProperties * gtk_style_provider_get_style       (GtkStyleProvider *provider,
                                                             GtkWidgetPath *path);

Returns the style settings affecting a widget defined by `path`, or `NULL` if `provider` doesn't contemplate styling `path`.

`provider` : | a GtkStyleProvider
`path` : | GtkWidgetPath to query
Returns : | a GtkStyleProperties containing the style settings affecting `path`. [transfer full]

Since 3.0

### gtk_style_provider_get_style_property ()

    gboolean            gtk_style_provider_get_style_property
                                                            (GtkStyleProvider *provider,
                                                             GtkWidgetPath *path,
                                                             GtkStateFlags state,
                                                             GParamSpec *pspec,
                                                             GValue *value);

Looks up a widget style property as defined by `provider` for the widget represented by `path`.

`provider` : | a GtkStyleProvider
`path` : | GtkWidgetPath to query
`state` : | state to query the style property for
`pspec` : | The GParamSpec to query
`value` : | return location for the property value. [out]
Returns : | `TRUE` if the property was found and has a value, `FALSE` otherwise

## See Also

GtkStyleContext, GtkCssProvider