more PascalCase to camelCase conversions

This commit is contained in:
Andrzej Rybczak
2012-09-13 19:23:33 +02:00
parent 8e6d9a97e3
commit dd7665bb7d
43 changed files with 567 additions and 567 deletions

View File

@@ -161,7 +161,7 @@ void Action::ResizeScreen(bool reload_main_window)
SetResizeFlags();
ApplyToVisibleWindows(&BasicScreen::Resize);
applyToVisibleWindows(&BasicScreen::resize);
if (Config.header_visibility || Config.new_design)
wHeader->resize(COLS, HeaderHeight);
@@ -170,7 +170,7 @@ void Action::ResizeScreen(bool reload_main_window)
wFooter->moveTo(0, FooterStartY);
wFooter->resize(COLS, Config.statusbar_visibility ? 2 : 1);
ApplyToVisibleWindows(&BasicScreen::Refresh);
applyToVisibleWindows(&BasicScreen::refresh);
Status::Changes::elapsedTime();
if (!Mpd.isPlaying())
@@ -349,21 +349,21 @@ void Action::ListsChangeFinisher()
# endif // HAVE_TAGLIB_H
)
{
if (myScreen->ActiveWindow() == myLibrary->Tags)
if (myScreen->activeWindow() == myLibrary->Tags)
{
myLibrary->Albums->clear();
myLibrary->Songs->clear();
}
else if (myScreen->ActiveWindow() == myLibrary->Albums)
else if (myScreen->activeWindow() == myLibrary->Albums)
{
myLibrary->Songs->clear();
}
else if (myScreen->ActiveWindow() == myPlaylistEditor->Playlists)
else if (myScreen->activeWindow() == myPlaylistEditor->Playlists)
{
myPlaylistEditor->Content->clear();
}
# ifdef HAVE_TAGLIB_H
else if (myScreen->ActiveWindow() == myTagEditor->Dirs)
else if (myScreen->activeWindow() == myTagEditor->Dirs)
{
myTagEditor->Tags->clear();
}
@@ -482,18 +482,18 @@ void MouseEvent::Run()
Mpd.SetVolume(Mpd.GetVolume()+2);
}
else if (itsMouseEvent.bstate & (BUTTON1_PRESSED | BUTTON2_PRESSED | BUTTON3_PRESSED | BUTTON4_PRESSED))
myScreen->MouseButtonPressed(itsMouseEvent);
myScreen->mouseButtonPressed(itsMouseEvent);
}
void ScrollUp::Run()
{
myScreen->Scroll(NC::wUp);
myScreen->scroll(NC::wUp);
ListsChangeFinisher();
}
void ScrollDown::Run()
{
myScreen->Scroll(NC::wDown);
myScreen->scroll(NC::wDown);
ListsChangeFinisher();
}
@@ -591,25 +591,25 @@ void ScrollDownAlbum::Run()
void PageUp::Run()
{
myScreen->Scroll(NC::wPageUp);
myScreen->scroll(NC::wPageUp);
ListsChangeFinisher();
}
void PageDown::Run()
{
myScreen->Scroll(NC::wPageDown);
myScreen->scroll(NC::wPageDown);
ListsChangeFinisher();
}
void MoveHome::Run()
{
myScreen->Scroll(NC::wHome);
myScreen->scroll(NC::wHome);
ListsChangeFinisher();
}
void MoveEnd::Run()
{
myScreen->Scroll(NC::wEnd);
myScreen->scroll(NC::wEnd);
ListsChangeFinisher();
}
@@ -630,7 +630,7 @@ bool JumpToParentDirectory::canBeRun() const
{
return (myScreen == myBrowser)
# ifdef HAVE_TAGLIB_H
|| (myScreen->ActiveWindow() == myTagEditor->Dirs)
|| (myScreen->activeWindow() == myTagEditor->Dirs)
# endif // HAVE_TAGLIB_H
;
}
@@ -641,8 +641,8 @@ void JumpToParentDirectory::Run()
{
if (myBrowser->CurrentDir() != "/")
{
myBrowser->Main()->reset();
myBrowser->EnterPressed();
myBrowser->main()->reset();
myBrowser->enterPressed();
}
}
# ifdef HAVE_TAGLIB_H
@@ -651,7 +651,7 @@ void JumpToParentDirectory::Run()
if (myTagEditor->CurrentDir() != "/")
{
myTagEditor->Dirs->reset();
myTagEditor->EnterPressed();
myTagEditor->enterPressed();
}
}
# endif // HAVE_TAGLIB_H
@@ -659,12 +659,12 @@ void JumpToParentDirectory::Run()
void PressEnter::Run()
{
myScreen->EnterPressed();
myScreen->enterPressed();
}
void PressSpace::Run()
{
myScreen->SpacePressed();
myScreen->spacePressed();
}
bool PreviousColumn::canBeRun() const
@@ -751,17 +751,17 @@ void Delete::Run()
Statusbar::msg("Item(s) deleted");
}
# ifndef WIN32
else if (myScreen == myBrowser && !myBrowser->Main()->empty())
else if (myScreen == myBrowser && !myBrowser->main()->empty())
{
if (!myBrowser->isLocal() && !isMPDMusicDirSet())
return;
std::string question;
if (myBrowser->Main()->hasSelected())
if (myBrowser->main()->hasSelected())
question = "Delete selected items?";
else
{
MPD::Item &item = myBrowser->Main()->current().value();
MPD::Item &item = myBrowser->main()->current().value();
std::string name = item.type == MPD::itSong ? item.song->getName() : item.name;
question = "Delete ";
question += itemTypeToString(item.type);
@@ -773,7 +773,7 @@ void Delete::Run()
if (yes)
{
bool success = true;
auto list = getSelectedOrCurrent(myBrowser->Main()->begin(), myBrowser->Main()->end(), myBrowser->Main()->currentI());
auto list = getSelectedOrCurrent(myBrowser->main()->begin(), myBrowser->main()->end(), myBrowser->main()->currentI());
for (auto it = list.begin(); it != list.end(); ++it)
{
const MPD::Item &i = (*it)->value();
@@ -803,7 +803,7 @@ void Delete::Run()
# endif // !WIN32
else if (myScreen == myPlaylistEditor && !myPlaylistEditor->Content->empty())
{
if (myScreen->ActiveWindow() == myPlaylistEditor->Playlists)
if (myScreen->activeWindow() == myPlaylistEditor->Playlists)
{
std::string question;
if (myPlaylistEditor->Playlists->hasSelected())
@@ -827,7 +827,7 @@ void Delete::Run()
else
Statusbar::msg("Aborted");
}
else if (myScreen->ActiveWindow() == myPlaylistEditor->Content)
else if (myScreen->activeWindow() == myPlaylistEditor->Content)
{
std::string playlist = myPlaylistEditor->Playlists->current().value();
auto delete_fun = std::bind(&MPD::Connection::PlaylistDelete, _1, playlist, _2);
@@ -889,7 +889,7 @@ void SavePlaylist::Run()
if (result == MPD_ERROR_SUCCESS)
{
Statusbar::msg("Playlist saved as \"%s\"", playlist_name.c_str());
if (myPlaylistEditor->Main()) // check if initialized
if (myPlaylistEditor->main()) // check if initialized
myPlaylistEditor->Playlists->clear(); // make playlist's list update itself
}
else if (result == MPD_SERVER_ERROR_EXIST)
@@ -903,17 +903,17 @@ void SavePlaylist::Run()
}
else
Statusbar::msg("Aborted");
if (myPlaylistEditor->Main()) // check if initialized
if (myPlaylistEditor->main()) // check if initialized
myPlaylistEditor->Playlists->clear(); // make playlist's list update itself
if (myScreen == myPlaylist)
myPlaylist->EnableHighlighting();
}
}
}
if (myBrowser->Main()
if (myBrowser->main()
&& !myBrowser->isLocal()
&& myBrowser->CurrentDir() == "/"
&& !myBrowser->Main()->empty())
&& !myBrowser->main()->empty())
myBrowser->GetDirectory(myBrowser->CurrentDir());
}
@@ -946,10 +946,10 @@ void MoveSortOrderDown::Run()
bool MoveSelectedItemsUp::canBeRun() const
{
return ((myScreen->ActiveWindow() == myPlaylist->Items
return ((myScreen->activeWindow() == myPlaylist->Items
&& !myPlaylist->Items->empty()
&& !myPlaylist->isFiltered())
|| (myScreen->ActiveWindow() == myPlaylistEditor->Content
|| (myScreen->activeWindow() == myPlaylistEditor->Content
&& !myPlaylistEditor->Content->empty()
&& !myPlaylistEditor->isContentFiltered()));
}
@@ -971,10 +971,10 @@ void MoveSelectedItemsUp::Run()
bool MoveSelectedItemsDown::canBeRun() const
{
return ((myScreen->ActiveWindow() == myPlaylist->Items
return ((myScreen->activeWindow() == myPlaylist->Items
&& !myPlaylist->Items->empty()
&& !myPlaylist->isFiltered())
|| (myScreen->ActiveWindow() == myPlaylistEditor->Content
|| (myScreen->activeWindow() == myPlaylistEditor->Content
&& !myPlaylistEditor->Content->empty()
&& !myPlaylistEditor->isContentFiltered()));
}
@@ -996,8 +996,8 @@ void MoveSelectedItemsDown::Run()
bool MoveSelectedItemsTo::canBeRun() const
{
return myScreen->ActiveWindow() == myPlaylist->Items
|| myScreen->ActiveWindow() == myPlaylistEditor->Content;
return myScreen->activeWindow() == myPlaylist->Items
|| myScreen->activeWindow() == myPlaylistEditor->Content;
}
void MoveSelectedItemsTo::Run()
@@ -1074,7 +1074,7 @@ bool ToggleDisplayMode::canBeRun() const
return myScreen == myPlaylist
|| myScreen == myBrowser
|| myScreen == mySearcher
|| myScreen->ActiveWindow() == myPlaylistEditor->Content;
|| myScreen->activeWindow() == myPlaylistEditor->Content;
}
void ToggleDisplayMode::Run()
@@ -1102,16 +1102,16 @@ void ToggleDisplayMode::Run()
{
Config.columns_in_browser = !Config.columns_in_browser;
Statusbar::msg("Browser display mode: %s", Config.columns_in_browser ? "Columns" : "Classic");
myBrowser->Main()->setTitle(Config.columns_in_browser && Config.titles_visibility ? Display::Columns(myBrowser->Main()->getWidth()) : "");
myBrowser->main()->setTitle(Config.columns_in_browser && Config.titles_visibility ? Display::Columns(myBrowser->main()->getWidth()) : "");
}
else if (myScreen == mySearcher)
{
Config.columns_in_search_engine = !Config.columns_in_search_engine;
Statusbar::msg("Search engine display mode: %s", Config.columns_in_search_engine ? "Columns" : "Classic");
if (mySearcher->Main()->size() > SearchEngine::StaticOptions)
mySearcher->Main()->setTitle(Config.columns_in_search_engine && Config.titles_visibility ? Display::Columns(mySearcher->Main()->getWidth()) : "");
if (mySearcher->main()->size() > SearchEngine::StaticOptions)
mySearcher->main()->setTitle(Config.columns_in_search_engine && Config.titles_visibility ? Display::Columns(mySearcher->main()->getWidth()) : "");
}
else if (myScreen->ActiveWindow() == myPlaylistEditor->Content)
else if (myScreen->activeWindow() == myPlaylistEditor->Content)
{
Config.columns_in_playlist_editor = !Config.columns_in_playlist_editor;
Statusbar::msg("Playlist editor display mode: %s", Config.columns_in_playlist_editor ? "Columns" : "Classic");
@@ -1222,23 +1222,23 @@ void ToggleRandom::Run()
bool StartSearching::canBeRun() const
{
return myScreen == mySearcher && !mySearcher->Main()->at(0).isInactive();
return myScreen == mySearcher && !mySearcher->main()->at(0).isInactive();
}
void StartSearching::Run()
{
mySearcher->Main()->highlight(SearchEngine::SearchButton);
mySearcher->Main()->setHighlighting(0);
mySearcher->Main()->refresh();
mySearcher->Main()->setHighlighting(1);
mySearcher->EnterPressed();
mySearcher->main()->highlight(SearchEngine::SearchButton);
mySearcher->main()->setHighlighting(0);
mySearcher->main()->refresh();
mySearcher->main()->setHighlighting(1);
mySearcher->enterPressed();
}
bool SaveTagChanges::canBeRun() const
{
# ifdef HAVE_TAGLIB_H
return myScreen == myTinyTagEditor
|| myScreen->ActiveWindow() == myTagEditor->TagTypes;
|| myScreen->activeWindow() == myTagEditor->TagTypes;
# else
return false;
# endif // HAVE_TAGLIB_H
@@ -1249,13 +1249,13 @@ void SaveTagChanges::Run()
# ifdef HAVE_TAGLIB_H
if (myScreen == myTinyTagEditor)
{
myTinyTagEditor->Main()->highlight(myTinyTagEditor->Main()->size()-2); // Save
myTinyTagEditor->EnterPressed();
myTinyTagEditor->main()->highlight(myTinyTagEditor->main()->size()-2); // Save
myTinyTagEditor->enterPressed();
}
else if (myScreen->ActiveWindow() == myTagEditor->TagTypes)
else if (myScreen->activeWindow() == myTagEditor->TagTypes)
{
myTagEditor->TagTypes->highlight(myTagEditor->TagTypes->size()-1); // Save
myTagEditor->EnterPressed();
myTagEditor->enterPressed();
}
# endif // HAVE_TAGLIB_H
}
@@ -1305,7 +1305,7 @@ void EditSong::Run()
# ifdef HAVE_TAGLIB_H
auto s = currentSong(myScreen);
myTinyTagEditor->SetEdited(*s);
myTinyTagEditor->SwitchTo();
myTinyTagEditor->switchTo();
# endif // HAVE_TAGLIB_H
}
@@ -1313,7 +1313,7 @@ bool EditLibraryTag::canBeRun() const
{
# ifdef HAVE_TAGLIB_H
return isMPDMusicDirSet()
&& myScreen->ActiveWindow() == myLibrary->Tags
&& myScreen->activeWindow() == myLibrary->Tags
&& !myLibrary->Tags->empty();
# else
return false;
@@ -1365,7 +1365,7 @@ bool EditLibraryAlbum::canBeRun() const
{
# ifdef HAVE_TAGLIB_H
return isMPDMusicDirSet()
&& myScreen->ActiveWindow() == myLibrary->Albums
&& myScreen->activeWindow() == myLibrary->Albums
&& !myLibrary->Albums->empty();
# else
return false;
@@ -1419,10 +1419,10 @@ bool EditDirectoryName::canBeRun() const
{
return isMPDMusicDirSet()
&& ((myScreen == myBrowser
&& !myBrowser->Main()->empty()
&& myBrowser->Main()->current().value().type == MPD::itDirectory)
&& !myBrowser->main()->empty()
&& myBrowser->main()->current().value().type == MPD::itDirectory)
# ifdef HAVE_TAGLIB_H
|| (myScreen->ActiveWindow() == myTagEditor->Dirs
|| (myScreen->activeWindow() == myTagEditor->Dirs
&& !myTagEditor->Dirs->empty()
&& myTagEditor->Dirs->choice() > 0)
# endif // HAVE_TAGLIB_H
@@ -1435,7 +1435,7 @@ void EditDirectoryName::Run()
if (myScreen == myBrowser)
{
std::string old_dir = myBrowser->Main()->current().value().name;
std::string old_dir = myBrowser->main()->current().value().name;
Statusbar::lock();
Statusbar::put() << NC::fmtBold << "Directory: " << NC::fmtBoldEnd;
std::string new_dir = wFooter->getString(old_dir);
@@ -1467,7 +1467,7 @@ void EditDirectoryName::Run()
}
}
# ifdef HAVE_TAGLIB_H
else if (myScreen->ActiveWindow() == myTagEditor->Dirs)
else if (myScreen->activeWindow() == myTagEditor->Dirs)
{
std::string old_dir = myTagEditor->Dirs->current().value().first;
Statusbar::lock();
@@ -1496,11 +1496,11 @@ void EditDirectoryName::Run()
bool EditPlaylistName::canBeRun() const
{
return (myScreen->ActiveWindow() == myPlaylistEditor->Playlists
return (myScreen->activeWindow() == myPlaylistEditor->Playlists
&& !myPlaylistEditor->Playlists->empty())
|| (myScreen == myBrowser
&& !myBrowser->Main()->empty()
&& myBrowser->Main()->current().value().type == MPD::itPlaylist);
&& !myBrowser->main()->empty()
&& myBrowser->main()->current().value().type == MPD::itPlaylist);
}
void EditPlaylistName::Run()
@@ -1508,10 +1508,10 @@ void EditPlaylistName::Run()
using Global::wFooter;
std::string old_name;
if (myScreen->ActiveWindow() == myPlaylistEditor->Playlists)
if (myScreen->activeWindow() == myPlaylistEditor->Playlists)
old_name = myPlaylistEditor->Playlists->current().value();
else
old_name = myBrowser->Main()->current().value().name;
old_name = myBrowser->main()->current().value().name;
Statusbar::lock();
Statusbar::put() << NC::fmtBold << "Playlist: " << NC::fmtBoldEnd;
std::string new_name = wFooter->getString(old_name);
@@ -1522,9 +1522,9 @@ void EditPlaylistName::Run()
{
const char msg[] = "Playlist renamed to \"%ls\"";
Statusbar::msg(msg, wideShorten(ToWString(new_name), COLS-const_strlen(msg)).c_str());
if (myBrowser->Main() && !myBrowser->isLocal())
if (myBrowser->main() && !myBrowser->isLocal())
myBrowser->GetDirectory("/");
if (myPlaylistEditor->Main())
if (myPlaylistEditor->main())
myPlaylistEditor->Playlists->clear();
}
}
@@ -1565,12 +1565,12 @@ void JumpToMediaLibrary::Run()
bool JumpToPlaylistEditor::canBeRun() const
{
return myScreen == myBrowser
&& myBrowser->Main()->current().value().type == MPD::itPlaylist;
&& myBrowser->main()->current().value().type == MPD::itPlaylist;
}
void JumpToPlaylistEditor::Run()
{
myPlaylistEditor->Locate(myBrowser->Main()->current().value().name);
myPlaylistEditor->Locate(myBrowser->main()->current().value().name);
}
void ToggleScreenLock::Run()
@@ -1580,9 +1580,9 @@ void ToggleScreenLock::Run()
if (myLockedScreen != 0)
{
BasicScreen::Unlock();
BasicScreen::unlock();
Action::SetResizeFlags();
myScreen->Resize();
myScreen->resize();
Statusbar::msg("Screen unlocked");
}
else
@@ -1604,7 +1604,7 @@ void ToggleScreenLock::Run()
return;
}
Config.locked_screen_width_part = part/100.0;
if (myScreen->Lock())
if (myScreen->lock())
Statusbar::msg("Screen locked (with %d%% width)", part);
else
Statusbar::msg("Current screen can't be locked");
@@ -1740,7 +1740,7 @@ void SelectAlbum::Run()
void AddSelectedItems::Run()
{
mySelectedItemsAdder->SwitchTo();
mySelectedItemsAdder->switchTo();
}
void CropMainPlaylist::Run()
@@ -1893,9 +1893,9 @@ void Find::Run()
Statusbar::msg("Searching...");
Screen<NC::Scrollpad> *s = static_cast<Screen<NC::Scrollpad> *>(myScreen);
s->Main()->removeFormatting();
Statusbar::msg("%s", findme.empty() || s->Main()->setFormatting(NC::fmtReverse, ToWString(findme), NC::fmtReverseEnd, 0) ? "Done" : "No matching patterns found");
s->Main()->flush();
s->main()->removeFormatting();
Statusbar::msg("%s", findme.empty() || s->main()->setFormatting(NC::fmtReverse, ToWString(findme), NC::fmtReverseEnd, 0) ? "Done" : "No matching patterns found");
s->main()->flush();
}
bool FindItemBackward::canBeRun() const
@@ -2056,14 +2056,14 @@ void ToggleBrowserSortMode::Run()
Statusbar::msg("Sort songs by: Name");
break;
}
std::sort(myBrowser->Main()->begin()+(myBrowser->CurrentDir() != "/"), myBrowser->Main()->end(),
std::sort(myBrowser->main()->begin()+(myBrowser->CurrentDir() != "/"), myBrowser->main()->end(),
LocaleBasedItemSorting(std::locale(), Config.ignore_leading_the, Config.browser_sort_mode));
}
bool ToggleLibraryTagType::canBeRun() const
{
return (myScreen->ActiveWindow() == myLibrary->Tags)
|| (myLibrary->Columns() == 2 && myScreen->ActiveWindow() == myLibrary->Albums);
return (myScreen->activeWindow() == myLibrary->Tags)
|| (myLibrary->Columns() == 2 && myScreen->activeWindow() == myLibrary->Albums);
}
void ToggleLibraryTagType::Run()
@@ -2145,7 +2145,7 @@ bool SetSelectedItemsPriority::canBeRun() const
Statusbar::msg("Priorities are supported in MPD >= 0.17.0");
return false;
}
return myScreen->ActiveWindow() == myPlaylist->Items && !myPlaylist->Items->empty();
return myScreen->activeWindow() == myPlaylist->Items && !myPlaylist->Items->empty();
}
void SetSelectedItemsPriority::Run()
@@ -2169,7 +2169,7 @@ void SetSelectedItemsPriority::Run()
bool FilterPlaylistOnPriorities::canBeRun() const
{
return myScreen->ActiveWindow() == myPlaylist->Items;
return myScreen->activeWindow() == myPlaylist->Items;
}
void FilterPlaylistOnPriorities::Run()
@@ -2192,14 +2192,14 @@ void FilterPlaylistOnPriorities::Run()
void ShowSongInfo::Run()
{
mySongInfo->SwitchTo();
mySongInfo->switchTo();
}
bool ShowArtistInfo::canBeRun() const
{
#ifdef HAVE_CURL_CURL_H
return myScreen == myLastfm
|| (myScreen->ActiveWindow() == myLibrary->Tags
|| (myScreen->activeWindow() == myLibrary->Tags
&& !myLibrary->Tags->empty()
&& Config.media_lib_primary_tag == MPD_TAG_ARTIST)
|| currentSong(myScreen);
@@ -2213,12 +2213,12 @@ void ShowArtistInfo::Run()
# ifdef HAVE_CURL_CURL_H
if (myScreen == myLastfm || myLastfm->isDownloading())
{
myLastfm->SwitchTo();
myLastfm->switchTo();
return;
}
std::string artist;
if (myScreen->ActiveWindow() == myLibrary->Tags)
if (myScreen->activeWindow() == myLibrary->Tags)
{
assert(!myLibrary->Tags->empty());
assert(Config.media_lib_primary_tag == MPD_TAG_ARTIST);
@@ -2232,13 +2232,13 @@ void ShowArtistInfo::Run()
}
if (!artist.empty() && myLastfm->SetArtistInfoArgs(artist, Config.lastfm_preferred_language))
myLastfm->SwitchTo();
myLastfm->switchTo();
# endif // HAVE_CURL_CURL_H
}
void ShowLyrics::Run()
{
myLyrics->SwitchTo();
myLyrics->switchTo();
}
void Quit::Run()
@@ -2254,17 +2254,17 @@ void NextScreen::Run()
if (Config.screen_switcher_previous)
{
if (myScreen->isTabbable())
myPrevScreen->SwitchTo();
myPrevScreen->switchTo();
else
myOldScreen->SwitchTo();
myOldScreen->switchTo();
}
else if (!Config.screens_seq.empty())
{
std::list<BasicScreen *>::const_iterator screen = std::find(Config.screens_seq.begin(), Config.screens_seq.end(), myScreen);
if (++screen == Config.screens_seq.end())
Config.screens_seq.front()->SwitchTo();
Config.screens_seq.front()->switchTo();
else
(*screen)->SwitchTo();
(*screen)->switchTo();
}
}
@@ -2276,17 +2276,17 @@ void PreviousScreen::Run()
if (Config.screen_switcher_previous)
{
if (myScreen->isTabbable())
myPrevScreen->SwitchTo();
myPrevScreen->switchTo();
else
myOldScreen->SwitchTo();
myOldScreen->switchTo();
}
else if (!Config.screens_seq.empty())
{
std::list<BasicScreen *>::const_iterator screen = std::find(Config.screens_seq.begin(), Config.screens_seq.end(), myScreen);
if (screen == Config.screens_seq.begin())
Config.screens_seq.back()->SwitchTo();
Config.screens_seq.back()->switchTo();
else
(*--screen)->SwitchTo();
(*--screen)->switchTo();
}
}
@@ -2299,7 +2299,7 @@ bool ShowHelp::canBeRun() const
void ShowHelp::Run()
{
myHelp->SwitchTo();
myHelp->switchTo();
}
#ifdef HAVE_TAGLIB_H
@@ -2311,7 +2311,7 @@ bool ShowPlaylist::canBeRun() const
void ShowPlaylist::Run()
{
myPlaylist->SwitchTo();
myPlaylist->switchTo();
}
#ifdef HAVE_TAGLIB_H
@@ -2323,7 +2323,7 @@ bool ShowBrowser::canBeRun() const
void ShowBrowser::Run()
{
myBrowser->SwitchTo();
myBrowser->switchTo();
}
#ifdef HAVE_TAGLIB_H
@@ -2335,7 +2335,7 @@ bool ShowSearchEngine::canBeRun() const
void ShowSearchEngine::Run()
{
mySearcher->SwitchTo();
mySearcher->switchTo();
}
#ifdef HAVE_TAGLIB_H
@@ -2347,7 +2347,7 @@ bool ShowMediaLibrary::canBeRun() const
void ShowMediaLibrary::Run()
{
myLibrary->SwitchTo();
myLibrary->switchTo();
}
#ifdef HAVE_TAGLIB_H
@@ -2359,7 +2359,7 @@ bool ShowPlaylistEditor::canBeRun() const
void ShowPlaylistEditor::Run()
{
myPlaylistEditor->SwitchTo();
myPlaylistEditor->switchTo();
}
bool ShowTagEditor::canBeRun() const
@@ -2375,7 +2375,7 @@ void ShowTagEditor::Run()
{
# ifdef HAVE_TAGLIB_H
if (isMPDMusicDirSet())
myTagEditor->SwitchTo();
myTagEditor->switchTo();
# endif // HAVE_TAGLIB_H
}
@@ -2395,7 +2395,7 @@ bool ShowOutputs::canBeRun() const
void ShowOutputs::Run()
{
# ifdef ENABLE_OUTPUTS
myOutputs->SwitchTo();
myOutputs->switchTo();
# endif // ENABLE_OUTPUTS
}
@@ -2415,7 +2415,7 @@ bool ShowVisualizer::canBeRun() const
void ShowVisualizer::Run()
{
# ifdef ENABLE_VISUALIZER
myVisualizer->SwitchTo();
myVisualizer->switchTo();
# endif // ENABLE_VISUALIZER
}
@@ -2435,7 +2435,7 @@ bool ShowClock::canBeRun() const
void ShowClock::Run()
{
# ifdef ENABLE_CLOCK
myClock->SwitchTo();
myClock->switchTo();
# endif // ENABLE_CLOCK
}
@@ -2448,7 +2448,7 @@ bool ShowServerInfo::canBeRun() const
void ShowServerInfo::Run()
{
myServerInfo->SwitchTo();
myServerInfo->switchTo();
}
namespace {//

View File

@@ -61,7 +61,7 @@ bool BrowserEntryMatcher(const Regex &rx, const MPD::Item &item, bool filter);
}
void Browser::Init()
void Browser::init()
{
w = new NC::Menu<MPD::Item>(0, MainStartY, COLS, MainHeight, Config.columns_in_browser && Config.titles_visibility ? Display::Columns(COLS) : "", Config.main_color, NC::brNone);
w->setHighlightColor(Config.main_highlight_color);
@@ -77,17 +77,17 @@ void Browser::Init()
isInitialized = 1;
}
void Browser::Resize()
void Browser::resize()
{
size_t x_offset, width;
GetWindowResizeParams(x_offset, width);
getWindowResizeParams(x_offset, width);
w->resize(width, MainHeight);
w->moveTo(x_offset, MainStartY);
w->setTitle(Config.columns_in_browser && Config.titles_visibility ? Display::Columns(w->getWidth()) : "");
hasToBeResized = 0;
}
void Browser::SwitchTo()
void Browser::switchTo()
{
using Global::myLockedScreen;
using Global::myInactiveScreen;
@@ -100,13 +100,13 @@ void Browser::SwitchTo()
}
if (!isInitialized)
Init();
init();
if (myLockedScreen)
UpdateInactiveScreen(this);
updateInactiveScreen(this);
if (hasToBeResized || myLockedScreen)
Resize();
resize();
if (isLocal() && Config.browser_sort_mode == smMTime) // local browser doesn't support sorting by mtime
Config.browser_sort_mode = smName;
@@ -122,14 +122,14 @@ void Browser::SwitchTo()
drawHeader();
}
std::wstring Browser::Title()
std::wstring Browser::title()
{
std::wstring result = L"Browse: ";
result += Scroller(ToWString(itsBrowsedDir), itsScrollBeginning, COLS-result.length()-(Config.new_design ? 2 : Global::VolumeState.length()));
return result;
}
void Browser::EnterPressed()
void Browser::enterPressed()
{
if (w->empty())
return;
@@ -162,7 +162,7 @@ void Browser::EnterPressed()
}
}
void Browser::SpacePressed()
void Browser::spacePressed()
{
if (w->empty())
return;
@@ -220,7 +220,7 @@ void Browser::SpacePressed()
w->scroll(NC::wDown);
}
void Browser::MouseButtonPressed(MEVENT me)
void Browser::mouseButtonPressed(MEVENT me)
{
if (w->empty() || !w->hasCoords(me.x, me.y) || size_t(me.y) >= w->size())
return;
@@ -238,7 +238,7 @@ void Browser::MouseButtonPressed(MEVENT me)
else
{
size_t pos = w->choice();
SpacePressed();
spacePressed();
if (pos < w->size()-1)
w->scroll(NC::wUp);
}
@@ -248,17 +248,17 @@ void Browser::MouseButtonPressed(MEVENT me)
if (me.bstate & BUTTON1_PRESSED)
{
size_t pos = w->choice();
SpacePressed();
spacePressed();
if (pos < w->size()-1)
w->scroll(NC::wUp);
}
else
EnterPressed();
enterPressed();
break;
}
}
else
Screen< NC::Menu<MPD::Item> >::MouseButtonPressed(me);
Screen< NC::Menu<MPD::Item> >::mouseButtonPressed(me);
}
/***********************************************************************/
@@ -373,7 +373,7 @@ void Browser::LocateSong(const MPD::Song &s)
itsBrowseLocally = !s.isFromDatabase();
if (myScreen != this)
SwitchTo();
switchTo();
if (itsBrowsedDir != s.getDirectory())
GetDirectory(s.getDirectory());

