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)
-
getEndLine()
Extension methodReturns the line in the CSS document where this section end. The line number is 0-indexed, so the first line of the document will return 0. This value may change in future invocations of this function if
section
is not yet parsed completely. This will for example happen in the GtkCssProviderparsing-error
signal. The end position and line may be identical to the start position and line for sections which failed to parse anything successfully.Declaration
Swift
@inlinable func getEndLine() -> Int
-
getEndPosition()
Extension methodReturns the offset in bytes from the start of the current line returned via
gtk_css_section_get_end_line()
. This value may change in future invocations of this function ifsection
is not yet parsed completely. This will for example happen in the GtkCssProviderparsing-error
signal. The end position and line may be identical to the start position and line for sections which failed to parse anything successfully.Declaration
Swift
@inlinable func getEndPosition() -> Int
-
getFile()
Extension methodGets the file that
section
was parsed from. If no such file exists, for example because the CSS was loaded viagtk_css_provider_load_from_data
()
, thennil
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 thissection
. A special case are sections of typeGTK_CSS_SECTION_DOCUMENT
. Their parent will either benil
if they are the original CSS document that was loaded bygtk_css_provider_load_from_file()
or a section of typeGTK_CSS_SECTION_IMPORT
if it was loaded with an import rule from a different file.Declaration
Swift
@inlinable func getParent() -> CssSectionRef!
-
getSectionType()
Extension methodGets the type of information that
section
describes.Declaration
Swift
@inlinable func getSectionType() -> GtkCssSectionType
-
getStartLine()
Extension methodReturns the line in the CSS document where this section starts. The line number is 0-indexed, so the first line of the document will return 0.
Declaration
Swift
@inlinable func getStartLine() -> Int
-
getStartPosition()
Extension methodReturns the offset in bytes from the start of the current line returned via
gtk_css_section_get_start_line()
.Declaration
Swift
@inlinable func getStartPosition() -> Int
-
ref()
Extension methodIncrements the reference count on
section
.Declaration
Swift
@discardableResult @inlinable func ref() -> CssSectionRef!
-
unref()
Extension methodDecrements the reference count on
section
, freeing the structure if the reference count reaches 0.Declaration
Swift
@inlinable func unref()
-
endLine
Extension methodReturns the line in the CSS document where this section end. The line number is 0-indexed, so the first line of the document will return 0. This value may change in future invocations of this function if
section
is not yet parsed completely. This will for example happen in the GtkCssProviderparsing-error
signal. The end position and line may be identical to the start position and line for sections which failed to parse anything successfully.Declaration
Swift
@inlinable var endLine: Int { get }
-
endPosition
Extension methodReturns the offset in bytes from the start of the current line returned via
gtk_css_section_get_end_line()
. This value may change in future invocations of this function ifsection
is not yet parsed completely. This will for example happen in the GtkCssProviderparsing-error
signal. The end position and line may be identical to the start position and line for sections which failed to parse anything successfully.Declaration
Swift
@inlinable var endPosition: Int { get }
-
file
Extension methodGets the file that
section
was parsed from. If no such file exists, for example because the CSS was loaded viagtk_css_provider_load_from_data
()
, thennil
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 thissection
. A special case are sections of typeGTK_CSS_SECTION_DOCUMENT
. Their parent will either benil
if they are the original CSS document that was loaded bygtk_css_provider_load_from_file()
or a section of typeGTK_CSS_SECTION_IMPORT
if it was loaded with an import rule from a different file.Declaration
Swift
@inlinable var parent: CssSectionRef! { get }
-
sectionType
Extension methodGets the type of information that
section
describes.Declaration
Swift
@inlinable var sectionType: GtkCssSectionType { get }
-
startLine
Extension methodReturns the line in the CSS document where this section starts. The line number is 0-indexed, so the first line of the document will return 0.
Declaration
Swift
@inlinable var startLine: Int { get }
-
startPosition
Extension methodReturns the offset in bytes from the start of the current line returned via
gtk_css_section_get_start_line()
.Declaration
Swift
@inlinable var startPosition: Int { get }