Package org.gnome.gtk
Class CssSection
java.lang.Object
io.github.jwharm.javagi.base.ProxyInstance
org.gnome.gtk.CssSection
- All Implemented Interfaces:
Proxy
Defines a part of a CSS document.
Because sections are nested into one another, you can use
getParent()
to get the containing region.
-
Constructor Summary
ConstructorDescriptionCssSection
(MemorySegment address) Create a CssSection proxy instance for the provided memory address.CssSection
(@Nullable File file, CssLocation start, CssLocation end) Creates a newGtkCssSection
referring to the section in the givenfile
from thestart
location to theend
location. -
Method Summary
Modifier and TypeMethodDescriptiongetBytes()
Gets the bytes that this CssSection was parsed from.Returns the location in the CSS document where this section ends.getFile()
Gets the file that this CssSection was parsed from.Gets the parent section for the givensection
.Returns the location in the CSS document where this section starts.static Type
getType()
Get the GType of the CssSection classvoid
Prints thesection
intostring
in a human-readable form.ref()
Increments the reference count onsection
.toString()
Prints the section into a human-readable text form usingprint(org.gnome.glib.GString)
.void
unref()
Decrements the reference count onsection
, freeing the structure if the reference count reaches 0.static CssSection
withBytes
(@Nullable File file, @Nullable Bytes bytes, CssLocation start, CssLocation end) Creates a newGtkCssSection
referring to the section in the givenfile
or the givenbytes
from thestart
location to theend
location.Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
CssSection
Create a CssSection proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
CssSection
Creates a newGtkCssSection
referring to the section in the givenfile
from thestart
location to theend
location.- Parameters:
file
- The file this section refers tostart
- The start locationend
- The end location
-
-
Method Details
-
getType
-
withBytes
public static CssSection withBytes(@Nullable @Nullable File file, @Nullable @Nullable Bytes bytes, CssLocation start, CssLocation end) Creates a newGtkCssSection
referring to the section in the givenfile
or the givenbytes
from thestart
location to theend
location.- Parameters:
file
- The file this section refers tobytes
- The bytes this sections refers tostart
- The start locationend
- The end location- Returns:
- a new
GtkCssSection
-
getBytes
Gets the bytes that this CssSection was parsed from.- Returns:
- the
GBytes
from which thesection
was parsed
-
getEndLocation
Returns the location in the CSS document where this section ends.- Returns:
- The end location of this section
-
getFile
Gets the file that this CssSection was parsed from.If no such file exists, for example because the CSS was loaded via
CssProvider.loadFromData(java.lang.String, long)
, thenNULL
is returned.- Returns:
- the
GFile
from which thesection
was parsed
-
getParent
Gets the parent section for the givensection
.The parent section is the section that contains this
section
. A special case are sections of typeGTK_CSS_SECTION_DOCUMEN
T. Their parent will either beNULL
if they are the original CSS document that was loaded byCssProvider.loadFromFile(org.gnome.gio.File)
or a section of typeGTK_CSS_SECTION_IMPORT
if it was loaded with an@import
rule from a different file.- Returns:
- the parent section
-
getStartLocation
Returns the location in the CSS document where this section starts.- Returns:
- The start location of this section
-
print
Prints thesection
intostring
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 filegtk.css
.- Parameters:
string
- aGString
to print to
-
ref
-
toString
Prints the section into a human-readable text form usingprint(org.gnome.glib.GString)
. -
unref
public void unref()Decrements the reference count onsection
, freeing the structure if the reference count reaches 0.
-