GvaGameStore

GvaGameStore — A GtkTreeModel that stores game information

Synopsis




                    GvaGameStore;
GtkTreeModel*       gva_game_store_new                  (void);
GtkTreeModel*       gva_game_store_new_from_query       (const gchar *sql,
                                                         GError **error);
void                gva_game_store_clear                (GvaGameStore *game_store);
void                gva_game_store_index_insert         (GvaGameStore *game_store,
                                                         const gchar *key,
                                                         GtkTreeIter *iter);
GtkTreePath*        gva_game_store_index_lookup         (GvaGameStore *game_store,
                                                         const gchar *key);


Object Hierarchy


  GObject
   +----GtkTreeStore
         +----GvaGameStore

Implemented Interfaces

GvaGameStore implements GtkBuildable, GtkTreeModel, GtkTreeDragSource, GtkTreeDragDest and GtkTreeSortable.

Description

A GvaGameStore stores information from the game database as a GtkTreeModel.

Details

GvaGameStore

typedef struct _GvaGameStore GvaGameStore;

Contains only private data that should be read and manipulated using the functions below.


gva_game_store_new ()

GtkTreeModel*       gva_game_store_new                  (void);

Creates a new GvaGameStore with pre-defined columns and settings.

Returns :

a new GvaGameStore

gva_game_store_new_from_query ()

GtkTreeModel*       gva_game_store_new_from_query       (const gchar *sql,
                                                         GError **error);

This may be the most powerful function in GNOME Video Arcade.

Creates a new GvaGameStore by executing the given SQL query on the games database and converting the results to tree model rows. The resulting GtkTreeModel can then be plugged into a GtkTreeView.

XXX Say more here.

sql :

an SQL query

error :

return locations for a GError, or NULL

Returns :

a new GvaGameStore

gva_game_store_clear ()

void                gva_game_store_clear                (GvaGameStore *game_store);

Removes all rows from game_store and clears the internal index.

game_store :

a GvaGameStore

gva_game_store_index_insert ()

void                gva_game_store_index_insert         (GvaGameStore *game_store,
                                                         const gchar *key,
                                                         GtkTreeIter *iter);

Adds an entry to game_store's internal index. You will want to call this immediately after adding a new row to game_store, such as with gtk_tree_store_append().

game_store :

a GvaGameStore

key :

an index key

iter :

a GtkTreeIter pointing to a row in game_store

gva_game_store_index_lookup ()

GtkTreePath*        gva_game_store_index_lookup         (GvaGameStore *game_store,
                                                         const gchar *key);

Looks up the row corresponding to key in game_store and returns a GtkTreePath to it, or NULL if the row was not found.

game_store :

a GvaGameStore

key :

an index key

Returns :

a GtkTreePath to the row corresponding to key, or NULL