Search
lxdream.org :: lxdream/src/gdlist.h
lxdream 0.9.1
released Jun 29
Download Now
filename src/gdlist.h
changeset 736:a02d1475ccfd
prev696:3b224db916e3
next1109:700c5ab26a63
author nkeynes
date Wed Jul 30 03:00:40 2008 +0000 (11 years ago)
permissions -rw-r--r--
last change Add debian changelog file
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 #ifdef __cplusplus
    26 extern "C" {
    27 #endif
    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);
    33 /**
    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.
    36  */
    37 void gdrom_list_init(void);
    39 /**
    40  * Return the index of the currently selected GD-Rom item. If there is no disc
    41  * currently mounted, returns 0. 
    42  */ 
    43 int gdrom_list_get_selection(void);
    45 /**
    46  * Return the number of items in the list, including separators.
    47  */
    48 int gdrom_list_size(void);
    50 /**
    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:
    55  *   "Empty" (localised)
    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).
    59  */
    60 const gchar *gdrom_list_get_display_name(int index);
    62 const gchar *gdrom_list_get_filename(int index);
    64 /**
    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. 
    68  */
    69 gboolean gdrom_list_set_selection(int posn);
    71 #ifdef __cplusplus
    72 }
    73 #endif
    75 #endif /* lxdream_gdlist_H */
.