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 Mon Jul 14 07:44:42 2008 +0000 (13 years ago)
permissions -rw-r--r--
last change Re-indent everything consistently
Fix include guards for consistency as well
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@736
    25
#ifdef __cplusplus
nkeynes@736
    26
extern "C" {
nkeynes@736
    27
#endif
nkeynes@736
    28
nkeynes@691
    29
typedef gboolean (*gdrom_list_change_hook_t)(gboolean list_changed, int selection, void *user_data);
nkeynes@691
    30
DECLARE_HOOK(gdrom_list_change_hook, gdrom_list_change_hook_t);
nkeynes@691
    31
nkeynes@691
    32
nkeynes@691
    33
/**
nkeynes@691
    34
 * Initialize the gdrom list (registers with the gdrom driver, creates the 
nkeynes@691
    35
 * initial lists, etc). Must be called exactly once before using the lists.
nkeynes@691
    36
 */
nkeynes@691
    37
void gdrom_list_init(void);
nkeynes@691
    38
nkeynes@691
    39
/**
nkeynes@691
    40
 * Return the index of the currently selected GD-Rom item. If there is no disc
nkeynes@691
    41
 * currently mounted, returns 0. 
nkeynes@691
    42
 */ 
nkeynes@691
    43
int gdrom_list_get_selection(void);
nkeynes@691
    44
nkeynes@691
    45
/**
nkeynes@691
    46
 * Return the number of items in the list, including separators.
nkeynes@691
    47
 */
nkeynes@691
    48
int gdrom_list_size(void);
nkeynes@691
    49
nkeynes@691
    50
/**
nkeynes@691
    51
 * Return the display name of the item at the specified index. If the
nkeynes@691
    52
 * item is a separator, returns the empty string. If the index is out
nkeynes@691
    53
 * of bounds, returns NULL. 
nkeynes@691
    54
 * The list will currently follow the following structure:
nkeynes@691
    55
 *   "Empty" (localised)
nkeynes@691
    56
 *   Any CD/DVD drives attached to the system
nkeynes@691
    57
 *   "" (empty string) - separator item
nkeynes@691
    58
 *   An LRU list of disc image files (note without directory components).
nkeynes@691
    59
 */
nkeynes@691
    60
const gchar *gdrom_list_get_display_name(int index);
nkeynes@691
    61
nkeynes@696
    62
const gchar *gdrom_list_get_filename(int index);
nkeynes@696
    63
nkeynes@691
    64
/**
nkeynes@691
    65
 * Change the current gdrom selection to the selected index. This will mount the
nkeynes@691
    66
 * appropriate drive/image where necessary.
nkeynes@691
    67
 * @return TRUE if the selection was updated, FALSE if the position was invalid. 
nkeynes@691
    68
 */
nkeynes@691
    69
gboolean gdrom_list_set_selection(int posn);
nkeynes@691
    70
nkeynes@736
    71
#ifdef __cplusplus
nkeynes@736
    72
}
nkeynes@736
    73
#endif
nkeynes@736
    74
nkeynes@691
    75
#endif /* lxdream_gdlist_H */
.