Class BuilderCScope
- All Implemented Interfaces:
BuilderScope,Proxy
- 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
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 org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClassNested classes/interfaces inherited from interface org.gnome.gtk.BuilderScope
BuilderScope.BuilderScope$Impl, BuilderScope.BuilderScopeInterface -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new BuilderCScope.BuilderCScope(MemorySegment address) Create a BuilderCScope proxy 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()Returns 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 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, 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 org.gnome.gobject.TypeInstance
callParent, callParent, cast, getPrivate, readGClass, writeGClassMethods inherited from class org.javagi.base.ProxyInstance
equals, handle, hashCodeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods 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 new BuilderCScope.
-
-
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 Javasuperkeyword, 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 thecallbackSymbolto the scope ofbuilderunder 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, @Nullable 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.Builderobject constructs aBuilderCScopewith the specified properties. Use the variousset...()methods to set properties, and finish construction withBuilderCScope.Builder.build().- Returns:
- the builder object
-