View File

@@ -31,16 +31,16 @@ class Browser : public Screen< NC::Menu<MPD::Item> >, public Filterable, public
Browser() : itsBrowseLocally(0), itsScrollBeginning(0), itsBrowsedDir("/") { }
// Screen< NC::Menu<MPD::Item> > implementation
virtual void Resize() OVERRIDE;
virtual void SwitchTo() OVERRIDE;
virtual void resize() OVERRIDE;
virtual void switchTo() OVERRIDE;
virtual std::wstring Title() OVERRIDE;
virtual std::wstring title() OVERRIDE;
virtual void Update() OVERRIDE { }
virtual void update() OVERRIDE { }
virtual void EnterPressed() OVERRIDE;
virtual void SpacePressed() OVERRIDE;
virtual void MouseButtonPressed(MEVENT me) OVERRIDE;
virtual void enterPressed() OVERRIDE;
virtual void spacePressed() OVERRIDE;
virtual void mouseButtonPressed(MEVENT me) OVERRIDE;
virtual bool isTabbable() OVERRIDE { return true; }
virtual bool isMergable() OVERRIDE { return true; }
@@ -81,7 +81,7 @@ class Browser : public Screen< NC::Menu<MPD::Item> >, public Filterable, public
}
protected:
virtual void Init() OVERRIDE;
virtual void init() OVERRIDE;
virtual bool isLockable() OVERRIDE { return true; }
private:

