1 /*
2 * $Id$
3 *
4 * (c) 2004 by Kalle Wallin <kaw@linux.se>
5 * Copyright (C) 2008 Max Kellermann <max@duempel.org>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 *
20 */
22 #ifndef SCREEN_BROWSER_H
23 #define SCREEN_BROWSER_H
25 #include "screen.h"
26 #include "mpdclient.h"
27 #include "config.h"
29 #include <stdbool.h>
31 struct list_window;
32 struct list_window_state;
34 struct screen_browser {
35 struct list_window *lw;
36 struct list_window_state *lw_state;
38 mpdclient_filelist_t *filelist;
39 };
41 void
42 sync_highlights(mpdclient_t *c, mpdclient_filelist_t *fl);
44 void
45 browser_playlist_changed(struct screen_browser *browser, mpdclient_t *c,
46 int event, gpointer data);
48 const char *browser_lw_callback(unsigned index, int *highlight, void *filelist);
50 int
51 browser_handle_select(struct screen_browser *browser, mpdclient_t *c);
53 int
54 browser_handle_add(struct screen_browser *browser, mpdclient_t *c);
56 void
57 browser_handle_select_all(struct screen_browser *browser, mpdclient_t *c);
59 int
60 browser_change_directory(struct screen_browser *browser, mpdclient_t *c,
61 filelist_entry_t *entry, const char *new_path);
63 int
64 browser_handle_enter(struct screen_browser *browser, mpdclient_t *c);
66 #ifdef HAVE_GETMOUSE
67 int browser_handle_mouse_event(struct screen_browser *browser, mpdclient_t *c);
68 #else
69 #define browser_handle_mouse_event(browser, c) (0)
70 #endif
72 bool
73 browser_cmd(struct screen_browser *browser, struct screen *screen,
74 struct mpdclient *c, command_t cmd);
76 #endif