From 3b68d63a1f1dc53e642bc269bbdd1148ede52a10 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 30 Sep 2009 21:08:17 +0200 Subject: [PATCH] moved struct screen_functions to screen_interface.h --- Makefile.am | 1 + src/screen.c | 1 + src/screen.h | 13 ------------ src/screen_artist.c | 2 +- src/screen_file.c | 2 +- src/screen_help.c | 2 +- src/screen_interface.h | 48 ++++++++++++++++++++++++++++++++++++++++++ src/screen_keydef.c | 1 + src/screen_list.c | 1 + src/screen_lyrics.c | 1 + src/screen_outputs.c | 1 + src/screen_play.c | 1 + src/screen_search.c | 2 +- src/screen_song.c | 1 + 14 files changed, 60 insertions(+), 17 deletions(-) create mode 100644 src/screen_interface.h diff --git a/Makefile.am b/Makefile.am index 8243a2f..91c83b2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -26,6 +26,7 @@ ncmpc_headers = \ src/progress_bar.h \ src/status_bar.h \ src/screen.h \ + src/screen_interface.h \ src/screen_list.h \ src/screen_play.h \ src/screen_utils.h \ diff --git a/src/screen.c b/src/screen.c index 7295c47..d9e7fdb 100644 --- a/src/screen.c +++ b/src/screen.c @@ -18,6 +18,7 @@ */ #include "screen.h" +#include "screen_interface.h" #include "screen_list.h" #include "screen_utils.h" #include "config.h" diff --git a/src/screen.h b/src/screen.h index 8923a7f..b20a6c9 100644 --- a/src/screen.h +++ b/src/screen.h @@ -87,19 +87,6 @@ extern const struct screen_functions screen_lyrics; extern const struct screen_functions screen_outputs; #endif - -typedef struct screen_functions { - void (*init)(WINDOW *w, int cols, int rows); - void (*exit)(void); - void (*open)(struct mpdclient *c); - void (*close)(void); - void (*resize)(int cols, int rows); - void (*paint)(void); - void (*update)(struct mpdclient *c); - bool (*cmd)(struct mpdclient *c, command_t cmd); - const char *(*get_title)(char *s, size_t size); -} screen_functions_t; - void screen_init(struct mpdclient *c); void screen_exit(void); void screen_resize(struct mpdclient *c); diff --git a/src/screen_artist.c b/src/screen_artist.c index b331015..905566d 100644 --- a/src/screen_artist.c +++ b/src/screen_artist.c @@ -24,7 +24,7 @@ #include "utils.h" #include "strfsong.h" #include "command.h" -#include "screen.h" +#include "screen_interface.h" #include "screen_utils.h" #include "screen_browser.h" #include "filelist.h" diff --git a/src/screen_file.c b/src/screen_file.c index 0295690..3aaade1 100644 --- a/src/screen_file.c +++ b/src/screen_file.c @@ -18,6 +18,7 @@ */ #include "screen_file.h" +#include "screen_interface.h" #include "config.h" #include "i18n.h" #include "options.h" @@ -25,7 +26,6 @@ #include "mpdclient.h" #include "filelist.h" #include "command.h" -#include "screen.h" #include "screen_utils.h" #include "screen_browser.h" #include "screen_play.h" diff --git a/src/screen_help.c b/src/screen_help.c index 59ea8a2..5aa579f 100644 --- a/src/screen_help.c +++ b/src/screen_help.c @@ -17,11 +17,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#include "screen_interface.h" #include "config.h" #include "i18n.h" #include "mpdclient.h" #include "command.h" -#include "screen.h" #include "screen_utils.h" #include diff --git a/src/screen_interface.h b/src/screen_interface.h new file mode 100644 index 0000000..ca8b783 --- /dev/null +++ b/src/screen_interface.h @@ -0,0 +1,48 @@ +/* ncmpc (Ncurses MPD Client) + * (c) 2004-2009 The Music Player Daemon Project + * Project homepage: http://musicpd.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifndef NCMPC_SCREEN_INTERFACE_H +#define NCMPC_SCREEN_INTERFACE_H + +#include "command.h" + +#include +#include + +#ifdef HAVE_NCURSESW_NCURSES_H +#include +#else +#include +#endif + +struct mpdclient; + +typedef struct screen_functions { + void (*init)(WINDOW *w, int cols, int rows); + void (*exit)(void); + void (*open)(struct mpdclient *c); + void (*close)(void); + void (*resize)(int cols, int rows); + void (*paint)(void); + void (*update)(struct mpdclient *c); + bool (*cmd)(struct mpdclient *c, command_t cmd); + const char *(*get_title)(char *s, size_t size); +} screen_functions_t; + +#endif diff --git a/src/screen_keydef.c b/src/screen_keydef.c index b92ebe3..5809cd2 100644 --- a/src/screen_keydef.c +++ b/src/screen_keydef.c @@ -17,6 +17,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#include "screen_interface.h" #include "i18n.h" #include "mpdclient.h" #include "options.h" diff --git a/src/screen_list.c b/src/screen_list.c index ae1acd5..49f6037 100644 --- a/src/screen_list.c +++ b/src/screen_list.c @@ -18,6 +18,7 @@ */ #include "screen_list.h" +#include "screen_interface.h" #include "screen.h" #include diff --git a/src/screen_lyrics.c b/src/screen_lyrics.c index 33a0c3a..62d5b13 100644 --- a/src/screen_lyrics.c +++ b/src/screen_lyrics.c @@ -17,6 +17,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#include "screen_interface.h" #include "screen_file.h" #include "i18n.h" #include "options.h" diff --git a/src/screen_outputs.c b/src/screen_outputs.c index 883e3c9..7ecc353 100644 --- a/src/screen_outputs.c +++ b/src/screen_outputs.c @@ -17,6 +17,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#include "screen_interface.h" #include "i18n.h" #include "screen.h" #include "list_window.h" diff --git a/src/screen_play.c b/src/screen_play.c index 5cc3457..3b50a12 100644 --- a/src/screen_play.c +++ b/src/screen_play.c @@ -18,6 +18,7 @@ */ #include "screen_file.h" +#include "screen_interface.h" #include "config.h" #include "i18n.h" #include "charset.h" diff --git a/src/screen_search.c b/src/screen_search.c index 3e533b6..43f6ea9 100644 --- a/src/screen_search.c +++ b/src/screen_search.c @@ -17,13 +17,13 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#include "screen_interface.h" #include "i18n.h" #include "options.h" #include "charset.h" #include "mpdclient.h" #include "strfsong.h" #include "command.h" -#include "screen.h" #include "utils.h" #include "screen_utils.h" #include "screen_browser.h" diff --git a/src/screen_song.c b/src/screen_song.c index c83cd45..7b6ec6f 100644 --- a/src/screen_song.c +++ b/src/screen_song.c @@ -17,6 +17,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#include "screen_interface.h" #include "screen_file.h" #include "i18n.h" #include "screen.h" -- 2.30.2