View File

@@ -52,7 +52,7 @@ long Clock::older[6], Clock::next[6], Clock::newer[6], Clock::mask;
size_t Clock::Width;
const size_t Clock::Height = 8;
void Clock::Init()
void Clock::init()
{
Width = Config.clock_display_seconds ? 60 : 40;
@@ -61,10 +61,10 @@ void Clock::Init()
isInitialized = 1;
}
void Clock::Resize()
void Clock::resize()
{
size_t x_offset, width;
GetWindowResizeParams(x_offset, width);
getWindowResizeParams(x_offset, width);
// used for clearing area out of clock window while resizing terminal
itsPane->resize(width, MainHeight);
@@ -75,7 +75,7 @@ void Clock::Resize()
w->moveTo(x_offset+(width-Width)/2, MainStartY+(MainHeight-Height)/2);
}
void Clock::SwitchTo()
void Clock::switchTo()
{
using Global::myLockedScreen;
@@ -83,23 +83,23 @@ void Clock::SwitchTo()
return;
if (!isInitialized)
Init();
init();
if (myLockedScreen)
UpdateInactiveScreen(this);
updateInactiveScreen(this);
size_t x_offset, width;
GetWindowResizeParams(x_offset, width, false);
getWindowResizeParams(x_offset, width, false);
if (Width > width || Height > MainHeight)
{
Statusbar::msg("Screen is too small to display clock");
if (myLockedScreen)
UpdateInactiveScreen(myLockedScreen);
updateInactiveScreen(myLockedScreen);
return;
}
if (hasToBeResized || myLockedScreen)
Resize();
resize();
if (myScreen != this && myScreen->isTabbable())
Global::myPrevScreen = myScreen;
@@ -112,12 +112,12 @@ void Clock::SwitchTo()
w->display();
}
std::wstring Clock::Title()
std::wstring Clock::title()
{
return L"Clock";
}
void Clock::Update()
void Clock::update()
{
if (Width > itsPane->getWidth() || Height > MainHeight)
{
@@ -128,10 +128,10 @@ void Clock::Update()
{
if (myInactiveScreen != myLockedScreen)
myScreen = myInactiveScreen;
myLockedScreen->SwitchTo();
myLockedScreen->switchTo();
}
else
myPlaylist->SwitchTo();
myPlaylist->switchTo();
}
tm *time = localtime(&Global::Timer.tv_sec);

View File

@@ -31,24 +31,24 @@
class Clock : public Screen<NC::Window>
{
public:
virtual void Resize();
virtual void SwitchTo();
virtual void resize() OVERRIDE;
virtual void switchTo() OVERRIDE;
virtual std::wstring Title();
virtual std::wstring title() OVERRIDE;
virtual void Update();
virtual void Scroll(NC::Where) { }
virtual void update() OVERRIDE;
virtual void scroll(NC::Where) OVERRIDE { }
virtual void EnterPressed() { }
virtual void SpacePressed() { }
virtual void MouseButtonPressed(MEVENT) { }
virtual bool isTabbable() { return true; }
virtual void enterPressed() OVERRIDE { }
virtual void spacePressed() OVERRIDE { }
virtual void mouseButtonPressed(MEVENT) OVERRIDE { }
virtual bool isMergable() { return true; }
virtual bool isTabbable() OVERRIDE { return true; }
virtual bool isMergable() OVERRIDE { return true; }
protected:
virtual void Init();
virtual bool isLockable() { return false; }
virtual void init() OVERRIDE;
virtual bool isLockable() OVERRIDE { return false; }
private:
NC::Window *itsPane;

View File

@@ -95,7 +95,7 @@ std::string keyToString(const Key &key, bool *print_backspace)
}
void Help::Init()
void Help::init()
{
w = new NC::Scrollpad(0, MainStartY, COLS, MainHeight, "", Config.main_color, NC::brNone);
GetKeybindings();
@@ -103,16 +103,16 @@ void Help::Init()
isInitialized = 1;
}
void Help::Resize()
void Help::resize()
{
size_t x_offset, width;
GetWindowResizeParams(x_offset, width);
getWindowResizeParams(x_offset, width);
w->resize(width, MainHeight);
w->moveTo(x_offset, MainStartY);
hasToBeResized = 0;
}
void Help::SwitchTo()
void Help::switchTo()
{
using Global::myScreen;
using Global::myLockedScreen;
@@ -121,13 +121,13 @@ void Help::SwitchTo()
return;
if (!isInitialized)
Init();
init();
if (myLockedScreen)
UpdateInactiveScreen(this);
updateInactiveScreen(this);
if (hasToBeResized || myLockedScreen)
Resize();
resize();
if (myScreen != this && myScreen->isTabbable())
Global::myPrevScreen = myScreen;
@@ -135,7 +135,7 @@ void Help::SwitchTo()
drawHeader();
}
std::wstring Help::Title()
std::wstring Help::title()
{
return L"Help";
}

View File

@@ -27,21 +27,21 @@
class Help : public Screen<NC::Scrollpad>
{
public:
virtual void Resize() OVERRIDE;
virtual void SwitchTo() OVERRIDE;
virtual void resize() OVERRIDE;
virtual void switchTo() OVERRIDE;
virtual std::wstring Title() OVERRIDE;
virtual std::wstring title() OVERRIDE;
virtual void Update() OVERRIDE { }
virtual void update() OVERRIDE { }
virtual void EnterPressed() OVERRIDE { }
virtual void SpacePressed() OVERRIDE { }
virtual void enterPressed() OVERRIDE { }
virtual void spacePressed() OVERRIDE { }
virtual bool isTabbable() OVERRIDE { return true; }
virtual bool isMergable() OVERRIDE { return true; }
protected:
virtual void Init() OVERRIDE;
virtual void init() OVERRIDE;
virtual bool isLockable() OVERRIDE { return true; }
private:

View File

@@ -45,27 +45,27 @@ using Global::MainStartY;
Lastfm *myLastfm = new Lastfm;
void Lastfm::Init()
void Lastfm::init()
{
w = new NC::Scrollpad(0, MainStartY, COLS, MainHeight, "", Config.main_color, NC::brNone);
isInitialized = 1;
}
void Lastfm::Resize()
void Lastfm::resize()
{
size_t x_offset, width;
GetWindowResizeParams(x_offset, width);
getWindowResizeParams(x_offset, width);
w->resize(width, MainHeight);
w->moveTo(x_offset, MainStartY);
hasToBeResized = 0;
}
std::wstring Lastfm::Title()
std::wstring Lastfm::title()
{
return itsTitle;
}
void Lastfm::Update()
void Lastfm::update()
{
if (isReadyToTake)
Take();
@@ -81,23 +81,23 @@ void Lastfm::Take()
isReadyToTake = 0;
}
void Lastfm::SwitchTo()
void Lastfm::switchTo()
{
using Global::myScreen;
using Global::myOldScreen;
using Global::myLockedScreen;
if (myScreen == this)
return myOldScreen->SwitchTo();
return myOldScreen->switchTo();
if (!isInitialized)
Init();
init();
if (myLockedScreen)
UpdateInactiveScreen(this);
updateInactiveScreen(this);
if (hasToBeResized || myLockedScreen)
Resize();
resize();
// get an old info if it waits
if (isReadyToTake)

View File

@@ -37,15 +37,15 @@ class Lastfm : public Screen<NC::Scrollpad>
Lastfm() : isReadyToTake(0), isDownloadInProgress(0) { }
// Screen<NC::Scrollpad>
virtual void SwitchTo() OVERRIDE;
virtual void Resize() OVERRIDE;
virtual void switchTo() OVERRIDE;
virtual void resize() OVERRIDE;
virtual std::wstring Title() OVERRIDE;
virtual std::wstring title() OVERRIDE;
virtual void Update() OVERRIDE;
virtual void update() OVERRIDE;
virtual void EnterPressed() OVERRIDE { }
virtual void SpacePressed() OVERRIDE { }
virtual void enterPressed() OVERRIDE { }
virtual void spacePressed() OVERRIDE { }
virtual bool isMergable() OVERRIDE { return true; }
virtual bool isTabbable() OVERRIDE { return false; }
@@ -57,7 +57,7 @@ class Lastfm : public Screen<NC::Scrollpad>
bool SetArtistInfoArgs(const std::string &artist, const std::string &lang = "");
protected:
virtual void Init() OVERRIDE;
virtual void init() OVERRIDE;
virtual bool isLockable() OVERRIDE { return false; }
private:

View File

@@ -50,22 +50,22 @@ size_t Lyrics::itsWorkersNumber = 0;
Lyrics *myLyrics = new Lyrics;
void Lyrics::Init()
void Lyrics::init()
{
w = new NC::Scrollpad(0, MainStartY, COLS, MainHeight, "", Config.main_color, NC::brNone);
isInitialized = 1;
}
void Lyrics::Resize()
void Lyrics::resize()
{
size_t x_offset, width;
GetWindowResizeParams(x_offset, width);
getWindowResizeParams(x_offset, width);
w->resize(width, MainHeight);
w->moveTo(x_offset, MainStartY);
hasToBeResized = 0;
}
void Lyrics::Update()
void Lyrics::update()
{
# ifdef HAVE_CURL_CURL_H
if (isReadyToTake)
@@ -91,19 +91,19 @@ void Lyrics::Update()
}
}
void Lyrics::SwitchTo()
void Lyrics::switchTo()
{
using Global::myLockedScreen;
using Global::myInactiveScreen;
if (myScreen == this)
return myOldScreen->SwitchTo();
return myOldScreen->switchTo();
if (!isInitialized)
Init();
init();
if (hasToBeResized)
Resize();
resize();
itsScrollBegin = 0;
@@ -144,19 +144,19 @@ void Lyrics::SwitchTo()
// to adjust screen size then.
if (myLockedScreen) // BUG
{
UpdateInactiveScreen(this);
Resize();
updateInactiveScreen(this);
resize();
}
}
std::wstring Lyrics::Title()
std::wstring Lyrics::title()
{
std::wstring result = L"Lyrics: ";
result += Scroller(ToWString(itsSong.toString("{%a - %t}", ", ")), itsScrollBegin, COLS-result.length()-(Config.new_design ? 2 : Global::VolumeState.length()));
return result;
}
void Lyrics::SpacePressed()
void Lyrics::spacePressed()
{
Config.now_playing_lyrics = !Config.now_playing_lyrics;
Statusbar::msg("Reload lyrics if song changes: %s", Config.now_playing_lyrics ? "On" : "Off");

View File

@@ -38,15 +38,15 @@ class Lyrics : public Screen<NC::Scrollpad>
itsScrollBegin(0) { }
// Screen<NC::Scrollpad> implementation
virtual void Resize() OVERRIDE;
virtual void SwitchTo() OVERRIDE;
virtual void resize() OVERRIDE;
virtual void switchTo() OVERRIDE;
virtual std::wstring Title() OVERRIDE;
virtual std::wstring title() OVERRIDE;
virtual void Update() OVERRIDE;
virtual void update() OVERRIDE;
virtual void EnterPressed() OVERRIDE { }
virtual void SpacePressed() OVERRIDE;
virtual void enterPressed() OVERRIDE { }
virtual void spacePressed() OVERRIDE;
virtual bool isMergable() OVERRIDE { return true; }
virtual bool isTabbable() OVERRIDE { return false; }
@@ -64,7 +64,7 @@ class Lyrics : public Screen<NC::Scrollpad>
bool ReloadNP;
protected:
virtual void Init() OVERRIDE;
virtual void init() OVERRIDE;
virtual bool isLockable() OVERRIDE { return false; }
private:

View File

@@ -112,7 +112,7 @@ public:
}
void MediaLibrary::Init()
void MediaLibrary::init()
{
hasTwoColumns = 0;
itsLeftColWidth = COLS/3-1;
@@ -149,10 +149,10 @@ void MediaLibrary::Init()
isInitialized = 1;
}
void MediaLibrary::Resize()
void MediaLibrary::resize()
{
size_t x_offset, width;
GetWindowResizeParams(x_offset, width);
getWindowResizeParams(x_offset, width);
if (!hasTwoColumns)
{
itsLeftColStartX = x_offset;
@@ -181,7 +181,7 @@ void MediaLibrary::Resize()
hasToBeResized = 0;
}
void MediaLibrary::Refresh()
void MediaLibrary::refresh()
{
Tags->display();
mvvline(MainStartY, itsMiddleColStartX-1, 0, MainHeight);
@@ -195,7 +195,7 @@ void MediaLibrary::Refresh()
}
}
void MediaLibrary::SwitchTo()
void MediaLibrary::switchTo()
{
using Global::myLockedScreen;
@@ -229,28 +229,28 @@ void MediaLibrary::SwitchTo()
}
if (!isInitialized)
Init();
init();
if (myLockedScreen)
UpdateInactiveScreen(this);
updateInactiveScreen(this);
if (hasToBeResized || myLockedScreen)
Resize();
resize();
if (myScreen != this && myScreen->isTabbable())
Global::myPrevScreen = myScreen;
myScreen = this;
drawHeader();
markSongsInPlaylist(songsProxyList());
Refresh();
refresh();
}
std::wstring MediaLibrary::Title()
std::wstring MediaLibrary::title()
{
return L"Media library";
}
void MediaLibrary::Update()
void MediaLibrary::update()
{
if (!hasTwoColumns && Tags->reallyEmpty())
{
@@ -372,12 +372,12 @@ void MediaLibrary::Update()
}
}
void MediaLibrary::EnterPressed()
void MediaLibrary::enterPressed()
{
AddToPlaylist(true);
}
void MediaLibrary::SpacePressed()
void MediaLibrary::spacePressed()
{
if (Config.space_selects)
{
@@ -408,7 +408,7 @@ void MediaLibrary::SpacePressed()
AddToPlaylist(0);
}
void MediaLibrary::MouseButtonPressed(MEVENT me)
void MediaLibrary::mouseButtonPressed(MEVENT me)
{
auto tryNextColumn = [this]() -> bool {
bool result = true;
@@ -442,13 +442,13 @@ void MediaLibrary::MouseButtonPressed(MEVENT me)
if (me.bstate & BUTTON3_PRESSED)
{
size_t pos = Tags->choice();
SpacePressed();
spacePressed();
if (pos < Tags->size()-1)
Tags->scroll(NC::wUp);
}
}
else
Screen<NC::Window>::MouseButtonPressed(me);
Screen<NC::Window>::mouseButtonPressed(me);
Albums->clear();
Songs->clear();
}
@@ -470,13 +470,13 @@ void MediaLibrary::MouseButtonPressed(MEVENT me)
if (me.bstate & BUTTON3_PRESSED)
{
size_t pos = Albums->choice();
SpacePressed();
spacePressed();
if (pos < Albums->size()-1)
Albums->scroll(NC::wUp);
}
}
else
Screen<NC::Window>::MouseButtonPressed(me);
Screen<NC::Window>::mouseButtonPressed(me);
Songs->clear();
}
else if (!Songs->empty() && Songs->hasCoords(me.x, me.y))
@@ -489,15 +489,15 @@ void MediaLibrary::MouseButtonPressed(MEVENT me)
if (me.bstate & BUTTON1_PRESSED)
{
size_t pos = Songs->choice();
SpacePressed();
spacePressed();
if (pos < Songs->size()-1)
Songs->scroll(NC::wUp);
}
else
EnterPressed();
enterPressed();
}
else
Screen<NC::Window>::MouseButtonPressed(me);
Screen<NC::Window>::mouseButtonPressed(me);
}
}
@@ -800,7 +800,7 @@ void MediaLibrary::LocateSong(const MPD::Song &s)
}
if (myScreen != this)
SwitchTo();
switchTo();
Statusbar::put() << "Jumping to song...";
Global::wFooter->refresh();
@@ -808,7 +808,7 @@ void MediaLibrary::LocateSong(const MPD::Song &s)
{
Tags->showAll();
if (Tags->empty())
Update();
update();
if (primary_tag != Tags->current().value())
{
for (size_t i = 0; i < Tags->size(); ++i)
@@ -826,7 +826,7 @@ void MediaLibrary::LocateSong(const MPD::Song &s)
Albums->showAll();
if (Albums->empty())
Update();
update();
std::string album = s.getAlbum();
std::string date = s.getDate();
@@ -849,7 +849,7 @@ void MediaLibrary::LocateSong(const MPD::Song &s)
Songs->showAll();
if (Songs->empty())
Update();
update();
if (s.getHash() != Songs->current().value().getHash())
{
@@ -867,7 +867,7 @@ void MediaLibrary::LocateSong(const MPD::Song &s)
Albums->setHighlightColor(Config.main_highlight_color);
Songs->setHighlightColor(Config.active_column_color);
w = Songs;
Refresh();
refresh();
}
void MediaLibrary::AddToPlaylist(bool add_n_play)

View File

@@ -27,17 +27,17 @@
class MediaLibrary : public Screen<NC::Window>, public Filterable, public HasColumns, public HasSongs, public Searchable
{
public:
virtual void SwitchTo() OVERRIDE;
virtual void Resize() OVERRIDE;
virtual void switchTo() OVERRIDE;
virtual void resize() OVERRIDE;
virtual std::wstring Title() OVERRIDE;
virtual std::wstring title() OVERRIDE;
virtual void Refresh() OVERRIDE;
virtual void Update() OVERRIDE;
virtual void refresh() OVERRIDE;
virtual void update() OVERRIDE;
virtual void EnterPressed() OVERRIDE;
virtual void SpacePressed() OVERRIDE;
virtual void MouseButtonPressed(MEVENT me) OVERRIDE;
virtual void enterPressed() OVERRIDE;
virtual void spacePressed() OVERRIDE;
virtual void mouseButtonPressed(MEVENT me) OVERRIDE;
virtual bool isTabbable() OVERRIDE { return true; }
virtual bool isMergable() OVERRIDE { return true; }
@@ -90,7 +90,7 @@ class MediaLibrary : public Screen<NC::Window>, public Filterable, public HasCol
NC::Menu<MPD::Song> *Songs;
protected:
virtual void Init();
virtual void init();
virtual bool isLockable() { return true; }
private:

View File

@@ -282,12 +282,12 @@ public:
void showFiltered() { m_options_ptr = &m_filtered_options; }
/// Refreshes the menu window
/// @see Window::Refresh()
/// @see Window::refresh()
virtual void refresh() OVERRIDE;
/// Scrolls by given amount of lines
/// @param where indicated where exactly one wants to go
/// @see Window::Scroll()
/// @see Window::scroll()
virtual void scroll(Where where) OVERRIDE;
/// Cleares all options, used filters etc. It doesn't reset highlighted position though.
@@ -341,8 +341,8 @@ public:
size_t size() const { return m_options_ptr->size(); }
/// @return currently drawn item. The result is defined only within
/// drawing function that is called by Refresh()
/// @see Refresh()
/// drawing function that is called by refresh()
/// @see refresh()
ConstIterator drawn() const { return begin() + m_drawn_position; }
/// @return reference to last item on the list

View File

@@ -173,12 +173,12 @@ int main(int argc, char **argv)
gettimeofday(&Timer, 0);
// go to playlist
myPlaylist->SwitchTo();
myPlaylist->switchTo();
myPlaylist->UpdateTimer();
// go to startup screen
if (Config.startup_screen != myScreen)
Config.startup_screen->SwitchTo();
Config.startup_screen->switchTo();
Mpd.SetStatusUpdater(Status::update, 0);
Mpd.SetErrorHandler(Status::handleError, 0);
@@ -247,7 +247,7 @@ int main(int argc, char **argv)
// header stuff end
if (input != Key::noOp)
myScreen->RefreshWindow();
myScreen->refreshWindow();
input = Key::read(*wFooter);
if (input == Key::noOp)

View File

@@ -35,7 +35,7 @@ using Global::myScreen;
Outputs *myOutputs = new Outputs;
void Outputs::Init()
void Outputs::init()
{
w = new NC::Menu<MPD::Output>(0, MainStartY, COLS, MainHeight, "", Config.main_color, NC::brNone);
w->cyclicScrolling(Config.use_cyclic_scrolling);
@@ -47,7 +47,7 @@ void Outputs::Init()
FetchList();
}
void Outputs::SwitchTo()
void Outputs::switchTo()
{
using Global::myLockedScreen;
@@ -55,13 +55,13 @@ void Outputs::SwitchTo()
return;
if (!isInitialized)
Init();
init();
if (myLockedScreen)
UpdateInactiveScreen(this);
updateInactiveScreen(this);
if (hasToBeResized || myLockedScreen)
Resize();
resize();
if (myScreen != this && myScreen->isTabbable())
Global::myPrevScreen = myScreen;
@@ -70,21 +70,21 @@ void Outputs::SwitchTo()
drawHeader();
}
void Outputs::Resize()
void Outputs::resize()
{
size_t x_offset, width;
GetWindowResizeParams(x_offset, width);
getWindowResizeParams(x_offset, width);
w->resize(width, MainHeight);
w->moveTo(x_offset, MainStartY);
hasToBeResized = 0;
}
std::wstring Outputs::Title()
std::wstring Outputs::title()
{
return L"Outputs";
}
void Outputs::EnterPressed()
void Outputs::enterPressed()
{
if (w->current().value().isEnabled())
{
@@ -100,7 +100,7 @@ void Outputs::EnterPressed()
FetchList();
}
void Outputs::MouseButtonPressed(MEVENT me)
void Outputs::mouseButtonPressed(MEVENT me)
{
if (w->empty() || !w->hasCoords(me.x, me.y) || size_t(me.y) >= w->size())
return;
@@ -108,10 +108,10 @@ void Outputs::MouseButtonPressed(MEVENT me)
{
w->Goto(me.y);
if (me.bstate & BUTTON3_PRESSED)
EnterPressed();
enterPressed();
}
else
Screen< NC::Menu<MPD::Output> >::MouseButtonPressed(me);
Screen< NC::Menu<MPD::Output> >::mouseButtonPressed(me);
}
void Outputs::FetchList()

View File

@@ -34,16 +34,16 @@ class Outputs : public Screen< NC::Menu<MPD::Output> >
public:
// Screen< NC::Menu<MPD::Output> > implementation
virtual void SwitchTo() OVERRIDE;
virtual void Resize() OVERRIDE;
virtual void switchTo() OVERRIDE;
virtual void resize() OVERRIDE;
virtual std::wstring Title() OVERRIDE;
virtual std::wstring title() OVERRIDE;
virtual void Update() OVERRIDE { }
virtual void update() OVERRIDE { }
virtual void EnterPressed() OVERRIDE;
virtual void SpacePressed() OVERRIDE { }
virtual void MouseButtonPressed(MEVENT me) OVERRIDE;
virtual void enterPressed() OVERRIDE;
virtual void spacePressed() OVERRIDE { }
virtual void mouseButtonPressed(MEVENT me) OVERRIDE;
virtual bool isTabbable() OVERRIDE { return true; }
virtual bool isMergable() OVERRIDE { return true; }
@@ -52,7 +52,7 @@ class Outputs : public Screen< NC::Menu<MPD::Output> >
void FetchList();
protected:
virtual void Init() OVERRIDE;
virtual void init() OVERRIDE;
virtual bool isLockable() OVERRIDE { return true; }
};

View File

@@ -56,7 +56,7 @@ bool playlistEntryMatcher(const Regex &rx, const MPD::Song &s);
}
void Playlist::Init()
void Playlist::init()
{
Items = new NC::Menu<MPD::Song>(0, MainStartY, COLS, MainHeight, Config.columns_in_playlist && Config.titles_visibility ? Display::Columns(COLS) : "", Config.main_color, NC::brNone);
Items->cyclicScrolling(Config.use_cyclic_scrolling);
@@ -97,7 +97,7 @@ void Playlist::Init()
isInitialized = 1;
}
void Playlist::SwitchTo()
void Playlist::switchTo()
{
using Global::myScreen;
using Global::myLockedScreen;
@@ -107,15 +107,15 @@ void Playlist::SwitchTo()
return;
if (!isInitialized)
Init();
init();
itsScrollBegin = 0;
if (myLockedScreen)
UpdateInactiveScreen(this);
updateInactiveScreen(this);
if (hasToBeResized || myLockedScreen)
Resize();
resize();
if (myScreen != this && myScreen->isTabbable())
Global::myPrevScreen = myScreen;
@@ -126,10 +126,10 @@ void Playlist::SwitchTo()
drawHeader();
}
void Playlist::Resize()
void Playlist::resize()
{
size_t x_offset, width;
GetWindowResizeParams(x_offset, width);
getWindowResizeParams(x_offset, width);
Items->resize(width, MainHeight);
Items->moveTo(x_offset, MainStartY);
@@ -149,7 +149,7 @@ void Playlist::Resize()
hasToBeResized = 0;
}
std::wstring Playlist::Title()
std::wstring Playlist::title()
{
std::wstring result = L"Playlist ";
if (ReloadTotalLength || ReloadRemaining)
@@ -158,7 +158,7 @@ std::wstring Playlist::Title()
return result;
}
void Playlist::EnterPressed()
void Playlist::enterPressed()
{
if (w == Items)
{
@@ -238,7 +238,7 @@ void Playlist::EnterPressed()
}
}
void Playlist::SpacePressed()
void Playlist::spacePressed()
{
if (w == Items && !Items->empty())
{
@@ -247,7 +247,7 @@ void Playlist::SpacePressed()
}
}
void Playlist::MouseButtonPressed(MEVENT me)
void Playlist::mouseButtonPressed(MEVENT me)
{
if (w == Items && !Items->empty() && Items->hasCoords(me.x, me.y))
{
@@ -255,10 +255,10 @@ void Playlist::MouseButtonPressed(MEVENT me)
{
Items->Goto(me.y);
if (me.bstate & BUTTON3_PRESSED)
EnterPressed();
enterPressed();
}
else
Screen<NC::Window>::MouseButtonPressed(me);
Screen<NC::Window>::mouseButtonPressed(me);
}
else if (w == SortDialog && SortDialog->hasCoords(me.x, me.y))
{
@@ -266,10 +266,10 @@ void Playlist::MouseButtonPressed(MEVENT me)
{
SortDialog->Goto(me.y);
if (me.bstate & BUTTON3_PRESSED)
EnterPressed();
enterPressed();
}
else
Screen<NC::Window>::MouseButtonPressed(me);
Screen<NC::Window>::mouseButtonPressed(me);
}
}

View File

@@ -34,16 +34,16 @@ class Playlist : public Screen<NC::Window>, public Filterable, public HasSongs,
~Playlist() { }
// Screen<NC::Window> implementation
virtual void SwitchTo() OVERRIDE;
virtual void Resize() OVERRIDE;
virtual void switchTo() OVERRIDE;
virtual void resize() OVERRIDE;
virtual std::wstring Title() OVERRIDE;
virtual std::wstring title() OVERRIDE;
virtual void Update() OVERRIDE { }
virtual void update() OVERRIDE { }
virtual void EnterPressed() OVERRIDE;
virtual void SpacePressed() OVERRIDE;
virtual void MouseButtonPressed(MEVENT me) OVERRIDE;
virtual void enterPressed() OVERRIDE;
virtual void spacePressed() OVERRIDE;
virtual void mouseButtonPressed(MEVENT me) OVERRIDE;
virtual bool isTabbable() OVERRIDE { return true; }
virtual bool isMergable() OVERRIDE { return true; }
@@ -99,7 +99,7 @@ class Playlist : public Screen<NC::Window>, public Filterable, public HasSongs,
static bool ReloadRemaining;
protected:
virtual void Init() OVERRIDE;
virtual void init() OVERRIDE;
virtual bool isLockable() OVERRIDE { return true; }
private:

View File

@@ -55,7 +55,7 @@ bool SongEntryMatcher(const Regex &rx, const MPD::Song &s);
}
void PlaylistEditor::Init()
void PlaylistEditor::init()
{
LeftColumnWidth = COLS/3-1;
RightColumnStartX = LeftColumnWidth+1;
@@ -84,10 +84,10 @@ void PlaylistEditor::Init()
isInitialized = 1;
}
void PlaylistEditor::Resize()
void PlaylistEditor::resize()
{
size_t x_offset, width;
GetWindowResizeParams(x_offset, width);
getWindowResizeParams(x_offset, width);
LeftColumnStartX = x_offset;
LeftColumnWidth = width/3-1;
@@ -103,19 +103,19 @@ void PlaylistEditor::Resize()
hasToBeResized = 0;
}
std::wstring PlaylistEditor::Title()
std::wstring PlaylistEditor::title()
{
return L"Playlist editor";
}
void PlaylistEditor::Refresh()
void PlaylistEditor::refresh()
{
Playlists->display();
mvvline(MainStartY, RightColumnStartX-1, 0, MainHeight);
Content->display();
}
void PlaylistEditor::SwitchTo()
void PlaylistEditor::switchTo()
{
using Global::myScreen;
using Global::myLockedScreen;
@@ -124,23 +124,23 @@ void PlaylistEditor::SwitchTo()
return;
if (!isInitialized)
Init();
init();
if (myLockedScreen)
UpdateInactiveScreen(this);
updateInactiveScreen(this);
if (hasToBeResized || myLockedScreen)
Resize();
resize();
if (myScreen != this && myScreen->isTabbable())
Global::myPrevScreen = myScreen;
myScreen = this;
drawHeader();
markSongsInPlaylist(contentProxyList());
Refresh();
refresh();
}
void PlaylistEditor::Update()
void PlaylistEditor::update()
{
if (Playlists->reallyEmpty() || playlistsUpdateRequested)
{
@@ -246,12 +246,12 @@ void PlaylistEditor::AddToPlaylist(bool add_n_play)
w->scroll(NC::wDown);
}
void PlaylistEditor::EnterPressed()
void PlaylistEditor::enterPressed()
{
AddToPlaylist(true);
}
void PlaylistEditor::SpacePressed()
void PlaylistEditor::spacePressed()
{
if (Config.space_selects)
{
@@ -276,7 +276,7 @@ void PlaylistEditor::SpacePressed()
AddToPlaylist(false);
}
void PlaylistEditor::MouseButtonPressed(MEVENT me)
void PlaylistEditor::mouseButtonPressed(MEVENT me)
{
if (!Playlists->empty() && Playlists->hasCoords(me.x, me.y))
{
@@ -293,13 +293,13 @@ void PlaylistEditor::MouseButtonPressed(MEVENT me)
if (me.bstate & BUTTON3_PRESSED)
{
size_t pos = Playlists->choice();
SpacePressed();
spacePressed();
if (pos < Playlists->size()-1)
Playlists->scroll(NC::wUp);
}
}
else
Screen<NC::Window>::MouseButtonPressed(me);
Screen<NC::Window>::mouseButtonPressed(me);
Content->clear();
}
else if (!Content->empty() && Content->hasCoords(me.x, me.y))
@@ -317,15 +317,15 @@ void PlaylistEditor::MouseButtonPressed(MEVENT me)
if (me.bstate & BUTTON1_PRESSED)
{
size_t pos = Content->choice();
SpacePressed();
spacePressed();
if (pos < Content->size()-1)
Content->scroll(NC::wUp);
}
else
EnterPressed();
enterPressed();
}
else
Screen<NC::Window>::MouseButtonPressed(me);
Screen<NC::Window>::mouseButtonPressed(me);
}
}
@@ -510,8 +510,8 @@ void PlaylistEditor::nextColumn()
void PlaylistEditor::Locate(const std::string &name)
{
if (!isInitialized)
Init();
Update();
init();
update();
for (size_t i = 0; i < Playlists->size(); ++i)
{
if (name == (*Playlists)[i].value())
@@ -521,7 +521,7 @@ void PlaylistEditor::Locate(const std::string &name)
break;
}
}
SwitchTo();
switchTo();
}
namespace {//

View File

@@ -27,17 +27,17 @@
class PlaylistEditor : public Screen<NC::Window>, public Filterable, public HasColumns, public HasSongs, public Searchable
{
public:
virtual void SwitchTo() OVERRIDE;
virtual void Resize() OVERRIDE;
virtual void switchTo() OVERRIDE;
virtual void resize() OVERRIDE;
virtual std::wstring Title() OVERRIDE;
virtual std::wstring title() OVERRIDE;
virtual void Refresh() OVERRIDE;
virtual void Update() OVERRIDE;
virtual void refresh() OVERRIDE;
virtual void update() OVERRIDE;
virtual void EnterPressed() OVERRIDE;
virtual void SpacePressed() OVERRIDE;
virtual void MouseButtonPressed(MEVENT me) OVERRIDE;
virtual void enterPressed() OVERRIDE;
virtual void spacePressed() OVERRIDE;
virtual void mouseButtonPressed(MEVENT me) OVERRIDE;
virtual bool isTabbable() OVERRIDE { return true; }
virtual bool isMergable() OVERRIDE { return true; }
@@ -79,7 +79,7 @@ class PlaylistEditor : public Screen<NC::Window>, public Filterable, public HasC
NC::Menu<MPD::Song> *Content;
protected:
virtual void Init() OVERRIDE;
virtual void init() OVERRIDE;
virtual bool isLockable() OVERRIDE { return true; }
private:

View File

@@ -30,7 +30,7 @@ using Global::myInactiveScreen;
namespace {//
void DrawScreenSeparator(int x)
void drawScreenSeparator(int x)
{
attron(COLOR_PAIR(Config.main_color));
mvvline(Global::MainStartY, x, 0, Global::MainHeight);
@@ -40,7 +40,7 @@ void DrawScreenSeparator(int x)
}
void GenericMouseButtonPressed(NC::Window *w, MEVENT me)
void genericMouseButtonPressed(NC::Window *w, MEVENT me)
{
if (me.bstate & BUTTON2_PRESSED)
{
@@ -60,7 +60,7 @@ void GenericMouseButtonPressed(NC::Window *w, MEVENT me)
}
}
void ScrollpadMouseButtonPressed(NC::Scrollpad *w, MEVENT me)
void scrollpadMouseButtonPressed(NC::Scrollpad *w, MEVENT me)
{
if (me.bstate & BUTTON2_PRESSED)
{
@@ -76,7 +76,7 @@ void ScrollpadMouseButtonPressed(NC::Scrollpad *w, MEVENT me)
/***********************************************************************/
void BasicScreen::GetWindowResizeParams(size_t &x_offset, size_t &width, bool adjust_locked_screen)
void BasicScreen::getWindowResizeParams(size_t &x_offset, size_t &width, bool adjust_locked_screen)
{
width = COLS;
x_offset = 0;
@@ -92,15 +92,15 @@ void BasicScreen::GetWindowResizeParams(size_t &x_offset, size_t &width, bool ad
if (adjust_locked_screen)
{
myLockedScreen->Resize();
myLockedScreen->Refresh();
DrawScreenSeparator(x_offset-1);
myLockedScreen->resize();
myLockedScreen->refresh();
drawScreenSeparator(x_offset-1);
}
}
}
}
bool BasicScreen::Lock()
bool BasicScreen::lock()
{
if (myLockedScreen)
return false;
@@ -113,18 +113,18 @@ bool BasicScreen::Lock()
return false;
}
void BasicScreen::Unlock()
void BasicScreen::unlock()
{
if (myInactiveScreen && myInactiveScreen != myLockedScreen)
myScreen = myInactiveScreen;
myLockedScreen->SwitchTo();
myLockedScreen->switchTo();
myLockedScreen = 0;
myInactiveScreen = 0;
}
/***********************************************************************/
void ApplyToVisibleWindows(void (BasicScreen::*f)())
void applyToVisibleWindows(void (BasicScreen::*f)())
{
if (myLockedScreen && myScreen->isMergable())
{
@@ -139,7 +139,7 @@ void ApplyToVisibleWindows(void (BasicScreen::*f)())
(myScreen->*f)();
}
void UpdateInactiveScreen(BasicScreen *screen_to_be_set)
void updateInactiveScreen(BasicScreen *screen_to_be_set)
{
if (myInactiveScreen && myLockedScreen != myInactiveScreen && myLockedScreen == screen_to_be_set)
{
@@ -151,8 +151,8 @@ void UpdateInactiveScreen(BasicScreen *screen_to_be_set)
// in such case we want to keep slave screen visible, so we never set it to null
// as in "else" case. we also need to refresh it and redraw separator between
// them as stacked screen probably has overwritten part ot it.
myInactiveScreen->Refresh();
DrawScreenSeparator(COLS*Config.locked_screen_width_part);
myInactiveScreen->refresh();
drawScreenSeparator(COLS*Config.locked_screen_width_part);
}
else
{

View File

@@ -24,8 +24,8 @@
#include "menu.h"
#include "scrollpad.h"
void GenericMouseButtonPressed(NC::Window *w, MEVENT me);
void ScrollpadMouseButtonPressed(NC::Scrollpad *w, MEVENT me);
void genericMouseButtonPressed(NC::Window *w, MEVENT me);
void scrollpadMouseButtonPressed(NC::Scrollpad *w, MEVENT me);
/// An interface for various instantiations of Screen template class. Since C++ doesn't like
/// comparison of two different instantiations of the same template class we need the most
@@ -38,40 +38,40 @@ class BasicScreen
virtual ~BasicScreen() { }
/// @see Screen::ActiveWindow()
virtual NC::Window *ActiveWindow() = 0;
/// @see Screen::activeWindow()
virtual NC::Window *activeWindow() = 0;
/// @see Screen::Refresh()
virtual void Refresh() = 0;
/// @see Screen::refresh()
virtual void refresh() = 0;
/// @see Screen::RefreshWindow()
virtual void RefreshWindow() = 0;
/// @see Screen::refreshWindow()
virtual void refreshWindow() = 0;
/// @see Screen::Scroll()
virtual void Scroll(NC::Where where) = 0;
/// @see Screen::scroll()
virtual void scroll(NC::Where where) = 0;
/// Method used for switching to screen
virtual void SwitchTo() = 0;
virtual void switchTo() = 0;
/// Method that should resize screen
/// if requested by hasToBeResized
virtual void Resize() = 0;
virtual void resize() = 0;
/// @return title of the screen
virtual std::wstring Title() = 0;
virtual std::wstring title() = 0;
/// If the screen contantly has to update itself
/// somehow, it should be called by this function.
virtual void Update() = 0;
virtual void update() = 0;
/// Invoked after Enter was pressed
virtual void EnterPressed() = 0;
virtual void enterPressed() = 0;
/// Invoked after Space was pressed
virtual void SpacePressed() = 0;
virtual void spacePressed() = 0;
/// @see Screen::MouseButtonPressed()
virtual void MouseButtonPressed(MEVENT me) = 0;
/// @see Screen::mouseButtonPressed()
virtual void mouseButtonPressed(MEVENT me) = 0;
/// When this is overwritten with a function returning true, the
/// screen will be used in tab switching.
@@ -85,20 +85,20 @@ class BasicScreen
/// Locks current screen.
/// @return true if lock was successful, false otherwise. Note that
/// if there is already locked screen, it'll not overwrite it.
bool Lock();
bool lock();
/// Should be set to true each time screen needs resize
bool hasToBeResized;
/// Unlocks a screen, ie. hides merged window (if there is one set).
static void Unlock();
static void unlock();
protected:
/// Since screens initialization is lazy, we don't want to do
/// this in the constructor. This function should be invoked
/// only once and after that isInitialized flag has to be set
/// to true to somehow avoid next attempt of initialization.
virtual void Init() = 0;
virtual void init() = 0;
/// @return true if screen can be locked. Note that returning
/// false here doesn't neccesarily mean that screen is also not
@@ -106,25 +106,25 @@ class BasicScreen
/// make much sense, but it's perfectly fine to merge it).
virtual bool isLockable() = 0;
/// Gets X offset and width of current screen to be used eg. in Resize() function.
/// Gets X offset and width of current screen to be used eg. in resize() function.
/// @param adjust_locked_screen indicates whether this function should
/// automatically adjust locked screen's dimensions (if there is one set)
/// if current screen is going to be subwindow.
void GetWindowResizeParams(size_t &x_offset, size_t &width, bool adjust_locked_screen = true);
void getWindowResizeParams(size_t &x_offset, size_t &width, bool adjust_locked_screen = true);
/// Flag that inditates whether the screen is initialized or not
bool isInitialized;
};
void ApplyToVisibleWindows(void (BasicScreen::*f)());
void UpdateInactiveScreen(BasicScreen *screen_to_be_set);
void applyToVisibleWindows(void (BasicScreen::*f)());
void updateInactiveScreen(BasicScreen *screen_to_be_set);
bool isVisible(BasicScreen *screen);
/// Class that all screens should derive from. It provides basic interface
/// for the screen to be working properly and assumes that we didn't forget
/// about anything vital.
///
template <typename WindowType> class Screen : public BasicScreen
template <typename WindowT> class Screen : public BasicScreen
{
public:
Screen() : w(0) { }
@@ -134,17 +134,17 @@ template <typename WindowType> class Screen : public BasicScreen
/// it's useful to determine the one that is being
/// active
/// @return address to window object cast to void *
virtual NC::Window *ActiveWindow() OVERRIDE {
virtual NC::Window *activeWindow() OVERRIDE {
return w;
}
/// Refreshes whole screen
virtual void Refresh() OVERRIDE {
virtual void refresh() OVERRIDE {
w->display();
}
/// Refreshes active window of the screen
virtual void RefreshWindow() OVERRIDE {
virtual void refreshWindow() OVERRIDE {
w->display();
}
@@ -152,19 +152,19 @@ template <typename WindowType> class Screen : public BasicScreen
/// if fancy scrolling feature is disabled, enters the
/// loop that holds main loop until user releases the key
/// @param where indicates where one wants to scroll
virtual void Scroll(NC::Where where) OVERRIDE {
virtual void scroll(NC::Where where) OVERRIDE {
w->scroll(where);
}
/// Invoked after there was one of mouse buttons pressed
/// @param me struct that contains coords of where the click
/// had its place and button actions
virtual void MouseButtonPressed(MEVENT me) OVERRIDE {
GenericMouseButtonPressed(w, me);
virtual void mouseButtonPressed(MEVENT me) OVERRIDE {
genericMouseButtonPressed(w, me);
}
/// @return pointer to currently active window
WindowType *Main() {
WindowT *main() {
return w;
}
@@ -173,15 +173,14 @@ template <typename WindowType> class Screen : public BasicScreen
/// of window used by the screen. What is more, it should
/// always be assigned to the currently active window (if
/// acreen contains more that one)
WindowType *w;
WindowT *w;
};
/// Specialization for Screen<Scrollpad>::MouseButtonPressed, that should
/// Specialization for Screen<Scrollpad>::mouseButtonPressed, that should
/// not scroll whole page, but rather a few lines (the number of them is
/// defined in the config)
template <> inline void Screen<NC::Scrollpad>::MouseButtonPressed(MEVENT me)
{
ScrollpadMouseButtonPressed(w, me);
template <> inline void Screen<NC::Scrollpad>::mouseButtonPressed(MEVENT me) {
scrollpadMouseButtonPressed(w, me);
}
#endif

View File

@@ -73,20 +73,20 @@ struct Scrollpad: public Window
const std::wstring &content() { return m_buffer.str(); }
/// Refreshes the window
/// @see Window::Refresh()
/// @see Window::refresh()
///
virtual void refresh() OVERRIDE;
/// Scrolls by given amount of lines
/// @param where indicates where exactly one wants to go
/// @see Window::Scroll()
/// @see Window::scroll()
///
virtual void scroll(Where where) OVERRIDE;
/// Resizes the window
/// @param new_width new window's width
/// @param new_height new window's height
/// @see Window::Resize()
/// @see Window::resize()
///
virtual void resize(size_t new_width, size_t new_height) OVERRIDE;

View File

@@ -101,7 +101,7 @@ size_t SearchEngine::StaticOptions = 20;
size_t SearchEngine::ResetButton = 16;
size_t SearchEngine::SearchButton = 15;
void SearchEngine::Init()
void SearchEngine::init()
{
w = new NC::Menu<SEItem>(0, MainStartY, COLS, MainHeight, "", Config.main_color, NC::brNone);
w->setHighlightColor(Config.main_highlight_color);
@@ -114,17 +114,17 @@ void SearchEngine::Init()
isInitialized = 1;
}
void SearchEngine::Resize()
void SearchEngine::resize()
{
size_t x_offset, width;
GetWindowResizeParams(x_offset, width);
getWindowResizeParams(x_offset, width);
w->resize(width, MainHeight);
w->moveTo(x_offset, MainStartY);
w->setTitle(Config.columns_in_search_engine && Config.titles_visibility ? Display::Columns(w->getWidth()) : "");
hasToBeResized = 0;
}
void SearchEngine::SwitchTo()
void SearchEngine::switchTo()
{
using Global::myScreen;
using Global::myLockedScreen;
@@ -136,13 +136,13 @@ void SearchEngine::SwitchTo()
}
if (!isInitialized)
Init();
init();
if (myLockedScreen)
UpdateInactiveScreen(this);
updateInactiveScreen(this);
if (hasToBeResized || myLockedScreen)
Resize();
resize();
if (w->empty())
Prepare();
@@ -154,12 +154,12 @@ void SearchEngine::SwitchTo()
markSongsInPlaylist(getProxySongList());
}
std::wstring SearchEngine::Title()
std::wstring SearchEngine::title()
{
return L"Search engine";
}
void SearchEngine::EnterPressed()
void SearchEngine::enterPressed()
{
size_t option = w->choice();
if (option > ConstraintsNumber && option < SearchButton)
@@ -227,7 +227,7 @@ void SearchEngine::EnterPressed()
Statusbar::unlock();
}
void SearchEngine::SpacePressed()
void SearchEngine::spacePressed()
{
if (!w->current().value().isSong())
return;
@@ -243,7 +243,7 @@ void SearchEngine::SpacePressed()
w->scroll(NC::wDown);
}
void SearchEngine::MouseButtonPressed(MEVENT me)
void SearchEngine::mouseButtonPressed(MEVENT me)
{
if (w->empty() || !w->hasCoords(me.x, me.y) || size_t(me.y) >= w->size())
return;
@@ -253,22 +253,22 @@ void SearchEngine::MouseButtonPressed(MEVENT me)
return;
w->refresh();
if ((me.bstate & BUTTON3_PRESSED || w->choice() > ConstraintsNumber) && w->choice() < StaticOptions)
EnterPressed();
enterPressed();
else if (w->choice() >= StaticOptions)
{
if (me.bstate & BUTTON1_PRESSED)
{
size_t pos = w->choice();
SpacePressed();
spacePressed();
if (pos < w->size()-1)
w->scroll(NC::wUp);
}
else
EnterPressed();
enterPressed();
}
}
else
Screen< NC::Menu<SEItem> >::MouseButtonPressed(me);
Screen< NC::Menu<SEItem> >::mouseButtonPressed(me);
}
/***********************************************************************/

View File

@@ -77,16 +77,16 @@ class SearchEngine : public Screen< NC::Menu<SEItem> >, public Filterable, publi
{
public:
// Screen< NC::Menu<SEItem> > implementation
virtual void Resize() OVERRIDE;
virtual void SwitchTo() OVERRIDE;
virtual void resize() OVERRIDE;
virtual void switchTo() OVERRIDE;
virtual std::wstring Title() OVERRIDE;
virtual std::wstring title() OVERRIDE;
virtual void Update() OVERRIDE { }
virtual void update() OVERRIDE { }
virtual void EnterPressed() OVERRIDE;
virtual void SpacePressed() OVERRIDE;
virtual void MouseButtonPressed(MEVENT me) OVERRIDE;
virtual void enterPressed() OVERRIDE;
virtual void spacePressed() OVERRIDE;
virtual void mouseButtonPressed(MEVENT me) OVERRIDE;
virtual bool isTabbable() OVERRIDE { return true; }
virtual bool isMergable() OVERRIDE { return true; }
@@ -116,7 +116,7 @@ class SearchEngine : public Screen< NC::Menu<SEItem> >, public Filterable, publi
static size_t ResetButton;
protected:
virtual void Init() OVERRIDE;
virtual void init() OVERRIDE;
virtual bool isLockable() OVERRIDE { return true; }
private:

View File

@@ -39,7 +39,7 @@ using Global::myOldScreen;
SelectedItemsAdder *mySelectedItemsAdder = new SelectedItemsAdder;
void SelectedItemsAdder::Init()
void SelectedItemsAdder::init()
{
SetDimensions();
itsPlaylistSelector = new NC::Menu<std::string>((COLS-itsWidth)/2, (MainHeight-itsHeight)/2+MainStartY, itsWidth, itsHeight, "Add selected item(s) to...", Config.main_color, Config.window_border);
@@ -65,11 +65,11 @@ void SelectedItemsAdder::Init()
isInitialized = 1;
}
void SelectedItemsAdder::SwitchTo()
void SelectedItemsAdder::switchTo()
{
if (myScreen == this)
{
myOldScreen->SwitchTo();
myOldScreen->switchTo();
return;
}
auto hs = dynamic_cast<HasSongs *>(myScreen);
@@ -83,16 +83,16 @@ void SelectedItemsAdder::SwitchTo()
}
if (!isInitialized)
Init();
init();
// default to main window
w = itsPlaylistSelector;
// Resize() can fall back to old screen, so we need it updated
// resize() can fall back to old screen, so we need it updated
myOldScreen = myScreen;
if (hasToBeResized)
Resize();
resize();
bool playlists_not_active = myScreen == myBrowser && myBrowser->isLocal();
if (playlists_not_active)
@@ -116,11 +116,11 @@ void SelectedItemsAdder::SwitchTo()
myScreen = this;
}
void SelectedItemsAdder::Resize()
void SelectedItemsAdder::resize()
{
SetDimensions();
if (itsHeight < 5) // screen too low to display this window
return myOldScreen->SwitchTo();
return myOldScreen->switchTo();
itsPlaylistSelector->resize(itsWidth, itsHeight);
itsPlaylistSelector->moveTo((COLS-itsWidth)/2, (MainHeight-itsHeight)/2+MainStartY);
size_t poss_width = std::min(itsPSWidth, size_t(COLS));
@@ -129,13 +129,13 @@ void SelectedItemsAdder::Resize()
itsPositionSelector->moveTo((COLS-poss_width)/2, (MainHeight-poss_height)/2+MainStartY);
if (myOldScreen && myOldScreen->hasToBeResized) // resize background window
{
myOldScreen->Resize();
myOldScreen->Refresh();
myOldScreen->resize();
myOldScreen->refresh();
}
hasToBeResized = 0;
}
void SelectedItemsAdder::Refresh()
void SelectedItemsAdder::refresh()
{
if (w == itsPositionSelector)
{
@@ -146,12 +146,12 @@ void SelectedItemsAdder::Refresh()
itsPlaylistSelector->display();
}
std::wstring SelectedItemsAdder::Title()
std::wstring SelectedItemsAdder::title()
{
return myOldScreen->Title();
return myOldScreen->title();
}
void SelectedItemsAdder::EnterPressed()
void SelectedItemsAdder::enterPressed()
{
size_t pos = w->choice();
@@ -198,9 +198,9 @@ void SelectedItemsAdder::EnterPressed()
if (pos != w->size()-1)
{
// refresh playlist's lists
if (myBrowser->Main() && !myBrowser->isLocal() && myBrowser->CurrentDir() == "/")
if (myBrowser->main() && !myBrowser->isLocal() && myBrowser->CurrentDir() == "/")
myBrowser->GetDirectory("/");
if (myPlaylistEditor->Main())
if (myPlaylistEditor->main())
myPlaylistEditor->Playlists->clear(); // make playlist editor update itself
}
}
@@ -248,10 +248,10 @@ void SelectedItemsAdder::EnterPressed()
if (successful_operation)
Statusbar::msg("Selected item(s) added");
}
SwitchTo();
switchTo();
}
void SelectedItemsAdder::MouseButtonPressed(MEVENT me)
void SelectedItemsAdder::mouseButtonPressed(MEVENT me)
{
if (w->empty() || !w->hasCoords(me.x, me.y) || size_t(me.y) >= w->size())
return;
@@ -259,10 +259,10 @@ void SelectedItemsAdder::MouseButtonPressed(MEVENT me)
{
w->Goto(me.y);
if (me.bstate & BUTTON3_PRESSED)
EnterPressed();
enterPressed();
}
else
Screen< NC::Menu<std::string> >::MouseButtonPressed(me);
Screen< NC::Menu<std::string> >::mouseButtonPressed(me);
}
void SelectedItemsAdder::SetDimensions()

View File

@@ -29,23 +29,23 @@ class SelectedItemsAdder : public Screen< NC::Menu<std::string> >
SelectedItemsAdder() : itsPSWidth(35), itsPSHeight(11) { }
// Screen< NC::Menu<std::string> > implementation
virtual void SwitchTo() OVERRIDE;
virtual void Resize() OVERRIDE;
virtual void Refresh() OVERRIDE;
virtual void switchTo() OVERRIDE;
virtual void resize() OVERRIDE;
virtual void refresh() OVERRIDE;
virtual std::wstring Title() OVERRIDE;
virtual std::wstring title() OVERRIDE;
virtual void Update() OVERRIDE { }
virtual void update() OVERRIDE { }
virtual void EnterPressed() OVERRIDE;
virtual void SpacePressed() OVERRIDE { }
virtual void MouseButtonPressed(MEVENT me) OVERRIDE;
virtual void enterPressed() OVERRIDE;
virtual void spacePressed() OVERRIDE { }
virtual void mouseButtonPressed(MEVENT me) OVERRIDE;
virtual bool isMergable() OVERRIDE { return false; }
virtual bool isTabbable() OVERRIDE { return false; }
protected:
virtual void Init() OVERRIDE;
virtual void init() OVERRIDE;
virtual bool isLockable() OVERRIDE { return false; }
private:

View File

@@ -32,7 +32,7 @@ using Global::myOldScreen;
ServerInfo *myServerInfo = new ServerInfo;
void ServerInfo::Init()
void ServerInfo::init()
{
SetDimensions();
w = new NC::Scrollpad((COLS-itsWidth)/2, (MainHeight-itsHeight)/2+MainStartY, itsWidth, itsHeight, "MPD server info", Config.main_color, Config.window_border);
@@ -43,13 +43,13 @@ void ServerInfo::Init()
isInitialized = 1;
}
void ServerInfo::SwitchTo()
void ServerInfo::switchTo()
{
using Global::myScreen;
if (myScreen == this)
{
myOldScreen->SwitchTo();
myOldScreen->switchTo();
return;
}
if (MainHeight < 5)
@@ -59,39 +59,39 @@ void ServerInfo::SwitchTo()
}
if (!isInitialized)
Init();
init();
// Resize() can fall back to old screen, so we need it updated
// resize() can fall back to old screen, so we need it updated
myOldScreen = myScreen;
if (hasToBeResized)
Resize();
resize();
myScreen = this;
//w->Window::clear();
}
void ServerInfo::Resize()
void ServerInfo::resize()
{
SetDimensions();
if (itsHeight < 5) // screen too low to display this window
return myOldScreen->SwitchTo();
return myOldScreen->switchTo();
w->resize(itsWidth, itsHeight);
w->moveTo((COLS-itsWidth)/2, (MainHeight-itsHeight)/2+MainStartY);
if (myOldScreen && myOldScreen->hasToBeResized) // resize background window
{
myOldScreen->Resize();
myOldScreen->Refresh();
myOldScreen->resize();
myOldScreen->refresh();
}
hasToBeResized = 0;
}
std::wstring ServerInfo::Title()
std::wstring ServerInfo::title()
{
return myOldScreen->Title();
return myOldScreen->title();
}
void ServerInfo::Update()
void ServerInfo::update()
{
static timeval past = { 0, 0 };
if (Global::Timer.tv_sec <= past.tv_sec)

View File

@@ -27,21 +27,21 @@ class ServerInfo : public Screen<NC::Scrollpad>
{
public:
// Screen<NC::Scrollpad> implementation
virtual void SwitchTo() OVERRIDE;
virtual void Resize() OVERRIDE;
virtual void switchTo() OVERRIDE;
virtual void resize() OVERRIDE;
virtual std::wstring Title() OVERRIDE;
virtual std::wstring title() OVERRIDE;
virtual void Update() OVERRIDE;
virtual void update() OVERRIDE;
virtual void EnterPressed() OVERRIDE { }
virtual void SpacePressed() OVERRIDE { }
virtual void enterPressed() OVERRIDE { }
virtual void spacePressed() OVERRIDE { }
virtual bool isMergable() OVERRIDE { return false; }
virtual bool isTabbable() OVERRIDE { return false; }
protected:
virtual void Init() OVERRIDE;
virtual void init() OVERRIDE;
virtual bool isLockable() OVERRIDE { return false; }
private:

View File

@@ -50,47 +50,47 @@ const SongInfo::Metadata SongInfo::Tags[] =
{ 0, 0, 0 }
};
void SongInfo::Init()
void SongInfo::init()
{
w = new NC::Scrollpad(0, MainStartY, COLS, MainHeight, "", Config.main_color, NC::brNone);
isInitialized = 1;
}
void SongInfo::Resize()
void SongInfo::resize()
{
size_t x_offset, width;
GetWindowResizeParams(x_offset, width);
getWindowResizeParams(x_offset, width);
w->resize(width, MainHeight);
w->moveTo(x_offset, MainStartY);
hasToBeResized = 0;
}
std::wstring SongInfo::Title()
std::wstring SongInfo::title()
{
return L"Song info";
}
void SongInfo::SwitchTo()
void SongInfo::switchTo()
{
using Global::myScreen;
using Global::myOldScreen;
using Global::myLockedScreen;
if (myScreen == this)
return myOldScreen->SwitchTo();
return myOldScreen->switchTo();
if (!isInitialized)
Init();
init();
if (myLockedScreen)
UpdateInactiveScreen(this);
updateInactiveScreen(this);
auto s = currentSong(myScreen);
if (!s)
return;
if (hasToBeResized || myLockedScreen)
Resize();
resize();
myOldScreen = myScreen;
myScreen = this;

View File

@@ -35,15 +35,15 @@ class SongInfo : public Screen<NC::Scrollpad>
};
// Screen<NC::Scrollpad> implementation
virtual void SwitchTo() OVERRIDE;
virtual void Resize() OVERRIDE;
virtual void switchTo() OVERRIDE;
virtual void resize() OVERRIDE;
virtual std::wstring Title() OVERRIDE;
virtual std::wstring title() OVERRIDE;
virtual void Update() OVERRIDE { }
virtual void update() OVERRIDE { }
virtual void EnterPressed() OVERRIDE { }
virtual void SpacePressed() OVERRIDE { }
virtual void enterPressed() OVERRIDE { }
virtual void spacePressed() OVERRIDE { }
virtual bool isMergable() OVERRIDE { return true; }
virtual bool isTabbable() OVERRIDE { return false; }
@@ -53,7 +53,7 @@ class SongInfo : public Screen<NC::Scrollpad>
static const Metadata Tags[];
protected:
virtual void Init() OVERRIDE;
virtual void init() OVERRIDE;
virtual bool isLockable() OVERRIDE { return false; }
private:

View File

@@ -90,9 +90,9 @@ void Status::trace()
Mpd.UpdateStatus();
}
ApplyToVisibleWindows(&BasicScreen::Update);
applyToVisibleWindows(&BasicScreen::update);
if (isVisible(myPlaylist) && myPlaylist->ActiveWindow() == myPlaylist->Items
if (isVisible(myPlaylist) && myPlaylist->activeWindow() == myPlaylist->Items
&& Timer.tv_sec == myPlaylist->Timer().tv_sec+Config.playlist_disable_highlight_delay
&& myPlaylist->Items->isHighlighted()
&& Config.playlist_disable_highlight_delay)
@@ -121,7 +121,7 @@ void Status::handleError(MPD::Connection * , int errorid, const char *msg, void
else if ((errorid >> 8) == MPD_SERVER_ERROR_NO_EXIST && myScreen == myBrowser)
{
myBrowser->GetDirectory(getParentDirectory(myBrowser->CurrentDir()));
myBrowser->Refresh();
myBrowser->refresh();
}
else
Statusbar::msg("MPD: %s", msg);
@@ -176,35 +176,35 @@ void Status::Changes::playlist()
void Status::Changes::storedPlaylists()
{
if (myPlaylistEditor->Main())
if (myPlaylistEditor->main())
{
myPlaylistEditor->requestPlaylistsUpdate();
myPlaylistEditor->requestContentsUpdate();
}
if (myBrowser->Main() && myBrowser->CurrentDir() == "/")
if (myBrowser->main() && myBrowser->CurrentDir() == "/")
{
myBrowser->GetDirectory("/");
if (isVisible(myBrowser))
myBrowser->Refresh();
myBrowser->refresh();
}
}
void Status::Changes::database()
{
if (myBrowser->Main())
if (myBrowser->main())
{
if (isVisible(myBrowser))
myBrowser->GetDirectory(myBrowser->CurrentDir());
else
myBrowser->Main()->clear();
myBrowser->main()->clear();
}
# ifdef HAVE_TAGLIB_H
if (myTagEditor->Main())
if (myTagEditor->main())
{
myTagEditor->Dirs->clear();
}
# endif // HAVE_TAGLIB_H
if (myLibrary->Main())
if (myLibrary->main())
{
if (myLibrary->Columns() == 2)
myLibrary->Albums->clear();
@@ -254,7 +254,7 @@ void Status::Changes::playerState()
player_state.clear();
# ifdef ENABLE_VISUALIZER
if (isVisible(myVisualizer))
myVisualizer->Main()->clear();
myVisualizer->main()->clear();
# endif // ENABLE_VISUALIZER
break;
}
@@ -565,5 +565,5 @@ void Status::update(MPD::Connection *, MPD::StatusChanges changes, void *)
if (changes.PlayerState || (changes.ElapsedTime && (!Config.new_design || Mpd.GetState() == MPD::psPlay)))
wFooter->refresh();
if (changes.Playlist || changes.Database || changes.PlayerState || changes.SongID)
ApplyToVisibleWindows(&BasicScreen::RefreshWindow);
applyToVisibleWindows(&BasicScreen::refreshWindow);
}

View File

@@ -192,7 +192,7 @@ void Statusbar::Helpers::ApplyFilterImmediately::operator()(const std::wstring &
{
m_ws = ws;
m_f->applyFilter(ToString(m_ws));
myScreen->RefreshWindow();
myScreen->refreshWindow();
}
Status::trace();
}

View File

@@ -84,7 +84,7 @@ bool SongEntryMatcher(const Regex &rx, const MPD::MutableSong &s);
}
void TagEditor::Init()
void TagEditor::init()
{
PatternsFile = Config.ncmpcpp_directory + "patterns.list";
SetDimensions(0, COLS);
@@ -162,10 +162,10 @@ void TagEditor::SetDimensions(size_t x_offset, size_t width)
FParserWidthTwo = FParserWidth-FParserWidthOne;
}
void TagEditor::Resize()
void TagEditor::resize()
{
size_t x_offset, width;
GetWindowResizeParams(x_offset, width);
getWindowResizeParams(x_offset, width);
SetDimensions(x_offset, width);
Dirs->resize(LeftColumnWidth, MainHeight);
@@ -191,12 +191,12 @@ void TagEditor::Resize()
hasToBeResized = 0;
}
std::wstring TagEditor::Title()
std::wstring TagEditor::title()
{
return L"Tag editor";
}
void TagEditor::SwitchTo()
void TagEditor::switchTo()
{
using Global::myLockedScreen;
@@ -204,22 +204,22 @@ void TagEditor::SwitchTo()
return;
if (!isInitialized)
Init();
init();
if (myLockedScreen)
UpdateInactiveScreen(this);
updateInactiveScreen(this);
if (hasToBeResized || myLockedScreen)
Resize();
resize();
if (myScreen != this && myScreen->isTabbable())
Global::myPrevScreen = myScreen;
myScreen = this;
drawHeader();
Refresh();
refresh();
}
void TagEditor::Refresh()
void TagEditor::refresh()
{
Dirs->display();
mvvline(MainStartY, MiddleColumnStartX-1, 0, MainHeight);
@@ -238,7 +238,7 @@ void TagEditor::Refresh()
}
}
void TagEditor::Update()
void TagEditor::update()
{
if (Dirs->reallyEmpty())
{
@@ -292,7 +292,7 @@ void TagEditor::Update()
}
}
void TagEditor::EnterPressed()
void TagEditor::enterPressed()
{
using Global::wFooter;
@@ -315,7 +315,7 @@ void TagEditor::EnterPressed()
if (choice == 3) // cancel
{
w = TagTypes;
Refresh();
refresh();
return;
}
GetPatternList();
@@ -461,7 +461,7 @@ void TagEditor::EnterPressed()
{
SavePatternList();
w = TagTypes;
Refresh();
refresh();
return;
}
}
@@ -609,7 +609,7 @@ void TagEditor::EnterPressed()
}
}
void TagEditor::SpacePressed()
void TagEditor::spacePressed()
{
if (w == Tags && !Tags->empty())
{
@@ -618,7 +618,7 @@ void TagEditor::SpacePressed()
}
}
void TagEditor::MouseButtonPressed(MEVENT me)
void TagEditor::mouseButtonPressed(MEVENT me)
{
auto tryPreviousColumn = [this]() -> bool {
bool result = true;
@@ -650,10 +650,10 @@ void TagEditor::MouseButtonPressed(MEVENT me)
{
FParserDialog->Goto(me.y);
if (me.bstate & BUTTON3_PRESSED)
EnterPressed();
enterPressed();
}
else
Screen<NC::Window>::MouseButtonPressed(me);
Screen<NC::Window>::mouseButtonPressed(me);
}
}
else if (w == FParser || w == FParserHelper)
@@ -671,10 +671,10 @@ void TagEditor::MouseButtonPressed(MEVENT me)
{
FParser->Goto(me.y);
if (me.bstate & BUTTON3_PRESSED)
EnterPressed();
enterPressed();
}
else
Screen<NC::Window>::MouseButtonPressed(me);
Screen<NC::Window>::mouseButtonPressed(me);
}
else if (FParserHelper->hasCoords(me.x, me.y))
{
@@ -685,7 +685,7 @@ void TagEditor::MouseButtonPressed(MEVENT me)
else
return;
}
ScrollpadMouseButtonPressed(FParserHelper, me);
scrollpadMouseButtonPressed(FParserHelper, me);
}
}
else if (!Dirs->empty() && Dirs->hasCoords(me.x, me.y))
@@ -696,12 +696,12 @@ void TagEditor::MouseButtonPressed(MEVENT me)
{
Dirs->Goto(me.y);
if (me.bstate & BUTTON1_PRESSED)
EnterPressed();
enterPressed();
else
SpacePressed();
spacePressed();
}
else
Screen<NC::Window>::MouseButtonPressed(me);
Screen<NC::Window>::mouseButtonPressed(me);
Tags->clear();
}
else if (!TagTypes->empty() && TagTypes->hasCoords(me.x, me.y))
@@ -723,10 +723,10 @@ void TagEditor::MouseButtonPressed(MEVENT me)
TagTypes->refresh();
Tags->refresh();
if (me.bstate & BUTTON3_PRESSED)
EnterPressed();
enterPressed();
}
else
Screen<NC::Window>::MouseButtonPressed(me);
Screen<NC::Window>::mouseButtonPressed(me);
}
else if (!Tags->empty() && Tags->hasCoords(me.x, me.y))
{
@@ -737,10 +737,10 @@ void TagEditor::MouseButtonPressed(MEVENT me)
Tags->Goto(me.y);
Tags->refresh();
if (me.bstate & BUTTON3_PRESSED)
EnterPressed();
enterPressed();
}
else
Screen<NC::Window>::MouseButtonPressed(me);
Screen<NC::Window>::mouseButtonPressed(me);
}
}
@@ -965,7 +965,7 @@ void TagEditor::LocateSong(const MPD::Song &s)
return;
if (Global::myScreen != this)
SwitchTo();
switchTo();
// go to right directory
if (itsBrowsedDir != s.getDirectory())
@@ -979,7 +979,7 @@ void TagEditor::LocateSong(const MPD::Song &s)
if (itsBrowsedDir.empty())
itsBrowsedDir = "/";
Dirs->clear();
Update();
update();
}
if (itsBrowsedDir == "/")
Dirs->reset(); // go to the first pos, which is "." (music dir root)
@@ -998,7 +998,7 @@ void TagEditor::LocateSong(const MPD::Song &s)
Dirs->refresh();
Tags->clear();
Update();
update();
// reset TagTypes since it can be under Filename
// and then songs in right column are not visible.

