Search
lxdream.org :: lxdream/src/gdlist.h :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/gdlist.h
changeset 691:ad3356543392
next696:3b224db916e3
author nkeynes
date Thu Jun 19 04:40:37 2008 +0000 (14 years ago)
permissions -rw-r--r--
last change Refactor the gd-rom list management out of the GUI (devices, recent files, etc).
Add gd-rom list to the cocoa UI.
file annotate diff log raw
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/src/gdlist.h Thu Jun 19 04:40:37 2008 +0000
1.3 @@ -0,0 +1,65 @@
1.4 +/**
1.5 + * $Id$
1.6 + *
1.7 + * GD-Rom list manager - maintains the list of recently accessed images and
1.8 + * available devices for the UI + config.
1.9 + *
1.10 + * Copyright (c) 2005 Nathan Keynes.
1.11 + *
1.12 + * This program is free software; you can redistribute it and/or modify
1.13 + * it under the terms of the GNU General Public License as published by
1.14 + * the Free Software Foundation; either version 2 of the License, or
1.15 + * (at your option) any later version.
1.16 + *
1.17 + * This program is distributed in the hope that it will be useful,
1.18 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1.19 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.20 + * GNU General Public License for more details.
1.21 + */
1.22 +
1.23 +#ifndef lxdream_gdlist_H
1.24 +#define lxdream_gdlist_H 1
1.25 +
1.26 +#include "hook.h"
1.27 +
1.28 +typedef gboolean (*gdrom_list_change_hook_t)(gboolean list_changed, int selection, void *user_data);
1.29 +DECLARE_HOOK(gdrom_list_change_hook, gdrom_list_change_hook_t);
1.30 +
1.31 +
1.32 +/**
1.33 + * Initialize the gdrom list (registers with the gdrom driver, creates the
1.34 + * initial lists, etc). Must be called exactly once before using the lists.
1.35 + */
1.36 +void gdrom_list_init(void);
1.37 +
1.38 +/**
1.39 + * Return the index of the currently selected GD-Rom item. If there is no disc
1.40 + * currently mounted, returns 0.
1.41 + */
1.42 +int gdrom_list_get_selection(void);
1.43 +
1.44 +/**
1.45 + * Return the number of items in the list, including separators.
1.46 + */
1.47 +int gdrom_list_size(void);
1.48 +
1.49 +/**
1.50 + * Return the display name of the item at the specified index. If the
1.51 + * item is a separator, returns the empty string. If the index is out
1.52 + * of bounds, returns NULL.
1.53 + * The list will currently follow the following structure:
1.54 + * "Empty" (localised)
1.55 + * Any CD/DVD drives attached to the system
1.56 + * "" (empty string) - separator item
1.57 + * An LRU list of disc image files (note without directory components).
1.58 + */
1.59 +const gchar *gdrom_list_get_display_name(int index);
1.60 +
1.61 +/**
1.62 + * Change the current gdrom selection to the selected index. This will mount the
1.63 + * appropriate drive/image where necessary.
1.64 + * @return TRUE if the selection was updated, FALSE if the position was invalid.
1.65 + */
1.66 +gboolean gdrom_list_set_selection(int posn);
1.67 +
1.68 +#endif /* lxdream_gdlist_H */
.