Commit 850485003b45b1ec4044877f0e47fc6180ec5f1e

Authored by Perry Werneck
1 parent b58b6883

Implementando novo formato para consulta D-Bus

src/libpw3270cpp/service.cc
@@ -200,6 +200,14 @@ @@ -200,6 +200,14 @@
200 200
201 virtual string get_text(int baddr = 0, size_t len = 1) 201 virtual string get_text(int baddr = 0, size_t len = 1)
202 { 202 {
  203 + dbus_int32_t a = (dbus_int32_t) baddr;
  204 + dbus_int32_t s = (dbus_int32_t) len;
  205 +
  206 + return getString( "getText",
  207 + DBUS_TYPE_STRING, &this->id,
  208 + DBUS_TYPE_INT32, &a,
  209 + DBUS_TYPE_INT32, &s,
  210 + DBUS_TYPE_INVALID);
203 211
204 } 212 }
205 213
@@ -227,7 +235,7 @@ @@ -227,7 +235,7 @@
227 DBUS_TYPE_STRING, &this->id, 235 DBUS_TYPE_STRING, &this->id,
228 DBUS_TYPE_INT32, &r, 236 DBUS_TYPE_INT32, &r,
229 DBUS_TYPE_INT32, &c, 237 DBUS_TYPE_INT32, &c,
230 - DBUS_TYPE_STRING, str, 238 + DBUS_TYPE_STRING, &str,
231 DBUS_TYPE_INVALID); 239 DBUS_TYPE_INVALID);
232 } 240 }
233 241
@@ -240,12 +248,16 @@ @@ -240,12 +248,16 @@
240 DBUS_TYPE_STRING, &this->id, 248 DBUS_TYPE_STRING, &this->id,
241 DBUS_TYPE_INT32, &r, 249 DBUS_TYPE_INT32, &r,
242 DBUS_TYPE_INT32, &c, 250 DBUS_TYPE_INT32, &c,
243 - DBUS_TYPE_STRING, str, 251 + DBUS_TYPE_STRING, &str,
244 DBUS_TYPE_INVALID); 252 DBUS_TYPE_INVALID);
245 } 253 }
246 254
247 virtual int emulate_input(const char *str) 255 virtual int emulate_input(const char *str)
248 { 256 {
  257 + return getInteger( "input",
  258 + DBUS_TYPE_STRING, &this->id,
  259 + DBUS_TYPE_STRING, &str,
  260 + DBUS_TYPE_INVALID);
249 261
250 } 262 }
251 263
@@ -342,12 +354,12 @@ @@ -342,12 +354,12 @@
342 354
343 virtual int set_host_charset(const char *charset) 355 virtual int set_host_charset(const char *charset)
344 { 356 {
345 - 357 + return getInteger("setHostCharset", DBUS_TYPE_STRING, &this->id, DBUS_TYPE_STRING, &charset, DBUS_TYPE_INVALID);
346 } 358 }
347 359
348 virtual string get_host_charset(void) 360 virtual string get_host_charset(void)
349 { 361 {
350 - 362 + return getString("getHostCharset", DBUS_TYPE_STRING, &this->id, DBUS_TYPE_INVALID);
351 } 363 }
352 364
353 virtual int connect() 365 virtual int connect()
@@ -384,7 +396,7 @@ @@ -384,7 +396,7 @@
384 396
385 virtual string get_url() 397 virtual string get_url()
386 { 398 {
387 - 399 + return getString("getUrl", DBUS_TYPE_STRING, &this->id, DBUS_TYPE_INVALID);
388 } 400 }
389 401
390 virtual int disconnect(void) 402 virtual int disconnect(void)
@@ -448,21 +460,38 @@ @@ -448,21 +460,38 @@
448 460
449 virtual int set_cursor_position(int row, int col) 461 virtual int set_cursor_position(int row, int col)
450 { 462 {
  463 + dbus_int32_t r = (dbus_int32_t) row;
  464 + dbus_int32_t c = (dbus_int32_t) col;
  465 +
  466 + return getInteger( "setCursorAt",
  467 + DBUS_TYPE_STRING, &this->id,
  468 + DBUS_TYPE_INT32, &r,
  469 + DBUS_TYPE_INT32, &c,
  470 + DBUS_TYPE_INVALID);
451 471
452 } 472 }
453 473
454 virtual int set_cursor_addr(int addr) 474 virtual int set_cursor_addr(int addr)
455 { 475 {
456 - 476 + dbus_int32_t a = (dbus_int32_t) addr;
  477 + return getInteger("setCursorAddr", DBUS_TYPE_STRING, &this->id, DBUS_TYPE_INT32, &addr, DBUS_TYPE_INVALID);
457 } 478 }
458 479
459 virtual int get_cursor_addr(void) 480 virtual int get_cursor_addr(void)
460 { 481 {
461 - 482 + return getInteger("getCursorAddr", DBUS_TYPE_STRING, &this->id, DBUS_TYPE_INVALID);
462 } 483 }
463 484
464 virtual int set_toggle(LIB3270_TOGGLE ix, bool value) 485 virtual int set_toggle(LIB3270_TOGGLE ix, bool value)
465 { 486 {
  487 + dbus_int32_t i = (dbus_int32_t) ix;
  488 + dbus_int32_t v = (dbus_int32_t) value;
  489 +
  490 + return getInteger("setToggle",
  491 + DBUS_TYPE_STRING, &this->id,
  492 + DBUS_TYPE_INT32, &i,
  493 + DBUS_TYPE_INT32, &v,
  494 + DBUS_TYPE_INVALID);
466 495
467 } 496 }
468 497
@@ -485,37 +514,42 @@ @@ -485,37 +514,42 @@
485 514
486 virtual int quit(void) 515 virtual int quit(void)
487 { 516 {
488 - 517 + return getInteger("quit",
  518 + DBUS_TYPE_STRING, &this->id,
  519 + DBUS_TYPE_INVALID);
489 } 520 }
490 521
491 virtual int action(const char *name) 522 virtual int action(const char *name)
492 { 523 {
493 - 524 + return getInteger("action",
  525 + DBUS_TYPE_STRING, &this->id,
  526 + DBUS_TYPE_STRING, &name,
  527 + DBUS_TYPE_INVALID);
494 } 528 }
495 529
496 virtual int erase(void) 530 virtual int erase(void)
497 { 531 {
498 - 532 + getInteger("erase", DBUS_TYPE_STRING, &this->id, DBUS_TYPE_INVALID);
499 } 533 }
500 534
501 virtual int erase_eof(void) 535 virtual int erase_eof(void)
502 { 536 {
503 - 537 + getInteger("eraseEof", DBUS_TYPE_STRING, &this->id, DBUS_TYPE_INVALID);
504 } 538 }
505 539
506 virtual int erase_eol(void) 540 virtual int erase_eol(void)
507 { 541 {
508 - 542 + getInteger("eraseEol", DBUS_TYPE_STRING, &this->id, DBUS_TYPE_INVALID);
509 } 543 }
510 544
511 virtual int erase_input(void) 545 virtual int erase_input(void)
512 { 546 {
513 - 547 + getInteger("eraseInput", DBUS_TYPE_STRING, &this->id, DBUS_TYPE_INVALID);
514 } 548 }
515 549
516 virtual int print(void) 550 virtual int print(void)
517 { 551 {
518 - 552 + getInteger("print", DBUS_TYPE_STRING, &this->id, DBUS_TYPE_INVALID);
519 } 553 }
520 554
521 virtual int get_field_start(int baddr = -1) 555 virtual int get_field_start(int baddr = -1)
src/libpw3270cpp/testprogram.cc
@@ -68,7 +68,7 @@ @@ -68,7 +68,7 @@
68 68
69 cout << "\tIsConnected: " << session->is_connected() << endl; 69 cout << "\tIsConnected: " << session->is_connected() << endl;
70 cout << "\tIsReady: " << session->is_ready() << endl; 70 cout << "\tIsReady: " << session->is_ready() << endl;
71 - cout << "\tString(3,2,14) " << session->get_string_at(3,2,14) << endl; 71 + cout << "\tString(1,2,26) " << session->get_string_at(1,2,26) << endl;
72 72
73 session->disconnect(); 73 session->disconnect();
74 delete session; 74 delete session;