From: Max Kellermann Date: Tue, 20 Oct 2009 06:00:13 +0000 (+0200) Subject: status_bar: un-inline constructor and destructor X-Git-Tag: release-0.16~66 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=140da05f051205910e69853be402d5d99eb3d4a0;p=ncmpc.git status_bar: un-inline constructor and destructor --- diff --git a/src/status_bar.c b/src/status_bar.c index 16012f4..657008c 100644 --- a/src/status_bar.c +++ b/src/status_bar.c @@ -31,6 +31,33 @@ #include #include +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 +} + +void +status_bar_deinit(struct status_bar *p) +{ + delwin(p->window.w); + + if (p->message_source_id != 0) + g_source_remove(p->message_source_id); +} + #ifndef NCMPC_MINI static gboolean scroll_timer_callback(gpointer data) diff --git a/src/status_bar.h b/src/status_bar.h index 1410aed..bfbb2c0 100644 --- a/src/status_bar.h +++ b/src/status_bar.h @@ -28,8 +28,6 @@ #include -#include - struct mpd_status; struct mpd_song; @@ -47,32 +45,11 @@ struct status_bar { #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,