nkeynes@691: /** nkeynes@691: * $Id$ nkeynes@691: * nkeynes@691: * GD-Rom list manager - maintains the list of recently accessed images and nkeynes@691: * available devices for the UI + config. nkeynes@691: * nkeynes@691: * Copyright (c) 2005 Nathan Keynes. nkeynes@691: * nkeynes@691: * This program is free software; you can redistribute it and/or modify nkeynes@691: * it under the terms of the GNU General Public License as published by nkeynes@691: * the Free Software Foundation; either version 2 of the License, or nkeynes@691: * (at your option) any later version. nkeynes@691: * nkeynes@691: * This program is distributed in the hope that it will be useful, nkeynes@691: * but WITHOUT ANY WARRANTY; without even the implied warranty of nkeynes@691: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the nkeynes@691: * GNU General Public License for more details. nkeynes@691: */ nkeynes@691: nkeynes@691: #ifndef lxdream_gdlist_H nkeynes@691: #define lxdream_gdlist_H 1 nkeynes@691: nkeynes@691: #include "hook.h" nkeynes@691: nkeynes@691: typedef gboolean (*gdrom_list_change_hook_t)(gboolean list_changed, int selection, void *user_data); nkeynes@691: DECLARE_HOOK(gdrom_list_change_hook, gdrom_list_change_hook_t); nkeynes@691: nkeynes@691: nkeynes@691: /** nkeynes@691: * Initialize the gdrom list (registers with the gdrom driver, creates the nkeynes@691: * initial lists, etc). Must be called exactly once before using the lists. nkeynes@691: */ nkeynes@691: void gdrom_list_init(void); nkeynes@691: nkeynes@691: /** nkeynes@691: * Return the index of the currently selected GD-Rom item. If there is no disc nkeynes@691: * currently mounted, returns 0. nkeynes@691: */ nkeynes@691: int gdrom_list_get_selection(void); nkeynes@691: nkeynes@691: /** nkeynes@691: * Return the number of items in the list, including separators. nkeynes@691: */ nkeynes@691: int gdrom_list_size(void); nkeynes@691: nkeynes@691: /** nkeynes@691: * Return the display name of the item at the specified index. If the nkeynes@691: * item is a separator, returns the empty string. If the index is out nkeynes@691: * of bounds, returns NULL. nkeynes@691: * The list will currently follow the following structure: nkeynes@691: * "Empty" (localised) nkeynes@691: * Any CD/DVD drives attached to the system nkeynes@691: * "" (empty string) - separator item nkeynes@691: * An LRU list of disc image files (note without directory components). nkeynes@691: */ nkeynes@691: const gchar *gdrom_list_get_display_name(int index); nkeynes@691: nkeynes@691: /** nkeynes@691: * Change the current gdrom selection to the selected index. This will mount the nkeynes@691: * appropriate drive/image where necessary. nkeynes@691: * @return TRUE if the selection was updated, FALSE if the position was invalid. nkeynes@691: */ nkeynes@691: gboolean gdrom_list_set_selection(int posn); nkeynes@691: nkeynes@691: #endif /* lxdream_gdlist_H */