[544:7] extends: object
GObjectRef is a low-level reusable wrapper for one GObject-derived handle. Generated wrappers can extend this to share explicit ref and unref behavior without tying native cleanup to GC.
GObjectRef (Handle)
Wraps one GObject-derived native handle.
Handle is a NativeHandle or compatible pointer-shaped object.handle ()
Returns the wrapped NativeHandle.
A NativeHandle object.isNull ()
Returns true when the wrapped handle is null.
A bool with true when the handle is null.ref ()
Returns a retained wrapper for the same native object.
A GObjectRef object.unref ()
Decrements the reference count on the wrapped native object.
nullunrefIfOwned ()
Decrements the reference count only when the wrapped handle is owned.
nullclearOwnedHandle ()
Clears the wrapped handle when it is explicitly owned.
A NativeHandle object pointing at null.typeName ()
Returns the runtime GType name for the wrapped pointer. Useful when iterating a container whose element type is unknown at emit time, so callers can branch on the concrete wrapper class to downcast to.
The GType name string, or null when the wrapped handle is null.as (Class)
Downcasts this reference to the provided generated wrapper class by calling its wrap constructor with the same native handle.
Class is the generated wrapper class to instantiate.A new instance of Class that wraps the same native handle.[13:21] static (extern: com.lehman.aussom.stdlib.AussomGLib) extends: object
The glib static class provides GLib-specific helpers built on top of the
generic panama FFM layer. Use it for GError** allocation and translation,
explicit GObject lifetime calls, and low-level GObject signal or property
helpers that should not live in the generic panama API.
gerror (object ArenaObj)
Allocates a
GError**out slot in the provided arena. Pass the returned object directly to native functions that expect aGError**parameter.
ArenaObj is a NativeArena object that owns the out slot allocation.A NativeGErrorOut object.ref (object HandleObj, string TypeName = "GObject*")
Increments the reference count on a GObject-derived handle and returns a handle to the same native object.
HandleObj is a NativeHandle or compatible pointer-shaped object.TypeName is an optional display name for the returned handle.A NativeHandle object for the retained native object.unref (object HandleObj)
Decrements the reference count on a GObject-derived handle.
HandleObj is a NativeHandle or compatible pointer-shaped object.nullunrefOwned (object HandleObj)
Decrements the reference count on an owned GObject-derived handle. This fails when the provided handle is not marked as owned.
HandleObj is a NativeHandle or compatible pointer-shaped object.nullunrefIfOwned (object HandleObj)
Decrements the reference count only when the handle is explicitly marked as owned. Borrowed and unknown handles are left untouched.
HandleObj is a NativeHandle or compatible pointer-shaped object.nullclearOwnedHandle (object HandleObj)
Clears an owned GObject-derived handle and returns a null handle of the same display type. Borrowed or unknown handles fail clearly.
HandleObj is a NativeHandle or compatible pointer-shaped object.A NativeHandle object pointing at null.throwIfGError (object GErrorOutObj, string Prefix = null)
Throws an Aussom exception when the provided
GError**slot contains an error object. On translation, the nativeGErroris freed and the slot is reset to null.
GErrorOutObj is a NativeGErrorOut object.Prefix is an optional call-site description to prepend to the message.null when no error is present.signalConnect (object HandleObj, string SignalName, object CallbackHandleObj, UserData = null, int ConnectFlags = 0)
Connects a native signal handler to a GObject-derived instance. The callback handle should usually come from a NativeCallback wrapper.
HandleObj is a NativeHandle or compatible pointer-shaped object.SignalName is the detailed signal name such as notify::title.CallbackHandleObj is a NativeCallback, NativeHandle, or compatible pointer-shaped object.UserData is an optional pointer-shaped user-data value.ConnectFlags is an optional int with GConnectFlags bits.An int with the native handler id.signalDisconnect (object HandleObj, int HandlerId)
Disconnects one native signal handler from a GObject-derived instance.
HandleObj is a NativeHandle or compatible pointer-shaped object.HandlerId is the native handler id returned by signalConnect.nullgetProperty (object HandleObj, string PropertyName, string TypeName = "pointer", string WrapTypeName = "GObject*")
Reads one property from a GObject-derived instance using a low-level type token. Supported type tokens are intentionally narrow in v1:
string,bool,int,double,object, andpointer.
HandleObj is a NativeHandle or compatible pointer-shaped object.PropertyName is the canonical property name.TypeName is the low-level property conversion token.WrapTypeName is the display type name used when returning object-like handles.A converted scalar, string, NativeHandle, or null.setProperty (object HandleObj, string PropertyName, Value, string TypeName = "pointer")
Writes one property on a GObject-derived instance using a low-level type token. Supported type tokens are intentionally narrow in v1:
string,bool,int,double,object, andpointer.
HandleObj is a NativeHandle or compatible pointer-shaped object.PropertyName is the canonical property name.Value is the value to store.TypeName is the low-level property conversion token.nullbindProperty (object SourceObj, string SourceProperty, object TargetObj, string TargetProperty, int Flags = 0)
Creates a low-level GObject property binding.
SourceObj is the source NativeHandle or compatible pointer-shaped object.SourceProperty is the readable source property name.TargetObj is the target NativeHandle or compatible pointer-shaped object.TargetProperty is the writable target property name.Flags is an optional int with GBindingFlags bits.A NativeHandle wrapping the returned GBinding*, or null on failure.iterate (bool MayBlock = false)
Iterates the default GLib main context once. Returns true when a source dispatched during the iteration.
MayBlock is true to block until work is available.A bool indicating whether a source ran.pending ()
Returns true when the default GLib main context has sources ready to dispatch.
A bool.typeName (object HandleObj)
Returns the GType name of a GObject instance. Wraps g_type_name_from_instance.
HandleObj is a NativeHandle or wrapper with handle().A string with the GType name, or null when the instance is untyped.timeoutAdd (int IntervalMs, object CallbackObj, int Priority = null)
Adds a main-loop timeout source.
IntervalMs is how often the callback fires, in milliseconds.CallbackObj is a NativeCallback whose C signature is int(void*) returning 0 to remove.Priority is optional; defaults to G_PRIORITY_DEFAULT (0).An int source id; pass to sourceRemove to cancel.idleAdd (object CallbackObj, int Priority = null)
Adds a main-loop idle source.
CallbackObj is a NativeCallback whose C signature is int(void*) returning 0 to remove.Priority is optional; defaults to G_PRIORITY_DEFAULT_IDLE (200).An int source id; pass to sourceRemove to cancel.sourceRemove (int SourceId)
Cancels a main-loop source by id.
SourceId is the id returned by timeoutAdd or idleAdd.A bool with true when the source existed and was removed.retainedSourceCount ()
Returns the number of currently-retained main-loop source callbacks. Used by tests to verify sources are being released.
An int count.valueNew (string Token)
Creates a standalone GValue for the provided property type token. Pass the returned NativeGValue directly where a GValue pointer is expected, or use .set() / .get() to read and write values through the same token system as getProperty.
Token is a GLib property type token (string, bool, int, int64, uint, uint64, double, float, char, uchar, long, ulong, object, pointer, enum, flags, gtype, strv).A NativeGValue object.variantNewBool (bool Value)
Creates a GVariant holding a bool. The returned handle is marked owned; call variantUnref to release it.
variantNewInt32 (int Value)
Creates a GVariant holding an int32.
variantNewInt64 (int Value)
Creates a GVariant holding an int64.
variantNewUint32 (int Value)
Creates a GVariant holding a uint32 (non-negative, <= 2^32-1).
variantNewUint64 (int Value)
Creates a GVariant holding a uint64.
variantNewDouble (Value)
Creates a GVariant holding a double.
variantNewString (string Value)
Creates a GVariant holding a UTF-8 string.
variantNewTuple (list Children)
Creates a GVariant tuple from a list of GVariant children.
variantNewStringArray (list Values)
Creates a GVariant holding an array of strings (GVariant "as").
variantParse (TypeString, string Text)
Parses a GVariant from its textual form, optionally typed.
TypeString is a GVariant type string (for example "(si)") or null.Text is the textual GVariant value, for example "('hi', 5)".variantGetType (object VariantObj)
Returns the GVariant type string (for example "i", "s", "(si)").
variantGetBool (object VariantObj)
Reads the value of a boolean GVariant.
variantGetInt32 (object VariantObj)
Reads the value of an int32 GVariant.
variantGetInt64 (object VariantObj)
Reads the value of an int64 GVariant.
variantGetUint32 (object VariantObj)
Reads the value of a uint32 GVariant as a non-negative int.
variantGetUint64 (object VariantObj)
Reads the value of a uint64 GVariant.
variantGetDouble (object VariantObj)
Reads the value of a double GVariant.
variantGetString (object VariantObj)
Reads the value of a string GVariant.
variantNChildren (object VariantObj)
Returns the number of children in a tuple or array GVariant.
variantGetChildValue (object VariantObj, int Index)
Returns the child GVariant at Index. The returned handle is owned; unref when done.
variantRef (object VariantObj)
Increments the reference count on a GVariant.
variantUnref (object VariantObj)
Decrements the reference count on a GVariant.
signalEmitv (object InstanceObj, string SignalName, list ArgValues, ReturnToken = null)
Emits a signal on a GObject instance using explicit NativeGValue arguments. The signal name may include a "::" detail suffix. This is the non-variadic form; use signalEmitByName for a more ergonomic surface that accepts token/value pairs.
InstanceObj is a NativeHandle for the GObject instance.SignalName is the signal name, optionally "name::detail".ArgValues is a list of NativeGValue objects (signal args).ReturnToken is an optional token for the signal's return type.The decoded return value or null for VOID-return signals.signalEmitByName (object InstanceObj, string SignalName, list ArgPairs, ReturnToken = null)
Emits a signal on a GObject instance with Aussom-native args. Each entry in ArgPairs is a two-element [token, value] list parallel to the signal's declared argument types.
InstanceObj is a NativeHandle for the GObject instance.SignalName is the signal name, optionally "name::detail".ArgPairs is a list of [token, value] pairs.ReturnToken is an optional token for the signal's return type.The decoded return value or null for VOID-return signals.objectNewWithProperties (string TypeName, Properties = null)
Constructs a new GObject of the given type with optional initial property values. Uses g_object_new_with_properties (non-variadic) so no Panama variadic support is required.
TypeName is the GLib type name such as "GtkLabel".Properties is an optional map of property-name -> [token, value].An owned NativeHandle for the new GObject.filePath (object FileObj)
Returns the filesystem path of a GFile, or null when the GFile has no path (for example remote URIs). Uses g_file_peek_path so no free is required.
FileObj is a NativeHandle for a GFile.A string path or null.fileOwnedPath (object FileObj)
Returns the filesystem path of a GFile as a freshly-allocated string that is freed on the native side after decoding.
FileObj is a NativeHandle for a GFile.A string path or null.fileNewForPath (string Path)
Creates a new GFile for the provided local path.
Path is a filesystem path string.An owned NativeHandle (GFile*).free (HandleObj)
Frees memory returned by a GLib function that expects the caller to call g_free on its result. Accepts null as a no-op.
HandleObj is a NativeHandle, NativeBuffer, or null.nullcancellableNew ()
Creates a new GCancellable. Release with glib.unref.
An owned NativeHandle (GCancellable*).cancellableCancel (object CancellableObj)
Requests cancellation of any operation bound to the given GCancellable. Subsequent calls to isCancelled return true.
CancellableObj is a NativeHandle for a GCancellable.nullcancellableIsCancelled (object CancellableObj)
Returns true when the GCancellable has been cancelled.
CancellableObj is a NativeHandle for a GCancellable.A bool.hashTableSize (object TableObj)
Returns the number of entries in a GHashTable.
TableObj is a NativeHandle for a GHashTable.An int count.hashTableLookup (object TableObj, KeyObj, string ValueTypeName = "pointer")
Looks up one value in a GHashTable. Returns a null handle when the key is not present.
TableObj is a NativeHandle for a GHashTable.KeyObj is the lookup key as a NativeHandle or null.ValueTypeName is an optional display name for the value.A NativeHandle for the value.hashTableKeys (object TableObj, string KeyTypeName = "pointer")
Returns the keys of a GHashTable as a list of NativeHandles.
TableObj is a NativeHandle for a GHashTable.KeyTypeName is an optional display name for the keys.A list of NativeHandle objects.hashTableUnref (object TableObj)
Releases one reference on a GHashTable.
TableObj is a NativeHandle for a GHashTable.nullptrArrayLength (object ArrayObj)
Returns the number of elements in a GPtrArray.
ArrayObj is a NativeHandle for a GPtrArray.An int length.ptrArrayIndex (object ArrayObj, int Index, string ElementTypeName = "pointer")
Returns the element at Index in a GPtrArray as a NativeHandle.
ArrayObj is a NativeHandle for a GPtrArray.Index is the zero-based index.ElementTypeName is an optional display name for the element.A NativeHandle for the element.ptrArrayUnref (object ArrayObj)
Releases one reference on a GPtrArray.
ArrayObj is a NativeHandle for a GPtrArray.nullthemedIconNew (string IconName)
Creates a new GThemedIcon for a named icon. Release with glib.unref.
IconName is a string name such as "document-save".An owned NativeHandle (GThemedIcon*).fileIconNew (object FileObj)
Creates a new GFileIcon for the provided GFile. Release with glib.unref.
FileObj is a NativeHandle for a GFile.An owned NativeHandle (GFileIcon*).errorDomainName (int Domain)
Resolves a GLib error-domain quark to its registered name. Use after throwIfGError or readGError to branch on a readable name rather than a numeric quark id.
Domain is the numeric quark returned by throwIfGError.A string name or null when the quark is unknown.bytesToBuffer (object BytesObj)
Copies the contents of a
GBytes*object into an Aussom Buffer.
BytesObj is a NativeHandle or compatible pointer-shaped object.A Buffer object.bytesUnref (object BytesObj)
Releases one
GBytes*object.
BytesObj is a NativeHandle or compatible pointer-shaped object.nulllistLength (object ListObj)
Returns the number of nodes in one
GList*.
ListObj is a NativeHandle or compatible pointer-shaped object.An int with the node count.listNth (object ListObj, int Index, string TypeName = "pointer")
Returns the data pointer stored at the provided
GList*index.
ListObj is a NativeHandle or compatible pointer-shaped object.Index is the zero-based index.TypeName is an optional display type name for the returned handle.A NativeHandle object.listFree (object ListObj)
Frees the node structure of one
GList*. The list item data is not destroyed.
ListObj is a NativeHandle or compatible pointer-shaped object.nullslistLength (object ListObj)
Returns the number of nodes in one
GSList*.
ListObj is a NativeHandle or compatible pointer-shaped object.An int with the node count.slistNth (object ListObj, int Index, string TypeName = "pointer")
Returns the data pointer stored at the provided
GSList*index.
ListObj is a NativeHandle or compatible pointer-shaped object.Index is the zero-based index.TypeName is an optional display type name for the returned handle.A NativeHandle object.slistFree (object ListObj)
Frees the node structure of one
GSList*. The list item data is not destroyed.
ListObj is a NativeHandle or compatible pointer-shaped object.null[705:14] (extern: com.lehman.aussom.stdlib.GLibNativeGError) extends: object
NativeGError is a decoded snapshot of one native GLib GError.
The message text is copied into Aussom-safe memory so it remains readable
after the native error object is freed.
domain ()
Returns the numeric GLib error domain value.
An int with the numeric domain.code ()
Returns the native GLib error code.
An int with the error code.message ()
Returns the decoded UTF-8 error message.
A string with the error message.handle ()
Returns the original native error pointer as a NativeHandle.
A NativeHandle object.[636:7] extends: object
CallbackRetention keeps one NativeCallback and its optional retained user-data value alive together until close() is called explicitly.
CallbackRetention (object CallbackObj, RetainedUserData = null, callback DestroyFn = null)
Stores a callback plus optional retained user data.
CallbackObj is a NativeCallback object.RetainedUserData is an optional retained pointer-like value.DestroyFn is an optional callback that receives RetainedUserData on close().callback ()
Returns the wrapped NativeCallback.
A NativeCallback object.userData ()
Returns the retained user-data value, if any.
The retained value or null.isClosed ()
Returns true when close() has already run.
A bool with true when this retention object is closed.close ()
Closes the NativeCallback and runs any configured user-data cleanup. The cleanup logic runs at most once.
This object.[739:14] (extern: com.lehman.aussom.stdlib.GLibNativeValue) extends: object
NativeGValue wraps one heap-allocated GLib GValue. Use it when a native API expects a GValue pointer, or for constructing typed values that can be passed to g_object_new_with_properties, g_signal_emitv, or similar. Close the GValue when done to free the native memory. The handle() method returns a NativeHandle pointing at the GValue struct.
setValue (Value)
Sets the stored value using the token the GValue was created with.
Value is the Aussom value to store.this object.getValue (string WrapTypeName = "GObject*")
Reads the stored value using the token the GValue was created with.
WrapTypeName is an optional display type name for returned handles.The decoded Aussom value.token ()
Returns the token this GValue was created with.
A string.handle ()
Returns a NativeHandle that points at the GValue struct.
A NativeHandle object.close ()
Releases the GValue and frees the underlying native arena. Idempotent.
this object.isClosedFn ()
Returns true when the GValue has been closed.
A bool.[784:14] (extern: com.lehman.aussom.stdlib.GLibNativeGErrorOut) extends: object
NativeGErrorOut wraps one GError** out slot.
It can be passed directly to native calls, inspected afterward, or cleared.
buffer ()
Returns the raw pointer-sized slot storage as a NativeBuffer.
A NativeBuffer object.hasError ()
Returns true when the slot currently contains a non-null
GError*.
A bool with true when an error is present.getError ()
Decodes the current native
GErrorinto a NativeGError snapshot.
A NativeGError object.clear ()
Frees any current native
GErrorand resets the slot to null. Calling clear on an empty slot is safe.
This object.