ncmpc  0.30
hscroll.hxx
Go to the documentation of this file.
1 /* ncmpc (Ncurses MPD Client)
2  * (c) 2004-2018 The Music Player Daemon Project
3  * Project homepage: http://musicpd.org
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 #ifndef HSCROLL_H
21 #define HSCROLL_H
22 
23 #include "config.h"
24 #include "ncmpc_curses.h"
25 #include "BasicMarquee.hxx"
26 
33 class hscroll {
34  WINDOW *const w;
35 
36  BasicMarquee basic;
37 
41  unsigned x, y;
42 
46  attr_t attrs;
47 
51  short pair;
52 
57  unsigned source_id = 0;
58 
59 public:
60  hscroll(WINDOW *_w, const char *_separator)
61  :w(_w), basic(_separator) {
62  }
63 
64  bool IsDefined() const {
65  return basic.IsDefined();
66  }
67 
73  void Set(unsigned x, unsigned y, unsigned width, const char *text);
74 
79  void Clear();
80 
81  void Rewind() {
82  basic.Rewind();
83  }
84 
85  void Step() {
86  basic.Step();
87  }
88 
93  void Paint() const;
94 
95 private:
96  bool TimerCallback();
97 };
98 
99 #endif
bool IsDefined() const
Definition: hscroll.hxx:64
Definition: hscroll.hxx:33
Definition: BasicMarquee.hxx:29
hscroll(WINDOW *_w, const char *_separator)
Definition: hscroll.hxx:60
void Set(unsigned x, unsigned y, unsigned width, const char *text)
void Clear()
void Rewind()
Definition: BasicMarquee.hxx:78
void Rewind()
Definition: hscroll.hxx:81
void Paint() const
void Step()
Definition: hscroll.hxx:85
bool IsDefined() const
Definition: BasicMarquee.hxx:62
void Step()
Definition: BasicMarquee.hxx:82