![]() |
![]() |
![]() |
GNOME Video Arcade Reference Manual | ![]() |
---|---|---|---|---|
GvaGameStoreGvaGameStore — A GtkTreeModel that stores game information |
GvaGameStore; enum GvaGameStoreColumn; 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);
GvaGameStore implements GtkBuildable, GtkTreeModel, GtkTreeDragSource, GtkTreeDragDest and GtkTreeSortable.
typedef struct _GvaGameStore GvaGameStore;
Contains only private data that should be read and manipulated using the functions below.
typedef enum { GVA_GAME_STORE_COLUMN_NAME, /* G_TYPE_STRING */ GVA_GAME_STORE_COLUMN_CATEGORY, /* G_TYPE_STRING */ GVA_GAME_STORE_COLUMN_FAVORITE, /* G_TYPE_BOOLEAN */ GVA_GAME_STORE_COLUMN_SOURCEFILE, /* G_TYPE_STRING */ GVA_GAME_STORE_COLUMN_RUNNABLE, /* G_TYPE_BOOLEAN */ GVA_GAME_STORE_COLUMN_CLONEOF, /* G_TYPE_STRING */ GVA_GAME_STORE_COLUMN_ROMOF, /* G_TYPE_STRING */ GVA_GAME_STORE_COLUMN_ROMSET, /* G_TYPE_STRING */ GVA_GAME_STORE_COLUMN_SAMPLEOF, /* G_TYPE_STRING */ GVA_GAME_STORE_COLUMN_SAMPLESET, /* G_TYPE_STRING */ GVA_GAME_STORE_COLUMN_DESCRIPTION, /* G_TYPE_STRING */ GVA_GAME_STORE_COLUMN_YEAR, /* G_TYPE_STRING */ GVA_GAME_STORE_COLUMN_MANUFACTURER, /* G_TYPE_STRING */ GVA_GAME_STORE_COLUMN_SOUND_CHANNELS, /* G_TYPE_INT */ GVA_GAME_STORE_COLUMN_INPUT_SERVICE, /* G_TYPE_BOOLEAN */ GVA_GAME_STORE_COLUMN_INPUT_TILT, /* G_TYPE_BOOLEAN */ GVA_GAME_STORE_COLUMN_INPUT_PLAYERS, /* G_TYPE_INT */ GVA_GAME_STORE_COLUMN_INPUT_BUTTONS, /* G_TYPE_INT */ GVA_GAME_STORE_COLUMN_INPUT_COINS, /* G_TYPE_INT */ GVA_GAME_STORE_COLUMN_DRIVER_STATUS, /* G_TYPE_STRING */ GVA_GAME_STORE_COLUMN_DRIVER_EMULATION, /* G_TYPE_STRING */ GVA_GAME_STORE_COLUMN_DRIVER_COLOR, /* G_TYPE_STRING */ GVA_GAME_STORE_COLUMN_DRIVER_SOUND, /* G_TYPE_STRING */ GVA_GAME_STORE_COLUMN_DRIVER_GRAPHIC, /* G_TYPE_STRING */ GVA_GAME_STORE_COLUMN_DRIVER_COCKTAIL, /* G_TYPE_STRING */ GVA_GAME_STORE_COLUMN_DRIVER_PROTECTION, /* G_TYPE_STRING */ GVA_GAME_STORE_COLUMN_DRIVER_SAVESTATE, /* G_TYPE_STRING */ GVA_GAME_STORE_COLUMN_DRIVER_PALETTESIZE, /* G_TYPE_INT */ GVA_GAME_STORE_COLUMN_COMMENT, /* G_TYPE_STRING */ GVA_GAME_STORE_COLUMN_INODE, /* G_TYPE_INT64 */ GVA_GAME_STORE_COLUMN_INPFILE, /* G_TYPE_STRING */ GVA_GAME_STORE_COLUMN_TIME, /* GVA_TYPE_TIME */ GVA_GAME_STORE_NUM_COLUMNS } GvaGameStoreColumn;
GtkTreeModel* gva_game_store_new (void);
Creates a new GvaGameStore with pre-defined columns and settings.
Returns : |
a new GvaGameStore |
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.
|
an SQL query |
|
return locations for a GError, or NULL
|
Returns : |
a new GvaGameStore |
void gva_game_store_clear (GvaGameStore *game_store);
Removes all rows from game_store
and clears the internal index.
|
a GvaGameStore |
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()
.
|
a GvaGameStore |
|
an index key |
|
a GtkTreeIter pointing to a row in game_store
|
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.
|
a GvaGameStore |
|
an index key |
Returns : |
a GtkTreePath to the row corresponding to key , or NULL
|