Code

meson.build: fix build with meson > 0.38.1
[ncmpc.git] / src / progress_bar.h
index d6fdba5b0235a967ab4b7eea539387f957181d06..1c241ff74f9a2eb9419391626887fa76248f668d 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
@@ -33,21 +33,27 @@ struct progress_bar {
 };
 
 static inline void
-progress_bar_init(struct progress_bar *p, unsigned height, unsigned width,
-                 int y, int x)
+progress_bar_init(struct progress_bar *p, unsigned width, int y, int x)
 {
-       window_init(&p->window, height, width, y, x);
+       window_init(&p->window, 1, width, y, x);
+       leaveok(p->window.w, TRUE);
 
        p->current = 0;
        p->max = 0;
        p->width = 0;
 }
 
+static inline void
+progress_bar_deinit(struct progress_bar *p)
+{
+       delwin(p->window.w);
+}
+
 void
 progress_bar_paint(const struct progress_bar *p);
 
-bool
-progress_bar_resize(struct progress_bar *p);
+void
+progress_bar_resize(struct progress_bar *p, unsigned width, int y, int x);
 
 bool
 progress_bar_set(struct progress_bar *p, unsigned current, unsigned max);