gi-gtk4-4.0.12: Gtk 4.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
  - getBytes
  - getEndLocation
  - getFile
  - getParent
  - getStartLocation
  - new
  - newWithBytes
  - print
  - ref
  - toString
  - unref

Description

Defines a part of a CSS document.

Because sections are nested into one another, you can use [method`cssSection`.get_parent] to get the containing region.

Synopsis

- newtype CssSection = CssSection (ManagedPtr CssSection)
- cssSectionGetBytes :: (HasCallStack, MonadIO m) => CssSection -> m (Maybe Bytes)
- cssSectionGetEndLocation :: (HasCallStack, MonadIO m) => CssSection -> m CssLocation
- cssSectionGetFile :: (HasCallStack, MonadIO m) => CssSection -> m (Maybe File)
- cssSectionGetParent :: (HasCallStack, MonadIO m) => CssSection -> m (Maybe CssSection)
- cssSectionGetStartLocation :: (HasCallStack, MonadIO m) => CssSection -> m CssLocation
- cssSectionNew :: (HasCallStack, MonadIO m, IsFile a) => Maybe a -> CssLocation -> CssLocation -> m CssSection
- cssSectionNewWithBytes :: (HasCallStack, MonadIO m, IsFile a) => Maybe a -> Maybe Bytes -> CssLocation -> CssLocation -> m CssSection
- cssSectionPrint :: (HasCallStack, MonadIO m) => CssSection -> String -> m ()
- cssSectionRef :: (HasCallStack, MonadIO m) => CssSection -> m CssSection
- cssSectionToString :: (HasCallStack, MonadIO m) => CssSection -> m Text
- 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

print, ref, toString, unref.

#### Getters

getBytes, getEndLocation, getFile, getParent, getStartLocation.

#### Setters

None.

## getBytes

cssSectionGetBytes Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> CssSection | `section`: the section
-> m (Maybe Bytes) | Returns: the `GBytes` from which the `section` was parsed

Gets the bytes that `section` was parsed from.

Since: 4.16

## getEndLocation

cssSectionGetEndLocation Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> CssSection | `section`: the section
-> m CssLocation | Returns: The end location of this section

Returns the location in the CSS document where this section ends.

## getFile

cssSectionGetFile Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> CssSection | `section`: the section
-> m (Maybe File) | Returns: the `GFile` from which the `section` was parsed

Gets the file that `section` was parsed from.

If no such file exists, for example because the CSS was loaded via `cssProviderLoadFromData`, then `NULL` is returned.

## getParent

cssSectionGetParent Source #

Arguments

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

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 `NULL` 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.

## getStartLocation

cssSectionGetStartLocation Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> CssSection | `section`: the section
-> m CssLocation | Returns: The start location of this section

Returns the location in the CSS document where this section starts.

## new

cssSectionNew Source #

Arguments

:: (HasCallStack, MonadIO m, IsFile a) |
=> Maybe a | `file`: The file this section refers to
-> CssLocation | `start`: The start location
-> CssLocation | `end`: The end location
-> m CssSection | Returns: a new `GtkCssSection`

Creates a new `GtkCssSection` referring to the section in the given `file` from the `start` location to the `end` location.

## newWithBytes

cssSectionNewWithBytes Source #

Arguments

:: (HasCallStack, MonadIO m, IsFile a) |
=> Maybe a | `file`: The file this section refers to
-> Maybe Bytes | `bytes`: The bytes this sections refers to
-> CssLocation | `start`: The start location
-> CssLocation | `end`: The end location
-> m CssSection | Returns: a new `GtkCssSection`

Creates a new `GtkCssSection` referring to the section in the given `file` or the given `bytes` from the `start` location to the `end` location.

Since: 4.16

## print

cssSectionPrint Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> CssSection | `section`: a section
-> String | `string`: a `GString` to print to
-> m () |

Prints the `section` into `string` 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 file `gtk.css`.

## ref

cssSectionRef Source #

Arguments

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

Increments the reference count on `section`.

## toString

cssSectionToString Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> CssSection | `section`: a `GtkCssSection`
-> m Text | Returns: A new string.

Prints the section into a human-readable text form using `cssSectionPrint`.

## unref

cssSectionUnref Source #

Arguments

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

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