Commit 58b9db5863c59d765c8bce029355fcb1281edba7
1 parent
cfaf3b74
Exists in
master
and in
1 other branch
Debugging getCursorPositionMethod (linux).
Showing
4 changed files
with
24 additions
and
9 deletions
Show diff stats
client/src/session/local/attribute.cc
@@ -533,12 +533,10 @@ | @@ -533,12 +533,10 @@ | ||
533 | 533 | ||
534 | unsigned short row = 0, col = 0; | 534 | unsigned short row = 0, col = 0; |
535 | 535 | ||
536 | - | ||
537 | return Session::Cursor(row,col); | 536 | return Session::Cursor(row,col); |
538 | 537 | ||
539 | }; | 538 | }; |
540 | 539 | ||
541 | - | ||
542 | std::string Local::Session::getVersion() const { | 540 | std::string Local::Session::getVersion() const { |
543 | 541 | ||
544 | std::lock_guard<std::recursive_mutex> lock(const_cast<Local::Session *>(this)->sync); | 542 | std::lock_guard<std::recursive_mutex> lock(const_cast<Local::Session *>(this)->sync); |
client/src/session/remote/actions.cc
@@ -151,10 +151,6 @@ | @@ -151,10 +151,6 @@ | ||
151 | throw std::system_error(ENOTSUP, std::system_category()); | 151 | throw std::system_error(ENOTSUP, std::system_category()); |
152 | } | 152 | } |
153 | 153 | ||
154 | - Session::Cursor IPC::Session::getCursorPosition() { | ||
155 | - throw std::system_error(ENOTSUP, std::system_category()); | ||
156 | - } | ||
157 | - | ||
158 | } | 154 | } |
159 | 155 | ||
160 | 156 |
client/src/session/remote/attribute.cc
@@ -489,7 +489,18 @@ | @@ -489,7 +489,18 @@ | ||
489 | 489 | ||
490 | } | 490 | } |
491 | 491 | ||
492 | + Session::Cursor IPC::Session::getCursorPosition() { | ||
492 | 493 | ||
494 | + uint32_t row, col; | ||
495 | + | ||
496 | + Request(*this,"getCursorPosition") | ||
497 | + .call() | ||
498 | + .pop(row) | ||
499 | + .pop(col); | ||
500 | + | ||
501 | + return Session::Cursor(row,col); | ||
502 | + | ||
503 | + } | ||
493 | 504 | ||
494 | } | 505 | } |
495 | 506 |
client/src/testprogram/testprogram.cc
@@ -103,7 +103,7 @@ | @@ -103,7 +103,7 @@ | ||
103 | 103 | ||
104 | TN3270::Host host{session}; | 104 | TN3270::Host host{session}; |
105 | 105 | ||
106 | - name="url"; | 106 | + //name="url"; |
107 | 107 | ||
108 | cout << endl << endl; | 108 | cout << endl << endl; |
109 | for(auto attribute : host.getAttributes()) { | 109 | for(auto attribute : host.getAttributes()) { |
@@ -125,11 +125,21 @@ | @@ -125,11 +125,21 @@ | ||
125 | 125 | ||
126 | cout << endl; | 126 | cout << endl; |
127 | 127 | ||
128 | - Sleep(100); | 128 | + } |
129 | + | ||
130 | + cout << "Cursor position: "; | ||
131 | + | ||
132 | + try { | ||
129 | 133 | ||
134 | + auto cursor = host.getCursorPosition(); | ||
135 | + cout << cursor.row << "," << cursor.col; | ||
136 | + | ||
137 | + } catch(const std::exception &e) { | ||
138 | + | ||
139 | + cout << "Exception(" << e.what() << ")"; | ||
130 | } | 140 | } |
131 | 141 | ||
132 | - cout << endl << endl; | 142 | + cout << endl << endl << endl; |
133 | 143 | ||
134 | } | 144 | } |
135 | 145 |