Class BuilderCScope
- All Implemented Interfaces:
BuilderScope, Proxy
- Direct Known Subclasses:
BuilderJavaScope
A GtkBuilderScope implementation for the C language.
GtkBuilderCScope instances use symbols explicitly added to builder
with prior calls to addCallbackSymbol(String, 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(String, 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
Nested ClassesModifier and TypeClassDescriptionstatic classBuilderCScope.Builder<B extends BuilderCScope.Builder<B>>Inner class implementing a builder pattern to construct a GObject with properties.static classNested classes/interfaces inherited from class GObject
GObject.NotifyCallback, GObject.ObjectClassNested classes/interfaces inherited from interface BuilderScope
BuilderScope.BuilderScope$Impl, BuilderScope.BuilderScopeInterface -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new BuilderCScope.BuilderCScope(MemorySegment address) Create a BuilderCScope instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCallbackSymbol(String callbackName, @Nullable Callback callbackSymbol) Adds thecallbackSymbolto the scope ofbuilderunder the givencallbackName.voidaddCallbackSymbols(String firstCallbackName, @Nullable Callback firstCallbackSymbol, Object... varargs) A convenience function to add many callbacks.protected BuilderCScopeasParent()Return this instance as if it were its parent type.static BuilderCScope.Builder<? extends BuilderCScope.Builder> builder()ABuilderCScope.Builderobject constructs aBuilderCScopewith the specified properties.static MemoryLayoutThe memory layout of the native struct.static @Nullable TypegetType()Get the GType of the BuilderCScope class.@Nullable CallbacklookupCallbackSymbol(String callbackName) Fetches a symbol previously added with gtk_builder_cscope_add_callback_symbol().Methods inherited from class 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, 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, withPropertiesMethods inherited from class TypeInstance
callParent, callParent, cast, getPrivate, readGClass, writeGClassMethods inherited from class ProxyInstance
equals, handle, hashCodeMethods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface BuilderScope
createClosure, getTypeFromFunction, getTypeFromName
-
Constructor Details
-
BuilderCScope
Create a BuilderCScope instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
BuilderCScope
public BuilderCScope()Create a new BuilderCScope.
-
-
Method Details
-
getType
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
asParent
Return this instance as if it were its parent type. Comparable to the Javasuperkeyword, but ensures the parent typeclass is also used in native code. -
addCallbackSymbol
Adds the
callbackSymbolto the scope ofbuilderunder the givencallbackName.Using this function overrides the behavior of
GtkBuilder.createClosure(String, Set, 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, @Nullable Callback firstCallbackSymbol, Object... varargs) A convenience function to add many callbacks.
This is equivalent to calling
addCallbackSymbol(String, 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.Builderobject constructs aBuilderCScopewith the specified properties. Use the variousset...()methods to set properties, and finish construction withBuilderCScope.Builder.build().- Returns:
- the builder object
-