Class BuilderCScope
- All Implemented Interfaces:
Proxy
,BuilderScope
- Direct Known Subclasses:
BuilderJavaScope
GtkBuilderScope
implementation for the C language.
GtkBuilderCScope
instances use symbols explicitly added to builder
with prior calls to addCallbackSymbol(java.lang.String, org.gnome.gobject.Callback)
.
If developers want to do that, they are encouraged to create their
own scopes for that purpose.
In the case that symbols are not explicitly added; GTK will uses
GModule
’s introspective features (by opening the module null
) to
look at the application’s symbol table. From here it tries to match
the signal function names given in the interface description with
symbols in the application.
Note that unless addCallbackSymbol(java.lang.String, org.gnome.gobject.Callback)
is
called for all signal callbacks which are referenced by the loaded XML,
this functionality will require that GModule
be supported on the platform.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
BuilderCScope.Builder<B extends BuilderCScope.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
Nested classes/interfaces inherited from interface org.gnome.gtk.BuilderScope
BuilderScope.BuilderScopeImpl, BuilderScope.BuilderScopeInterface
-
Constructor Summary
ConstructorDescriptionCreates a newGtkBuilderCScope
object to use with futureGtkBuilder
instances.BuilderCScope
(MemorySegment address) Create a BuilderCScope proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCallbackSymbol
(String callbackName, Callback callbackSymbol) Adds thecallbackSymbol
to the scope ofbuilder
under the givencallbackName
.void
addCallbackSymbols
(String firstCallbackName, Callback firstCallbackSymbol, Object... varargs) A convenience function to add many callbacks.protected BuilderCScope
asParent()
Returns this instance as if it were its parent type.static BuilderCScope.Builder
<? extends BuilderCScope.Builder> builder()
ABuilderCScope.Builder
object constructs aBuilderCScope
with the specified properties.static MemoryLayout
The memory layout of the native struct.static Type
getType()
Get the GType of the BuilderCScope classlookupCallbackSymbol
(String callbackName) Fetches a symbol previously added with gtk_builder_cscope_add_callback_symbol().Methods 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, 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
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.gnome.gtk.BuilderScope
createClosure, getTypeFromFunction, getTypeFromName
-
Constructor Details
-
BuilderCScope
Create a BuilderCScope proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
BuilderCScope
public BuilderCScope()Creates a newGtkBuilderCScope
object to use with futureGtkBuilder
instances.Calling this function is only necessary if you want to add custom callbacks via
addCallbackSymbol(java.lang.String, org.gnome.gobject.Callback)
.
-
-
Method Details
-
getType
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
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. -
addCallbackSymbol
Adds thecallbackSymbol
to the scope ofbuilder
under the givencallbackName
.Using this function overrides the behavior of
GtkBuilder.createClosure(java.lang.String, java.util.Set<org.gnome.gtk.BuilderClosureFlags>, org.gnome.gobject.GObject)
for any callback symbols that are added. Using this method allows for better encapsulation as it does not require that callback symbols be declared in the global namespace.- Parameters:
callbackName
- The name of the callback, as expected in the XMLcallbackSymbol
- The callback pointer
-
addCallbackSymbols
public void addCallbackSymbols(String firstCallbackName, Callback firstCallbackSymbol, Object... varargs) A convenience function to add many callbacks.This is equivalent to calling
addCallbackSymbol(java.lang.String, org.gnome.gobject.Callback)
for each symbol.- Parameters:
firstCallbackName
- The name of the callback, as expected in the XMLfirstCallbackSymbol
- The callback pointervarargs
- A list of callback name and callback symbol pairs terminated withnull
-
lookupCallbackSymbol
-
builder
ABuilderCScope.Builder
object constructs aBuilderCScope
with the specified properties. Use the variousset...()
methods to set properties, and finish construction withBuilderCScope.Builder.build()
.
-