View File

@@ -38,17 +38,17 @@ class TagEditor : public Screen<NC::Window>, public Filterable, public HasColumn
public:
TagEditor() : FParser(0), FParserHelper(0), FParserLegend(0), FParserPreview(0), itsBrowsedDir("/") { }
virtual void Resize() OVERRIDE;
virtual void SwitchTo() OVERRIDE;
virtual void resize() OVERRIDE;
virtual void switchTo() OVERRIDE;
virtual std::wstring Title() OVERRIDE;
virtual std::wstring title() OVERRIDE;
virtual void Refresh() OVERRIDE;
virtual void Update() OVERRIDE;
virtual void refresh() OVERRIDE;
virtual void update() OVERRIDE;
virtual void EnterPressed() OVERRIDE;
virtual void SpacePressed() OVERRIDE;
virtual void MouseButtonPressed(MEVENT) OVERRIDE;
virtual void enterPressed() OVERRIDE;
virtual void spacePressed() OVERRIDE;
virtual void mouseButtonPressed(MEVENT) OVERRIDE;
virtual bool isTabbable() OVERRIDE { return true; }
virtual bool isMergable() OVERRIDE { return true; }
@@ -88,7 +88,7 @@ class TagEditor : public Screen<NC::Window>, public Filterable, public HasColumn
NC::Menu<MPD::MutableSong> *Tags;
protected:
virtual void Init();
virtual void init();
virtual bool isLockable() { return true; }
private:

