toolOptions

toolOptions — A convienent wrapper around GHashTable that can support types.

Functions

Types and Values

Description

This wrapper is a simple way to store integers, floating point values or booleans in a table, accessing with a string key and remembering their types.

Functions

tool_option_new ()

ToolOption *
tool_option_new (const gchar *name,
                 const gchar *label,
                 GType g_type);

Create a new Option using the name as identifier.

Parameters

name

a string identifying the option ;

 

label

a string describing shortly the option (must be in UTF-8).

 

g_type

the type of option to create.

 

Returns

a newly created option, use tool_option_free() to free it.

[transfer none]


tool_option_free ()

void
tool_option_free (ToolOption *option);

Free the memory used by the data .

Parameters

option

the Option to free.

 

tool_option_copy ()

ToolOption *
tool_option_copy (const ToolOption *from);

Create a new ToolOption using the values from option from .

Parameters

from

an existing ToolOption.

 

Returns

a newly created option, use tool_option_free() to free it.

[transfer none]


tool_option_getName ()

const gchar *
tool_option_getName (ToolOption *option);

Get the name of the option.

Parameters

option

the Option to get the name of.

 

Returns

a string owned by V_Sim, should not be freed.


tool_option_getLabel ()

const gchar *
tool_option_getLabel (ToolOption *option);

Get the label of the option.

Parameters

option

the Option to get the label of.

 

Returns

a string owned by V_Sim, should not be freed.


tool_option_getType ()

GType
tool_option_getType (ToolOption *option);

Get the type of the option.

Parameters

option

the Option to get the type of.

 

Returns

a OptionTypes value.


tool_option_getValue ()

GValue *
tool_option_getValue (ToolOption *option);

Get the location of the storage for the option.

Parameters

option

a Option object.

 

Returns

the GValue storing the option value.


tool_option_getValueAndLabel ()

gchar *
tool_option_getValueAndLabel (ToolOption *option);

This method returns a string with the value followed by the label in parenthesis and with Pango markup for smaller font.

Parameters

option

the Option to get the value from.

 

Returns

a newly created markup string.

Types and Values

ToolOption

typedef struct _ToolOption ToolOption;

An opaque structure to store values. It is equivalent to GValue but with a name and a label.