Package org.gnome.gtk
Class CssSection
java.lang.Object
org.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
ConstructorsConstructorDescriptionCssSection(MemorySegment address) Create a CssSection proxy instance for the provided memory address.CssSection(@Nullable File file, CssLocation start, CssLocation end) Creates a newGtkCssSectionreferring to the section in the givenfilefrom thestartlocation to theendlocation. -
Method Summary
Modifier and TypeMethodDescriptionbyte @Nullable []getBytes()Gets the bytes that this CssSection was parsed from.Returns the location in the CSS document where this section ends.@Nullable FilegetFile()Gets the file that this CssSection was parsed from.@Nullable CssSectionGets the parent section for the givensection.Returns the location in the CSS document where this section starts.static @Nullable TypegetType()Get the GType of the CssSection classvoidPrints thesectionintostringin a human-readable form.ref()Increments the reference count onsection.toString()Prints the section into a human-readable text form usingprint(java.lang.String).voidunref()Decrements the reference count onsection, freeing the structure if the reference count reaches 0.static CssSectionwithBytes(@Nullable File file, byte @Nullable [] bytes, CssLocation start, CssLocation end) Creates a newGtkCssSectionreferring to the section in the givenfileor the givenbytesfrom thestartlocation to theendlocation.Methods inherited from class org.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 newGtkCssSectionreferring to the section in the givenfilefrom thestartlocation to theendlocation.- Parameters:
file- The file this section refers tostart- The start locationend- The end location
-
-
Method Details
-
getType
-
withBytes
public static CssSection withBytes(@Nullable File file, byte @Nullable [] bytes, CssLocation start, CssLocation end) Creates a newGtkCssSectionreferring to the section in the givenfileor the givenbytesfrom thestartlocation to theendlocation.- Parameters:
file- The file this section refers tobytes- The bytes this sections refers tostart- The start locationend- The end location- Returns:
- a new
GtkCssSection - Since:
- 4.16
-
getBytes
public byte @Nullable [] getBytes()Gets the bytes that this CssSection was parsed from.- Returns:
- the
GBytesfrom which thesectionwas parsed - Since:
- 4.16
-
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), thenNULLis returned.- Returns:
- the
GFilefrom which thesectionwas 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_DOCUMENT. Their parent will either beNULLif they are the original CSS document that was loaded byCssProvider.loadFromFile(org.gnome.gio.File)or a section of typeGTK_CSS_SECTION_IMPORTif it was loaded with an@importrule 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 thesectionintostringin a human-readable form.This is a form like
gtk.css:32:1-23to denote line 32, characters 1 to 23 in the filegtk.css.- Parameters:
string- aGStringto print to
-
ref
-
toString
Prints the section into a human-readable text form usingprint(java.lang.String). -
unref
public void unref()Decrements the reference count onsection, freeing the structure if the reference count reaches 0.
-