31 #include "util/Compiler.h" 33 #include <mpd/client.h> 48 static constexpr
int title_y = 0, title_x = 0;
50 static constexpr
int progress_x = 0;
51 static constexpr
int status_x = 0;
53 constexpr
explicit Layout(
Size _size)
56 constexpr
unsigned GetMainRows()
const {
57 return GetProgressY() - main_y;
60 constexpr
Size GetMainSize()
const {
61 return {size.
width, GetMainRows()};
64 constexpr
int GetProgressY()
const {
65 return GetStatusY() - 1;
68 constexpr
int GetStatusY()
const {
86 using PageMap = std::map<
const PageMeta *,
87 std::unique_ptr<Page>>;
89 PageMap::iterator current_page = pages.begin();
111 return *current_page->first;
120 return &page == current_page->second.get();
128 void Paint(
bool main_dirty);
138 void NextMode(
struct mpdclient &c,
int offset);
Command
Definition: Command.hxx:29
virtual bool OnCommand(struct mpdclient &c, Command cmd)=0
gcc_pure bool IsVisible(const Page &page) const
Definition: screen.hxx:119
const PageMeta & GetCurrentPageMeta() const
Definition: screen.hxx:110
Definition: screen.hxx:44
std::list< std::string > History
Definition: History.hxx:26
StatusBar status_bar
Definition: screen.hxx:83
PageMap::iterator MakePage(const PageMeta &sf)
Definition: Window.hxx:28
void Update(struct mpdclient &c)
Definition: Page.hxx:73
std::string findbuf
Definition: screen.hxx:97
Point GetMainPosition() const
Definition: screen.hxx:106
Definition: PageMeta.hxx:32
Definition: mpdclient.hxx:17
Window main_window
Definition: screen.hxx:77
Definition: StatusBar.hxx:36
virtual void OnResize(Size size)=0
static constexpr unsigned GetHeight()
Definition: TitleBar.hxx:37
Definition: TitleBar.hxx:28
void Swap(struct mpdclient &c, const struct mpd_song *song)
unsigned width
Definition: Size.hxx:27
unsigned height
Definition: Size.hxx:27
virtual void Paint() const =0
History find_history
Definition: screen.hxx:98
void Init(struct mpdclient *c)
Definition: ProgressBar.hxx:25
void Switch(const PageMeta &sf, struct mpdclient &c)