Package ch.bailu.gtk.gobject
Class TypeClass
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.type.Record
ch.bailu.gtk.gobject.TypeClass
- All Implemented Interfaces:
PointerInterface
An opaque structure used as the base of all classes.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
adjustPrivateOffset
(Pointer g_class, Int private_size_or_offset) static ClassHandler
long
int
Gets the offset of the private data for instances of @g_class.static int
getPrivate
(long private_type) static Pointer
peek
(long type) This function is essentially the same as g_type_class_ref(),
except that the classes reference count isn't incremented.This is a convenience function often needed in class initializers.static Pointer
peekStatic
(long type) A more efficient version of g_type_class_peek() which works only for
static types.static Pointer
ref
(long type) Increments the reference count of the class structure belonging to
@type.void
unref()
Decrements the reference count of the class structure being passed in.void
A variant of g_type_class_unref() for use in #GTypeClassCacheFunc
implementations.Methods inherited from class ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Methods inherited from class ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Field Details
-
G_TYPE
- See Also:
-
-
Constructor Details
-
TypeClass
-
TypeClass
public TypeClass()
-
-
Method Details
-
getClassHandler
-
getFieldGType
public long getFieldGType() -
getInstancePrivateOffset
public int getInstancePrivateOffset()Gets the offset of the private data for instances of @g_class.
This is how many bytes you should add to the instance pointer of a
class in order to get the private data for the type represented by
@g_class.
You can only call this function after you have registered a private
data area for @g_class using g_type_class_add_private().- Returns:
- the offset, in bytes
-
getPrivate
- Parameters:
private_type
-- Returns:
-
peekParent
This is a convenience function often needed in class initializers.
It returns the class structure of the immediate parent type of the
class passed in. Since derived classes hold a reference count on
their parent classes as long as they are instantiated, the returned
class will always exist.
This function is essentially equivalent to:
g_type_class_peek (g_type_parent (G_TYPE_FROM_CLASS (g_class)))- Returns:
- the parent class of @g_class
-
unref
public void unref()Decrements the reference count of the class structure being passed in.
Once the last reference count of a class has been released, classes
may be finalized by the type system, so further dereferencing of a
class pointer after g_type_class_unref() are invalid. -
unrefUncached
public void unrefUncached()A variant of g_type_class_unref() for use in #GTypeClassCacheFunc
implementations. It unreferences a class without consulting the chain
of #GTypeClassCacheFuncs, avoiding the recursion which would occur
otherwise. -
adjustPrivateOffset
public static void adjustPrivateOffset(@Nullable Pointer g_class, @Nonnull Int private_size_or_offset) - Parameters:
g_class
-private_size_or_offset
-
-
peek
This function is essentially the same as g_type_class_ref(),
except that the classes reference count isn't incremented.
As a consequence, this function may return %NULL if the class
of the type passed in does not currently exist (hasn't been
referenced before).- Parameters:
type
- type ID of a classed type- Returns:
- the #GTypeClass structure for the given type ID or %NULL if the class does not currently exist
-
peekStatic
A more efficient version of g_type_class_peek() which works only for
static types.- Parameters:
type
- type ID of a classed type- Returns:
- the #GTypeClass structure for the given type ID or %NULL if the class does not currently exist or is dynamically loaded
-
ref
Increments the reference count of the class structure belonging to
@type. This function will demand-create the class if it doesn't
exist already.- Parameters:
type
- type ID of a classed type- Returns:
- the #GTypeClass structure for the given type ID
-
getInstanceSize
public static int getInstanceSize()
-