1 /* ncmpc (Ncurses MPD Client)
2 * (c) 2004-2017 The Music Player Daemon Project
3 * Project homepage: http://musicpd.org
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
20 #ifndef SCREEN_H
21 #define SCREEN_H
23 #include "config.h"
24 #include "command.h"
25 #include "window.h"
26 #include "title_bar.h"
27 #include "progress_bar.h"
28 #include "status_bar.h"
29 #include "ncmpc_curses.h"
31 #include <mpd/client.h>
33 #include <glib.h>
35 struct mpdclient;
36 struct screen_functions;
38 struct screen {
39 struct title_bar title_bar;
40 struct window main_window;
41 struct progress_bar progress_bar;
42 struct status_bar status_bar;
44 char *buf;
45 size_t buf_size;
47 char *findbuf;
48 GList *find_history;
50 #ifndef NCMPC_MINI
51 /**
52 * Non-zero when the welcome message is currently being
53 * displayed. The associated timer will disable it.
54 */
55 guint welcome_source_id;
56 #endif
57 };
59 extern struct screen screen;
61 void screen_init(struct mpdclient *c);
62 void screen_exit(void);
63 void screen_resize(struct mpdclient *c);
65 void
66 screen_paint(struct mpdclient *c, bool main_dirty);
68 void screen_update(struct mpdclient *c);
69 void screen_cmd(struct mpdclient *c, command_t cmd);
71 void
72 screen_switch(const struct screen_functions *sf, struct mpdclient *c);
73 void
74 screen_swap(struct mpdclient *c, const struct mpd_song *song);
76 gboolean
77 screen_is_visible(const struct screen_functions *sf);
79 int
80 screen_get_mouse_event(struct mpdclient *c, unsigned long *bstate, int *row);
82 #endif