window: remove GetXY

This commit is contained in:
Andrzej Rybczak
2012-08-30 06:21:21 +02:00
parent 5989cc6317
commit 0447b4e881
3 changed files with 5 additions and 33 deletions

View File

@@ -215,8 +215,8 @@ void NcmpcppStatusChanged(MPD::Connection *, MPD::StatusChanges changed, void *)
static std::string player_state; static std::string player_state;
static MPD::Song np; static MPD::Song np;
int sx, sy; int sx = wFooter->X();
wFooter->GetXY(sx, sy); int sy = wFooter->Y();
myPlaylist->NowPlaying = Mpd.GetCurrentlyPlayingSongPos(); myPlaylist->NowPlaying = Mpd.GetCurrentlyPlayingSongPos();

View File

@@ -91,8 +91,6 @@ Window::Window(size_t startx,
itsBaseBgColor(clDefault), itsBaseBgColor(clDefault),
itsBorder(border), itsBorder(border),
itsGetStringHelper(0), itsGetStringHelper(0),
itsX(0),
itsY(0),
itsTitle(title), itsTitle(title),
itsHistory(0), itsHistory(0),
itsBoldCounter(0), itsBoldCounter(0),
@@ -141,8 +139,6 @@ Window::Window(const Window &w) : itsWindow(dupwin(w.itsWindow)),
itsBaseBgColor(w.itsBaseBgColor), itsBaseBgColor(w.itsBaseBgColor),
itsBorder(w.itsBorder), itsBorder(w.itsBorder),
itsGetStringHelper(w.itsGetStringHelper), itsGetStringHelper(w.itsGetStringHelper),
itsX(w.itsX),
itsY(w.itsY),
itsTitle(w.itsTitle), itsTitle(w.itsTitle),
itsColors(w.itsColors), itsColors(w.itsColors),
itsHistory(w.itsHistory), itsHistory(w.itsHistory),
@@ -653,30 +649,19 @@ std::string Window::GetString(const std::string &base, size_t length, size_t wid
return ToString(*tmp); 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) void Window::GotoXY(int x, int y)
{ {
wmove(itsWindow, y, x); wmove(itsWindow, y, x);
itsX = x;
itsY = y;
} }
int Window::X() int Window::X()
{ {
getyx(itsWindow, itsY, itsX); return getcurx(itsWindow);
return itsX;
} }
int Window::Y() int Window::Y()
{ {
getyx(itsWindow, itsY, itsX); return getcury(itsWindow);
return itsY;
} }
bool Window::hasCoords(int &x, int &y) bool Window::hasCoords(int &x, int &y)

View File

@@ -264,7 +264,7 @@ namespace NCurses
/// @see CreateHistory() /// @see CreateHistory()
/// ///
std::string GetString(const std::string &base, size_t length = -1, 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). /// Wrapper for above function that doesn't take base string (it will be empty).
/// Taken parameters are the same as for above. /// Taken parameters are the same as for above.
@@ -274,12 +274,6 @@ namespace NCurses
return GetString("", length, width, encrypted); 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 /// Moves cursor to given coordinates
/// @param x given X position /// @param x given X position
/// @param y given Y position /// @param y given Y position
@@ -593,13 +587,6 @@ namespace NCurses
/// ///
GetStringHelper itsGetStringHelper; GetStringHelper itsGetStringHelper;
/// temporary coordinates
/// @see X()
/// @see Y()
///
int itsX;
int itsY;
/// window title /// window title
std::string itsTitle; std::string itsTitle;