ncmpc  0.29
screen.h
Go to the documentation of this file.
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  */
19 
20 #ifndef SCREEN_H
21 #define SCREEN_H
22 
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"
30 
31 #include <mpd/client.h>
32 
33 #include <glib.h>
34 
35 #include <stdbool.h>
36 
37 struct mpdclient;
38 struct screen_functions;
39 
40 struct screen {
45 
47 
48  char *buf;
49  size_t buf_size;
50 
51  char *findbuf;
52  GList *find_history;
53 
54 #ifndef NCMPC_MINI
55 
60 #endif
61 };
62 
63 extern struct screen screen;
64 
65 void screen_init(struct mpdclient *c);
66 void screen_exit(void);
67 void screen_resize(struct mpdclient *c);
68 
69 void
70 paint_top_window(const struct mpdclient *c);
71 
72 void
73 screen_paint(struct mpdclient *c, bool main_dirty);
74 
75 void screen_update(struct mpdclient *c);
76 void screen_cmd(struct mpdclient *c, command_t cmd);
77 
78 #ifdef HAVE_GETMOUSE
79 bool
80 screen_mouse(struct mpdclient *c, int x, int y, mmask_t bstate);
81 #endif
82 
83 void
84 screen_switch(const struct screen_functions *sf, struct mpdclient *c);
85 void
86 screen_swap(struct mpdclient *c, const struct mpd_song *song);
87 
88 static inline bool
89 screen_is_visible(const struct screen_functions *sf)
90 {
91  return sf == screen.current_page;
92 }
93 
94 #endif
char * buf
Definition: screen.h:48
size_t buf_size
Definition: screen.h:49
void screen_paint(struct mpdclient *c, bool main_dirty)
Definition: screen_interface.h:32
Definition: progress_bar.h:27
void screen_switch(const struct screen_functions *sf, struct mpdclient *c)
Definition: title_bar.h:29
void screen_exit(void)
void screen_swap(struct mpdclient *c, const struct mpd_song *song)
Definition: status_bar.h:34
void screen_update(struct mpdclient *c)
void screen_init(struct mpdclient *c)
Definition: mpdclient.h:12
const struct screen_functions * current_page
Definition: screen.h:46
guint welcome_source_id
Definition: screen.h:59
GList * find_history
Definition: screen.h:52
command_t
Definition: command.h:36
void screen_resize(struct mpdclient *c)
char * findbuf
Definition: screen.h:51
void paint_top_window(const struct mpdclient *c)
struct window main_window
Definition: screen.h:42
Definition: window.h:26
void screen_cmd(struct mpdclient *c, command_t cmd)
Definition: screen.h:40