Help on GObject Introspection Annotations



Resently has been added the following annotations for gtk-doc headings:

Set value func:
Get value func:

in GDA we have a GdaNumeric struct with gda_value_set_numeric and
gda_value_get_numeric to set this Boxed Derived type to a GValue is it
correct to add the following annotations:

/**
 * GdaNumeric:
 * @number: a string representing a number
 * @precision: precision to use when @number is converted (not implemented jet)
 * @width: (not implemented jet)
 *
 * Holds numbers represented as strings.
 *
 * Set value func: gda_value_set_numeric
 * Get value func: gda_value_get_numeric
 */
typedef struct {
	gchar   *number;
	glong    precision;
	glong    width;
	
	/*< private >*/
	gpointer reserved; /* reserved for future usage with GMP
(http://gmplib.org/) */
} GdaNumeric;


What about the following new annotations?

Unref func:

Ref func:

we have gda_numeric_free and gda_numeric_copy and is possible to add a
new gda_numeric_new, do these annotations must point to some of these
functions?

What a bout char* number member if we add a gda_numeric_set_number
function, because bindings (like python) can't set its value, for me
is better to just use:

# set value
numeric.number = "3.40012"

and

# get value
numeric.number

hiding gda_numeric_set_number. But How Can I annotate these member in
order to use that function instead to try to access directly the
member? This is because you use this code in python:

from gi.repository import Gda
n = Gda.Numeric()
n.number = "3.04020"

I get these messages:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
RuntimeError: unable to set value for field


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]