3.7 <GtkCssSection>

Structure: <GtkCssSection>

Defines a part of a CSS document.

Because sections are nested into one another, you can use CssSection.get_parent to get the containing region.

Procedures

Method: css-section:get-bytes self ⇒ %return
Method: get-bytes self ⇒ %return

Gets the bytes that self was parsed from.

self

Passed: a <GtkCssSection>.

the section

%return

Returned: a <GBytes>, or #f.

the <GBytes> from which the section was parsed

Method: css-section:get-end-location self ⇒ %return
Method: get-end-location self ⇒ %return

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

self

Passed: a <GtkCssSection>.

the section

%return

Returned: a <GtkCssLocation>.

The end location of this section

Method: css-section:get-file self ⇒ %return
Method: get-file self ⇒ %return

Gets the file that self was parsed from.

If no such file exists, for example because the CSS was loaded via css-provider:load-from-data, then NULL is returned.

self

Passed: a <GtkCssSection>.

the section

%return

Returned: a <GFile>, or #f.

the <GFile> from which the section was parsed

Method: css-section:get-parent self ⇒ %return
Method: get-parent self ⇒ %return

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 css-provider:load-from-file or a section of type GTK_CSS_SECTION_IMPORT if it was loaded with an @import rule from a different file.

self

Passed: a <GtkCssSection>.

the section

%return

Returned: a <GtkCssSection>, or #f.

the parent section

Method: css-section:get-start-location self ⇒ %return
Method: get-start-location self ⇒ %return

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

self

Passed: a <GtkCssSection>.

the section

%return

Returned: a <GtkCssLocation>.

The start location of this section

Procedure: css-section:new file start end ⇒ %return

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

file

Passed: a <GFile>, or #f.

The file this section refers to

start

Passed: a <GtkCssLocation>.

The start location

end

Passed: a <GtkCssLocation>.

The end location

%return

Returned: a <GtkCssSection>.

a new <GtkCssSection>

Procedure: css-section:new-with-bytes file bytes start end ⇒ %return

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

file

Passed: a <GFile>, or #f.

The file this section refers to

bytes

Passed: a <GBytes>, or #f.

The bytes this sections refers to

start

Passed: a <GtkCssLocation>.

The start location

end

Passed: a <GtkCssLocation>.

The end location

%return

Returned: a <GtkCssSection>.

a new <GtkCssSection>

Method: css-section:print self string
Method: print self string

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.

self

Passed: a <GtkCssSection>.

a section

string

Passed: a <GString>.

a <GString> to print to

Method: css-section:ref self ⇒ %return
Method: ref self ⇒ %return

Increments the reference count on section.

self

Passed: a <GtkCssSection>.

a <GtkCssSection>

%return

Returned: a <GtkCssSection>.

the CSS section itself.

Method: css-section:to-string self ⇒ %return
Method: to-string self ⇒ %return

Prints the section into a human-readable text form using css-section:print.

self

Passed: a <GtkCssSection>.

a <GtkCssSection>

%return

Returned: a string.

A new string.

Method: css-section:unref self
Method: unref self

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

self

Passed: a <GtkCssSection>.

a <GtkCssSection>