Class: RemoteTkIp
- Inherits:
-
MultiTkIp
show all
- Defined in:
- ext/lib/remote-tk.rb,
ext/lib/remote-tk.rb,
ext/lib/remote-tk.rb,
ext/lib/remote-tk.rb
Constant Summary
collapse
- @@IP_TABLE =
MultiTkIp._IP_TABLE
- @@TK_TABLE_LIST =
MultiTkIp._TK_TABLE_LIST
Constants inherited
from MultiTkIp
MultiTkIp::BASE_DIR, MultiTkIp::INTERP_MUTEX, MultiTkIp::INTERP_ROOT_CHECK, MultiTkIp::INTERP_THREAD, MultiTkIp::INTERP_THREAD_STATUS, MultiTkIp::RUN_EVENTLOOP_ON_MAIN_THREAD, MultiTkIp::WITH_ENCODING, MultiTkIp::WITH_RUBY_VM
Class Method Summary
collapse
Instance Method Summary
collapse
-
#__eval(str) ⇒ Object
-
#__invoke(*args) ⇒ Object
-
#_conv_listelement(str) ⇒ Object
-
#_create_console ⇒ Object
-
#_eval(str) ⇒ Object
-
#_eval_with_enc(str) ⇒ Object
-
#_eval_without_enc(str) ⇒ Object
-
#_fromUTF8(str, encoding = nil) ⇒ Object
-
#_get_global_var(var_name) ⇒ Object
-
#_get_global_var2(var_name, index_name) ⇒ Object
-
#_get_variable(var_name, flag) ⇒ Object
-
#_get_variable2(var_name, index_name, flag) ⇒ Object
-
#_invoke(*args) ⇒ Object
-
#_invoke_with_enc(*args) ⇒ Object
-
#_invoke_without_enc(*args) ⇒ Object
-
#_ip_id_ ⇒ Object
-
#_merge_tklist(*args) ⇒ Object
-
#_return_value ⇒ Object
-
#_set_global_var(var_name, value) ⇒ Object
-
#_set_global_var2(var_name, index_name, value) ⇒ Object
-
#_set_variable(var_name, value, flag) ⇒ Object
-
#_set_variable2(var_name, index_name, value, flag) ⇒ Object
-
#_split_tklist(str) ⇒ Object
-
#_thread_tkwait(mode, target) ⇒ Object
-
#_thread_vwait(var_name) ⇒ Object
-
#_toUTF8(str, encoding = nil) ⇒ Object
-
#_unset_global_var(var_name) ⇒ Object
-
#_unset_global_var2(var_name, index_name) ⇒ Object
-
#_unset_variable(var_name, flag) ⇒ Object
-
#_unset_variable2(var_name, index_name, flag) ⇒ Object
-
#allow_ruby_exit=(mode) ⇒ Object
-
#allow_ruby_exit? ⇒ Boolean
-
#appsend(async, *args) ⇒ Object
-
#create_slave(name, safe = false) ⇒ Object
-
#delete ⇒ Object
-
#deleted? ⇒ Boolean
-
#do_one_evant(flag = nil) ⇒ Object
-
#get_eventloop_tick ⇒ Object
-
#get_eventloop_weight ⇒ Object
-
#get_no_event_wait ⇒ Object
-
#has_mainwindow? ⇒ Boolean
-
#initialize(remote_ip, displayof = nil, timeout = 5) ⇒ RemoteTkIp
constructor
A new instance of RemoteTkIp.
-
#invalid_namespace? ⇒ Boolean
-
#is_rubytk? ⇒ Boolean
-
#mainloop ⇒ Object
-
#mainloop_abort_on_exception ⇒ Object
-
#mainloop_abort_on_exception=(mode) ⇒ Object
-
#mainloop_watchdog ⇒ Object
-
#make_safe ⇒ Object
-
#manipulable? ⇒ Boolean
-
#rb_appsend(async, *args) ⇒ Object
-
#ready?(timeout = 5) ⇒ Boolean
-
#restart ⇒ Object
-
#safe? ⇒ Boolean
-
#safe_base? ⇒ Boolean
-
#set_eventloop_tick(*args) ⇒ Object
-
#set_eventloop_weight(*args) ⇒ Object
-
#set_no_event_wait(*args) ⇒ Object
Methods inherited from MultiTkIp
_DEFAULT_MASTER, _IP_TABLE, _TK_TABLE_LIST, #__create_safe_slave_obj, #__create_trusted_slave_obj, __getip, #__pseudo_toplevel, #__pseudo_toplevel=, #__pseudo_toplevel_evaluable=, #__pseudo_toplevel_evaluable?, #_add_new_tables, #_add_tk_procs, _conv_listelement, _create_console, #_create_slave_object, #_default_delete_hook, #_destroy_slaves_of_slaveIP, _eval, _eval_with_enc, _eval_without_enc, _fromUTF8, _get_global_var, _get_global_var2, _get_variable, _get_variable2, #_init_ip_env, #_init_ip_internal, _invoke, _invoke_with_enc, _invoke_without_enc, _ip_id_, _make_menu_embeddable, #_make_menu_embeddable, _merge_tklist, #_receiver_mainloop, #_remove_tk_procs, _return_value, _set_global_var, _set_global_var2, _set_variable, _set_variable2, _split_tklist, _thread_tkwait, _thread_vwait, #_tk_cmd_tbl, #_tk_table_list, #_tk_windows, _toUTF8, _unset_global_var, _unset_global_var2, _unset_variable, _unset_variable2, abort, #abort, add_tk_procs, #alias_delete, alias_delete, #alias_info, alias_info, #alias_target, alias_target, #aliases, aliases, #alive?, alive?, allow_ruby_exit=, allow_ruby_exit?, #background_call, #background_eval, #background_eval_proc, #background_eval_str, #background_eval_string, #bg_call, bg_eval, #bg_eval, #bg_eval_proc, bg_eval_proc, #bg_eval_str, #bg_eval_string, bg_eval_string, bgerror, #call, cb_entry_class, #cb_error, #cb_eval, create_table, def_alias, #def_alias, default_encoding, #default_encoding=, default_encoding=, default_master?, delete, #delete_cmd, delete_cmd, #delete_slaves, delete_slaves, deleted?, do_one_event, encoding, #encoding=, encoding=, encoding_convert_from, encoding_convert_to, encoding_convertfrom, #encoding_convertfrom, encoding_convertto, #encoding_convertto, encoding_name, #encoding_name, #encoding_obj, encoding_obj, encoding_table, #encoding_table, eval, #eval, #eval_callback, eval_proc, #eval_proc, #eval_str, eval_string, #eval_string, exist?, #exist?, exit, #exit, exit!, #exit!, #expose_cmd, expose_cmd, #force_default_encoding=, force_default_encoding=, force_default_encoding?, #force_default_encoding?, #get_bgerror_handler, get_cb_entry, #get_limit, get_limit, has_mainwindow?, #hidden_cmds, hidden_cmds, hide_cmd, #hide_cmd, inherited, init_ip_env, init_ip_internal, #inspect, invalid_namespace?, #invoke_hidden, invoke_hidden, #invoke_hidden_on_global, invoke_hidden_on_global, invoke_hidden_on_namespace, #invoke_hidden_on_namespace, #ip_name, ip_name, make_safe, #mark_trusted, mark_trusted, master?, #master?, method_missing, new_master, new_safe_slave, new_slave, path, #path, recursion_limit, #recursion_limit, remove_tk_procs, restart, #running_mainloop?, safe?, safe_base?, #safe_level, safe_level, safe_level=, #safe_level=, #safeip_add_to_access_path, #safeip_configinfo, #safeip_configure, #safeip_delete, #safeip_find_in_access_path, #safeip_set_log_cmd, #set_bgerror_handler, #set_cb_error, #set_limit, set_limit, #set_safe_level, set_safe_level, #share_stderr, share_stderr, #share_stdin, share_stdin, share_stdio, #share_stdio, #share_stdout, share_stdout, #slave?, slave?, slaves, #slaves, #thread_eval_proc, tk_cmd_tbl, tk_object_table, tk_windows, to_eval, #to_eval, transfer_stderr, #transfer_stderr, transfer_stdin, #transfer_stdin, transfer_stdio, #transfer_stdio, #transfer_stdout, transfer_stdout, #wait_on_mainloop=, #wait_on_mainloop?
Constructor Details
#initialize(remote_ip, displayof = nil, timeout = 5) ⇒ RemoteTkIp
Returns a new instance of RemoteTkIp.
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
|
# File 'ext/lib/remote-tk.rb', line 63
def initialize(remote_ip, displayof=nil, timeout=5)
if $SAFE >= 4
fail SecurityError, "cannot access another interpreter at level #{$SAFE}"
end
@interp = MultiTkIp.__getip
if @interp.safe?
fail SecurityError, "safe-IP cannot create RemoteTkIp"
end
@interp.allow_ruby_exit = false
@appname = @interp._invoke('tk', 'appname')
@remote = remote_ip.to_s.dup.freeze
if displayof.kind_of?(TkWindow)
@displayof = displayof.path.dup.freeze
else
@displayof = nil
end
if self.deleted?
fail RuntimeError, "no Tk application named \"#{@remote}\""
end
@tk_windows = {}
@tk_table_list = []
@slave_ip_tbl = {}
@slave_ip_top = {}
@force_default_encoding ||= [false].taint
@encoding ||= [nil].taint
def @encoding.to_s; self.join(nil); end
@tk_windows.taint unless @tk_windows.tainted?
@tk_table_list.taint unless @tk_table_list.tainted?
@slave_ip_tbl.taint unless @slave_ip_tbl.tainted?
@slave_ip_top.taint unless @slave_ip_top.tainted?
@system = Object.new
@threadgroup = ThreadGroup.new
@safe_level = [$SAFE]
@wait_on_mainloop = [true, 0]
@cmd_queue = Queue.new
=begin
@cmd_receiver, @receiver_watchdog = _create_receiver_and_watchdog()
@threadgroup.add @cmd_receiver
@threadgroup.add @receiver_watchdog
@threadgroup.enclose
=end
@@DEFAULT_MASTER.assign_receiver_and_watchdog(self)
@@IP_TABLE[@threadgroup] = self
@@TK_TABLE_LIST.size.times{
(tbl = {}).tainted? || tbl.taint
@tk_table_list << tbl
}
@ret_val = TkVariable.new
if timeout > 0 && ! _available_check(timeout)
fail RuntimeError, "cannot create connection"
end
@ip_id = _create_connection
class << self
undef :instance_eval
end
self.freeze end
|
Class Method Details
.do_one_evant(flag = nil) ⇒ Object
503
504
505
|
# File 'ext/lib/remote-tk.rb', line 503
def do_one_evant(flag = nil)
fail RuntimeError, 'not support "do_one_event" on the remote interpreter'
end
|
.get_eventloop_tick ⇒ Object
515
516
517
|
# File 'ext/lib/remote-tk.rb', line 515
def get_eventloop_tick
fail RuntimeError, 'not support "get_eventloop_tick" on the remote interpreter'
end
|
.get_eventloop_weight ⇒ Object
527
528
529
|
# File 'ext/lib/remote-tk.rb', line 527
def get_eventloop_weight
fail RuntimeError, 'not support "get_eventloop_weight" on the remote interpreter'
end
|
.get_no_event_wait ⇒ Object
521
522
523
|
# File 'ext/lib/remote-tk.rb', line 521
def get_no_event_wait
fail RuntimeError, 'not support "get_no_event_wait" on the remote interpreter'
end
|
.mainloop(*args) ⇒ Object
497
498
499
|
# File 'ext/lib/remote-tk.rb', line 497
def mainloop(*args)
fail RuntimeError, 'not support "mainloop" on the remote interpreter'
end
|
.mainloop_abort_on_exception ⇒ Object
506
507
508
|
# File 'ext/lib/remote-tk.rb', line 506
def mainloop_abort_on_exception
fail RuntimeError, 'not support "mainloop_abort_on_exception" on the remote interpreter'
end
|
.mainloop_abort_on_exception=(mode) ⇒ Object
509
510
511
|
# File 'ext/lib/remote-tk.rb', line 509
def mainloop_abort_on_exception=(mode)
fail RuntimeError, 'not support "mainloop_abort_on_exception=" on the remote interpreter'
end
|
.mainloop_watchdog(*args) ⇒ Object
500
501
502
|
# File 'ext/lib/remote-tk.rb', line 500
def mainloop_watchdog(*args)
fail RuntimeError, 'not support "mainloop_watchdog" on the remote interpreter'
end
|
.manipulable? ⇒ Boolean
143
144
145
|
# File 'ext/lib/remote-tk.rb', line 143
def self.manipulable?
true
end
|
.new(*args, &b) ⇒ Object
55
56
57
58
59
|
# File 'ext/lib/remote-tk.rb', line 55
def new(*args, &b)
ip = __new(*args)
ip.eval_proc(&b) if b
ip
end
|
.set_eventloop_tick(*args) ⇒ Object
512
513
514
|
# File 'ext/lib/remote-tk.rb', line 512
def set_eventloop_tick(*args)
fail RuntimeError, 'not support "set_eventloop_tick" on the remote interpreter'
end
|
.set_eventloop_weight(*args) ⇒ Object
524
525
526
|
# File 'ext/lib/remote-tk.rb', line 524
def set_eventloop_weight(*args)
fail RuntimeError, 'not support "set_eventloop_weight" on the remote interpreter'
end
|
.set_no_event_wait(*args) ⇒ Object
518
519
520
|
# File 'ext/lib/remote-tk.rb', line 518
def set_no_event_wait(*args)
fail RuntimeError, 'not support "set_no_event_wait" on the remote interpreter'
end
|
93
|
# File 'ext/lib/remote-tk.rb', line 93
def @encoding.to_s; self.join(nil); end
|
Instance Method Details
#__eval(str) ⇒ Object
341
342
343
|
# File 'ext/lib/remote-tk.rb', line 341
def __eval(str)
_appsend(false, false, str)
end
|
#__invoke(*args) ⇒ Object
358
359
360
|
# File 'ext/lib/remote-tk.rb', line 358
def __invoke(*args)
_appsend(false, false, *args)
end
|
#_conv_listelement(str) ⇒ Object
452
453
454
455
|
# File 'ext/lib/remote-tk.rb', line 452
def _conv_listelement(str)
raise SecurityError, "no permission to manipulate" unless self.manipulable?
@interp._conv_listelement(str)
end
|
#_create_console ⇒ Object
457
458
459
|
# File 'ext/lib/remote-tk.rb', line 457
def _create_console
fail RuntimeError, 'not support "_create_console" on the remote interpreter'
end
|
#_eval(str) ⇒ Object
344
345
346
|
# File 'ext/lib/remote-tk.rb', line 344
def _eval(str)
_appsend(nil, false, str)
end
|
#_eval_with_enc(str) ⇒ Object
350
351
352
|
# File 'ext/lib/remote-tk.rb', line 350
def _eval_with_enc(str)
_appsend(true, false, str)
end
|
#_eval_without_enc(str) ⇒ Object
347
348
349
|
# File 'ext/lib/remote-tk.rb', line 347
def _eval_without_enc(str)
_appsend(false, false, str)
end
|
#_fromUTF8(str, encoding = nil) ⇒ Object
376
377
378
379
|
# File 'ext/lib/remote-tk.rb', line 376
def _fromUTF8(str, encoding=nil)
raise SecurityError, "no permission to manipulate" unless self.manipulable?
@interp._fromUTF8(str, encoding)
end
|
#_get_global_var(var_name) ⇒ Object
421
422
423
|
# File 'ext/lib/remote-tk.rb', line 421
def _get_global_var(var_name)
_appsend(false, 'set', TkComm::_get_eval_string(var_name))
end
|
#_get_global_var2(var_name, index_name) ⇒ Object
#_get_variable(var_name, flag) ⇒ Object
394
395
396
397
|
# File 'ext/lib/remote-tk.rb', line 394
def _get_variable(var_name, flag)
_appsend(false, 'set', TkComm::_get_eval_string(var_name))
end
|
#_get_variable2(var_name, index_name, flag) ⇒ Object
#_invoke(*args) ⇒ Object
354
355
356
|
# File 'ext/lib/remote-tk.rb', line 354
def _invoke(*args)
_appsend(nil, false, *args)
end
|
#_invoke_with_enc(*args) ⇒ Object
367
368
369
|
# File 'ext/lib/remote-tk.rb', line 367
def _invoke_with_enc(*args)
_appsend(true, false, *args)
end
|
#_invoke_without_enc(*args) ⇒ Object
364
365
366
|
# File 'ext/lib/remote-tk.rb', line 364
def _invoke_without_enc(*args)
_appsend(false, false, *args)
end
|
152
153
154
|
# File 'ext/lib/remote-tk.rb', line 152
def _ip_id_
@ip_id
end
|
#_merge_tklist(*args) ⇒ Object
447
448
449
450
|
# File 'ext/lib/remote-tk.rb', line 447
def _merge_tklist(*args)
raise SecurityError, "no permission to manipulate" unless self.manipulable?
@interp._merge_tklist(*args)
end
|
#_return_value ⇒ Object
389
390
391
392
|
# File 'ext/lib/remote-tk.rb', line 389
def _return_value
raise SecurityError, "no permission to manipulate" unless self.manipulable?
@interp._return_value
end
|
#_set_global_var(var_name, value) ⇒ Object
#_set_global_var2(var_name, index_name, value) ⇒ Object
#_set_variable(var_name, value, flag) ⇒ Object
#_set_variable2(var_name, index_name, value, flag) ⇒ Object
#_split_tklist(str) ⇒ Object
442
443
444
445
|
# File 'ext/lib/remote-tk.rb', line 442
def _split_tklist(str)
raise SecurityError, "no permission to manipulate" unless self.manipulable?
@interp._split_tklist(str)
end
|
#_thread_tkwait(mode, target) ⇒ Object
385
386
387
|
# File 'ext/lib/remote-tk.rb', line 385
def _thread_tkwait(mode, target)
_appsend(false, 'thread_tkwait', mode, target)
end
|
#_thread_vwait(var_name) ⇒ Object
381
382
383
|
# File 'ext/lib/remote-tk.rb', line 381
def _thread_vwait(var_name)
_appsend(false, 'thread_vwait', varname)
end
|
#_toUTF8(str, encoding = nil) ⇒ Object
371
372
373
374
|
# File 'ext/lib/remote-tk.rb', line 371
def _toUTF8(str, encoding=nil)
raise SecurityError, "no permission to manipulate" unless self.manipulable?
@interp._toUTF8(str, encoding)
end
|
#_unset_global_var(var_name) ⇒ Object
435
436
437
|
# File 'ext/lib/remote-tk.rb', line 435
def _unset_global_var(var_name)
_appsend(false, 'unset', TkComm::_get_eval_string(var_name))
end
|
#_unset_global_var2(var_name, index_name) ⇒ Object
438
439
440
|
# File 'ext/lib/remote-tk.rb', line 438
def _unset_global_var2(var_name, index_name)
_appsend(false, 'unset', "#{var_name}(#{index_name})")
end
|
#_unset_variable(var_name, flag) ⇒ Object
412
413
414
415
|
# File 'ext/lib/remote-tk.rb', line 412
def _unset_variable(var_name, flag)
_appsend(false, 'unset', TkComm::_get_eval_string(var_name))
end
|
#_unset_variable2(var_name, index_name, flag) ⇒ Object
416
417
418
419
|
# File 'ext/lib/remote-tk.rb', line 416
def _unset_variable2(var_name, index_name, flag)
_appsend(false, 'unset', "#{var_name}(#{index_name})")
end
|
#allow_ruby_exit=(mode) ⇒ Object
293
294
295
|
# File 'ext/lib/remote-tk.rb', line 293
def allow_ruby_exit= (mode)
fail RuntimeError, 'cannot change mode of the remote interpreter'
end
|
#allow_ruby_exit? ⇒ Boolean
289
290
291
|
# File 'ext/lib/remote-tk.rb', line 289
def allow_ruby_exit?
false
end
|
#appsend(async, *args) ⇒ Object
240
241
242
243
244
245
246
247
248
249
250
251
252
|
# File 'ext/lib/remote-tk.rb', line 240
def appsend(async, *args)
raise SecurityError, "no permission to manipulate" unless self.manipulable?
if async != true && async != false && async != nil
args.unshift(async)
async = false
end
if @displayof
Tk.appsend_displayof(@remote, @displayof, async, *args)
else
Tk.appsend(@remote, async, *args)
end
end
|
#create_slave(name, safe = false) ⇒ Object
268
269
270
271
272
273
274
275
|
# File 'ext/lib/remote-tk.rb', line 268
def create_slave(name, safe=false)
if safe
safe_opt = ''
else
safe_opt = '-safe'
end
_appsend(false, false, "interp create #{safe_opt} -- #{name}")
end
|
297
298
299
|
# File 'ext/lib/remote-tk.rb', line 297
def delete
_appsend(false, true, 'exit')
end
|
#deleted? ⇒ Boolean
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
|
# File 'ext/lib/remote-tk.rb', line 301
def deleted?
raise SecurityError, "no permission to manipulate" unless self.manipulable?
if @displayof
lst = @interp._invoke_without_enc('winfo', 'interps',
'-displayof', @displayof)
else
lst = @interp._invoke_without_enc('winfo', 'interps')
end
unless @interp._split_tklist(lst).index(_toUTF8(@remote))
true
else
false
end
end
|
#do_one_evant(flag = nil) ⇒ Object
467
468
469
|
# File 'ext/lib/remote-tk.rb', line 467
def do_one_evant(flag = nil)
fail RuntimeError, 'not support "do_one_event" on the remote interpreter'
end
|
#get_eventloop_tick ⇒ Object
479
480
481
|
# File 'ext/lib/remote-tk.rb', line 479
def get_eventloop_tick
fail RuntimeError, 'not support "get_eventloop_tick" on the remote interpreter'
end
|
#get_eventloop_weight ⇒ Object
491
492
493
|
# File 'ext/lib/remote-tk.rb', line 491
def get_eventloop_weight
fail RuntimeError, 'not support "get_eventloop_weight" on the remote interpreter'
end
|
#get_no_event_wait ⇒ Object
485
486
487
|
# File 'ext/lib/remote-tk.rb', line 485
def get_no_event_wait
fail RuntimeError, 'not support "get_no_event_wait" on the remote interpreter'
end
|
#has_mainwindow? ⇒ Boolean
318
319
320
321
322
323
324
325
326
327
328
329
330
331
|
# File 'ext/lib/remote-tk.rb', line 318
def has_mainwindow?
raise SecurityError, "no permission to manipulate" unless self.manipulable?
begin
inf = @interp._invoke_without_enc('info', 'command', '.')
rescue Exception
return nil
end
if !inf.kind_of?(String) || inf != '.'
false
else
true
end
end
|
#invalid_namespace? ⇒ Boolean
333
334
335
|
# File 'ext/lib/remote-tk.rb', line 333
def invalid_namespace?
false
end
|
#is_rubytk? ⇒ Boolean
234
235
236
237
238
|
# File 'ext/lib/remote-tk.rb', line 234
def is_rubytk?
return false if _appsend(false, false, 'info', 'command', 'ruby') == ""
[ _appsend(false, false, 'ruby', 'RUBY_VERSION'),
_appsend(false, false, 'set', 'tk_patchLevel') ]
end
|
461
462
463
|
# File 'ext/lib/remote-tk.rb', line 461
def mainloop
fail RuntimeError, 'not support "mainloop" on the remote interpreter'
end
|
#mainloop_abort_on_exception ⇒ Object
470
471
472
|
# File 'ext/lib/remote-tk.rb', line 470
def mainloop_abort_on_exception
fail RuntimeError, 'not support "mainloop_abort_on_exception" on the remote interpreter'
end
|
#mainloop_abort_on_exception=(mode) ⇒ Object
473
474
475
|
# File 'ext/lib/remote-tk.rb', line 473
def mainloop_abort_on_exception=(mode)
fail RuntimeError, 'not support "mainloop_abort_on_exception=" on the remote interpreter'
end
|
#mainloop_watchdog ⇒ Object
464
465
466
|
# File 'ext/lib/remote-tk.rb', line 464
def mainloop_watchdog
fail RuntimeError, 'not support "mainloop_watchdog" on the remote interpreter'
end
|
#make_safe ⇒ Object
277
278
279
|
# File 'ext/lib/remote-tk.rb', line 277
def make_safe
fail RuntimeError, 'cannot change safe mode of the remote interpreter'
end
|
#manipulable? ⇒ Boolean
139
140
141
142
|
# File 'ext/lib/remote-tk.rb', line 139
def manipulable?
return true if (Thread.current.group == ThreadGroup::Default)
MultiTkIp.__getip == @interp && ! @interp.safe?
end
|
#rb_appsend(async, *args) ⇒ Object
254
255
256
257
258
259
260
261
262
263
264
265
266
|
# File 'ext/lib/remote-tk.rb', line 254
def rb_appsend(async, *args)
raise SecurityError, "no permission to manipulate" unless self.manipulable?
if async != true && async != false && async != nil
args.unshift(async)
async = false
end
if @displayof
Tk.rb_appsend_displayof(@remote, @displayof, async, *args)
else
Tk.rb_appsend(@remote, async, *args)
end
end
|
#ready?(timeout = 5) ⇒ Boolean
227
228
229
230
231
232
|
# File 'ext/lib/remote-tk.rb', line 227
def ready?(timeout=5)
if timeout < 0
fail ArgumentError, "timeout must be positive number"
end
_available_check(timeout)
end
|
337
338
339
|
# File 'ext/lib/remote-tk.rb', line 337
def restart
fail RuntimeError, 'cannot restart the remote interpreter'
end
|
#safe? ⇒ Boolean
281
282
283
|
# File 'ext/lib/remote-tk.rb', line 281
def safe?
_appsend(false, false, 'interp issafe')
end
|
#safe_base? ⇒ Boolean
285
286
287
|
# File 'ext/lib/remote-tk.rb', line 285
def safe_base?
false
end
|
#set_eventloop_tick(*args) ⇒ Object
476
477
478
|
# File 'ext/lib/remote-tk.rb', line 476
def set_eventloop_tick(*args)
fail RuntimeError, 'not support "set_eventloop_tick" on the remote interpreter'
end
|
#set_eventloop_weight(*args) ⇒ Object
488
489
490
|
# File 'ext/lib/remote-tk.rb', line 488
def set_eventloop_weight(*args)
fail RuntimeError, 'not support "set_eventloop_weight" on the remote interpreter'
end
|
#set_no_event_wait(*args) ⇒ Object
482
483
484
|
# File 'ext/lib/remote-tk.rb', line 482
def set_no_event_wait(*args)
fail RuntimeError, 'not support "set_no_event_wait" on the remote interpreter'
end
|