CssProviderRef

public struct CssProviderRef : CssProviderProtocol, GWeakCapturing

GtkCssProvider is an object implementing the GtkStyleProvider interface. It is able to parse CSS-like input in order to style widgets.

An application can make GTK+ parse a specific CSS style sheet by calling gtk_css_provider_load_from_file() or gtk_css_provider_load_from_resource() and adding the provider with gtk_style_context_add_provider() or gtk_style_context_add_provider_for_screen().

In addition, certain files will be read when GTK+ is initialized. First, the file $XDG_CONFIG_HOME/gtk-3.0/gtk.css is loaded if it exists. Then, GTK+ loads the first existing file among XDG_DATA_HOME/themes/THEME/gtk-VERSION/gtk.css, $HOME/.themes/THEME/gtk-VERSION/gtk.css, $XDG_DATA_DIRS/themes/THEME/gtk-VERSION/gtk.css and DATADIR/share/themes/THEME/gtk-VERSION/gtk.css, where THEME is the name of the current theme (see the GtkSettings:gtk-theme-name setting), DATADIR is the prefix configured when GTK+ was compiled (unless overridden by the GTK_DATA_PREFIX environment variable), and VERSION is the GTK+ version number. If no file is found for the current version, GTK+ tries older versions all the way back to 3.0.

In the same way, GTK+ tries to load a gtk-keys.css file for the current key theme, as defined by GtkSettings:gtk-key-theme-name.

The CssProviderRef type acts as a lightweight Swift reference to an underlying GtkCssProvider instance. It exposes methods that can operate on this data type through CssProviderProtocol conformance. Use CssProviderRef only as an unowned reference to an existing GtkCssProvider instance.

  • ptr
    Untyped pointer to the underlying `GtkCssProvider` instance.
    

    For type-safe access, use the generated, typed pointer css_provider_ptr property instead.

    Declaration

    Swift

    public let ptr: UnsafeMutableRawPointer!

CssProvider Class

  • Designated initialiser from the underlying C data type

    Declaration

    Swift

    @inlinable
    init(_ p: UnsafeMutablePointer<GtkCssProvider>)
  • Designated initialiser from a constant pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init(_ p: UnsafePointer<GtkCssProvider>)
  • Conditional initialiser from an optional pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init!(_ maybePointer: UnsafeMutablePointer<GtkCssProvider>?)
  • Conditional initialiser from an optional, non-mutable pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init!(_ maybePointer: UnsafePointer<GtkCssProvider>?)
  • Conditional initialiser from an optional gpointer

    Declaration

    Swift

    @inlinable
    init!(gpointer g: gpointer?)
  • Conditional initialiser from an optional, non-mutable gconstpointer

    Declaration

    Swift

    @inlinable
    init!(gconstpointer g: gconstpointer?)
  • Reference intialiser for a related type that implements CssProviderProtocol

    Declaration

    Swift

    @inlinable
    init<T>(_ other: T) where T : CssProviderProtocol
  • This factory is syntactic sugar for setting weak pointers wrapped in GWeak<T>

    Declaration

    Swift

    @inlinable
    static func unowned<T>(_ other: T) -> CssProviderRef where T : CssProviderProtocol
  • Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to CssProviderProtocol.

    Declaration

    Swift

    @inlinable
    init<T>(cPointer: UnsafeMutablePointer<T>)
  • Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to CssProviderProtocol.

    Declaration

    Swift

    @inlinable
    init<T>(constPointer: UnsafePointer<T>)
  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to CssProviderProtocol.

    Declaration

    Swift

    @inlinable
    init(mutating raw: UnsafeRawPointer)
  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to CssProviderProtocol.

    Declaration

    Swift

    @inlinable
    init(raw: UnsafeMutableRawPointer)
  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to CssProviderProtocol.

    Declaration

    Swift

    @inlinable
    init(opaquePointer: OpaquePointer)
  • Returns a newly created GtkCssProvider.

    Declaration

    Swift

    @inlinable
    init()
  • Returns the provider containing the style settings used as a fallback for all widgets.

    get_default is deprecated: Use gtk_css_provider_new() instead.

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    static func getDefault() -> CssProviderRef!
  • Loads a theme from the usual theme paths

    Declaration

    Swift

    @inlinable
    static func getNamed(name: UnsafePointer<gchar>!, variant: UnsafePointer<gchar>? = nil) -> CssProviderRef!