CssSectionProtocol
public protocol CssSectionProtocol
Defines a part of a CSS document.
Because sections are nested into one another, you can use
gtk_css_section_get_parent()
to get the containing region.
The CssSectionProtocol
protocol exposes the methods and properties of an underlying GtkCssSection
instance.
The default implementation of these can be found in the protocol extension below.
For a concrete class that implements these methods and properties, see CssSection
.
Alternatively, use CssSectionRef
as a lighweight, unowned
reference if you already have an instance you just want to use.
-
Untyped pointer to the underlying
GtkCssSection
instance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get }
-
css_section_ptr
Default implementationTyped pointer to the underlying
GtkCssSection
instance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkCssSection
instance.Declaration
Swift
var css_section_ptr: UnsafeMutablePointer<GtkCssSection>! { get }
-
Required Initialiser for types conforming to
CssSectionProtocol
Declaration
Swift
init(raw: UnsafeMutableRawPointer)
-
getEndLocation()
Extension methodReturns the location in the CSS document where this section ends.
Declaration
Swift
@inlinable func getEndLocation() -> CssLocationRef!
-
getFile()
Extension methodGets the file that
section
was parsed from.If no such file exists, for example because the CSS was loaded via [method
Gtk.CssProvider.load_from_data
], thenNULL
is returned.Declaration
Swift
@inlinable func getFile() -> GIO.FileRef!
-
getParent()
Extension methodGets the parent section for the given
section
.The parent section is the section that contains this
section
. A special case are sections of typeGTK_CSS_SECTION_DOCUMEN
T. Their parent will either beNULL
if they are the original CSS document that was loaded by [methodGtk.CssProvider.load_from_file
] or a section of typeGTK_CSS_SECTION_IMPORT
if it was loaded with animport
rule from a different file.Declaration
Swift
@inlinable func getParent() -> CssSectionRef!
-
getStartLocation()
Extension methodReturns the location in the CSS document where this section starts.
Declaration
Swift
@inlinable func getStartLocation() -> CssLocationRef!
-
print(string:
Extension method) Prints the
section
intostring
in a human-readable form.This is a form like
gtk.css:32:1-23
to denote line 32, characters 1 to 23 in the filegtk.css
.Declaration
Swift
@inlinable func print<StringTypeT>(string: StringTypeT) where StringTypeT : StringProtocol
-
ref()
Extension methodIncrements the reference count on
section
.Declaration
Swift
@discardableResult @inlinable func ref() -> CssSectionRef!
-
toString()
Extension methodPrints the section into a human-readable text form using [method
Gtk.CssSection.print
].Declaration
Swift
@inlinable func toString() -> String!
-
unref()
Extension methodDecrements the reference count on
section
, freeing the structure if the reference count reaches 0.Declaration
Swift
@inlinable func unref()
-
endLocation
Extension methodReturns the location in the CSS document where this section ends.
Declaration
Swift
@inlinable var endLocation: CssLocationRef! { get }
-
file
Extension methodGets the file that
section
was parsed from.If no such file exists, for example because the CSS was loaded via [method
Gtk.CssProvider.load_from_data
], thenNULL
is returned.Declaration
Swift
@inlinable var file: GIO.FileRef! { get }
-
parent
Extension methodGets the parent section for the given
section
.The parent section is the section that contains this
section
. A special case are sections of typeGTK_CSS_SECTION_DOCUMEN
T. Their parent will either beNULL
if they are the original CSS document that was loaded by [methodGtk.CssProvider.load_from_file
] or a section of typeGTK_CSS_SECTION_IMPORT
if it was loaded with animport
rule from a different file.Declaration
Swift
@inlinable var parent: CssSectionRef! { get }
-
startLocation
Extension methodReturns the location in the CSS document where this section starts.
Declaration
Swift
@inlinable var startLocation: CssLocationRef! { get }