Code

moved struct screen_functions to screen_interface.h
authorMax Kellermann <max@duempel.org>
Wed, 30 Sep 2009 19:08:17 +0000 (21:08 +0200)
committerMax Kellermann <max@duempel.org>
Wed, 30 Sep 2009 19:08:17 +0000 (21:08 +0200)
14 files changed:
Makefile.am
src/screen.c
src/screen.h
src/screen_artist.c
src/screen_file.c
src/screen_help.c
src/screen_interface.h [new file with mode: 0644]
src/screen_keydef.c
src/screen_list.c
src/screen_lyrics.c
src/screen_outputs.c
src/screen_play.c
src/screen_search.c
src/screen_song.c

index 8243a2f352f83d4738b3d411e2986ef96f425bbc..91c83b2961475c470a8b2f895684706315d9ac63 100644 (file)
@@ -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 \
index 7295c47098c9975c4cdb4c0b9474a4265908f4dc..d9e7fdbe86ed0510a61ffd7d856e652b2e678a0b 100644 (file)
@@ -18,6 +18,7 @@
 */
 
 #include "screen.h"
+#include "screen_interface.h"
 #include "screen_list.h"
 #include "screen_utils.h"
 #include "config.h"
index 8923a7f57e2b87be0682f4be898008fc7d1667c8..b20a6c9449f1a18459ae95fd7e7573833398b6b1 100644 (file)
@@ -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);
index b331015e25b9d2599d76ecda14fb814cb15221f3..905566d4849d1368a4df97a63ff537df49e911ff 100644 (file)
@@ -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"
index 0295690aad7aa4614e3f7e9e2a049585e0bd6be3..3aaade12a03896d727d92e34cbc8062c40dc7f6f 100644 (file)
@@ -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"
index 59ea8a230feba3fd0b3c8096ecedd4a2a3e81420..5aa579f9bac7dd2b1e1b7d9673da8e452f8bb5d1 100644 (file)
  * 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 <stdlib.h>
diff --git a/src/screen_interface.h b/src/screen_interface.h
new file mode 100644 (file)
index 0000000..ca8b783
--- /dev/null
@@ -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 <stdbool.h>
+#include <stddef.h>
+
+#ifdef HAVE_NCURSESW_NCURSES_H
+#include <ncursesw/ncurses.h>
+#else
+#include <ncurses.h>
+#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
index b92ebe39d584453f7fa6d61d3a3bdc6f96ad230c..5809cd278e46f49fe3313d0d91c5d8d7a16e4caf 100644 (file)
@@ -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"
index ae1acd5dcef2e7f3c09c049792ae54fb9415ddf5..49f6037800cf2812d62777929e11706bdc568f16 100644 (file)
@@ -18,6 +18,7 @@
 */
 
 #include "screen_list.h"
+#include "screen_interface.h"
 #include "screen.h"
 
 #include <string.h>
index 33a0c3a2659e4ec0176ceb043029f4b924f46a59..62d5b13c6d64c9ddda8a3c1958885c9604cd5904 100644 (file)
@@ -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"
index 883e3c9a9a80886407747432aafe05863e504f98..7ecc353cb88476a0331b5966ee58ca81d382caff 100644 (file)
@@ -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"
index 5cc3457592878492362a7ff04df9390b759922a9..3b50a12b852a14871ed13fc2087f21d42f492263 100644 (file)
@@ -18,6 +18,7 @@
 */
 
 #include "screen_file.h"
+#include "screen_interface.h"
 #include "config.h"
 #include "i18n.h"
 #include "charset.h"
index 3e533b624112090bb2e66447c098d048779b7e63..43f6ea9e23b1daa22e9b889cc1a856c13255bfed 100644 (file)
  * 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"
index c83cd45b3a247b24cafc21b527297681437642a7..7b6ec6fbd5f8ca90ccd9e9b896675398fb04633b 100644 (file)
@@ -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"