Class: TclTkIp
- Defined in:
- sample/demos-en/tkencoding.rb,
lib/tk.rb,
tcltklib.c,
lib/tk.rb,
lib/tk.rb
Overview
frozen_string_literal: false -*- 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
2889 2890 2891 |
# File 'lib/tk.rb', line 2889 def encoding=(value) @encoding = value end |
Class Method Details
.__new__ ⇒ Object
25 |
# File 'lib/multi-tk.rb', line 25 alias __new__ new |
.new(*args) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/multi-tk.rb', line 28 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
36 |
# File 'lib/tk.rb', line 36 def @encoding.to_s; self.join(nil); end |
Instance Method Details
#__eval__ ⇒ Object
19 |
# File 'lib/tk.rb', line 19 alias __eval__ _eval |
#__fromUTF8 ⇒ Object
2909 2910 2911 |
# File 'lib/tk.rb', line 2909 static VALUE ip_fromUTF8(argc, argv, self) int argc; |
#__invoke__ ⇒ Object
21 |
# File 'lib/tk.rb', line 21 alias __invoke__ _invoke |
#__toUTF8 ⇒ Object
2908 2909 2910 |
# File 'lib/tk.rb', line 2908 static VALUE ip_toUTF8(argc, argv, self) int argc; |
#_cancel_eval ⇒ Object
7770 7771 7772 |
# File 'tcltklib.c', line 7770 static VALUE ip_cancel_eval(argc, argv, self) int argc; |
#_cancel_eval_unwind ⇒ Object
7791 7792 7793 |
# File 'tcltklib.c', line 7791 static VALUE ip_cancel_eval_unwind(argc, argv, self) int argc; |
#_conv_listelement ⇒ Object
9936 9937 9938 |
# File 'tcltklib.c', line 9936 static VALUE lib_conv_listelement(self, src) VALUE self; |
#_create_console ⇒ Object
6606 6607 6608 |
# File 'tcltklib.c', line 6606 static VALUE ip_create_console(self) VALUE self; |
#_eval(cmd) ⇒ Object Also known as: _eval_with_enc, __eval
7565 7566 7567 7568 7569 7570 7571 |
# File 'tcltklib.c', line 7565 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
18 |
# File 'lib/tk.rb', line 18 alias _eval_without_enc _eval |
#_fromUTF8(str, encoding = nil) ⇒ Object
8289 8290 8291 |
# File 'tcltklib.c', line 8289 static VALUE ip_fromUTF8(argc, argv, self) int argc; |
#_get_global_var ⇒ Object
9626 9627 9628 |
# File 'tcltklib.c', line 9626 static VALUE ip_get_global_var(self, varname) VALUE self; |
#_get_global_var2 ⇒ Object
9635 9636 9637 |
# File 'tcltklib.c', line 9635 static VALUE ip_get_global_var2(self, varname, index) VALUE self; |
#_get_variable ⇒ Object
9403 9404 9405 |
# File 'tcltklib.c', line 9403 static VALUE ip_get_variable(self, varname, flag) VALUE self; |
#_get_variable2 ⇒ Object
9377 9378 9379 |
# File 'tcltklib.c', line 9377 static VALUE ip_get_variable2(self, varname, index, flag) VALUE self; |
#_immediate_invoke ⇒ Object
9269 9270 9271 |
# File 'tcltklib.c', line 9269 static VALUE ip_invoke_immediate(argc, argv, obj) int argc; |
#_invoke(*cmds) ⇒ Object Also known as: _invoke_with_enc, __invoke
9260 9261 9262 9263 9264 9265 9266 9267 |
# File 'tcltklib.c', line 9260 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
20 |
# File 'lib/tk.rb', line 20 alias _invoke_without_enc _invoke |
#_ip_id_ ⇒ Object
23 24 25 26 |
# File 'lib/tk.rb', line 23 def _ip_id_ # for RemoteTkIp '' end |
#_make_menu_embeddable ⇒ Object
10730 10731 10732 |
# File 'tcltklib.c', line 10730 static VALUE (interp, ) VALUE interp; |
#_merge_tklist ⇒ Object
9838 9839 9840 |
# File 'tcltklib.c', line 9838 static VALUE lib_merge_tklist(argc, argv, obj) int argc; |
#_return_value ⇒ Object
get return code from Tcl_Eval()
9243 9244 9245 |
# File 'tcltklib.c', line 9243 static VALUE ip_retval(self) VALUE self; |
#_set_global_var ⇒ Object
9645 9646 9647 |
# File 'tcltklib.c', line 9645 static VALUE ip_set_global_var(self, varname, value) VALUE self; |
#_set_global_var2 ⇒ Object
9655 9656 9657 |
# File 'tcltklib.c', line 9655 static VALUE ip_set_global_var2(self, varname, index, value) VALUE self; |
#_set_variable ⇒ Object
9542 9543 9544 |
# File 'tcltklib.c', line 9542 static VALUE ip_set_variable(self, varname, value, flag) VALUE self; |
#_set_variable2 ⇒ Object
9513 9514 9515 |
# File 'tcltklib.c', line 9513 static VALUE ip_set_variable2(self, varname, index, value, flag) VALUE self; |
#_split_tklist ⇒ Object
9830 9831 9832 |
# File 'tcltklib.c', line 9830 static VALUE ip_split_tklist(self, list_str) VALUE self; |
#_thread_tkwait ⇒ Object
5475 5476 5477 |
# File 'tcltklib.c', line 5475 static VALUE ip_thread_tkwait(self, mode, target) VALUE self; |
#_thread_vwait ⇒ Object
5461 5462 5463 |
# File 'tcltklib.c', line 5461 static VALUE ip_thread_vwait(self, var) VALUE self; |
#_toUTF8(str, encoding = nil) ⇒ Object
without Encoding (Ruby 1.8)
8087 8088 8089 |
# File 'tcltklib.c', line 8087 static VALUE ip_toUTF8(argc, argv, self) int argc; |
#_unset_global_var ⇒ Object
9666 9667 9668 |
# File 'tcltklib.c', line 9666 static VALUE ip_unset_global_var(self, varname) VALUE self; |
#_unset_global_var2 ⇒ Object
9675 9676 9677 |
# File 'tcltklib.c', line 9675 static VALUE ip_unset_global_var2(self, varname, index) VALUE self; |
#_unset_variable ⇒ Object
9617 9618 9619 |
# File 'tcltklib.c', line 9617 static VALUE ip_unset_variable(self, varname, flag) VALUE self; |
#_unset_variable2 ⇒ Object
9591 9592 9593 |
# File 'tcltklib.c', line 9591 static VALUE ip_unset_variable2(self, varname, index, flag) VALUE self; |
#allow_ruby_exit= ⇒ Object
allow_ruby_exit = mode
6712 6713 6714 |
# File 'tcltklib.c', line 6712 static VALUE ip_allow_ruby_exit_set(self, val) VALUE self, val; |
#allow_ruby_exit? ⇒ Boolean
allow_ruby_exit?
6693 6694 6695 |
# File 'tcltklib.c', line 6693 static VALUE ip_allow_ruby_exit_p(self) VALUE self; |
#create_dummy_encoding_for_tk ⇒ Object
10111 10112 10113 |
# File 'tcltklib.c', line 10111 static VALUE create_dummy_encoding_for_tk(interp, name) VALUE interp; |
#create_slave ⇒ Object
6490 6491 6492 |
# File 'tcltklib.c', line 6490 static VALUE ip_create_slave(argc, argv, self) int argc; |
#default_encoding=(name) ⇒ Object
2882 2883 2884 2885 |
# File 'lib/tk.rb', line 2882 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
6767 6768 6769 |
# File 'tcltklib.c', line 6767 static VALUE ip_delete(self) VALUE self; |
#deleted? ⇒ Boolean
6821 6822 6823 |
# File 'tcltklib.c', line 6821 static VALUE ip_is_deleted_p(self) VALUE self; |
#do_one_event ⇒ Object
3097 3098 3099 |
# File 'tcltklib.c', line 3097 static VALUE ip_do_one_event(argc, argv, self) int argc; |
#encoding_name ⇒ Object Also known as: encoding, default_encoding
2894 2895 2896 |
# File 'lib/tk.rb', line 2894 def encoding_name (@encoding[0])? @encoding[0].dup: nil end |
#encoding_obj ⇒ Object
2900 2901 2902 2903 2904 2905 2906 |
# File 'lib/tk.rb', line 2900 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
10585 10586 10587 |
# File 'tcltklib.c', line 10585 static VALUE ip_get_encoding_table(interp) VALUE interp; |
#force_default_encoding=(mode) ⇒ Object
2874 2875 2876 |
# File 'lib/tk.rb', line 2874 def force_default_encoding=(mode) @force_default_encoding[0] = (mode)? true: false end |
#force_default_encoding? ⇒ Boolean
2878 2879 2880 |
# File 'lib/tk.rb', line 2878 def force_default_encoding? @force_default_encoding[0] ||= false end |
#get_eventloop_tick ⇒ Object
1773 1774 1775 |
# File 'tcltklib.c', line 1773 static VALUE ip_get_eventloop_tick(self) VALUE self; |
#get_eventloop_weight ⇒ Object
1878 1879 1880 |
# File 'tcltklib.c', line 1878 static VALUE ip_get_eventloop_weight(self) VALUE self; |
#get_no_event_wait ⇒ Object
1824 1825 1826 |
# File 'tcltklib.c', line 1824 static VALUE ip_get_no_event_wait(self) VALUE self; |
#has_mainwindow? ⇒ Boolean
6851 6852 6853 |
# File 'tcltklib.c', line 6851 static VALUE ip_has_mainwindow_p(self) VALUE self; |
#invalid_namespace? ⇒ Boolean
is deleted?
6799 6800 6801 |
# File 'tcltklib.c', line 6799 static VALUE ip_has_invalid_namespace_p(self) VALUE self; |
#mainloop ⇒ Object
2772 2773 2774 |
# File 'tcltklib.c', line 2772 static VALUE ip_mainloop(argc, argv, self) int argc; |
#mainloop_abort_on_exception ⇒ Object
1947 1948 1949 |
# File 'tcltklib.c', line 1947 static VALUE ip_evloop_abort_on_exc(self) VALUE self; |
#mainloop_abort_on_exception= ⇒ Object
1968 1969 1970 |
# File 'tcltklib.c', line 1968 static VALUE ip_evloop_abort_on_exc_set(self, val) VALUE self, val; |
#mainloop_watchdog ⇒ Object
2901 2902 2903 |
# File 'tcltklib.c', line 2901 static VALUE ip_mainloop_watchdog(argc, argv, self) int argc; |
#make_safe ⇒ Object
6659 6660 6661 |
# File 'tcltklib.c', line 6659 static VALUE ip_make_safe(self) VALUE self; |
#restart ⇒ Object
7892 7893 7894 |
# File 'tcltklib.c', line 7892 static VALUE ip_restart(self) VALUE self; |
#safe? ⇒ Boolean
is safe?
6674 6675 6676 |
# File 'tcltklib.c', line 6674 static VALUE ip_is_safe_p(self) VALUE self; |
#set_eventloop_tick ⇒ Object
1754 1755 1756 |
# File 'tcltklib.c', line 1754 static VALUE ip_set_eventloop_tick(self, tick) VALUE self; |
#set_eventloop_weight ⇒ Object
1858 1859 1860 |
# File 'tcltklib.c', line 1858 static VALUE ip_set_eventloop_weight(self, loop_max, no_event) VALUE self; |
#set_max_block_time ⇒ Object
1885 1886 1887 |
# File 'tcltklib.c', line 1885 static VALUE set_max_block_time(self, time) VALUE self; |
#set_no_event_wait ⇒ Object
1805 1806 1807 |
# File 'tcltklib.c', line 1805 static VALUE ip_set_no_event_wait(self, wait) VALUE self; |
#slave_of? ⇒ Boolean
self is slave of master?
6524 6525 6526 |
# File 'tcltklib.c', line 6524 static VALUE ip_is_slave_of_p(self, master) VALUE self, master; |