Code

screen: moved status message functions to screen_message.c
authorMax Kellermann <max@duempel.org>
Thu, 1 Oct 2009 20:12:47 +0000 (22:12 +0200)
committerMax Kellermann <max@duempel.org>
Thu, 1 Oct 2009 20:12:47 +0000 (22:12 +0200)
19 files changed:
Makefile.am
src/list_window.c
src/main.c
src/player_command.c
src/screen.c
src/screen.h
src/screen_artist.c
src/screen_browser.c
src/screen_browser.h
src/screen_client.c
src/screen_file.c
src/screen_keydef.c
src/screen_lyrics.c
src/screen_message.c [new file with mode: 0644]
src/screen_message.h [new file with mode: 0644]
src/screen_outputs.c
src/screen_play.c
src/screen_search.c
src/screen_utils.c

index 65620e339a240f68ee4812583e81482c41b51c36..52b5953f34897ed1fa8b25f8e6a32e104d789217 100644 (file)
@@ -26,6 +26,7 @@ ncmpc_headers = \
        src/progress_bar.h \
        src/status_bar.h \
        src/screen.h \
+       src/screen_message.h \
        src/screen_interface.h \
        src/screen_list.h \
        src/screen_utils.h \
@@ -79,6 +80,7 @@ src_ncmpc_SOURCES = \
        src/progress_bar.c \
        src/status_bar.c \
        src/screen.c \
+       src/screen_message.c \
        src/screen_list.c \
        src/screen_utils.c \
        src/screen_client.c \
index 9f3bfc7065cb7508d8b9be0e82a61665e4fa6539..ca857b8a06ec60185e3d9d334c318d084b881b55 100644 (file)
@@ -24,7 +24,7 @@
 #include "match.h"
 #include "command.h"
 #include "colors.h"
-#include "screen.h"
+#include "screen_message.h"
 #include "i18n.h"
 
 #include <assert.h>
index 43e0dd7a3d2db19a883b5834008260f5ca3a569e..8abdcbda94c60f4a043b9bd4bd403645abae8436 100644 (file)
@@ -26,6 +26,7 @@
 #include "ncu.h"
 #include "screen.h"
 #include "screen_utils.h"
+#include "screen_message.h"
 #include "strfsong.h"
 #include "i18n.h"
 #include "player_command.h"
index 3d6d75ab3c40ed3a27713d7013a3a9db2d18cae3..fbd77c4d22cbc6e39e5696fc972edb2a5bf87a54 100644 (file)
@@ -20,9 +20,9 @@
 #include "player_command.h"
 #include "mpdclient.h"
 #include "options.h"
-#include "screen.h"
 #include "i18n.h"
 #include "screen_client.h"
+#include "screen_message.h"
 
 int seek_id = -1;
 int seek_target_time;
index f988cb09208d1168dbc74070efd1420e96f5f81e..a7c46b943e7c080e1f65697f1ace76f900e95407 100644 (file)
@@ -21,6 +21,7 @@
 #include "screen_interface.h"
 #include "screen_list.h"
 #include "screen_utils.h"
+#include "screen_message.h"
 #include "config.h"
 #include "i18n.h"
 #include "charset.h"
@@ -43,7 +44,6 @@
 
 #include <stdlib.h>
 #include <unistd.h>
-#include <stdarg.h>
 #include <string.h>
 #include <time.h>
 #include <locale.h>
@@ -242,25 +242,6 @@ screen_resize(struct mpdclient *c)
        screen_paint(c);
 }
 
