gva-columns

gva-columns — Column Creation and Persistence

Synopsis




GtkTreeViewColumn*  gva_columns_new_from_id             (GvaGameStoreColumn column_id);
GtkTreeViewColumn*  gva_columns_new_from_name           (const gchar *column_name);
gboolean            gva_columns_lookup_id               (const gchar *column_name,
                                                         GvaGameStoreColumn *column_id);
const gchar*        gva_columns_lookup_name             (GvaGameStoreColumn column_id);
void                gva_columns_load                    (GtkTreeView *view);
void                gva_columns_save                    (GtkTreeView *view);
GSList*             gva_columns_get_names               (GtkTreeView *view,
                                                         gboolean visible_only);

Description

These functions manipulate the columns in the main tree view.

Details

gva_columns_new_from_id ()

GtkTreeViewColumn*  gva_columns_new_from_id             (GvaGameStoreColumn column_id);

Creates a new GtkTreeViewColumn from the given column_id, configured for use in the main tree view.

column_id : the ID of the column to create
Returns : a new GtkTreeViewColumn

gva_columns_new_from_name ()

GtkTreeViewColumn*  gva_columns_new_from_name           (const gchar *column_name);

Creates a new GtkTreeViewColumn from the given column_name (as stored in GConf), configured for use in the main tree view.

column_name : the name of the column to create
Returns : a new GtkTreeViewColumn

gva_columns_lookup_id ()

gboolean            gva_columns_lookup_id               (const gchar *column_name,
                                                         GvaGameStoreColumn *column_id);

Looks up the numeric column ID corresponding to column_name, and write the result to column_id if found.

column_name : the name of the column to lookup
column_id : return location for the column ID
Returns : TRUE if a column ID was found, FALSE otherwise

gva_columns_lookup_name ()

const gchar*        gva_columns_lookup_name             (GvaGameStoreColumn column_id);

Looks up the column name corresponding to column_id.

column_id : the ID of the column to lookup
Returns : the column name, or NULL if not found

gva_columns_load ()

void                gva_columns_load                    (GtkTreeView *view);

Loads view with columns in the order stored in the GConf key /apps/gnome-video-arcade/all-columns, but only makes visible those columns listed in /apps/gnome-video-arcade/columns. Newly supported columns are appended to view but remain invisible until explicitly selected in the Preferences window.

Each column is loaded by reading the column name from GConf and passing it to gva_columns_new_from_name() to create the GtkTreeViewColumn.

view : a GtkTreeView

gva_columns_save ()

void                gva_columns_save                    (GtkTreeView *view);

Writes the column order and visible columns of view to the GConf keys /apps/gnome-video-arcade/all-columns and /apps/gnome-video-arcade/columns respectively, using gva_columns_get_names() to extract the column names.

view : a GtkTreeView

gva_columns_get_names ()

GSList*             gva_columns_get_names               (GtkTreeView *view,
                                                         gboolean visible_only);

Extracts a list of column names from view, using gva_columns_lookup_name() to convert each numeric column ID to a name. If visible_only is TRUE then only visible columns are included in the list. The column name strings are owned by view and should not be freed; only the list itself should be free using g_slist_free().

view : a GtkTreeView
visible_only : only extract visible columns
Returns : a GSList of column names