Search
lxdream.org :: lxdream/src/gdlist.h
lxdream 0.9.1
released Jun 29
Download Now
filename src/gdlist.h
changeset 696:3b224db916e3
prev691:ad3356543392
next736:a02d1475ccfd
author nkeynes
date Sun Jun 22 03:59:56 2008 +0000 (13 years ago)
permissions -rw-r--r--
last change Add a get_filename method to gdlist
return mount resuls from gdrom_list_set_selection()
file annotate diff log raw
nkeynes@691
     1
/**
nkeynes@691
     2
 * $Id$
nkeynes@691
     3
 *
nkeynes@691
     4
 * GD-Rom list manager - maintains the list of recently accessed images and
nkeynes@691
     5
 * available devices for the UI + config. 
nkeynes@691
     6
 *
nkeynes@691
     7
 * Copyright (c) 2005 Nathan Keynes.
nkeynes@691
     8
 *
nkeynes@691
     9
 * This program is free software; you can redistribute it and/or modify
nkeynes@691
    10
 * it under the terms of the GNU General Public License as published by
nkeynes@691
    11
 * the Free Software Foundation; either version 2 of the License, or
nkeynes@691
    12
 * (at your option) any later version.
nkeynes@691
    13
 *
nkeynes@691
    14
 * This program is distributed in the hope that it will be useful,
nkeynes@691
    15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
nkeynes@691
    16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
nkeynes@691
    17
 * GNU General Public License for more details.
nkeynes@691
    18
 */
nkeynes@691
    19
nkeynes@691
    20
#ifndef lxdream_gdlist_H
nkeynes@691
    21
#define lxdream_gdlist_H 1
nkeynes@691
    22
nkeynes@691
    23
#include "hook.h"
nkeynes@691
    24
nkeynes@691
    25
typedef gboolean (*gdrom_list_change_hook_t)(gboolean list_changed, int selection, void *user_data);
nkeynes@691
    26
DECLARE_HOOK(gdrom_list_change_hook, gdrom_list_change_hook_t);
nkeynes@691
    27
nkeynes@691
    28
nkeynes@691
    29
/**
nkeynes@691
    30
 * Initialize the gdrom list (registers with the gdrom driver, creates the 
nkeynes@691
    31
 * initial lists, etc). Must be called exactly once before using the lists.
nkeynes@691
    32
 */
nkeynes@691
    33
void gdrom_list_init(void);
nkeynes@691
    34
nkeynes@691
    35
/**
nkeynes@691
    36
 * Return the index of the currently selected GD-Rom item. If there is no disc
nkeynes@691
    37
 * currently mounted, returns 0. 
nkeynes@691
    38
 */ 
nkeynes@691
    39
int gdrom_list_get_selection(void);
nkeynes@691
    40
nkeynes@691
    41
/**
nkeynes@691
    42
 * Return the number of items in the list, including separators.
nkeynes@691
    43
 */
nkeynes@691
    44
int gdrom_list_size(void);
nkeynes@691
    45
nkeynes@691
    46
/**
nkeynes@691
    47
 * Return the display name of the item at the specified index. If the
nkeynes@691
    48
 * item is a separator, returns the empty string. If the index is out
nkeynes@691
    49
 * of bounds, returns NULL. 
nkeynes@691
    50
 * The list will currently follow the following structure:
nkeynes@691
    51
 *   "Empty" (localised)
nkeynes@691
    52
 *   Any CD/DVD drives attached to the system
nkeynes@691
    53
 *   "" (empty string) - separator item
nkeynes@691
    54
 *   An LRU list of disc image files (note without directory components).
nkeynes@691
    55
 */
nkeynes@691
    56
const gchar *gdrom_list_get_display_name(int index);
nkeynes@691
    57
nkeynes@696
    58
const gchar *gdrom_list_get_filename(int index);
nkeynes@696
    59
nkeynes@691
    60
/**
nkeynes@691
    61
 * Change the current gdrom selection to the selected index. This will mount the
nkeynes@691
    62
 * appropriate drive/image where necessary.
nkeynes@691
    63
 * @return TRUE if the selection was updated, FALSE if the position was invalid. 
nkeynes@691
    64
 */
nkeynes@691
    65
gboolean gdrom_list_set_selection(int posn);
nkeynes@691
    66
nkeynes@691
    67
#endif /* lxdream_gdlist_H */
.