Class: TclTkIp
- Defined in:
- sample/demos-en/tkencoding.rb,
lib/tk.rb,
tcltklib.c,
lib/tk.rb,
lib/tk.rb more...
Overview
-*- ruby -*-
tkencoding.rb written by ttate@jaist.ac.jp
Instance Attribute Summary collapse
-
#encoding ⇒ Object
Sets the attribute encoding.
Class Method Summary collapse
Instance Method Summary collapse
- #__eval__ ⇒ Object
- #__fromUTF8 ⇒ Object
- #__invoke__ ⇒ Object
- #__toUTF8 ⇒ Object
- #_cancel_eval ⇒ Object
- #_cancel_eval_unwind ⇒ Object
- #_conv_listelement ⇒ Object
- #_create_console ⇒ Object
- #_eval(cmd) ⇒ Object (also: #_eval_with_enc, #__eval)
-
#_eval_without_enc ⇒ Object
backup original (without encoding) _eval and _invoke.
- #_fromUTF8(str, encoding = nil) ⇒ Object
- #_get_global_var ⇒ Object
- #_get_global_var2 ⇒ Object
-
#_get_variable ⇒ Object
—————————————————————.
- #_get_variable2 ⇒ Object
- #_immediate_invoke ⇒ Object
- #_invoke(*cmds) ⇒ Object (also: #_invoke_with_enc, #__invoke)
- #_invoke_without_enc ⇒ Object
- #_ip_id_ ⇒ Object
-
#_make_menu_embeddable ⇒ Object
—————————————————————.
- #_merge_tklist ⇒ Object
-
#_return_value ⇒ Object
get return code from Tcl_Eval().
- #_set_global_var ⇒ Object
- #_set_global_var2 ⇒ Object
- #_set_variable ⇒ Object
- #_set_variable2 ⇒ Object
-
#_split_tklist ⇒ Object
—————————————————————.
- #_thread_tkwait ⇒ Object
- #_thread_vwait ⇒ Object
- #_toUTF8(str, encoding = nil) ⇒ Object
- #_unset_global_var ⇒ Object
- #_unset_global_var2 ⇒ Object
- #_unset_variable ⇒ Object
- #_unset_variable2 ⇒ Object
-
#allow_ruby_exit= ⇒ Object
allow_ruby_exit = mode.
-
#allow_ruby_exit? ⇒ Boolean
allow_ruby_exit?.
-
#create_dummy_encoding_for_tk ⇒ Object
—————————————————————.
- #create_slave ⇒ Object
- #default_encoding=(name) ⇒ Object
-
#delete ⇒ Object
delete interpreter.
- #deleted? ⇒ Boolean
- #do_one_event ⇒ Object
- #encoding_name ⇒ Object (also: #encoding, #default_encoding)
- #encoding_obj ⇒ Object
- #encoding_table ⇒ Object
- #force_default_encoding=(mode) ⇒ Object
- #force_default_encoding? ⇒ Boolean
- #get_eventloop_tick ⇒ Object
- #get_eventloop_weight ⇒ Object
- #get_no_event_wait ⇒ Object
- #has_mainwindow? ⇒ Boolean
-
#initialize(*args) ⇒ Object
constructor
initialize interpreter.
-
#invalid_namespace? ⇒ Boolean
is deleted?.
-
#mainloop ⇒ Object
—————————————————————.
- #mainloop_abort_on_exception ⇒ Object
- #mainloop_abort_on_exception= ⇒ Object
- #mainloop_watchdog ⇒ Object
- #make_safe ⇒ Object
- #restart ⇒ Object
-
#safe? ⇒ Boolean
is safe?.
- #set_eventloop_tick ⇒ Object
- #set_eventloop_weight ⇒ Object
- #set_max_block_time ⇒ Object
- #set_no_event_wait ⇒ Object
-
#slave_of? ⇒ Boolean
self is slave of master?.
Constructor Details
permalink #initialize(*args) ⇒ Object
initialize interpreter
6119 6120 6121 6122 6123 6124 6125 |
# File 'tcltklib.c', line 6119 def initialize(*args) __initialize__(*args) @force_default_encoding ||= TkUtil.untrust([false]) @encoding ||= TkUtil.untrust([nil]) def @encoding.to_s; self.join(nil); end end |
Instance Attribute Details
Class Method Details
permalink .new(*args) ⇒ Object
[View source]
27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/multi-tk.rb', line 27 def new(*args) if Thread.current.group != ThreadGroup::Default raise SecurityError, 'only ThreadGroup::Default can call TclTkIp.new' end obj = __new__(*args) obj.instance_eval{ @force_default_encoding ||= TkUtil.untrust([false]) @encoding ||= TkUtil.untrust([nil]) def @encoding.to_s; self.join(nil); end } obj end |
permalink .to_s ⇒ Object
[View source]
35 |
# File 'lib/tk.rb', line 35 def @encoding.to_s; self.join(nil); end |
Instance Method Details
permalink #__fromUTF8 ⇒ Object
[View source]
2907 2908 2909 |
# File 'lib/tk.rb', line 2907 static VALUE ip_fromUTF8(argc, argv, self) int argc; |
permalink #__invoke__ ⇒ Object
[View source]
20 |
# File 'lib/tk.rb', line 20 alias __invoke__ _invoke |
permalink #__toUTF8 ⇒ Object
[View source]
2906 2907 2908 |
# File 'lib/tk.rb', line 2906 static VALUE ip_toUTF8(argc, argv, self) int argc; |
permalink #_cancel_eval ⇒ Object
[View source]
7761 7762 7763 |
# File 'tcltklib.c', line 7761 static VALUE ip_cancel_eval(argc, argv, self) int argc; |
permalink #_cancel_eval_unwind ⇒ Object
[View source]
7782 7783 7784 |
# File 'tcltklib.c', line 7782 static VALUE ip_cancel_eval_unwind(argc, argv, self) int argc; |
permalink #_conv_listelement ⇒ Object
[View source]
9907 9908 9909 |
# File 'tcltklib.c', line 9907 static VALUE lib_conv_listelement(self, src) VALUE self; |
permalink #_create_console ⇒ Object
[View source]
6598 6599 6600 |
# File 'tcltklib.c', line 6598 static VALUE ip_create_console(self) VALUE self; |
permalink #_eval(cmd) ⇒ Object Also known as: _eval_with_enc, __eval
[View source]
7557 7558 7559 7560 7561 7562 7563 |
# File 'tcltklib.c', line 7557 def _eval(cmd) if( @encoding ) _fromUTF8(__eval(_toUTF8(cmd,@encoding)),@encoding) else __eval(cmd) end end |
permalink #_eval_without_enc ⇒ Object
backup original (without encoding) _eval and _invoke
17 |
# File 'lib/tk.rb', line 17 alias _eval_without_enc _eval |
permalink #_fromUTF8(str, encoding = nil) ⇒ Object
[View source]
8280 8281 8282 |
# File 'tcltklib.c', line 8280 static VALUE ip_fromUTF8(argc, argv, self) int argc; |
permalink #_get_global_var ⇒ Object
[View source]
9597 9598 9599 |
# File 'tcltklib.c', line 9597 static VALUE ip_get_global_var(self, varname) VALUE self; |
permalink #_get_global_var2 ⇒ Object
[View source]
9606 9607 9608 |
# File 'tcltklib.c', line 9606 static VALUE ip_get_global_var2(self, varname, index) VALUE self; |
permalink #_get_variable ⇒ Object
9374 9375 9376 |
# File 'tcltklib.c', line 9374 static VALUE ip_get_variable(self, varname, flag) VALUE self; |
permalink #_get_variable2 ⇒ Object
[View source]
9348 9349 9350 |
# File 'tcltklib.c', line 9348 static VALUE ip_get_variable2(self, varname, index, flag) VALUE self; |
permalink #_immediate_invoke ⇒ Object
[View source]
9240 9241 9242 |
# File 'tcltklib.c', line 9240 static VALUE ip_invoke_immediate(argc, argv, obj) int argc; |
permalink #_invoke(*cmds) ⇒ Object Also known as: _invoke_with_enc, __invoke
[View source]
9231 9232 9233 9234 9235 9236 9237 9238 |
# File 'tcltklib.c', line 9231 def _invoke(*cmds) if( @encoding ) cmds = cmds.collect{|cmd| _toUTF8(cmd,@encoding)} _fromUTF8(__invoke(*cmds),@encoding) else __invoke(*cmds) end end |
permalink #_invoke_without_enc ⇒ Object
[View source]
19 |
# File 'lib/tk.rb', line 19 alias _invoke_without_enc _invoke |
permalink #_ip_id_ ⇒ Object
[View source]
22 23 24 25 |
# File 'lib/tk.rb', line 22 def _ip_id_ # for RemoteTkIp '' end |
permalink #_make_menu_embeddable ⇒ Object
10701 10702 10703 |
# File 'tcltklib.c', line 10701 static VALUE (interp, ) VALUE interp; |
permalink #_merge_tklist ⇒ Object
[View source]
9809 9810 9811 |
# File 'tcltklib.c', line 9809 static VALUE lib_merge_tklist(argc, argv, obj) int argc; |
permalink #_return_value ⇒ Object
get return code from Tcl_Eval()
9214 9215 9216 |
# File 'tcltklib.c', line 9214 static VALUE ip_retval(self) VALUE self; |
permalink #_set_global_var ⇒ Object
[View source]
9616 9617 9618 |
# File 'tcltklib.c', line 9616 static VALUE ip_set_global_var(self, varname, value) VALUE self; |
permalink #_set_global_var2 ⇒ Object
[View source]
9626 9627 9628 |
# File 'tcltklib.c', line 9626 static VALUE ip_set_global_var2(self, varname, index, value) VALUE self; |
permalink #_set_variable ⇒ Object
[View source]
9513 9514 9515 |
# File 'tcltklib.c', line 9513 static VALUE ip_set_variable(self, varname, value, flag) VALUE self; |
permalink #_set_variable2 ⇒ Object
[View source]
9484 9485 9486 |
# File 'tcltklib.c', line 9484 static VALUE ip_set_variable2(self, varname, index, value, flag) VALUE self; |
permalink #_split_tklist ⇒ Object
9801 9802 9803 |
# File 'tcltklib.c', line 9801 static VALUE ip_split_tklist(self, list_str) VALUE self; |
permalink #_thread_tkwait ⇒ Object
[View source]
5506 5507 5508 |
# File 'tcltklib.c', line 5506 static VALUE ip_thread_tkwait(self, mode, target) VALUE self; |
permalink #_thread_vwait ⇒ Object
[View source]
5492 5493 5494 |
# File 'tcltklib.c', line 5492 static VALUE ip_thread_vwait(self, var) VALUE self; |
permalink #_toUTF8(str, encoding = nil) ⇒ Object
[View source]
8078 8079 8080 |
# File 'tcltklib.c', line 8078 static VALUE ip_toUTF8(argc, argv, self) int argc; |
permalink #_unset_global_var ⇒ Object
[View source]
9637 9638 9639 |
# File 'tcltklib.c', line 9637 static VALUE ip_unset_global_var(self, varname) VALUE self; |
permalink #_unset_global_var2 ⇒ Object
[View source]
9646 9647 9648 |
# File 'tcltklib.c', line 9646 static VALUE ip_unset_global_var2(self, varname, index) VALUE self; |
permalink #_unset_variable ⇒ Object
[View source]
9588 9589 9590 |
# File 'tcltklib.c', line 9588 static VALUE ip_unset_variable(self, varname, flag) VALUE self; |
permalink #_unset_variable2 ⇒ Object
[View source]
9562 9563 9564 |
# File 'tcltklib.c', line 9562 static VALUE ip_unset_variable2(self, varname, index, flag) VALUE self; |
permalink #allow_ruby_exit= ⇒ Object
allow_ruby_exit = mode
6704 6705 6706 |
# File 'tcltklib.c', line 6704 static VALUE ip_allow_ruby_exit_set(self, val) VALUE self, val; |
permalink #allow_ruby_exit? ⇒ Boolean
allow_ruby_exit?
6685 6686 6687 |
# File 'tcltklib.c', line 6685 static VALUE ip_allow_ruby_exit_p(self) VALUE self; |
permalink #create_dummy_encoding_for_tk ⇒ Object
10082 10083 10084 |
# File 'tcltklib.c', line 10082 static VALUE create_dummy_encoding_for_tk(interp, name) VALUE interp; |
permalink #create_slave ⇒ Object
[View source]
6482 6483 6484 |
# File 'tcltklib.c', line 6482 static VALUE ip_create_slave(argc, argv, self) int argc; |
permalink #default_encoding=(name) ⇒ Object
[View source]
2880 2881 2882 2883 |
# File 'lib/tk.rb', line 2880 def default_encoding=(name) name = name.name if Tk::WITH_ENCODING && name.kind_of?(::Encoding) @encoding[0] = name.to_s.dup end |
permalink #delete ⇒ Object
delete interpreter
6759 6760 6761 |
# File 'tcltklib.c', line 6759 static VALUE ip_delete(self) VALUE self; |
permalink #deleted? ⇒ Boolean
6813 6814 6815 |
# File 'tcltklib.c', line 6813 static VALUE ip_is_deleted_p(self) VALUE self; |
permalink #do_one_event ⇒ Object
[View source]
3075 3076 3077 |
# File 'tcltklib.c', line 3075 static VALUE ip_do_one_event(argc, argv, self) int argc; |
permalink #encoding_name ⇒ Object Also known as: encoding, default_encoding
[View source]
2892 2893 2894 |
# File 'lib/tk.rb', line 2892 def encoding_name (@encoding[0])? @encoding[0].dup: nil end |
permalink #encoding_obj ⇒ Object
[View source]
2898 2899 2900 2901 2902 2903 2904 |
# File 'lib/tk.rb', line 2898 def encoding_obj if Tk::WITH_ENCODING Tk::Encoding.tcl2rb_encoding(@encoding[0]) else (@encoding[0])? @encoding[0].dup: nil end end |
permalink #encoding_table ⇒ Object
[View source]
10556 10557 10558 |
# File 'tcltklib.c', line 10556 static VALUE ip_get_encoding_table(interp) VALUE interp; |
permalink #force_default_encoding=(mode) ⇒ Object
[View source]
2872 2873 2874 |
# File 'lib/tk.rb', line 2872 def force_default_encoding=(mode) @force_default_encoding[0] = (mode)? true: false end |
permalink #force_default_encoding? ⇒ Boolean
2876 2877 2878 |
# File 'lib/tk.rb', line 2876 def force_default_encoding? @force_default_encoding[0] ||= false end |
permalink #get_eventloop_tick ⇒ Object
[View source]
1751 1752 1753 |
# File 'tcltklib.c', line 1751 static VALUE ip_get_eventloop_tick(self) VALUE self; |
permalink #get_eventloop_weight ⇒ Object
[View source]
1856 1857 1858 |
# File 'tcltklib.c', line 1856 static VALUE ip_get_eventloop_weight(self) VALUE self; |
permalink #get_no_event_wait ⇒ Object
[View source]
1802 1803 1804 |
# File 'tcltklib.c', line 1802 static VALUE ip_get_no_event_wait(self) VALUE self; |
permalink #has_mainwindow? ⇒ Boolean
6843 6844 6845 |
# File 'tcltklib.c', line 6843 static VALUE ip_has_mainwindow_p(self) VALUE self; |
permalink #invalid_namespace? ⇒ Boolean
is deleted?
6791 6792 6793 |
# File 'tcltklib.c', line 6791 static VALUE ip_has_invalid_namespace_p(self) VALUE self; |
permalink #mainloop ⇒ Object
2750 2751 2752 |
# File 'tcltklib.c', line 2750 static VALUE ip_mainloop(argc, argv, self) int argc; |
permalink #mainloop_abort_on_exception ⇒ Object
[View source]
1925 1926 1927 |
# File 'tcltklib.c', line 1925 static VALUE ip_evloop_abort_on_exc(self) VALUE self; |
permalink #mainloop_abort_on_exception= ⇒ Object
[View source]
1946 1947 1948 |
# File 'tcltklib.c', line 1946 static VALUE ip_evloop_abort_on_exc_set(self, val) VALUE self, val; |
permalink #mainloop_watchdog ⇒ Object
[View source]
2879 2880 2881 |
# File 'tcltklib.c', line 2879 static VALUE ip_mainloop_watchdog(argc, argv, self) int argc; |
permalink #make_safe ⇒ Object
[View source]
6651 6652 6653 |
# File 'tcltklib.c', line 6651 static VALUE ip_make_safe(self) VALUE self; |
permalink #restart ⇒ Object
[View source]
7883 7884 7885 |
# File 'tcltklib.c', line 7883 static VALUE ip_restart(self) VALUE self; |
permalink #safe? ⇒ Boolean
is safe?
6666 6667 6668 |
# File 'tcltklib.c', line 6666 static VALUE ip_is_safe_p(self) VALUE self; |
permalink #set_eventloop_tick ⇒ Object
[View source]
1732 1733 1734 |
# File 'tcltklib.c', line 1732 static VALUE ip_set_eventloop_tick(self, tick) VALUE self; |
permalink #set_eventloop_weight ⇒ Object
[View source]
1836 1837 1838 |
# File 'tcltklib.c', line 1836 static VALUE ip_set_eventloop_weight(self, loop_max, no_event) VALUE self; |
permalink #set_max_block_time ⇒ Object
[View source]
1863 1864 1865 |
# File 'tcltklib.c', line 1863 static VALUE set_max_block_time(self, time) VALUE self; |
permalink #set_no_event_wait ⇒ Object
[View source]
1783 1784 1785 |
# File 'tcltklib.c', line 1783 static VALUE ip_set_no_event_wait(self, wait) VALUE self; |
permalink #slave_of? ⇒ Boolean
self is slave of master?
6516 6517 6518 |
# File 'tcltklib.c', line 6516 static VALUE ip_is_slave_of_p(self, master) VALUE self, master; |