Code

meson.build: define _GNU_SOURCE for getaddrinfo() and sigaction() with glibc
[ncmpc.git] / src / status_bar.h
index 1410aed989a8cd81b7fe8b5682c3108727066428..1fc4cf369163debb236aea022a515d5fa28171cb 100644 (file)
@@ -1,5 +1,5 @@
 /* ncmpc (Ncurses MPD Client)
- * (c) 2004-2009 The Music Player Daemon Project
+ * (c) 2004-2017 The Music Player Daemon Project
  * Project homepage: http://musicpd.org
  *
  * This program is free software; you can redistribute it and/or modify
@@ -28,8 +28,6 @@
 
 #include <glib.h>
 
-#include <stdbool.h>
-
 struct mpd_status;
 struct mpd_song;
 
@@ -40,39 +38,17 @@ struct status_bar {
 
 #ifndef NCMPC_MINI
        struct hscroll hscroll;
-       guint scroll_source_id;
 
        const struct mpd_status *prev_status;
        const struct mpd_song *prev_song;
 #endif
 };
 
-static inline void
-status_bar_init(struct status_bar *p, unsigned width, int y, int x)
-{
-       window_init(&p->window, 1, width, y, x);
-
-       leaveok(p->window.w, false);
-       keypad(p->window.w, true);
-
-       p->message_source_id = 0;
-
-#ifndef NCMPC_MINI
-       hscroll_reset(&p->hscroll);
-       p->scroll_source_id = 0;
-       p->prev_status = NULL;
-       p->prev_song = NULL;
-#endif
-}
-
-static inline void
-status_bar_deinit(struct status_bar *p)
-{
-       delwin(p->window.w);
+void
+status_bar_init(struct status_bar *p, unsigned width, int y, int x);
 
-       if (p->message_source_id != 0)
-               g_source_remove(p->message_source_id);
-}
+void
+status_bar_deinit(struct status_bar *p);
 
 void
 status_bar_paint(struct status_bar *p, const struct mpd_status *status,
@@ -84,4 +60,7 @@ status_bar_resize(struct status_bar *p, unsigned width, int y, int x);
 void
 status_bar_message(struct status_bar *p, const char *msg);
 
+void
+status_bar_clear_message(struct status_bar *p);
+
 #endif