![]() |
![]() |
![]() |
adg-1 reference manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties |
#include <adg-1/adg.h> struct AdgTable; struct AdgTableClass; AdgTable * adg_table_new (void
); void adg_table_insert (AdgTable *table
,AdgTableRow *table_row
,AdgTableRow *before_row
); void adg_table_remove (AdgTable *table
,AdgTableRow *table_row
); void adg_table_foreach (AdgTable *table
,GCallback callback
,gpointer user_data
); void adg_table_foreach_cell (AdgTable *table
,GCallback callback
,gpointer user_data
); void adg_table_set_cell (AdgTable *table
,const gchar *name
,AdgTableCell *table_cell
); AdgTableCell * adg_table_get_cell (AdgTable *table
,const gchar *name
); AdgStyle * adg_table_get_table_style (AdgTable *table
); void adg_table_set_table_dress (AdgTable *table
,AdgDress dress
); AdgDress adg_table_get_table_dress (AdgTable *table
); void adg_table_switch_frame (AdgTable *table
,gboolean new_state
); gboolean adg_table_has_frame (AdgTable *table
); void adg_table_invalidate_grid (AdgTable *table
);
The AdgTable is the entity to be used for rendering data arranged in tabular evironments.
To define a table, you should add to it a serie of one or more AdgTableRow by using the AdgTableRow specific APIs.
By default, the "local-mix" property is set to ADG_MIX_DISABLED on AdgTable entities.
struct AdgTable;
All fields are private and should not be used directly. Use its public methods instead.
Since 1.0
AdgTable * adg_table_new (void
);
Creates a new empty table entity.
Returns : |
the newly created table entity |
Since 1.0
void adg_table_insert (AdgTable *table
,AdgTableRow *table_row
,AdgTableRow *before_row
);
Inserts table_row
inside the rows list of table
. If before_row
is specified, table_row
is inserted before it.
|
an AdgTable |
|
a valid AdgTableRow |
|
an AdgTableRow or NULL . [allow-none]
|
Since 1.0
void adg_table_remove (AdgTable *table
,AdgTableRow *table_row
);
Removes table_row
from list of rows of table
.
|
an AdgTable |
|
a valid AdgTableRow |
Since 1.0
void adg_table_foreach (AdgTable *table
,GCallback callback
,gpointer user_data
);
Invokes callback
on each row of table
.
The callback should be declared as:
1 |
void callback(AdgTableRow *table_row, gpointer user_data); |
|
an AdgTable |
|
a callback. [scope call] |
|
callback user data |
Since 1.0
void adg_table_foreach_cell (AdgTable *table
,GCallback callback
,gpointer user_data
);
Invokes callback
on each cell of table
.
The callback should be declared as:
1 |
void callback(AdgTableCell *table_cell, gpointer user_data); |
|
an AdgTable |
|
a callback. [scope call] |
|
callback user data |
Since 1.0
void adg_table_set_cell (AdgTable *table
,const gchar *name
,AdgTableCell *table_cell
);
Binds table_cell
to name
, so it can be accessed by name later
with adg_table_get_cell()
. Internally the binding is handled with
an hash table, so accessing the cell this way is O(1).
If name
is NULL
, any binding to @ŧable_cell will be removed.
This is quite inefficient because the whole hash table must be scanned.
If table_cell
is NULL
, the key with name
in the hash table will
be removed.
Both name
and table_cell
cannot be NULL
at the same time.
|
an AdgTable |
|
the name of the cell |
|
the named cell |
Since 1.0
AdgTableCell * adg_table_get_cell (AdgTable *table
,const gchar *name
);
Gets the cell named name
inside table
. Only named cells
can be retrieved by this method.
The returned cell is owned by @ŧable and must not be modified or freed.
|
an AdgTable |
|
the name of a cell |
Returns : |
the requested cell or NULL if not found. [transfer none]
|
Since 1.0
AdgStyle * adg_table_get_table_style (AdgTable *table
);
Gets the AdgTableStyle explicitely set on table
. This is a kind
of accessor function: for rendering purpose use adg_entity_style()
instead. The returned object is owned by table
and should not be
freed or modified.
|
an AdgTable |
Returns : |
the requested style or NULL on errors. [transfer none]
|
Since 1.0
void adg_table_set_table_dress (AdgTable *table
,AdgDress dress
);
Sets a new table dress for rendering table
. The new dress
must be related to the original dress for this property:
you cannot set a dress used for line styles to a dress
managing fonts.
The check is done by calling adg_dress_are_related()
with
dress
and the previous dress as arguments. Check out its
documentation for details on what is a related dress.
Since 1.0
AdgDress adg_table_get_table_dress (AdgTable *table
);
Gets the table dress to be used in rendering table
.
|
an AdgTable |
Returns : |
the current table dress. [transfer none] |
Since 1.0
void adg_table_switch_frame (AdgTable *table
,gboolean new_state
);
Sets the "has-frame" property: TRUE
will draw a
frame around the whole table using the "frame-dress"
dress of the table style.
|
an AdgTable |
|
the new state of the frame |
Since 1.0
gboolean adg_table_has_frame (AdgTable *table
);
Returns the state of the "has-frame" property.
|
an AdgTable |
Returns : |
the current state. |
Since 1.0
"has-frame"
property "has-frame" gboolean : Read / Write
If enabled, a frame using the proper dress found in this table style will be drawn around the table extents.
Default value: TRUE
"table-dress"
property"table-dress" AdgDress : Read / Write
The dress to use for stroking this entity.