comparison src/com/five_ten_sg/connectbot/service/TerminalMonitor.java @ 422:651aff5a46c7

synchronize font size listeners; log get/set field values
author Carl Byington <carl@five-ten-sg.com>
date Thu, 30 Oct 2014 16:27:31 -0700
parents 660ac2d2003b
children 09c1d3aae3f0
comparison
equal deleted inserted replaced
421:660ac2d2003b 422:651aff5a46c7
431 public synchronized void setField(int l, int c, char[] data, int offset) { 431 public synchronized void setField(int l, int c, char[] data, int offset) {
432 Log.i(TAG, "setField()"); 432 Log.i(TAG, "setField()");
433 int len = data.length - offset; 433 int len = data.length - offset;
434 char[] da = new char[len]; 434 char[] da = new char[len];
435 System.arraycopy(data, offset, da, 0, len); 435 System.arraycopy(data, offset, da, 0, len);
436 Log.i(TAG, String.format("setField(line %d, col %d, value %s)", l, c, new String(da)));
436 437
437 if ((l > 60000) || (c > 60000)) { 438 if ((l > 60000) || (c > 60000)) {
438 l = -1; 439 l = -1;
439 c = -1; 440 c = -1;
440 } 441 }
454 Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); 455 Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
455 parent.startActivity(intent); 456 parent.startActivity(intent);
456 } 457 }
457 458
458 public synchronized void getField(int l, int c, int len) { 459 public synchronized void getField(int l, int c, int len) {
459 Log.i(TAG, "getField()"); 460 Log.i(TAG, String.format("getField(line %d, col %d, len %d)", l, c, len));
460 char[] arg2 = new char[4 + len]; 461 char[] arg2 = new char[4 + len];
461 arg2[2] = (char)(l & 0x0000ffff); 462 arg2[2] = (char)(l & 0x0000ffff);
462 arg2[3] = (char)(c & 0x0000ffff); 463 arg2[3] = (char)(c & 0x0000ffff);
463 int base = 4; 464 int base = 4;
464 465
466 Arrays.fill(arg2, base, base + len, ' '); 467 Arrays.fill(arg2, base, base + len, ' ');
467 } 468 }
468 else { 469 else {
469 System.arraycopy(buffer.charArray[buffer.screenBase + l], c, arg2, base, len); 470 System.arraycopy(buffer.charArray[buffer.screenBase + l], c, arg2, base, len);
470 } 471 }
472
473 char[] da = new char[len];
474 System.arraycopy(arg2, base, da, 0, len);
475 Log.i(TAG, String.format("getField value %s", new String(da)));
471 476
472 monitorWrite(MONITOR_CMD_FIELDVALUE, arg2); 477 monitorWrite(MONITOR_CMD_FIELDVALUE, arg2);
473 } 478 }
474 479
475 public synchronized void screenWatch(int l, int c, int len) { 480 public synchronized void screenWatch(int l, int c, int len) {