View File

@@ -268,7 +268,7 @@ bool write(MPD::MutableSong &s)
}
Mpd.CommitCommandsList();
}
else // only myBrowser->Main()
else // only myBrowser->main()
myBrowser->GetDirectory(myBrowser->CurrentDir());
}
}

View File

@@ -45,7 +45,7 @@ using Global::myOldScreen;
TinyTagEditor *myTinyTagEditor = new TinyTagEditor;
void TinyTagEditor::Init()
void TinyTagEditor::init()
{
w = new NC::Menu<NC::Buffer>(0, MainStartY, COLS, MainHeight, "", Config.main_color, NC::brNone);
w->setHighlightColor(Config.main_highlight_color);
@@ -55,16 +55,16 @@ void TinyTagEditor::Init()
isInitialized = 1;
}
void TinyTagEditor::Resize()
void TinyTagEditor::resize()
{
size_t x_offset, width;
GetWindowResizeParams(x_offset, width);
getWindowResizeParams(x_offset, width);
w->resize(width, MainHeight);
w->moveTo(x_offset, MainStartY);
hasToBeResized = 0;
}
void TinyTagEditor::SwitchTo()
void TinyTagEditor::switchTo()
{
using Global::myScreen;
using Global::myLockedScreen;
@@ -76,10 +76,10 @@ void TinyTagEditor::SwitchTo()
else if (getTags())
{
if (myLockedScreen)
UpdateInactiveScreen(this);
updateInactiveScreen(this);
if (hasToBeResized || myLockedScreen)
Resize();
resize();
myOldScreen = myScreen;
myScreen = this;
@@ -97,12 +97,12 @@ void TinyTagEditor::SwitchTo()
}
}
std::wstring TinyTagEditor::Title()
std::wstring TinyTagEditor::title()
{
return L"Tiny tag editor";
}
void TinyTagEditor::EnterPressed()
void TinyTagEditor::enterPressed()
{
size_t option = w->choice();
Statusbar::lock();
@@ -150,10 +150,10 @@ void TinyTagEditor::EnterPressed()
Statusbar::msg("Error while writing tags");
}
if (option > 21)
myOldScreen->SwitchTo();
myOldScreen->switchTo();
}
void TinyTagEditor::MouseButtonPressed(MEVENT me)
void TinyTagEditor::mouseButtonPressed(MEVENT me)
{
if (w->empty() || !w->hasCoords(me.x, me.y) || size_t(me.y) >= w->size())
return;
@@ -164,11 +164,11 @@ void TinyTagEditor::MouseButtonPressed(MEVENT me)
if (me.bstate & BUTTON3_PRESSED)
{
w->refresh();
EnterPressed();
enterPressed();
}
}
else
Screen< NC::Menu<NC::Buffer> >::MouseButtonPressed(me);
Screen< NC::Menu<NC::Buffer> >::mouseButtonPressed(me);
}
void TinyTagEditor::SetEdited(const MPD::Song &s)
@@ -192,7 +192,7 @@ bool TinyTagEditor::getTags()
ext = lowercase(ext.substr(ext.rfind(".")+1));
if (!isInitialized)
Init();
init();
w->clear();
w->reset();

