4 * GD-Rom list manager - maintains the list of recently accessed images and
5 * available devices for the UI + config.
7 * Copyright (c) 2005 Nathan Keynes.
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
20 #ifndef lxdream_gdlist_H
21 #define lxdream_gdlist_H 1
30 typedef gboolean (*gdrom_list_change_hook_t)(gboolean list_changed, int selection, void *user_data);
31 DECLARE_HOOK(gdrom_list_change_hook, gdrom_list_change_hook_t);
35 * Initialize the gdrom list (registers with the gdrom driver, creates the
36 * initial lists, etc). Must be called exactly once before using the lists.
38 void gdrom_list_init(void);
41 * Return the index of the currently selected GD-Rom item. If there is no disc
42 * currently mounted, returns 0.
44 int gdrom_list_get_selection(void);
47 * Return the number of items in the list, including separators.
49 int gdrom_list_size(void);
52 * Return the display name of the item at the specified index. If the
53 * item is a separator, returns the empty string. If the index is out
54 * of bounds, returns NULL.
55 * The list will currently follow the following structure:
57 * Any CD/DVD drives attached to the system
58 * "" (empty string) - separator item
59 * An LRU list of disc image files (note without directory components).
61 const gchar *gdrom_list_get_display_name(int index);
63 const gchar *gdrom_list_get_filename(int index);
66 * Change the current gdrom selection to the selected index. This will mount the
67 * appropriate drive/image where necessary.
68 * @param err Updated if there was an error loading the selected gdrom
69 * @return TRUE if the selection was updated, FALSE if the position was invalid.
71 gboolean gdrom_list_set_selection(int posn, ERROR *err);
77 #endif /* lxdream_gdlist_H */
.