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
29 typedef gboolean (*gdrom_list_change_hook_t)(gboolean list_changed, int selection, void *user_data);
30 DECLARE_HOOK(gdrom_list_change_hook, gdrom_list_change_hook_t);
34 * Initialize the gdrom list (registers with the gdrom driver, creates the
35 * initial lists, etc). Must be called exactly once before using the lists.
37 void gdrom_list_init(void);
40 * Return the index of the currently selected GD-Rom item. If there is no disc
41 * currently mounted, returns 0.
43 int gdrom_list_get_selection(void);
46 * Return the number of items in the list, including separators.
48 int gdrom_list_size(void);
51 * Return the display name of the item at the specified index. If the
52 * item is a separator, returns the empty string. If the index is out
53 * of bounds, returns NULL.
54 * The list will currently follow the following structure:
56 * Any CD/DVD drives attached to the system
57 * "" (empty string) - separator item
58 * An LRU list of disc image files (note without directory components).
60 const gchar *gdrom_list_get_display_name(int index);
62 const gchar *gdrom_list_get_filename(int index);
65 * Change the current gdrom selection to the selected index. This will mount the
66 * appropriate drive/image where necessary.
67 * @return TRUE if the selection was updated, FALSE if the position was invalid.
69 gboolean gdrom_list_set_selection(int posn);
75 #endif /* lxdream_gdlist_H */
.