Package ch.bailu.gtk.gobject
Klasse Value
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.type.Record
ch.bailu.gtk.gobject.Value
- Alle implementierten Schnittstellen:
PointerInterface
An opaque structure used to hold different types of values.
The data within the structure has protected scope: it is accessible only
to functions within a #GTypeValueTable structure, or implementations of
the g_value_*() API. That is, code portions which implement new fundamental
types.
#GValue users cannot make any assumptions about how data is stored
within the 2 element @data union, and the @g_type member should
only be accessed through the G_VALUE_TYPE() macro.
The data within the structure has protected scope: it is accessible only
to functions within a #GTypeValueTable structure, or implementations of
the g_value_*() API. That is, code portions which implement new fundamental
types.
#GValue users cannot make any assumptions about how data is stored
within the 2 element @data union, and the @g_type member should
only be accessed through the G_VALUE_TYPE() macro.
-
Verschachtelte Klassen - Übersicht
Verschachtelte Klassen -
Feldübersicht
Felder -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoid
Copies the value of @src_value into @dest_value.dupBoxed()
Get the contents of a %G_TYPE_BOXED derived #GValue.Get the contents of a %G_TYPE_OBJECT derived #GValue, increasing
its reference count.dupParam()
Get the contents of a %G_TYPE_PARAM #GValue, increasing its
reference count.Get a copy the contents of a %G_TYPE_STRING #GValue.Get the contents of a variant #GValue, increasing its refcount.boolean
Determines if @value will fit inside the size of a pointer value.boolean
Get the contents of a %G_TYPE_BOOLEAN #GValue.getBoxed()
Get the contents of a %G_TYPE_BOXED derived #GValue.byte
getChar()
Veraltet.static ClassHandler
double
Get the contents of a %G_TYPE_DOUBLE #GValue.int
getEnum()
Get the contents of a %G_TYPE_ENUM #GValue.long
int
getFlags()
Get the contents of a %G_TYPE_FLAGS #GValue.float
getFloat()
Get the contents of a %G_TYPE_FLOAT #GValue.long
getGtype()
Get the contents of a %G_TYPE_GTYPE #GValue.static int
int
getInt()
Get the contents of a %G_TYPE_INT #GValue.long
getInt64()
Get the contents of a %G_TYPE_INT64 #GValue.long
getLong()
Get the contents of a %G_TYPE_LONG #GValue.Get the contents of a %G_TYPE_OBJECT derived #GValue.getParam()
Get the contents of a %G_TYPE_PARAM #GValue.static long
static TypeSystem.TypeSize
Get the contents of a pointer #GValue.int
getSchar()
Get the contents of a %G_TYPE_CHAR #GValue.Get the contents of a %G_TYPE_STRING #GValue.static long
static TypeSystem.TypeSize
byte
getUchar()
Get the contents of a %G_TYPE_UCHAR #GValue.int
getUint()
Get the contents of a %G_TYPE_UINT #GValue.long
Get the contents of a %G_TYPE_UINT64 #GValue.long
getUlong()
Get the contents of a %G_TYPE_ULONG #GValue.Get the contents of a variant #GValue.init
(long g_type) Initializes @value with the default value of @type.void
initFromInstance
(Pointer instance) Initializes and sets @value from an instantiatable type via the
value_table's collect_value() function.Returns the value contents as pointer.static void
registerTransformFunc
(long src_type, long dest_type, Value.OnValueTransform transform_func) Registers a value transformation function for use in g_value_transform().reset()
Clears the current value in @value and resets it to the default value
(as if the value had just been initialized).void
setBoolean
(boolean v_boolean) Set the contents of a %G_TYPE_BOOLEAN #GValue to @v_boolean.void
Set the contents of a %G_TYPE_BOXED derived #GValue to @v_boxed.void
setBoxedTakeOwnership
(Pointer v_boxed) Veraltet.void
setChar
(byte v_char) Veraltet.void
setDouble
(double v_double) Set the contents of a %G_TYPE_DOUBLE #GValue to @v_double.void
setEnum
(int v_enum) Set the contents of a %G_TYPE_ENUM #GValue to @v_enum.void
setFlags
(int v_flags) Set the contents of a %G_TYPE_FLAGS #GValue to @v_flags.void
setFloat
(float v_float) Set the contents of a %G_TYPE_FLOAT #GValue to @v_float.void
setGtype
(long v_gtype) Set the contents of a %G_TYPE_GTYPE #GValue to @v_gtype.void
setInstance
(Pointer instance) Sets @value from an instantiatable type via the
value_table's collect_value() function.void
setInt
(int v_int) Set the contents of a %G_TYPE_INT #GValue to @v_int.void
setInt64
(long v_int64) Set the contents of a %G_TYPE_INT64 #GValue to @v_int64.void
setInternedString
(Str v_string) Set the contents of a %G_TYPE_STRING #GValue to @v_string.void
setInternedString
(String v_string) Set the contents of a %G_TYPE_STRING #GValue to @v_string.void
setLong
(long v_long) Set the contents of a %G_TYPE_LONG #GValue to @v_long.void
Set the contents of a %G_TYPE_OBJECT derived #GValue to @v_object.void
setObjectTakeOwnership
(Pointer v_object) Veraltet.void
Set the contents of a %G_TYPE_PARAM #GValue to @param.void
setParamTakeOwnership
(ParamSpec param) Veraltet.void
setPointer
(Pointer v_pointer) Set the contents of a pointer #GValue to @v_pointer.void
setSchar
(int v_char) Set the contents of a %G_TYPE_CHAR #GValue to @v_char.void
setStaticBoxed
(Pointer v_boxed) Set the contents of a %G_TYPE_BOXED derived #GValue to @v_boxed.void
setStaticString
(Str v_string) Set the contents of a %G_TYPE_STRING #GValue to @v_string.void
setStaticString
(String v_string) Set the contents of a %G_TYPE_STRING #GValue to @v_string.void
Set the contents of a %G_TYPE_STRING #GValue to a copy of @v_string.void
Set the contents of a %G_TYPE_STRING #GValue to a copy of @v_string.void
setStringTakeOwnership
(Str v_string) Veraltet.void
setUchar
(byte v_uchar) Set the contents of a %G_TYPE_UCHAR #GValue to @v_uchar.void
setUint
(int v_uint) Set the contents of a %G_TYPE_UINT #GValue to @v_uint.void
setUint64
(long v_uint64) Set the contents of a %G_TYPE_UINT64 #GValue to @v_uint64.void
setUlong
(long v_ulong) Set the contents of a %G_TYPE_ULONG #GValue to @v_ulong.void
setVariant
(Variant variant) Set the contents of a variant #GValue to @variant.Steal ownership on contents of a %G_TYPE_STRING #GValue.void
Sets the contents of a %G_TYPE_BOXED derived #GValue to @v_boxed
and takes over the ownership of the caller’s reference to @v_boxed;
the caller doesn’t have to unref it any more.void
takeObject
(Pointer v_object) Sets the contents of a %G_TYPE_OBJECT derived #GValue to @v_object
and takes over the ownership of the caller’s reference to @v_object;
the caller doesn’t have to unref it any more (i.e. the reference
count of the object is not increased).void
Sets the contents of a %G_TYPE_PARAM #GValue to @param and takes
over the ownership of the caller’s reference to @param; the caller
doesn’t have to unref it any more.void
takeString
(Str v_string) Sets the contents of a %G_TYPE_STRING #GValue to @v_string.void
takeVariant
(Variant variant) Set the contents of a variant #GValue to @variant, and takes over
the ownership of the caller's reference to @variant;
the caller doesn't have to unref it any more (i.e. the reference
count of the variant is not increased).boolean
Tries to cast the contents of @src_value into a type appropriate
to store in @dest_value, e.g. to transform a %G_TYPE_INT value
into a %G_TYPE_FLOAT value.static boolean
typeCompatible
(long src_type, long dest_type) Returns whether a #GValue of type @src_type can be copied into
a #GValue of type @dest_type.static boolean
typeTransformable
(long src_type, long dest_type) Check whether g_value_transform() is able to transform values
of type @src_type into values of type @dest_type.void
unset()
Clears the current value in @value (if any) and "unsets" the type,
this releases all resources associated with this GValue.Von Klasse geerbte Methoden ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Von Klasse geerbte Methoden ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Von Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Von Schnittstelle geerbte Methoden ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Felddetails
-
G_TYPE
- Siehe auch:
-
-
Konstruktordetails
-
Value
-
-
Methodendetails
-
getClassHandler
-
getFieldGType
public long getFieldGType() -
copy
Copies the value of @src_value into @dest_value.- Parameter:
dest_value
- An initialized #GValue structure of the same type as @src_value.
-
dupBoxed
Get the contents of a %G_TYPE_BOXED derived #GValue. Upon getting,
the boxed value is duplicated and needs to be later freed with
g_boxed_free(), e.g. like: g_boxed_free (G_VALUE_TYPE (@value),
return_value);- Gibt zurück:
- boxed contents of @value
-
dupObject
Get the contents of a %G_TYPE_OBJECT derived #GValue, increasing
its reference count. If the contents of the #GValue are %NULL, then
%NULL will be returned.- Gibt zurück:
- object content of @value, should be unreferenced when no longer needed.
-
dupParam
Get the contents of a %G_TYPE_PARAM #GValue, increasing its
reference count.- Gibt zurück:
- #GParamSpec content of @value, should be unreferenced when no longer needed.
-
dupString
Get a copy the contents of a %G_TYPE_STRING #GValue.- Gibt zurück:
- a newly allocated copy of the string content of @value
-
dupVariant
Get the contents of a variant #GValue, increasing its refcount. The returned
#GVariant is never floating.- Gibt zurück:
- variant contents of @value (may be %NULL); should be unreffed using g_variant_unref() when no longer needed
-
fitsPointer
public boolean fitsPointer()Determines if @value will fit inside the size of a pointer value.
This is an internal function introduced mainly for C marshallers.- Gibt zurück:
- %TRUE if @value will fit inside a pointer value.
-
getBoolean
public boolean getBoolean()Get the contents of a %G_TYPE_BOOLEAN #GValue.- Gibt zurück:
- boolean contents of @value
-
getBoxed
Get the contents of a %G_TYPE_BOXED derived #GValue.- Gibt zurück:
- boxed contents of @value
-
getChar
Veraltet.Do not use this function; it is broken on platforms where the %char
type is unsigned, such as ARM and PowerPC. See g_value_get_schar().
Get the contents of a %G_TYPE_CHAR #GValue.- Gibt zurück:
- character contents of @value
-
getDouble
public double getDouble()Get the contents of a %G_TYPE_DOUBLE #GValue.- Gibt zurück:
- double contents of @value
-
getEnum
public int getEnum()Get the contents of a %G_TYPE_ENUM #GValue.- Gibt zurück:
- enum contents of @value
-
getFlags
public int getFlags()Get the contents of a %G_TYPE_FLAGS #GValue.- Gibt zurück:
- flags contents of @value
-
getFloat
public float getFloat()Get the contents of a %G_TYPE_FLOAT #GValue.- Gibt zurück:
- float contents of @value
-
getGtype
public long getGtype()Get the contents of a %G_TYPE_GTYPE #GValue.- Gibt zurück:
- the #GType stored in @value
-
getInt
public int getInt()Get the contents of a %G_TYPE_INT #GValue.- Gibt zurück:
- integer contents of @value
-
getInt64
public long getInt64()Get the contents of a %G_TYPE_INT64 #GValue.- Gibt zurück:
- 64bit integer contents of @value
-
getLong
public long getLong()Get the contents of a %G_TYPE_LONG #GValue.- Gibt zurück:
- long integer contents of @value
-
getObject
Get the contents of a %G_TYPE_OBJECT derived #GValue.- Gibt zurück:
- object contents of @value
-
getParam
Get the contents of a %G_TYPE_PARAM #GValue.- Gibt zurück:
- #GParamSpec content of @value
-
getPointer
Get the contents of a pointer #GValue.- Gibt zurück:
- pointer contents of @value
-
getSchar
public int getSchar()Get the contents of a %G_TYPE_CHAR #GValue.- Gibt zurück:
- signed 8 bit integer contents of @value
-
getString
Get the contents of a %G_TYPE_STRING #GValue.- Gibt zurück:
- string content of @value
-
getUchar
public byte getUchar()Get the contents of a %G_TYPE_UCHAR #GValue.- Gibt zurück:
- unsigned character contents of @value
-
getUint
public int getUint()Get the contents of a %G_TYPE_UINT #GValue.- Gibt zurück:
- unsigned integer contents of @value
-
getUint64
public long getUint64()Get the contents of a %G_TYPE_UINT64 #GValue.- Gibt zurück:
- unsigned 64bit integer contents of @value
-
getUlong
public long getUlong()Get the contents of a %G_TYPE_ULONG #GValue.- Gibt zurück:
- unsigned long integer contents of @value
-
getVariant
Get the contents of a variant #GValue.- Gibt zurück:
- variant contents of @value (may be %NULL)
-
init
Initializes @value with the default value of @type.- Parameter:
g_type
- Type the #GValue should hold values of.- Gibt zurück:
- the #GValue structure that has been passed in
-
initFromInstance
Initializes and sets @value from an instantiatable type via the
value_table's collect_value() function.
Note: The @value will be initialised with the exact type of
@instance. If you wish to set the @value's type to a different GType
(such as a parent class GType), you need to manually call
g_value_init() and g_value_set_instance().- Parameter:
instance
- the instance
-
peekPointer
Returns the value contents as pointer. This function asserts that
g_value_fits_pointer() returned %TRUE for the passed in value.
This is an internal function introduced mainly for C marshallers.- Gibt zurück:
- the value contents as pointer
-
reset
Clears the current value in @value and resets it to the default value
(as if the value had just been initialized).- Gibt zurück:
- the #GValue structure that has been passed in
-
setBoolean
public void setBoolean(boolean v_boolean) Set the contents of a %G_TYPE_BOOLEAN #GValue to @v_boolean.- Parameter:
v_boolean
- boolean value to be set
-
setBoxed
Set the contents of a %G_TYPE_BOXED derived #GValue to @v_boxed.- Parameter:
v_boxed
- boxed value to be set
-
setBoxedTakeOwnership
Veraltet.This is an internal function introduced mainly for C marshallers.- Parameter:
v_boxed
- duplicated unowned boxed value to be set
-
setChar
Veraltet.Set the contents of a %G_TYPE_CHAR #GValue to @v_char.- Parameter:
v_char
- character value to be set
-
setDouble
public void setDouble(double v_double) Set the contents of a %G_TYPE_DOUBLE #GValue to @v_double.- Parameter:
v_double
- double value to be set
-
setEnum
public void setEnum(int v_enum) Set the contents of a %G_TYPE_ENUM #GValue to @v_enum.- Parameter:
v_enum
- enum value to be set
-
setFlags
public void setFlags(int v_flags) Set the contents of a %G_TYPE_FLAGS #GValue to @v_flags.- Parameter:
v_flags
- flags value to be set
-
setFloat
public void setFloat(float v_float) Set the contents of a %G_TYPE_FLOAT #GValue to @v_float.- Parameter:
v_float
- float value to be set
-
setGtype
public void setGtype(long v_gtype) Set the contents of a %G_TYPE_GTYPE #GValue to @v_gtype.- Parameter:
v_gtype
- #GType to be set
-
setInstance
Sets @value from an instantiatable type via the
value_table's collect_value() function.- Parameter:
instance
- the instance
-
setInt
public void setInt(int v_int) Set the contents of a %G_TYPE_INT #GValue to @v_int.- Parameter:
v_int
- integer value to be set
-
setInt64
public void setInt64(long v_int64) Set the contents of a %G_TYPE_INT64 #GValue to @v_int64.- Parameter:
v_int64
- 64bit integer value to be set
-
setInternedString
Set the contents of a %G_TYPE_STRING #GValue to @v_string. The string is
assumed to be static and interned (canonical, for example from
g_intern_string()), and is thus not duplicated when setting the #GValue.- Parameter:
v_string
- static string to be set
-
setInternedString
Set the contents of a %G_TYPE_STRING #GValue to @v_string. The string is
assumed to be static and interned (canonical, for example from
g_intern_string()), and is thus not duplicated when setting the #GValue.- Parameter:
v_string
- static string to be set
-
setLong
public void setLong(long v_long) Set the contents of a %G_TYPE_LONG #GValue to @v_long.- Parameter:
v_long
- long integer value to be set
-
setObject
Set the contents of a %G_TYPE_OBJECT derived #GValue to @v_object.
g_value_set_object() increases the reference count of @v_object
(the #GValue holds a reference to @v_object). If you do not wish
to increase the reference count of the object (i.e. you wish to
pass your current reference to the #GValue because you no longer
need it), use g_value_take_object() instead.
It is important that your #GValue holds a reference to @v_object (either its
own, or one it has taken) to ensure that the object won't be destroyed while
the #GValue still exists).- Parameter:
v_object
- object value to be set
-
setObjectTakeOwnership
Veraltet.This is an internal function introduced mainly for C marshallers.- Parameter:
v_object
- object value to be set
-
setParam
Set the contents of a %G_TYPE_PARAM #GValue to @param.- Parameter:
param
- the #GParamSpec to be set
-
setParamTakeOwnership
Veraltet.This is an internal function introduced mainly for C marshallers.- Parameter:
param
- the #GParamSpec to be set
-
setPointer
Set the contents of a pointer #GValue to @v_pointer.- Parameter:
v_pointer
- pointer value to be set
-
setSchar
public void setSchar(int v_char) Set the contents of a %G_TYPE_CHAR #GValue to @v_char.- Parameter:
v_char
- signed 8 bit integer to be set
-
setStaticBoxed
Set the contents of a %G_TYPE_BOXED derived #GValue to @v_boxed.
The boxed value is assumed to be static, and is thus not duplicated
when setting the #GValue.- Parameter:
v_boxed
- static boxed value to be set
-
setStaticString
Set the contents of a %G_TYPE_STRING #GValue to @v_string.
The string is assumed to be static, and is thus not duplicated
when setting the #GValue.
If the the string is a canonical string, using g_value_set_interned_string()
is more appropriate.- Parameter:
v_string
- static string to be set
-
setStaticString
Set the contents of a %G_TYPE_STRING #GValue to @v_string.
The string is assumed to be static, and is thus not duplicated
when setting the #GValue.
If the the string is a canonical string, using g_value_set_interned_string()
is more appropriate.- Parameter:
v_string
- static string to be set
-
setString
Set the contents of a %G_TYPE_STRING #GValue to a copy of @v_string.- Parameter:
v_string
- caller-owned string to be duplicated for the #GValue
-
setString
Set the contents of a %G_TYPE_STRING #GValue to a copy of @v_string.- Parameter:
v_string
- caller-owned string to be duplicated for the #GValue
-
setStringTakeOwnership
Veraltet.This is an internal function introduced mainly for C marshallers.- Parameter:
v_string
- duplicated unowned string to be set
-
setUchar
public void setUchar(byte v_uchar) Set the contents of a %G_TYPE_UCHAR #GValue to @v_uchar.- Parameter:
v_uchar
- unsigned character value to be set
-
setUint
public void setUint(int v_uint) Set the contents of a %G_TYPE_UINT #GValue to @v_uint.- Parameter:
v_uint
- unsigned integer value to be set
-
setUint64
public void setUint64(long v_uint64) Set the contents of a %G_TYPE_UINT64 #GValue to @v_uint64.- Parameter:
v_uint64
- unsigned 64bit integer value to be set
-
setUlong
public void setUlong(long v_ulong) Set the contents of a %G_TYPE_ULONG #GValue to @v_ulong.- Parameter:
v_ulong
- unsigned long integer value to be set
-
setVariant
Set the contents of a variant #GValue to @variant.
If the variant is floating, it is consumed.- Parameter:
variant
- a #GVariant, or %NULL
-
stealString
Steal ownership on contents of a %G_TYPE_STRING #GValue.
As a result of this operation the value's contents will be reset to %NULL.
The purpose of this call is to provide a way to avoid an extra copy
when some object have been serialized into string through #GValue API.
NOTE: for safety and compatibility purposes, if #GValue contains
static string, or an interned one, this function will return a copy
of the string. Otherwise the transfer notation would be ambiguous.- Gibt zurück:
- string content of @value; Should be freed with g_free() when no longer needed.
-
takeBoxed
Sets the contents of a %G_TYPE_BOXED derived #GValue to @v_boxed
and takes over the ownership of the caller’s reference to @v_boxed;
the caller doesn’t have to unref it any more.- Parameter:
v_boxed
- duplicated unowned boxed value to be set
-
takeObject
Sets the contents of a %G_TYPE_OBJECT derived #GValue to @v_object
and takes over the ownership of the caller’s reference to @v_object;
the caller doesn’t have to unref it any more (i.e. the reference
count of the object is not increased).
If you want the #GValue to hold its own reference to @v_object, use
g_value_set_object() instead.- Parameter:
v_object
- object value to be set
-
takeParam
Sets the contents of a %G_TYPE_PARAM #GValue to @param and takes
over the ownership of the caller’s reference to @param; the caller
doesn’t have to unref it any more.- Parameter:
param
- the #GParamSpec to be set
-
takeString
Sets the contents of a %G_TYPE_STRING #GValue to @v_string.- Parameter:
v_string
- string to take ownership of
-
takeVariant
Set the contents of a variant #GValue to @variant, and takes over
the ownership of the caller's reference to @variant;
the caller doesn't have to unref it any more (i.e. the reference
count of the variant is not increased).
If @variant was floating then its floating reference is converted to
a hard reference.
If you want the #GValue to hold its own reference to @variant, use
g_value_set_variant() instead.
This is an internal function introduced mainly for C marshallers.- Parameter:
variant
- a #GVariant, or %NULL
-
transform
Tries to cast the contents of @src_value into a type appropriate
to store in @dest_value, e.g. to transform a %G_TYPE_INT value
into a %G_TYPE_FLOAT value. Performing transformations between
value types might incur precision lossage. Especially
transformations into strings might reveal seemingly arbitrary
results and shouldn't be relied upon for production code (such
as rcfile value or object property serialization).- Parameter:
dest_value
- Target value.- Gibt zurück:
- Whether a transformation rule was found and could be applied. Upon failing transformations, @dest_value is left untouched.
-
unset
public void unset()Clears the current value in @value (if any) and "unsets" the type,
this releases all resources associated with this GValue. An unset
value is the same as an uninitialized (zero-filled) #GValue
structure. -
registerTransformFunc
public static void registerTransformFunc(long src_type, long dest_type, Value.OnValueTransform transform_func) Registers a value transformation function for use in g_value_transform().
A previously registered transformation function for @src_type and @dest_type
will be replaced.- Parameter:
src_type
- Source type.dest_type
- Target type.transform_func
- a function which transforms values of type @src_type into value of type @dest_type
-
typeCompatible
public static boolean typeCompatible(long src_type, long dest_type) Returns whether a #GValue of type @src_type can be copied into
a #GValue of type @dest_type.- Parameter:
src_type
- source type to be copied.dest_type
- destination type for copying.- Gibt zurück:
- %TRUE if g_value_copy() is possible with @src_type and @dest_type.
-
typeTransformable
public static boolean typeTransformable(long src_type, long dest_type) Check whether g_value_transform() is able to transform values
of type @src_type into values of type @dest_type. Note that for
the types to be transformable, they must be compatible or a
transformation function must be registered.- Parameter:
src_type
- Source type.dest_type
- Target type.- Gibt zurück:
- %TRUE if the transformation is possible, %FALSE otherwise.
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-