View File

@@ -32,16 +32,16 @@ class TinyTagEditor : public Screen< NC::Menu<NC::Buffer> >
{
public:
// Screen< NC::Menu<NC::Buffer> > implementation
virtual void Resize() OVERRIDE;
virtual void SwitchTo() OVERRIDE;
virtual void resize() OVERRIDE;
virtual void switchTo() OVERRIDE;
virtual std::wstring Title() OVERRIDE;
virtual std::wstring title() OVERRIDE;
virtual void Update() OVERRIDE { }
virtual void update() OVERRIDE { }
virtual void EnterPressed() OVERRIDE;
virtual void SpacePressed() OVERRIDE { }
virtual void MouseButtonPressed(MEVENT me) OVERRIDE;
virtual void enterPressed() OVERRIDE;
virtual void spacePressed() OVERRIDE { }
virtual void mouseButtonPressed(MEVENT me) OVERRIDE;
virtual bool isMergable() OVERRIDE { return true; }
virtual bool isTabbable() OVERRIDE { return false; }
@@ -50,7 +50,7 @@ class TinyTagEditor : public Screen< NC::Menu<NC::Buffer> >
void SetEdited(const MPD::Song &);
protected:
virtual void Init() OVERRIDE;
virtual void init() OVERRIDE;
virtual bool isLockable() OVERRIDE { return true; }
private:

View File

@@ -45,7 +45,7 @@ void drawHeader()
return;
if (Config.new_design)
{
std::wstring title = myScreen->Title();
std::wstring title = myScreen->title();
*wHeader << NC::XY(0, 3) << wclrtoeol;
*wHeader << NC::fmtBold << Config.alternative_ui_separator_color;
mvwhline(wHeader->raw(), 2, 0, 0, COLS);
@@ -56,7 +56,7 @@ void drawHeader()
}
else
{
*wHeader << NC::XY(0, 0) << wclrtoeol << NC::fmtBold << myScreen->Title() << NC::fmtBoldEnd;
*wHeader << NC::XY(0, 0) << wclrtoeol << NC::fmtBold << myScreen->title() << NC::fmtBoldEnd;
*wHeader << Config.volume_color;
*wHeader << NC::XY(wHeader->getWidth()-VolumeState.length(), 0) << VolumeState;
*wHeader << NC::clEnd;

View File

@@ -44,7 +44,7 @@ Visualizer *myVisualizer = new Visualizer;
const int Visualizer::WindowTimeout = 1000/25; /* 25 fps */
void Visualizer::Init()
void Visualizer::init()
{
w = new NC::Window(0, MainStartY, COLS, MainHeight, "", Config.visualizer_color, NC::brNone);
@@ -63,7 +63,7 @@ void Visualizer::Init()
isInitialized = 1;
}
void Visualizer::SwitchTo()
void Visualizer::switchTo()
{
using Global::myScreen;
using Global::myLockedScreen;
@@ -72,13 +72,13 @@ void Visualizer::SwitchTo()
return;
if (!isInitialized)
Init();
init();
if (myLockedScreen)
UpdateInactiveScreen(this);
updateInactiveScreen(this);
if (hasToBeResized || myLockedScreen)
Resize();
resize();
if (myScreen != this && myScreen->isTabbable())
Global::myPrevScreen = myScreen;
@@ -95,21 +95,21 @@ void Visualizer::SwitchTo()
Global::wFooter->setTimeout(WindowTimeout);
}
void Visualizer::Resize()
void Visualizer::resize()
{
size_t x_offset, width;
GetWindowResizeParams(x_offset, width);
getWindowResizeParams(x_offset, width);
w->resize(width, MainHeight);
w->moveTo(x_offset, MainStartY);
hasToBeResized = 0;
}
std::wstring Visualizer::Title()
std::wstring Visualizer::title()
{
return L"Music visualizer";
}
void Visualizer::Update()
void Visualizer::update()
{
if (itsFifo < 0)
return;
@@ -155,7 +155,7 @@ void Visualizer::Update()
w->refresh();
}
void Visualizer::SpacePressed()
void Visualizer::spacePressed()
{
# ifdef HAVE_FFTW3_H
Config.visualizer_use_wave = !Config.visualizer_use_wave;

View File

@@ -35,21 +35,22 @@
class Visualizer : public Screen<NC::Window>
{
public:
virtual void SwitchTo();
virtual void Resize();
virtual void switchTo() OVERRIDE;
virtual void resize() OVERRIDE;
virtual std::wstring Title();
virtual std::wstring title() OVERRIDE;
virtual void Update();
virtual void Scroll(NC::Where) { }
virtual void update() OVERRIDE;
virtual void scroll(NC::Where) OVERRIDE { }
virtual void EnterPressed() { }
virtual void SpacePressed();
virtual void MouseButtonPressed(MEVENT) { }
virtual bool isTabbable() { return true; }
virtual void enterPressed() OVERRIDE { }
virtual void spacePressed() OVERRIDE;
virtual void mouseButtonPressed(MEVENT) OVERRIDE { }
virtual bool isMergable() { return true; }
virtual bool isTabbable() OVERRIDE { return true; }
virtual bool isMergable() OVERRIDE { return true; }
// private members
void SetFD();
void ResetFD();
void FindOutputID();
@@ -57,7 +58,7 @@ class Visualizer : public Screen<NC::Window>
static const int WindowTimeout;
protected:
virtual void Init();
virtual void init();
virtual bool isLockable() { return true; }
private:

View File

@@ -287,7 +287,7 @@ struct Window
void deleteHistory();
/// Refreshed whole window and its border
/// @see Refresh()
/// @see refresh()
void display();
/// Refreshes whole window, but not the border
@@ -424,20 +424,20 @@ protected:
///
void showBorder() const;
/// Changes dimensions of window, called from Resize()
/// Changes dimensions of window, called from resize()
/// @param width new window's width
/// @param height new window's height
/// @see Resize()
/// @see resize()
///
void adjustDimensions(size_t width, size_t height);
/// Deletes old window and creates new. It's called by Resize(),
/// Deletes old window and creates new. It's called by resize(),
/// SetBorder() or setTitle() since internally windows are
/// handled as curses pads and change in size requires to delete
/// them and create again, there is no way to change size of pad.
/// @see SetBorder()
/// @see setTitle()
/// @see Resize()
/// @see resize()
///
virtual void recreate(size_t width, size_t height);