gtkmm 4.19.1
Gtk::StyleProvider Class Reference

Interface to provide style information to Gtk::StyleContext. More...

#include <gtkmm/styleprovider.h>

Inheritance diagram for Gtk::StyleProvider:

Public Member Functions

 StyleProvider (StyleProvider && src) noexcept
StyleProvideroperator= (StyleProvider && src) noexcept
 ~StyleProvider () noexcept override
GtkStyleProvider * gobj ()
 Provides access to the underlying C GObject.
const GtkStyleProvider * gobj () const
 Provides access to the underlying C GObject.
Public Member Functions inherited from Glib::Interface
 Interface ()
 Interface (Interface &&src) noexcept
Interfaceoperator= (Interface &&src) noexcept
 Interface (const Glib::Interface_Class &interface_class)
 Interface (GObject *castitem)
 ~Interface () noexcept override
 Interface (const Interface &)=delete
Interfaceoperator= (const Interface &)=delete
GObject * gobj ()
const GObject * gobj () const
Public Member Functions inherited from Glib::ObjectBase
 ObjectBase (const ObjectBase &)=delete
ObjectBaseoperator= (const ObjectBase &)=delete
void set_property_value (const Glib::ustring &property_name, const Glib::ValueBase &value)
void get_property_value (const Glib::ustring &property_name, Glib::ValueBase &value) const
void set_property (const Glib::ustring &property_name, const PropertyType &value)
void get_property (const Glib::ustring &property_name, PropertyType &value) const
PropertyType get_property (const Glib::ustring &property_name) const
sigc::connection connect_property_changed (const Glib::ustring &property_name, const sigc::slot< void()> &slot)
sigc::connection connect_property_changed (const Glib::ustring &property_name, sigc::slot< void()> &&slot)
void freeze_notify ()
void thaw_notify ()
virtual void reference () const
virtual void unreference () const
GObject * gobj ()
const GObject * gobj () const
GObject * gobj_copy () const

Static Public Member Functions

static void add_interface (GType gtype_implementer)
static GType get_type ()
 Get the GType for this class, for use with the underlying GObject type system.
static void add_provider_for_display (const Glib::RefPtr< Gdk::Display > & display, const Glib::RefPtr< StyleProvider > & provider, guint priority)
 Adds a global style provider to display, which will be used in style construction for all Gtk::StyleContexts under display.
static void remove_provider_for_display (const Glib::RefPtr< Gdk::Display > & display, const Glib::RefPtr< StyleProvider > & provider)
 Removes provider from the global style providers list in display.

Protected Member Functions

 StyleProvider ()
 You should derive from this class to use it.
Protected Member Functions inherited from Glib::ObjectBase
 ObjectBase ()
 ObjectBase (const char *custom_type_name)
 ObjectBase (const std::type_info &custom_type_info)
 ObjectBase (ObjectBase &&src) noexcept
ObjectBaseoperator= (ObjectBase &&src) noexcept
virtual ~ObjectBase () noexcept=0
void initialize (GObject *castitem)
void initialize_move (GObject *castitem, Glib::ObjectBase *previous_wrapper)

(Note that these are not member symbols.)

Glib::RefPtr< Gtk::StyleProviderwrap (GtkStyleProvider * object, bool take_copy=false)
 A Glib::wrap() method for this object.

Detailed Description

Interface to provide style information to Gtk::StyleContext.

Gtk::StyleProvider is an interface used to provide style information to a Gtk::StyleContext. See StyleContext::add_provider() and add_provider_for_display().

GTK uses the Gtk::StyleProvider implementation for CSS in Gtk::CssProvider.

See also
Gtk::StyleContext, Gtk::CssProvider
Since gtkmm 3.0

Constructor & Destructor Documentation

◆ StyleProvider() [1/2]

Gtk::StyleProvider::StyleProvider ( )
protected

You should derive from this class to use it.

◆ StyleProvider() [2/2]

Gtk::StyleProvider::StyleProvider ( StyleProvider && src)
noexcept

◆ ~StyleProvider()

Gtk::StyleProvider::~StyleProvider ( )
overridenoexcept

Member Function Documentation

◆ add_interface()

void Gtk::StyleProvider::add_interface ( GType gtype_implementer)
static

◆ add_provider_for_display()

void Gtk::StyleProvider::add_provider_for_display ( const Glib::RefPtr< Gdk::Display > & display,
const Glib::RefPtr< StyleProvider > & provider,
guint priority )
static

Adds a global style provider to display, which will be used in style construction for all Gtk::StyleContexts under display.

GTK uses this to make styling information from Gtk::Settings available.

Note
If both priorities are the same, A Gtk::StyleProvider added through add_provider() takes precedence over another added through this function.
Since gtkmm 4.10
Parameters
displayA Gdk::Display.
providerA Gtk::StyleProvider.
priorityThe priority of the style provider. The lower it is, the earlier it will be used in the style construction. Typically this will be in the range between GTK_STYLE_PROVIDER_PRIORITY_FALLBACK and GTK_STYLE_PROVIDER_PRIORITY_USER.

◆ get_type()

GType Gtk::StyleProvider::get_type ( )
static

Get the GType for this class, for use with the underlying GObject type system.

◆ gobj() [1/2]

GtkStyleProvider * Gtk::StyleProvider::gobj ( )
inline

Provides access to the underlying C GObject.

◆ gobj() [2/2]

const GtkStyleProvider * Gtk::StyleProvider::gobj ( ) const
inline

Provides access to the underlying C GObject.

◆ operator=()

StyleProvider & Gtk::StyleProvider::operator= ( StyleProvider && src)
noexcept

◆ remove_provider_for_display()

void Gtk::StyleProvider::remove_provider_for_display ( const Glib::RefPtr< Gdk::Display > & display,
const Glib::RefPtr< StyleProvider > & provider )
static

Removes provider from the global style providers list in display.

Since gtkmm 4.10
Parameters
displayA Gdk::Display.
providerA Gtk::StyleProvider.

◆ wrap()

Glib::RefPtr< Gtk::StyleProvider > wrap ( GtkStyleProvider * object,
bool take_copy = false )
related

A Glib::wrap() method for this object.

Parameters
objectThe C instance.
take_copyFalse if the result should take ownership of the C instance. True if it should take a new copy or ref.
Returns
A C++ instance that wraps this C instance.