From 58b9db5863c59d765c8bce029355fcb1281edba7 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Wed, 16 Sep 2020 21:03:40 -0300 Subject: [PATCH] Debugging getCursorPositionMethod (linux). --- client/src/session/local/attribute.cc | 2 -- client/src/session/remote/actions.cc | 4 ---- client/src/session/remote/attribute.cc | 11 +++++++++++ client/src/testprogram/testprogram.cc | 16 +++++++++++++--- 4 files changed, 24 insertions(+), 9 deletions(-) diff --git a/client/src/session/local/attribute.cc b/client/src/session/local/attribute.cc index 4ce77ac..6465426 100644 --- a/client/src/session/local/attribute.cc +++ b/client/src/session/local/attribute.cc @@ -533,12 +533,10 @@ unsigned short row = 0, col = 0; - return Session::Cursor(row,col); }; - std::string Local::Session::getVersion() const { std::lock_guard lock(const_cast(this)->sync); diff --git a/client/src/session/remote/actions.cc b/client/src/session/remote/actions.cc index 204b4ae..1dd3307 100644 --- a/client/src/session/remote/actions.cc +++ b/client/src/session/remote/actions.cc @@ -151,10 +151,6 @@ throw std::system_error(ENOTSUP, std::system_category()); } - Session::Cursor IPC::Session::getCursorPosition() { - throw std::system_error(ENOTSUP, std::system_category()); - } - } diff --git a/client/src/session/remote/attribute.cc b/client/src/session/remote/attribute.cc index 5cb92e0..d52914d 100644 --- a/client/src/session/remote/attribute.cc +++ b/client/src/session/remote/attribute.cc @@ -489,7 +489,18 @@ } + Session::Cursor IPC::Session::getCursorPosition() { + uint32_t row, col; + + Request(*this,"getCursorPosition") + .call() + .pop(row) + .pop(col); + + return Session::Cursor(row,col); + + } } diff --git a/client/src/testprogram/testprogram.cc b/client/src/testprogram/testprogram.cc index ca0f302..f99d392 100644 --- a/client/src/testprogram/testprogram.cc +++ b/client/src/testprogram/testprogram.cc @@ -103,7 +103,7 @@ TN3270::Host host{session}; - name="url"; + //name="url"; cout << endl << endl; for(auto attribute : host.getAttributes()) { @@ -125,11 +125,21 @@ cout << endl; - Sleep(100); + } + + cout << "Cursor position: "; + + try { + auto cursor = host.getCursorPosition(); + cout << cursor.row << "," << cursor.col; + + } catch(const std::exception &e) { + + cout << "Exception(" << e.what() << ")"; } - cout << endl << endl; + cout << endl << endl << endl; } -- libgit2 0.21.2