filename | src/gdlist.h |
changeset | 696:3b224db916e3 |
prev | 691:ad3356543392 |
next | 736:a02d1475ccfd |
author | nkeynes |
date | Sun Jul 06 05:30:32 2008 +0000 (15 years ago) |
permissions | -rw-r--r-- |
last change | Add register defns for sort DMA Add register defn for 005F81AC to match the test |
view | annotate | diff | log | raw |
1 /**
2 * $Id$
3 *
4 * GD-Rom list manager - maintains the list of recently accessed images and
5 * available devices for the UI + config.
6 *
7 * Copyright (c) 2005 Nathan Keynes.
8 *
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.
13 *
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.
18 */
20 #ifndef lxdream_gdlist_H
21 #define lxdream_gdlist_H 1
23 #include "hook.h"
25 typedef gboolean (*gdrom_list_change_hook_t)(gboolean list_changed, int selection, void *user_data);
26 DECLARE_HOOK(gdrom_list_change_hook, gdrom_list_change_hook_t);
29 /**
30 * Initialize the gdrom list (registers with the gdrom driver, creates the
31 * initial lists, etc). Must be called exactly once before using the lists.
32 */
33 void gdrom_list_init(void);
35 /**
36 * Return the index of the currently selected GD-Rom item. If there is no disc
37 * currently mounted, returns 0.
38 */
39 int gdrom_list_get_selection(void);
41 /**
42 * Return the number of items in the list, including separators.
43 */
44 int gdrom_list_size(void);
46 /**
47 * Return the display name of the item at the specified index. If the
48 * item is a separator, returns the empty string. If the index is out
49 * of bounds, returns NULL.
50 * The list will currently follow the following structure:
51 * "Empty" (localised)
52 * Any CD/DVD drives attached to the system
53 * "" (empty string) - separator item
54 * An LRU list of disc image files (note without directory components).
55 */
56 const gchar *gdrom_list_get_display_name(int index);
58 const gchar *gdrom_list_get_filename(int index);
60 /**
61 * Change the current gdrom selection to the selected index. This will mount the
62 * appropriate drive/image where necessary.
63 * @return TRUE if the selection was updated, FALSE if the position was invalid.
64 */
65 gboolean gdrom_list_set_selection(int posn);
67 #endif /* lxdream_gdlist_H */
.