window: remove GetXY
This commit is contained in:
@@ -215,8 +215,8 @@ void NcmpcppStatusChanged(MPD::Connection *, MPD::StatusChanges changed, void *)
|
||||
static std::string player_state;
|
||||
static MPD::Song np;
|
||||
|
||||
int sx, sy;
|
||||
wFooter->GetXY(sx, sy);
|
||||
int sx = wFooter->X();
|
||||
int sy = wFooter->Y();
|
||||
|
||||
myPlaylist->NowPlaying = Mpd.GetCurrentlyPlayingSongPos();
|
||||
|
||||
|
||||
@@ -91,8 +91,6 @@ Window::Window(size_t startx,
|
||||
itsBaseBgColor(clDefault),
|
||||
itsBorder(border),
|
||||
itsGetStringHelper(0),
|
||||
itsX(0),
|
||||
itsY(0),
|
||||
itsTitle(title),
|
||||
itsHistory(0),
|
||||
itsBoldCounter(0),
|
||||
@@ -141,8 +139,6 @@ Window::Window(const Window &w) : itsWindow(dupwin(w.itsWindow)),
|
||||
itsBaseBgColor(w.itsBaseBgColor),
|
||||
itsBorder(w.itsBorder),
|
||||
itsGetStringHelper(w.itsGetStringHelper),
|
||||
itsX(w.itsX),
|
||||
itsY(w.itsY),
|
||||
itsTitle(w.itsTitle),
|
||||
itsColors(w.itsColors),
|
||||
itsHistory(w.itsHistory),
|
||||
@@ -653,30 +649,19 @@ std::string Window::GetString(const std::string &base, size_t length, size_t wid
|
||||
return ToString(*tmp);
|
||||
}
|
||||
|
||||
void Window::GetXY(int &x, int &y)
|
||||
{
|
||||
getyx(itsWindow, itsY, itsX);
|
||||
x = itsX;
|
||||
y = itsY;
|
||||
}
|
||||
|
||||
void Window::GotoXY(int x, int y)
|
||||
{
|
||||
wmove(itsWindow, y, x);
|
||||
itsX = x;
|
||||
itsY = y;
|
||||
}
|
||||
|
||||
int Window::X()
|
||||
{
|
||||
getyx(itsWindow, itsY, itsX);
|
||||
return itsX;
|
||||
return getcurx(itsWindow);
|
||||
}
|
||||
|
||||
int Window::Y()
|
||||
{
|
||||
getyx(itsWindow, itsY, itsX);
|
||||
return itsY;
|
||||
return getcury(itsWindow);
|
||||
}
|
||||
|
||||
bool Window::hasCoords(int &x, int &y)
|
||||
|
||||
15
src/window.h
15
src/window.h
@@ -264,7 +264,7 @@ namespace NCurses
|
||||
/// @see CreateHistory()
|
||||
///
|
||||
std::string GetString(const std::string &base, size_t length = -1,
|
||||
size_t width = 0, bool encrypted = 0);
|
||||
size_t width = 0, bool encrypted = 0);
|
||||
|
||||
/// Wrapper for above function that doesn't take base string (it will be empty).
|
||||
/// Taken parameters are the same as for above.
|
||||
@@ -274,12 +274,6 @@ namespace NCurses
|
||||
return GetString("", length, width, encrypted);
|
||||
}
|
||||
|
||||
/// Gets present position of cursor's coordinates
|
||||
/// @param x variable that will be set to current X position
|
||||
/// @param y variable that will be set to current Y position
|
||||
///
|
||||
void GetXY(int &x, int &y);
|
||||
|
||||
/// Moves cursor to given coordinates
|
||||
/// @param x given X position
|
||||
/// @param y given Y position
|
||||
@@ -593,13 +587,6 @@ namespace NCurses
|
||||
///
|
||||
GetStringHelper itsGetStringHelper;
|
||||
|
||||
/// temporary coordinates
|
||||
/// @see X()
|
||||
/// @see Y()
|
||||
///
|
||||
int itsX;
|
||||
int itsY;
|
||||
|
||||
/// window title
|
||||
std::string itsTitle;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user