Class Language
- All Implemented Interfaces:
Proxy
A GtkSourceLanguage
represents a programming or markup language, affecting
syntax highlighting and context classes.
Use LanguageManager
to obtain a GtkSourceLanguage
instance, and
Buffer.setLanguage(org.gnome.gtksourceview.Language)
to apply it to a Buffer
.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Language.Builder<B extends Language.Builder<B>>
Inner class implementing a builder pattern to construct a GObject with properties.static class
Nested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass
-
Constructor Summary
ConstructorDescriptionLanguage
(MemorySegment address) Create a Language proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected Language
asParent()
Returns this instance as if it were its parent type.static Language.Builder
<? extends Language.Builder> builder()
ALanguage.Builder
object constructs aLanguage
with the specified properties.String[]
getGlobs()
Returns the globs associated to this language.boolean
Returns whether the language should be hidden from the user.getId()
Returns the ID of the language.getMetadata
(String name) String[]
Returns the mime types associated to this language.getName()
Returns the localized name of the language.Returns the localized section of the language.getStyleFallback
(String styleId) Returns the ID of the style to use if the specifiedstyleId
is not present in the current style scheme.String[]
Returns the ids of the styles defined by this this Language.getStyleName
(String styleId) Returns the name of the style with IDstyleId
defined by this this Language.static Type
getType()
Get the GType of the Language classMethods inherited from class org.gnome.gobject.GObject
addToggleRef, addWeakPointer, bindProperty, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, connect, constructed, disconnect, dispatchPropertiesChanged, dispose, dupData, dupQdata, emit, emitNotify, finalize_, forceFloating, freezeNotify, get, getData, getMemoryLayout, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, newInstance, newInstance, newInstance, newInstance, newv, notify_, notify_, notifyByPspec, onNotify, ref, refSink, removeToggleRef, removeWeakPointer, replaceData, replaceQdata, runDispose, set, setData, setDataFull, setProperty, setProperty, setProperty, setQdata, setQdataFull, setv, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref, withProperties
Methods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, getPrivate, readGClass, writeGClass
Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
Language
Create a Language proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
-
Method Details
-
getType
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuper
keyword, but will set the native typeclass function pointers to the parent type. When overriding a native virtual method in Java, "chaining up" withsuper.methodName()
doesn't work, because it invokes the overridden function pointer again. To chain up, callasParent().methodName()
. This will call the native function pointer of this virtual method in the typeclass of the parent type. -
getGlobs
Returns the globs associated to this language.This is just an utility wrapper around
getMetadata(java.lang.String)
to retrieve the "globs" metadata property and split it into an array.- Returns:
- a newly-allocated
null
terminated array containing the globs ornull
if no globs are found. The returned array must be freed with g_strfreev().
-
getHidden
public boolean getHidden()Returns whether the language should be hidden from the user.- Returns:
true
if the language should be hidden,false
otherwise.
-
getId
Returns the ID of the language.The ID is not locale-dependent.The returned string is owned by this Language and should not be freed or modified.
- Returns:
- the ID of this Language.
-
getMetadata
-
getMimeTypes
Returns the mime types associated to this language.This is just an utility wrapper around
getMetadata(java.lang.String)
to retrieve the "mimetypes" metadata property and split it into an array.- Returns:
- a newly-allocated
null
terminated array containing the mime types ornull
if no mime types are found. The returned array must be freed with g_strfreev().
-
getName
Returns the localized name of the language.The returned string is owned by this Language and should not be freed or modified.
- Returns:
- the name of this Language.
-
getSection
Returns the localized section of the language.Each language belong to a section (ex. HTML belongs to the Markup section). The returned string is owned by this Language and should not be freed or modified.
- Returns:
- the section of this Language.
-
getStyleFallback
Returns the ID of the style to use if the specifiedstyleId
is not present in the current style scheme.- Parameters:
styleId
- a style ID.- Returns:
- the ID of the style to use if the
specified
styleId
is not present in the current style scheme ornull
if the style has no fallback defined. The returned string is owned by the this Language and must not be modified.
-
getStyleIds
Returns the ids of the styles defined by this this Language.- Returns:
- a newly-allocated
null
terminated array containing ids of the styles defined by this this Language ornull
if no style is defined. The returned array must be freed with g_strfreev().
-
getStyleName
Returns the name of the style with IDstyleId
defined by this this Language.- Parameters:
styleId
- a style ID.- Returns:
- the name of the style with ID
styleId
defined by this this Language ornull
if the style has no name or there is no style with IDstyleId
defined by this this Language. The returned string is owned by the this Language and must not be modified.
-
builder
ALanguage.Builder
object constructs aLanguage
with the specified properties. Use the variousset...()
methods to set properties, and finish construction withLanguage.Builder.build()
.
-