Synopsis

#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);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----AdgEntity
               +----AdgTable
                     +----AdgTitleBlock

Properties

  "has-frame"                gboolean              : Read / Write
  "table-dress"              AdgDress              : Read / Write

Description

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.

Note

By default, the "local-mix" property is set to ADG_MIX_DISABLED on AdgTable entities.

Details

struct AdgTable

struct AdgTable;

All fields are private and should not be used directly. Use its public methods instead.

Since 1.0


struct AdgTableClass

struct AdgTableClass {
};

adg_table_new ()

AdgTable *          adg_table_new                       (void);

Creates a new empty table entity.

Returns :

the newly created table entity

Since 1.0


adg_table_insert ()

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.

table :

an AdgTable

table_row :

a valid AdgTableRow

before_row :

an AdgTableRow or NULL. [allow-none]

Since 1.0


adg_table_remove ()

void                adg_table_remove                    (AdgTable *table,
                                                         AdgTableRow *table_row);

Removes table_row from list of rows of table.

table :

an AdgTable

table_row :

a valid AdgTableRow

Since 1.0


adg_table_foreach ()

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);

table :

an AdgTable

callback :

a callback. [scope call]

user_data :

callback user data

Since 1.0


adg_table_foreach_cell ()

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);

table :

an AdgTable

callback :

a callback. [scope call]

user_data :

callback user data

Since 1.0


adg_table_set_cell ()

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.

table :

an AdgTable

name :

the name of the cell

table_cell :

the named cell

Since 1.0


adg_table_get_cell ()

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.

table :

an AdgTable

name :

the name of a cell

Returns :

the requested cell or NULL if not found. [transfer none]

Since 1.0


adg_table_get_table_style ()

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.

table :

an AdgTable

Returns :

the requested style or NULL on errors. [transfer none]

Since 1.0


adg_table_set_table_dress ()

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.

table :

an AdgTable

dress :

the new AdgDress to use

Since 1.0


adg_table_get_table_dress ()

AdgDress            adg_table_get_table_dress           (AdgTable *table);

Gets the table dress to be used in rendering table.

table :

an AdgTable

Returns :

the current table dress. [transfer none]

Since 1.0


adg_table_switch_frame ()

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.

table :

an AdgTable

new_state :

the new state of the frame

Since 1.0


adg_table_has_frame ()

gboolean            adg_table_has_frame                 (AdgTable *table);

Returns the state of the "has-frame" property.

table :

an AdgTable

Returns :

the current state.

Since 1.0


adg_table_invalidate_grid ()

void                adg_table_invalidate_grid           (AdgTable *table);

Note

This method is only useful in table children implementation.

Clears the internal grid cache, effectively forcing its regeneration next time the "arrange" signal is emitted.

table :

an AdgTable

Property Details

The "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


The "table-dress" property

  "table-dress"              AdgDress              : Read / Write

The dress to use for stroking this entity.