Class: TclTkIp
- Defined in:
- sample/demos-en/tkencoding.rb,
lib/tk.rb,
tcltklib.c,
lib/tk.rb,
lib/tk.rb
Overview
-*- ruby -*-
tkencoding.rb written by [email protected]
Instance Attribute Summary collapse
-
#encoding ⇒ Object
from tkencoding.rb by [email protected] attr_accessor :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
without Encoding (Ruby 1.8).
- #_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
Instance Attribute Details
#encoding=(value) ⇒ Object
from tkencoding.rb by [email protected] attr_accessor :encoding
2899 2900 2901 |
# File 'lib/tk.rb', line 2899 def encoding=(value) @encoding = value end |
Class Method Details
.__new__ ⇒ Object
24 |
# File 'lib/multi-tk.rb', line 24 alias __new__ new |
.new(*args) ⇒ Object
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 |
.to_s ⇒ Object
35 |
# File 'lib/tk.rb', line 35 def @encoding.to_s; self.join(nil); end |
Instance Method Details
#__eval__ ⇒ Object
18 |
# File 'lib/tk.rb', line 18 alias __eval__ _eval |
#__fromUTF8 ⇒ Object
2919 2920 2921 |
# File 'lib/tk.rb', line 2919 static VALUE ip_fromUTF8(argc, argv, self) int argc; |
#__invoke__ ⇒ Object
20 |
# File 'lib/tk.rb', line 20 alias __invoke__ _invoke |
#__toUTF8 ⇒ Object
2918 2919 2920 |
# File 'lib/tk.rb', line 2918 static VALUE ip_toUTF8(argc, argv, self) int argc; |
#_cancel_eval ⇒ Object
7810 7811 7812 |
# File 'tcltklib.c', line 7810 static VALUE ip_cancel_eval(argc, argv, self) int argc; |
#_cancel_eval_unwind ⇒ Object
7831 7832 7833 |
# File 'tcltklib.c', line 7831 static VALUE ip_cancel_eval_unwind(argc, argv, self) int argc; |
#_conv_listelement ⇒ Object
9979 9980 9981 |
# File 'tcltklib.c', line 9979 static VALUE lib_conv_listelement(self, src) VALUE self; |
#_create_console ⇒ Object
6647 6648 6649 |
# File 'tcltklib.c', line 6647 static VALUE ip_create_console(self) VALUE self; |
#_eval(cmd) ⇒ Object Also known as: _eval_with_enc, __eval
7606 7607 7608 7609 7610 7611 7612 |
# File 'tcltklib.c', line 7606 def _eval(cmd) if( @encoding ) _fromUTF8(__eval(_toUTF8(cmd,@encoding)),@encoding) else __eval(cmd) end end |
#_eval_without_enc ⇒ Object
backup original (without encoding) _eval and _invoke
17 |
# File 'lib/tk.rb', line 17 alias _eval_without_enc _eval |
#_fromUTF8(str, encoding = nil) ⇒ Object
8329 8330 8331 |
# File 'tcltklib.c', line 8329 static VALUE ip_fromUTF8(argc, argv, self) int argc; |
#_get_global_var ⇒ Object
9669 9670 9671 |
# File 'tcltklib.c', line 9669 static VALUE ip_get_global_var(self, varname) VALUE self; |
#_get_global_var2 ⇒ Object
9678 9679 9680 |
# File 'tcltklib.c', line 9678 static VALUE ip_get_global_var2(self, varname, index) VALUE self; |
#_get_variable ⇒ Object
9446 9447 9448 |
# File 'tcltklib.c', line 9446 static VALUE ip_get_variable(self, varname, flag) VALUE self; |
#_get_variable2 ⇒ Object
9420 9421 9422 |
# File 'tcltklib.c', line 9420 static VALUE ip_get_variable2(self, varname, index, flag) VALUE self; |
#_immediate_invoke ⇒ Object
9312 9313 9314 |
# File 'tcltklib.c', line 9312 static VALUE ip_invoke_immediate(argc, argv, obj) int argc; |
#_invoke(*cmds) ⇒ Object Also known as: _invoke_with_enc, __invoke
9303 9304 9305 9306 9307 9308 9309 9310 |
# File 'tcltklib.c', line 9303 def _invoke(*cmds) if( @encoding ) cmds = cmds.collect{|cmd| _toUTF8(cmd,@encoding)} _fromUTF8(__invoke(*cmds),@encoding) else __invoke(*cmds) end end |
#_invoke_without_enc ⇒ Object
19 |
# File 'lib/tk.rb', line 19 alias _invoke_without_enc _invoke |
#_ip_id_ ⇒ Object
22 23 24 25 |
# File 'lib/tk.rb', line 22 def _ip_id_ # for RemoteTkIp '' end |
#_make_menu_embeddable ⇒ Object
10773 10774 10775 |
# File 'tcltklib.c', line 10773 static VALUE (interp, ) VALUE interp; |
#_merge_tklist ⇒ Object
9881 9882 9883 |
# File 'tcltklib.c', line 9881 static VALUE lib_merge_tklist(argc, argv, obj) int argc; |
#_return_value ⇒ Object
get return code from Tcl_Eval()
9286 9287 9288 |
# File 'tcltklib.c', line 9286 static VALUE ip_retval(self) VALUE self; |
#_set_global_var ⇒ Object
9688 9689 9690 |
# File 'tcltklib.c', line 9688 static VALUE ip_set_global_var(self, varname, value) VALUE self; |
#_set_global_var2 ⇒ Object
9698 9699 9700 |
# File 'tcltklib.c', line 9698 static VALUE ip_set_global_var2(self, varname, index, value) VALUE self; |
#_set_variable ⇒ Object
9585 9586 9587 |
# File 'tcltklib.c', line 9585 static VALUE ip_set_variable(self, varname, value, flag) VALUE self; |
#_set_variable2 ⇒ Object
9556 9557 9558 |
# File 'tcltklib.c', line 9556 static VALUE ip_set_variable2(self, varname, index, value, flag) VALUE self; |
#_split_tklist ⇒ Object
9873 9874 9875 |
# File 'tcltklib.c', line 9873 static VALUE ip_split_tklist(self, list_str) VALUE self; |
#_thread_tkwait ⇒ Object
5515 5516 5517 |
# File 'tcltklib.c', line 5515 static VALUE ip_thread_tkwait(self, mode, target) VALUE self; |
#_thread_vwait ⇒ Object
5501 5502 5503 |
# File 'tcltklib.c', line 5501 static VALUE ip_thread_vwait(self, var) VALUE self; |
#_toUTF8(str, encoding = nil) ⇒ Object
without Encoding (Ruby 1.8)
8127 8128 8129 |
# File 'tcltklib.c', line 8127 static VALUE ip_toUTF8(argc, argv, self) int argc; |
#_unset_global_var ⇒ Object
9709 9710 9711 |
# File 'tcltklib.c', line 9709 static VALUE ip_unset_global_var(self, varname) VALUE self; |
#_unset_global_var2 ⇒ Object
9718 9719 9720 |
# File 'tcltklib.c', line 9718 static VALUE ip_unset_global_var2(self, varname, index) VALUE self; |
#_unset_variable ⇒ Object
9660 9661 9662 |
# File 'tcltklib.c', line 9660 static VALUE ip_unset_variable(self, varname, flag) VALUE self; |
#_unset_variable2 ⇒ Object
9634 9635 9636 |
# File 'tcltklib.c', line 9634 static VALUE ip_unset_variable2(self, varname, index, flag) VALUE self; |
#allow_ruby_exit= ⇒ Object
allow_ruby_exit = mode
6753 6754 6755 |
# File 'tcltklib.c', line 6753 static VALUE ip_allow_ruby_exit_set(self, val) VALUE self, val; |
#allow_ruby_exit? ⇒ Boolean
allow_ruby_exit?
6734 6735 6736 |
# File 'tcltklib.c', line 6734 static VALUE ip_allow_ruby_exit_p(self) VALUE self; |
#create_dummy_encoding_for_tk ⇒ Object
10154 10155 10156 |
# File 'tcltklib.c', line 10154 static VALUE create_dummy_encoding_for_tk(interp, name) VALUE interp; |
#create_slave ⇒ Object
6531 6532 6533 |
# File 'tcltklib.c', line 6531 static VALUE ip_create_slave(argc, argv, self) int argc; |
#default_encoding=(name) ⇒ Object
2892 2893 2894 2895 |
# File 'lib/tk.rb', line 2892 def default_encoding=(name) name = name.name if Tk::WITH_ENCODING && name.kind_of?(::Encoding) @encoding[0] = name.to_s.dup end |
#delete ⇒ Object
delete interpreter
6808 6809 6810 |
# File 'tcltklib.c', line 6808 static VALUE ip_delete(self) VALUE self; |
#deleted? ⇒ Boolean
6862 6863 6864 |
# File 'tcltklib.c', line 6862 static VALUE ip_is_deleted_p(self) VALUE self; |
#do_one_event ⇒ Object
3084 3085 3086 |
# File 'tcltklib.c', line 3084 static VALUE ip_do_one_event(argc, argv, self) int argc; |
#encoding_name ⇒ Object Also known as: encoding, default_encoding
2904 2905 2906 |
# File 'lib/tk.rb', line 2904 def encoding_name (@encoding[0])? @encoding[0].dup: nil end |
#encoding_obj ⇒ Object
2910 2911 2912 2913 2914 2915 2916 |
# File 'lib/tk.rb', line 2910 def encoding_obj if Tk::WITH_ENCODING Tk::Encoding.tcl2rb_encoding(@encoding[0]) else (@encoding[0])? @encoding[0].dup: nil end end |
#encoding_table ⇒ Object
10628 10629 10630 |
# File 'tcltklib.c', line 10628 static VALUE ip_get_encoding_table(interp) VALUE interp; |
#force_default_encoding=(mode) ⇒ Object
2884 2885 2886 |
# File 'lib/tk.rb', line 2884 def force_default_encoding=(mode) @force_default_encoding[0] = (mode)? true: false end |
#force_default_encoding? ⇒ Boolean
2888 2889 2890 |
# File 'lib/tk.rb', line 2888 def force_default_encoding? @force_default_encoding[0] ||= false end |
#get_eventloop_tick ⇒ Object
1760 1761 1762 |
# File 'tcltklib.c', line 1760 static VALUE ip_get_eventloop_tick(self) VALUE self; |
#get_eventloop_weight ⇒ Object
1865 1866 1867 |
# File 'tcltklib.c', line 1865 static VALUE ip_get_eventloop_weight(self) VALUE self; |
#get_no_event_wait ⇒ Object
1811 1812 1813 |
# File 'tcltklib.c', line 1811 static VALUE ip_get_no_event_wait(self) VALUE self; |
#has_mainwindow? ⇒ Boolean
6892 6893 6894 |
# File 'tcltklib.c', line 6892 static VALUE ip_has_mainwindow_p(self) VALUE self; |
#invalid_namespace? ⇒ Boolean
is deleted?
6840 6841 6842 |
# File 'tcltklib.c', line 6840 static VALUE ip_has_invalid_namespace_p(self) VALUE self; |
#mainloop ⇒ Object
2759 2760 2761 |
# File 'tcltklib.c', line 2759 static VALUE ip_mainloop(argc, argv, self) int argc; |
#mainloop_abort_on_exception ⇒ Object
1934 1935 1936 |
# File 'tcltklib.c', line 1934 static VALUE ip_evloop_abort_on_exc(self) VALUE self; |
#mainloop_abort_on_exception= ⇒ Object
1955 1956 1957 |
# File 'tcltklib.c', line 1955 static VALUE ip_evloop_abort_on_exc_set(self, val) VALUE self, val; |
#mainloop_watchdog ⇒ Object
2888 2889 2890 |
# File 'tcltklib.c', line 2888 static VALUE ip_mainloop_watchdog(argc, argv, self) int argc; |
#make_safe ⇒ Object
6700 6701 6702 |
# File 'tcltklib.c', line 6700 static VALUE ip_make_safe(self) VALUE self; |
#restart ⇒ Object
7932 7933 7934 |
# File 'tcltklib.c', line 7932 static VALUE ip_restart(self) VALUE self; |
#safe? ⇒ Boolean
is safe?
6715 6716 6717 |
# File 'tcltklib.c', line 6715 static VALUE ip_is_safe_p(self) VALUE self; |
#set_eventloop_tick ⇒ Object
1741 1742 1743 |
# File 'tcltklib.c', line 1741 static VALUE ip_set_eventloop_tick(self, tick) VALUE self; |
#set_eventloop_weight ⇒ Object
1845 1846 1847 |
# File 'tcltklib.c', line 1845 static VALUE ip_set_eventloop_weight(self, loop_max, no_event) VALUE self; |
#set_max_block_time ⇒ Object
1872 1873 1874 |
# File 'tcltklib.c', line 1872 static VALUE set_max_block_time(self, time) VALUE self; |
#set_no_event_wait ⇒ Object
1792 1793 1794 |
# File 'tcltklib.c', line 1792 static VALUE ip_set_no_event_wait(self, wait) VALUE self; |
#slave_of? ⇒ Boolean
self is slave of master?
6565 6566 6567 |
# File 'tcltklib.c', line 6565 static VALUE ip_is_slave_of_p(self, master) VALUE self, master; |