gi-gtk3-3.0.44: Gtk 3.x bindings

Copyright | Will Thompson and Iñaki García Etxebarria
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | None
Language | Haskell2010

GI.Gtk.Structs.CssSection

Contents

- Exported types
- Methods
  - getEndLine
  - getEndPosition
  - getFile
  - getParent
  - getSectionType
  - getStartLine
  - getStartPosition
  - ref
  - unref

Description

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)
- 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.

Constructors

CssSection (ManagedPtr CssSection) |

#### Instances

Instances details

Eq CssSection Source # |
Instance details Defined in GI.Gtk.Structs.CssSection Methods (==) :: CssSection -> CssSection -> Bool Source # (/=) :: CssSection -> CssSection -> Bool Source #
GBoxed CssSection Source # |
Instance details Defined in GI.Gtk.Structs.CssSection
ManagedPtrNewtype CssSection Source # |
Instance details Defined in GI.Gtk.Structs.CssSection Methods toManagedPtr :: CssSection -> ManagedPtr CssSection Source #
TypedObject CssSection Source # |
Instance details Defined in GI.Gtk.Structs.CssSection Methods glibType :: IO GType Source #
HasParentTypes CssSection Source # |
Instance details Defined in GI.Gtk.Structs.CssSection
IsGValue (Maybe CssSection) Source # | Convert `CssSection` to and from `GValue`. See `toGValue` and `fromGValue`.
Instance details Defined in GI.Gtk.Structs.CssSection Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe CssSection -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe CssSection) Source #
type ParentTypes CssSection Source # |
Instance details Defined in GI.Gtk.Structs.CssSection type ParentTypes CssSection = '[] :: [Type]

# Methods

### Click to display all available methods, including inherited ones

Expand

#### Methods

ref, unref.

#### Getters

getEndLine, getEndPosition, getFile, getParent, getSectionType, getStartLine, getStartPosition.

#### Setters

None.

## getEndLine

cssSectionGetEndLine Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> CssSection | `section`: the section
-> 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 GtkCssProviderparsingError 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 #

Arguments

:: (HasCallStack, MonadIO m) |
=> CssSection | `section`: the section
-> 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 GtkCssProviderparsingError 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

cssSectionGetFile Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> CssSection | `section`: the section
-> m File | Returns: the `File` that `section` was parsed from or `Nothing` if `section` was parsed from other data

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

cssSectionGetParent Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> CssSection | `section`: the section
-> m (Maybe CssSection) | Returns: the parent section or `Nothing` if none

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 #

Arguments

:: (HasCallStack, MonadIO m) |
=> CssSection | `section`: the section
-> m CssSectionType | Returns: the type of `section`

Gets the type of information that `section` describes.

Since: 3.2

## getStartLine

cssSectionGetStartLine Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> CssSection | `section`: the section
-> 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 #

Arguments

:: (HasCallStack, MonadIO m) |
=> CssSection | `section`: the section
-> 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

cssSectionRef Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> CssSection | `section`: a `CssSection`
-> m CssSection | Returns: `section` itself.

Increments the reference count on `section`.

Since: 3.2

## unref

cssSectionUnref Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> CssSection | `section`: a `CssSection`
-> m () |

Decrements the reference count on `section`, freeing the structure if the reference count reaches 0.

Since: 3.2