-void
-screen_status_message(const char *msg)
-{
-       status_bar_message(&screen.status_bar, msg);
-}
-
-void
-screen_status_printf(const char *format, ...)
-{
-       char *msg;
-       va_list ap;
-
-       va_start(ap,format);
-       msg = g_strdup_vprintf(format,ap);
-       va_end(ap);
-       screen_status_message(msg);
-       g_free(msg);
-}
-
 void
 screen_init(struct mpdclient *c)
 {
index 245be7782f195285f827b5fae8468ddfbfc7568a..b9486473c1531d032d310ac4335e1eae76c86ca5 100644 (file)
@@ -63,8 +63,6 @@ extern struct screen screen;
 void screen_init(struct mpdclient *c);
 void screen_exit(void);
 void screen_resize(struct mpdclient *c);
-void screen_status_message(const char *msg);
-void screen_status_printf(const char *format, ...);
 void screen_paint(struct mpdclient *c);
 void screen_update(struct mpdclient *c);
 void screen_cmd(struct mpdclient *c, command_t cmd);
index eb1e449f491f29159f0a60acac2af32a705c74df..89fc55e31d0ea3b6a1c06a63dfbe3e7c6301cbb3 100644 (file)
@@ -19,6 +19,8 @@
 
 #include "screen_artist.h"
 #include "screen_interface.h"
+#include "screen_message.h"
+#include "screen.h"
 #include "i18n.h"
 #include "charset.h"
 #include "mpdclient.h"
index 95771234e06a915baf063eb3ab86c1bcfbc9658e..deb9e48900d2086e3a9420043d0d68820353fad5 100644 (file)
@@ -21,6 +21,8 @@
 #include "screen_file.h"
 #include "screen_song.h"
 #include "screen_lyrics.h"
+#include "screen_message.h"
+#include "screen.h"
 #include "i18n.h"
 #include "options.h"
 #include "charset.h"
index 57a575bca2d192ae671c8b33ef2720f1aa8938e8..2b02fbd8290eb9364be5a521052e6dfb18cb324b 100644 (file)
@@ -20,7 +20,7 @@
 #ifndef SCREEN_BROWSER_H
 #define SCREEN_BROWSER_H
 
-#include "screen.h"
+#include "command.h"
 #include "config.h"
 
 #include <stdbool.h>
index d442cabc2f860887c435b60d51dda642459e2bb7..2d39a29a591f29d47b1b5c9d0f133223604f7050 100644 (file)
@@ -19,7 +19,7 @@
 
 #include "screen_client.h"
 #include "screen_utils.h"
-#include "screen.h"
+#include "screen_message.h"
 #include "mpdclient.h"
 #include "i18n.h"
 #include "charset.h"
index 47efc9b399c8d9620236d6dc48293f45933fe5c0..b4dc24d6d1a23a01231614fbc2c0e867221372bb 100644 (file)
@@ -20,6 +20,8 @@
 #include "screen_file.h"
 #include "screen_browser.h"
 #include "screen_interface.h"
+#include "screen_message.h"
+#include "screen.h"
 #include "config.h"
 #include "i18n.h"
 #include "charset.h"
index 30f85ac76e18f378dc4dcc45379cf89e3bf705e5..d93757a9c67bd5ca64f744dc2b8c79cd395727af 100644 (file)
@@ -19,6 +19,7 @@
 
 #include "screen_keydef.h"
 #include "screen_interface.h"
+#include "screen_message.h"
 #include "i18n.h"
 #include "conf.h"
 #include "screen.h"
index 928a42ec22fafb2deb966cbe77e3ace3115964ec..7c3d6378ced530804a900feec239123dda2ec355 100644 (file)
@@ -19,6 +19,7 @@
 
 #include "screen_lyrics.h"
 #include "screen_interface.h"
+#include "screen_message.h"
 #include "screen_file.h"
 #include "screen_song.h"
 #include "i18n.h"
diff --git a/src/screen_message.c b/src/screen_message.c
new file mode 100644 (file)
index 0000000..99b3deb
--- /dev/null
@@ -0,0 +1,42 @@
+/* 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.
+ */
+
+#include "screen_message.h"
+#include "screen.h"
+
+#include <stdarg.h>
+
+void
+screen_status_message(const char *msg)
+{
+       status_bar_message(&screen.status_bar, msg);
+}
+
+void
+screen_status_printf(const char *format, ...)
+{
+       char *msg;
+       va_list ap;
+
+       va_start(ap,format);
+       msg = g_strdup_vprintf(format,ap);
+       va_end(ap);
+       screen_status_message(msg);
+       g_free(msg);
+}
diff --git a/src/screen_message.h b/src/screen_message.h
new file mode 100644 (file)
index 0000000..4eed37a
--- /dev/null
@@ -0,0 +1,29 @@
+/* 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_MESSAGE_H
+#define NCMPC_SCREEN_MESSAGE_H
+
+void
+screen_status_message(const char *msg);
+
+void
+screen_status_printf(const char *format, ...);
+
+#endif
index 7f64bd0fc49a919ce2126ee3aa7c531905175a81..cd3a4435a9148aa664534a5ea7cb37504c7bf63b 100644 (file)
@@ -19,8 +19,8 @@
 
 #include "screen_outputs.h"
 #include "screen_interface.h"
+#include "screen_message.h"
 #include "i18n.h"
-#include "screen.h"
 #include "list_window.h"
 #include "mpdclient.h"
 
index f1af5196f76a0ff572201f38f1e24662ab0a6194..39fdf032d6fe1d8ba3a7056be571d4fa9c8f4042 100644 (file)
@@ -20,6 +20,7 @@
 #include "screen_play.h"
 #include "screen_interface.h"
 #include "screen_file.h"
+#include "screen_message.h"
 #include "config.h"
 #include "i18n.h"
 #include "charset.h"
index d7e49aadea5960de2b88afe0e4322a95fe435790..5434738660830b3ddd6e29221cb71b95c53c8ed3 100644 (file)
@@ -19,6 +19,8 @@
 
 #include "screen_search.h"
 #include "screen_interface.h"
+#include "screen_message.h"
+#include "screen.h"
 #include "i18n.h"
 #include "options.h"
 #include "charset.h"
index 063893e15652ae928ffb0f4736acdc428e9dcc9d..6cd72324140675cf9f409d9eedb950fa851401dd 100644 (file)
@@ -18,6 +18,7 @@
 */
 
 #include "screen_utils.h"
+#include "screen_message.h"
 #include "screen.h"
 #include "mpdclient.h"
 #include "config.h"