Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
Defines a part of a CSS document. Because sections are nested into
one another, you can use cssSectionGetParent
to get the
containing region.
Since: 3.2
Synopsis
- newtype CssSection = CssSection (ManagedPtr CssSection)
- noCssSection :: Maybe CssSection
- cssSectionGetEndLine :: (HasCallStack, MonadIO m) => CssSection -> m Word32
- cssSectionGetEndPosition :: (HasCallStack, MonadIO m) => CssSection -> m Word32
- cssSectionGetFile :: (HasCallStack, MonadIO m) => CssSection -> m File
- cssSectionGetParent :: (HasCallStack, MonadIO m) => CssSection -> m (Maybe CssSection)
- cssSectionGetSectionType :: (HasCallStack, MonadIO m) => CssSection -> m CssSectionType
- cssSectionGetStartLine :: (HasCallStack, MonadIO m) => CssSection -> m Word32
- cssSectionGetStartPosition :: (HasCallStack, MonadIO m) => CssSection -> m Word32
- cssSectionRef :: (HasCallStack, MonadIO m) => CssSection -> m CssSection
- cssSectionUnref :: (HasCallStack, MonadIO m) => CssSection -> m ()
Exported types
newtype CssSection Source #
Memory-managed wrapper type.
Instances
Eq CssSection Source # | |
Defined in GI.Gtk.Structs.CssSection (==) :: CssSection -> CssSection -> Bool # (/=) :: CssSection -> CssSection -> Bool # | |
IsGValue CssSection Source # | Convert |
Defined in GI.Gtk.Structs.CssSection toGValue :: CssSection -> IO GValue # fromGValue :: GValue -> IO CssSection # | |
BoxedObject CssSection Source # | |
Defined in GI.Gtk.Structs.CssSection boxedType :: CssSection -> IO GType # |
noCssSection :: Maybe CssSection Source #
A convenience alias for Nothing
:: Maybe
CssSection
.
Methods
Overloaded methods
getEndLine
:: (HasCallStack, MonadIO m) | |
=> CssSection |
|
-> m Word32 | Returns: the line number |
Returns 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 GtkCssProvider[parsingError](#signal:parsingError) signal.
The end position and line may be identical to the start
position and line for sections which failed to parse anything
successfully.
Since: 3.2
getEndPosition
cssSectionGetEndPosition Source #
:: (HasCallStack, MonadIO m) | |
=> CssSection |
|
-> m Word32 | Returns: the offset in bytes from the start of the line. |
Returns the offset in bytes from the start of the current line
returned via cssSectionGetEndLine
.
This value may change in future invocations of this function if
section
is not yet parsed completely. This will for example
happen in the GtkCssProvider[parsingError](#signal:parsingError) signal.
The end position and line may be identical to the start
position and line for sections which failed to parse anything
successfully.
Since: 3.2
getFile
:: (HasCallStack, MonadIO m) | |
=> CssSection |
|
-> m File | Returns: the |
Gets the file that section
was parsed from. If no such file exists,
for example because the CSS was loaded via
gtkCssProviderLoadFromData
(), then Nothing
is returned.
Since: 3.2
getParent
:: (HasCallStack, MonadIO m) | |
=> CssSection |
|
-> m (Maybe CssSection) | Returns: the parent section or |
Gets the parent section for the given section
. The parent section is
the section that contains this section
. A special case are sections of
type GTK_CSS_SECTION_DOCUMENT
. Their parent will either be Nothing
if they are the original CSS document that was loaded by
cssProviderLoadFromFile
or a section of type
GTK_CSS_SECTION_IMPORT
if it was loaded with an import rule from
a different file.
Since: 3.2
getSectionType
cssSectionGetSectionType Source #
:: (HasCallStack, MonadIO m) | |
=> CssSection |
|
-> m CssSectionType | Returns: the type of |
Gets the type of information that section
describes.
Since: 3.2
getStartLine
cssSectionGetStartLine Source #
:: (HasCallStack, MonadIO m) | |
=> CssSection |
|
-> m Word32 | Returns: the line number |
Returns 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.
Since: 3.2
getStartPosition
cssSectionGetStartPosition Source #
:: (HasCallStack, MonadIO m) | |
=> CssSection |
|
-> m Word32 | Returns: the offset in bytes from the start of the line. |
Returns the offset in bytes from the start of the current line
returned via cssSectionGetStartLine
.
Since: 3.2
ref
:: (HasCallStack, MonadIO m) | |
=> CssSection |
|
-> m CssSection | Returns: |
Increments the reference count on section
.
Since: 3.2
unref
:: (HasCallStack, MonadIO m) | |
=> CssSection |
|
-> m () |
Decrements the reference count on section
, freeing the
structure if the reference count reaches 0.
Since: 3.2