![]() |
![]() |
![]() |
cpg-network Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties | Signals |
#define CPG_FUNCTION_ARGUMENT_CONST (obj) struct CpgFunctionArgument; struct CpgFunctionArgumentClass; CpgFunctionArgument * cpg_function_argument_new (const gchar *name
,CpgExpression *expression
,gboolean isexplicit
); CpgFunctionArgument * cpg_function_argument_copy (CpgFunctionArgument *argument
); const gchar * cpg_function_argument_get_name (CpgFunctionArgument *argument
); gboolean cpg_function_argument_set_name (CpgFunctionArgument *argument
,const gchar *name
); gboolean cpg_function_argument_get_optional (CpgFunctionArgument *argument
); void cpg_function_argument_set_optional (CpgFunctionArgument *argument
,gboolean optional
); CpgExpression * cpg_function_argument_get_default_value (CpgFunctionArgument *argument
); void cpg_function_argument_set_default_value (CpgFunctionArgument *argument
,CpgExpression *expression
); gboolean cpg_function_argument_get_explicit (CpgFunctionArgument *argument
); void cpg_function_argument_set_explicit (CpgFunctionArgument *argument
,gboolean isexplicit
); CpgFunctionArgumentPrivate;
"default-value" CpgExpression* : Read / Write / Construct "explicit" gboolean : Read / Write / Construct "name" gchar* : Read / Write / Construct "optional" gboolean : Read
A CpgFunctionArgument contains information on an argument (or parameter) to a custom defined function.
#define CPG_FUNCTION_ARGUMENT_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CPG_TYPE_FUNCTION_ARGUMENT, CpgFunctionArgument const))
struct CpgFunctionArgumentClass { /* signals */ gboolean (*invalidate_name) (CpgFunctionArgument *argument, const gchar *name); };
CpgFunctionArgument * cpg_function_argument_new (const gchar *name
,CpgExpression *expression
,gboolean isexplicit
);
Create a new CpgFunctionArgument. Note that CpgFunctionArgument derives from GInitiallyUnowned. This means that initially, the newly created object has a floating reference and does not need to be freed if you add it to a function using cpg_function_add_argument.
|
The function argument name |
Returns : |
A CpgFunctionArgument |
CpgFunctionArgument * cpg_function_argument_copy (CpgFunctionArgument *argument
);
Create a copy of a function argument. Note that CpgFunctionArgument derives from GInitiallyUnowned. This means that initially, the newly created object has a floating reference and does not need to be freed if you add it to a function using cpg_function_add_argument.
|
A CpgFunctionArgument |
Returns : |
A CpgFunctionArgument. [transfer full] |
const gchar * cpg_function_argument_get_name (CpgFunctionArgument *argument
);
Get the function name.
|
A CpgFunctionArgument |
Returns : |
the function name |
gboolean cpg_function_argument_set_name (CpgFunctionArgument *argument
,const gchar *name
);
Set the function argument name.
|
A CpgFunctionArgument |
|
The argument name |
Returns : |
TRUE if the function argument name could be successfully changed,
FALSE otherwise. |
gboolean cpg_function_argument_get_optional (CpgFunctionArgument *argument
);
Get whether the function argument is optional. If the argument is optional its default value can be obtained with cpg_function_argument_get_default_value
|
A CpgFunctionArgument |
Returns : |
whether the argument is optional |
void cpg_function_argument_set_optional (CpgFunctionArgument *argument
,gboolean optional
);
CpgExpression * cpg_function_argument_get_default_value
(CpgFunctionArgument *argument
);
Get the function argument default value.
|
A CpgFunctionArgument |
Returns : |
the default value. [transfer none] |
void cpg_function_argument_set_default_value (CpgFunctionArgument *argument
,CpgExpression *expression
);
Set the default argument value for an optional function argument.
|
A CpgFunctionArgument |
gboolean cpg_function_argument_get_explicit (CpgFunctionArgument *argument
);
Get whether the function argument is explicit.
|
A CpgFunctionArgument |
Returns : |
whether the argument is explicit |
void cpg_function_argument_set_explicit (CpgFunctionArgument *argument
,gboolean isexplicit
);
Set whether a function argument is explicit.
|
A CpgFunctionArgument |
|
Whether the argument is explicit |
"default-value"
property"default-value" CpgExpression* : Read / Write / Construct
Default Value.
"explicit"
property"explicit" gboolean : Read / Write / Construct
Explicit.
Default value: TRUE
"name"
property"name" gchar* : Read / Write / Construct
The function argument name
Default value: NULL
"optional"
property"optional" gboolean : Read
Whether or not the function argument is optional
Default value: FALSE
"invalidate-name"
signalgboolean user_function (CpgFunctionArgument *object,
gchar *name,
gpointer user_data) : Run Last
This signal is emitted to validate (or rather, invalidate) a new
name for a function argument. When a signal handler returns TRUE
,
the new name is rejected.
|
a CpgFunctionArgument |
|
the new function argument name |
|
user data set when the signal handler was connected. |
Returns : |
TRUE if the new name should be rejected, FALSE otherwise |