diff --git a/meson.build b/meson.build index c22d4d18..c4de7cef 100644 --- a/meson.build +++ b/meson.build @@ -361,10 +361,6 @@ if enable_chat_screen need_screen_text = true endif -if need_screen_text - sources += ['src/TextPage.cxx'] -endif - if need_plugin_library if host_machine.system() == 'windows' error('Plugins not yet compatible with Windows') @@ -384,6 +380,7 @@ subdir('src/system') subdir('src/net') subdir('src/event') subdir('src/ui') +subdir('src/page') ncmpc = executable('ncmpc', 'src/Main.cxx', @@ -415,11 +412,9 @@ ncmpc = executable('ncmpc', 'src/screen_list.cxx', 'src/screen_find.cxx', 'src/screen_client.cxx', - 'src/Page.cxx', 'src/QueuePage.cxx', 'src/FileListPage.cxx', 'src/FileBrowserPage.cxx', - 'src/ProxyPage.cxx', 'src/save_playlist.cxx', 'src/SongRowPaint.cxx', 'src/BasicColors.cxx', @@ -445,6 +440,7 @@ ncmpc = executable('ncmpc', libmpdclient_dep, fmt_dep, ui_dep, + page_dep, ], install: true ) diff --git a/src/ChatPage.cxx b/src/ChatPage.cxx index 6fa09447..7d7b8b7e 100644 --- a/src/ChatPage.cxx +++ b/src/ChatPage.cxx @@ -5,12 +5,12 @@ #include "PageMeta.hxx" #include "screen_utils.hxx" #include "screen_status.hxx" -#include "TextPage.hxx" #include "mpdclient.hxx" #include "i18n.h" #include "charset.hxx" #include "Command.hxx" #include "Options.hxx" +#include "page/TextPage.hxx" #include "util/StringAPI.hxx" #include diff --git a/src/FileListPage.hxx b/src/FileListPage.hxx index b2150c8e..56bf2f46 100644 --- a/src/FileListPage.hxx +++ b/src/FileListPage.hxx @@ -4,7 +4,7 @@ #pragma once #include "config.h" -#include "ListPage.hxx" +#include "page/ListPage.hxx" #include "ui/ListRenderer.hxx" #include "ui/ListText.hxx" diff --git a/src/HelpPage.cxx b/src/HelpPage.cxx index e2e8a8ec..53808341 100644 --- a/src/HelpPage.cxx +++ b/src/HelpPage.cxx @@ -3,12 +3,12 @@ #include "HelpPage.hxx" #include "PageMeta.hxx" -#include "ListPage.hxx" #include "screen_find.hxx" #include "Bindings.hxx" #include "GlobalBindings.hxx" #include "config.h" #include "i18n.h" +#include "page/ListPage.hxx" #include "ui/ListRenderer.hxx" #include "ui/ListText.hxx" #include "ui/paint.hxx" diff --git a/src/KeyDefPage.cxx b/src/KeyDefPage.cxx index 3878ef33..c8f767cc 100644 --- a/src/KeyDefPage.cxx +++ b/src/KeyDefPage.cxx @@ -3,8 +3,6 @@ #include "KeyDefPage.hxx" #include "PageMeta.hxx" -#include "ListPage.hxx" -#include "ProxyPage.hxx" #include "screen_status.hxx" #include "screen_find.hxx" #include "KeyName.hxx" @@ -14,6 +12,8 @@ #include "GlobalBindings.hxx" #include "screen_utils.hxx" #include "Options.hxx" +#include "page/ListPage.hxx" +#include "page/ProxyPage.hxx" #include "ui/Bell.hxx" #include "ui/ListText.hxx" #include "ui/TextListRenderer.hxx" diff --git a/src/LibraryPage.cxx b/src/LibraryPage.cxx index 5f90315a..81b584d5 100644 --- a/src/LibraryPage.cxx +++ b/src/LibraryPage.cxx @@ -6,12 +6,12 @@ #include "PageMeta.hxx" #include "FileListPage.hxx" #include "Command.hxx" -#include "ProxyPage.hxx" #include "i18n.h" #include "charset.hxx" #include "mpdclient.hxx" #include "filelist.hxx" #include "Options.hxx" +#include "page/ProxyPage.hxx" #include "lib/fmt/ToSpan.hxx" #include diff --git a/src/LyricsPage.cxx b/src/LyricsPage.cxx index 992bbc81..6e9f6f0a 100644 --- a/src/LyricsPage.cxx +++ b/src/LyricsPage.cxx @@ -14,8 +14,8 @@ #include "mpdclient.hxx" #include "screen.hxx" #include "plugin.hxx" -#include "TextPage.hxx" #include "ncu.hxx" +#include "page/TextPage.hxx" #include "lib/fmt/ToSpan.hxx" #include "util/StringAPI.hxx" diff --git a/src/OutputsPage.cxx b/src/OutputsPage.cxx index f3d8f1f7..cff9230f 100644 --- a/src/OutputsPage.cxx +++ b/src/OutputsPage.cxx @@ -4,12 +4,12 @@ #include "OutputsPage.hxx" #include "Deleter.hxx" #include "PageMeta.hxx" -#include "ListPage.hxx" #include "screen_status.hxx" #include "Command.hxx" #include "screen_utils.hxx" #include "i18n.h" #include "mpdclient.hxx" +#include "page/ListPage.hxx" #include "ui/ListRenderer.hxx" #include "ui/paint.hxx" #include "util/FNVHash.hxx" diff --git a/src/QueuePage.cxx b/src/QueuePage.cxx index 8b35e920..ceb40cf9 100644 --- a/src/QueuePage.cxx +++ b/src/QueuePage.cxx @@ -3,7 +3,6 @@ #include "QueuePage.hxx" #include "PageMeta.hxx" -#include "ListPage.hxx" #include "FileBrowserPage.hxx" #include "screen_status.hxx" #include "screen_find.hxx" @@ -24,6 +23,7 @@ #include "SongPage.hxx" #include "LyricsPage.hxx" #include "db_completion.hxx" +#include "page/ListPage.hxx" #include "ui/ListRenderer.hxx" #include "ui/ListText.hxx" #include "event/CoarseTimerEvent.hxx" diff --git a/src/SongPage.cxx b/src/SongPage.cxx index b57e9e39..663d9892 100644 --- a/src/SongPage.cxx +++ b/src/SongPage.cxx @@ -3,7 +3,6 @@ #include "SongPage.hxx" #include "PageMeta.hxx" -#include "ListPage.hxx" #include "FileBrowserPage.hxx" #include "LyricsPage.hxx" #include "screen_find.hxx" @@ -13,6 +12,7 @@ #include "charset.hxx" #include "time_format.hxx" #include "mpdclient.hxx" +#include "page/ListPage.hxx" #include "ui/ListText.hxx" #include "ui/TextListRenderer.hxx" #include "lib/fmt/ToSpan.hxx" diff --git a/src/TagListPage.hxx b/src/TagListPage.hxx index 0ed26a2e..43f7d00e 100644 --- a/src/TagListPage.hxx +++ b/src/TagListPage.hxx @@ -4,7 +4,7 @@ #pragma once #include "TagFilter.hxx" -#include "ListPage.hxx" +#include "page/ListPage.hxx" #include "ui/ListRenderer.hxx" #include "ui/ListText.hxx" diff --git a/src/ListPage.hxx b/src/page/ListPage.hxx similarity index 100% rename from src/ListPage.hxx rename to src/page/ListPage.hxx diff --git a/src/Page.cxx b/src/page/Page.cxx similarity index 100% rename from src/Page.cxx rename to src/page/Page.cxx diff --git a/src/Page.hxx b/src/page/Page.hxx similarity index 98% rename from src/Page.hxx rename to src/page/Page.hxx index ad2b732b..dd906036 100644 --- a/src/Page.hxx +++ b/src/page/Page.hxx @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0-or-later +// SPDX-License-Identifier: GPL-2.0-or-lateryes // Copyright The Music Player Daemon Project #pragma once diff --git a/src/ProxyPage.cxx b/src/page/ProxyPage.cxx similarity index 100% rename from src/ProxyPage.cxx rename to src/page/ProxyPage.cxx diff --git a/src/ProxyPage.hxx b/src/page/ProxyPage.hxx similarity index 100% rename from src/ProxyPage.hxx rename to src/page/ProxyPage.hxx diff --git a/src/TextPage.cxx b/src/page/TextPage.cxx similarity index 100% rename from src/TextPage.cxx rename to src/page/TextPage.cxx diff --git a/src/TextPage.hxx b/src/page/TextPage.hxx similarity index 100% rename from src/TextPage.hxx rename to src/page/TextPage.hxx diff --git a/src/page/meson.build b/src/page/meson.build new file mode 100644 index 00000000..ce9e4670 --- /dev/null +++ b/src/page/meson.build @@ -0,0 +1,24 @@ +page_sources = [ + 'Page.cxx', + 'ProxyPage.cxx', +] + +if need_screen_text + page_sources += 'TextPage.cxx' +endif + +page = static_library( + 'page', + page_sources, + include_directories: inc, + dependencies: [ + ui_dep, + ], +) + +page_dep = declare_dependency( + link_with: page, + dependencies: [ + ui_dep, + ], +) diff --git a/src/screen.cxx b/src/screen.cxx index 37f57ff5..04884f23 100644 --- a/src/screen.cxx +++ b/src/screen.cxx @@ -5,7 +5,6 @@ #include "PageMeta.hxx" #include "screen_list.hxx" #include "screen_status.hxx" -#include "Page.hxx" #include "Command.hxx" #include "config.h" #include "i18n.h" @@ -15,6 +14,7 @@ #include "player_command.hxx" #include "SongPage.hxx" #include "LyricsPage.hxx" +#include "page/Page.hxx" #include "ui/Options.hxx" #include "util/StringAPI.hxx" diff --git a/src/screen_init.cxx b/src/screen_init.cxx index b57da07f..b6ad867a 100644 --- a/src/screen_init.cxx +++ b/src/screen_init.cxx @@ -2,10 +2,10 @@ // Copyright The Music Player Daemon Project #include "screen.hxx" -#include "Page.hxx" #include "QueuePage.hxx" #include "config.h" #include "Styles.hxx" +#include "page/Page.hxx" #include "ui/Options.hxx" /* minimum window size */ diff --git a/src/screen_paint.cxx b/src/screen_paint.cxx index 01bc2916..52535693 100644 --- a/src/screen_paint.cxx +++ b/src/screen_paint.cxx @@ -2,7 +2,7 @@ // Copyright The Music Player Daemon Project #include "screen.hxx" -#include "Page.hxx" +#include "page/Page.hxx" #include "ui/Options.hxx" void