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
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
Instance Attribute Details
#encoding=(value) ⇒ Object
Sets the attribute encoding
12 13 14 |
# File 'sample/demos-en/tkencoding.rb', line 12 def encoding=(value) @encoding = value end |
Class Method Details
.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
2907 2908 2909 |
# File 'lib/tk.rb', line 2907 static VALUE ip_fromUTF8(argc, argv, self) int argc; |
#__invoke__ ⇒ Object
20 |
# File 'lib/tk.rb', line 20 alias __invoke__ _invoke |
#__toUTF8 ⇒ Object
2906 2907 2908 |
# File 'lib/tk.rb', line 2906 static VALUE ip_toUTF8(argc, argv, self) int argc; |
#_cancel_eval ⇒ Object
7762 7763 7764 |
# File 'tcltklib.c', line 7762 static VALUE ip_cancel_eval(argc, argv, self) int argc; |
#_cancel_eval_unwind ⇒ Object
7783 7784 7785 |
# File 'tcltklib.c', line 7783 static VALUE ip_cancel_eval_unwind(argc, argv, self) int argc; |
#_conv_listelement ⇒ Object
9908 9909 9910 |
# File 'tcltklib.c', line 9908 static VALUE lib_conv_listelement(self, src) VALUE self; |
#_create_console ⇒ Object
6599 6600 6601 |
# File 'tcltklib.c', line 6599 static VALUE ip_create_console(self) VALUE self; |
#_eval(cmd) ⇒ Object Also known as: _eval_with_enc, __eval
7558 7559 7560 7561 7562 7563 7564 |
# File 'tcltklib.c', line 7558 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
8281 8282 8283 |
# File 'tcltklib.c', line 8281 static VALUE ip_fromUTF8(argc, argv, self) int argc; |
#_get_global_var ⇒ Object
9598 9599 9600 |
# File 'tcltklib.c', line 9598 static VALUE ip_get_global_var(self, varname) VALUE self; |
#_get_global_var2 ⇒ Object
9607 9608 9609 |
# File 'tcltklib.c', line 9607 static VALUE ip_get_global_var2(self, varname, index) VALUE self; |
#_get_variable ⇒ Object
9375 9376 9377 |
# File 'tcltklib.c', line 9375 static VALUE ip_get_variable(self, varname, flag) VALUE self; |
#_get_variable2 ⇒ Object
9349 9350 9351 |
# File 'tcltklib.c', line 9349 static VALUE ip_get_variable2(self, varname, index, flag) VALUE self; |
#_immediate_invoke ⇒ Object
9241 9242 9243 |
# File 'tcltklib.c', line 9241 static VALUE ip_invoke_immediate(argc, argv, obj) int argc; |
#_invoke(*cmds) ⇒ Object Also known as: _invoke_with_enc, __invoke
9232 9233 9234 9235 9236 9237 9238 9239 |
# File 'tcltklib.c', line 9232 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
10702 10703 10704 |
# File 'tcltklib.c', line 10702 static VALUE (interp, ) VALUE interp; |
#_merge_tklist ⇒ Object
9810 9811 9812 |
# File 'tcltklib.c', line 9810 static VALUE lib_merge_tklist(argc, argv, obj) int argc; |
#_return_value ⇒ Object
get return code from Tcl_Eval()
9215 9216 9217 |
# File 'tcltklib.c', line 9215 static VALUE ip_retval(self) VALUE self; |
#_set_global_var ⇒ Object
9617 9618 9619 |
# File 'tcltklib.c', line 9617 static VALUE ip_set_global_var(self, varname, value) VALUE self; |
#_set_global_var2 ⇒ Object
9627 9628 9629 |
# File 'tcltklib.c', line 9627 static VALUE ip_set_global_var2(self, varname, index, value) VALUE self; |
#_set_variable ⇒ Object
9514 9515 9516 |
# File 'tcltklib.c', line 9514 static VALUE ip_set_variable(self, varname, value, flag) VALUE self; |
#_set_variable2 ⇒ Object
9485 9486 9487 |
# File 'tcltklib.c', line 9485 static VALUE ip_set_variable2(self, varname, index, value, flag) VALUE self; |
#_split_tklist ⇒ Object
9802 9803 9804 |
# File 'tcltklib.c', line 9802 static VALUE ip_split_tklist(self, list_str) VALUE self; |
#_thread_tkwait ⇒ Object
5507 5508 5509 |
# File 'tcltklib.c', line 5507 static VALUE ip_thread_tkwait(self, mode, target) VALUE self; |
#_thread_vwait ⇒ Object
5493 5494 5495 |
# File 'tcltklib.c', line 5493 static VALUE ip_thread_vwait(self, var) VALUE self; |
#_toUTF8(str, encoding = nil) ⇒ Object
8079 8080 8081 |
# File 'tcltklib.c', line 8079 static VALUE ip_toUTF8(argc, argv, self) int argc; |
#_unset_global_var ⇒ Object
9638 9639 9640 |
# File 'tcltklib.c', line 9638 static VALUE ip_unset_global_var(self, varname) VALUE self; |
#_unset_global_var2 ⇒ Object
9647 9648 9649 |
# File 'tcltklib.c', line 9647 static VALUE ip_unset_global_var2(self, varname, index) VALUE self; |
#_unset_variable ⇒ Object
9589 9590 9591 |
# File 'tcltklib.c', line 9589 static VALUE ip_unset_variable(self, varname, flag) VALUE self; |
#_unset_variable2 ⇒ Object
9563 9564 9565 |
# File 'tcltklib.c', line 9563 static VALUE ip_unset_variable2(self, varname, index, flag) VALUE self; |
#allow_ruby_exit= ⇒ Object
allow_ruby_exit = mode
6705 6706 6707 |
# File 'tcltklib.c', line 6705 static VALUE ip_allow_ruby_exit_set(self, val) VALUE self, val; |
#allow_ruby_exit? ⇒ Boolean
allow_ruby_exit?
6686 6687 6688 |
# File 'tcltklib.c', line 6686 static VALUE ip_allow_ruby_exit_p(self) VALUE self; |
#create_dummy_encoding_for_tk ⇒ Object
10083 10084 10085 |
# File 'tcltklib.c', line 10083 static VALUE create_dummy_encoding_for_tk(interp, name) VALUE interp; |
#create_slave ⇒ Object
6483 6484 6485 |
# File 'tcltklib.c', line 6483 static VALUE ip_create_slave(argc, argv, self) int argc; |
#default_encoding=(name) ⇒ Object
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 |
#delete ⇒ Object
delete interpreter
6760 6761 6762 |
# File 'tcltklib.c', line 6760 static VALUE ip_delete(self) VALUE self; |
#deleted? ⇒ Boolean
6814 6815 6816 |
# File 'tcltklib.c', line 6814 static VALUE ip_is_deleted_p(self) VALUE self; |
#do_one_event ⇒ Object
3076 3077 3078 |
# File 'tcltklib.c', line 3076 static VALUE ip_do_one_event(argc, argv, self) int argc; |
#encoding_name ⇒ Object Also known as: encoding, default_encoding
2892 2893 2894 |
# File 'lib/tk.rb', line 2892 def encoding_name (@encoding[0])? @encoding[0].dup: nil end |
#encoding_obj ⇒ Object
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 |
#encoding_table ⇒ Object
10557 10558 10559 |
# File 'tcltklib.c', line 10557 static VALUE ip_get_encoding_table(interp) VALUE interp; |
#force_default_encoding=(mode) ⇒ Object
2872 2873 2874 |
# File 'lib/tk.rb', line 2872 def force_default_encoding=(mode) @force_default_encoding[0] = (mode)? true: false end |
#force_default_encoding? ⇒ Boolean
2876 2877 2878 |
# File 'lib/tk.rb', line 2876 def force_default_encoding? @force_default_encoding[0] ||= false end |
#get_eventloop_tick ⇒ Object
1752 1753 1754 |
# File 'tcltklib.c', line 1752 static VALUE ip_get_eventloop_tick(self) VALUE self; |
#get_eventloop_weight ⇒ Object
1857 1858 1859 |
# File 'tcltklib.c', line 1857 static VALUE ip_get_eventloop_weight(self) VALUE self; |
#get_no_event_wait ⇒ Object
1803 1804 1805 |
# File 'tcltklib.c', line 1803 static VALUE ip_get_no_event_wait(self) VALUE self; |
#has_mainwindow? ⇒ Boolean
6844 6845 6846 |
# File 'tcltklib.c', line 6844 static VALUE ip_has_mainwindow_p(self) VALUE self; |
#invalid_namespace? ⇒ Boolean
is deleted?
6792 6793 6794 |
# File 'tcltklib.c', line 6792 static VALUE ip_has_invalid_namespace_p(self) VALUE self; |
#mainloop ⇒ Object
2751 2752 2753 |
# File 'tcltklib.c', line 2751 static VALUE ip_mainloop(argc, argv, self) int argc; |
#mainloop_abort_on_exception ⇒ Object
1926 1927 1928 |
# File 'tcltklib.c', line 1926 static VALUE ip_evloop_abort_on_exc(self) VALUE self; |
#mainloop_abort_on_exception= ⇒ Object
1947 1948 1949 |
# File 'tcltklib.c', line 1947 static VALUE ip_evloop_abort_on_exc_set(self, val) VALUE self, val; |
#mainloop_watchdog ⇒ Object
2880 2881 2882 |
# File 'tcltklib.c', line 2880 static VALUE ip_mainloop_watchdog(argc, argv, self) int argc; |
#make_safe ⇒ Object
6652 6653 6654 |
# File 'tcltklib.c', line 6652 static VALUE ip_make_safe(self) VALUE self; |
#restart ⇒ Object
7884 7885 7886 |
# File 'tcltklib.c', line 7884 static VALUE ip_restart(self) VALUE self; |
#safe? ⇒ Boolean
is safe?
6667 6668 6669 |
# File 'tcltklib.c', line 6667 static VALUE ip_is_safe_p(self) VALUE self; |
#set_eventloop_tick ⇒ Object
1733 1734 1735 |
# File 'tcltklib.c', line 1733 static VALUE ip_set_eventloop_tick(self, tick) VALUE self; |
#set_eventloop_weight ⇒ Object
1837 1838 1839 |
# File 'tcltklib.c', line 1837 static VALUE ip_set_eventloop_weight(self, loop_max, no_event) VALUE self; |
#set_max_block_time ⇒ Object
1864 1865 1866 |
# File 'tcltklib.c', line 1864 static VALUE set_max_block_time(self, time) VALUE self; |
#set_no_event_wait ⇒ Object
1784 1785 1786 |
# File 'tcltklib.c', line 1784 static VALUE ip_set_no_event_wait(self, wait) VALUE self; |
#slave_of? ⇒ Boolean
self is slave of master?
6517 6518 6519 |
# File 'tcltklib.c', line 6517 static VALUE ip_is_slave_of_p(self, master) VALUE self, master; |