mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* {ext,lib,test}/**/*.rb: removed trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9b52ae2e64
commit
287a34ae0d
856 changed files with 13989 additions and 13989 deletions
|
|
@ -2,7 +2,7 @@
|
|||
# setup.rb -- setup script before calling TkPackage.require()
|
||||
#
|
||||
# If you need some setup operations (for example, add a library path
|
||||
# to the library search path) before using Tcl/Tk library packages
|
||||
# wrapped by Ruby scripts in this directory, please write the setup
|
||||
# to the library search path) before using Tcl/Tk library packages
|
||||
# wrapped by Ruby scripts in this directory, please write the setup
|
||||
# operations in this file.
|
||||
#
|
||||
|
|
|
|||
|
|
@ -32,14 +32,14 @@ module Tk
|
|||
end
|
||||
end
|
||||
|
||||
HasColumnCreateCommand =
|
||||
HasColumnCreateCommand =
|
||||
(TkPackage.vcompare(self.package_version, '1.1') >= 0)
|
||||
|
||||
# dummy ::
|
||||
# pkgIndex.tcl of TreeCtrl-1.0 doesn't support auto_load for
|
||||
# 'loupe' command (probably it is bug, I think).
|
||||
# So, calling a 'treectrl' command for loading the dll with
|
||||
# the auto_load facility.
|
||||
# dummy ::
|
||||
# pkgIndex.tcl of TreeCtrl-1.0 doesn't support auto_load for
|
||||
# 'loupe' command (probably it is bug, I think).
|
||||
# So, calling a 'treectrl' command for loading the dll with
|
||||
# the auto_load facility.
|
||||
begin
|
||||
tk_call('treectrl')
|
||||
rescue
|
||||
|
|
@ -48,7 +48,7 @@ module Tk
|
|||
# NOTE: platform == 'unix' only
|
||||
|
||||
# img => TkPhotoImage
|
||||
# x, y => screen coords
|
||||
# x, y => screen coords
|
||||
# w, h => magnifier width and height
|
||||
# zoom => zooming rate
|
||||
Tk.tk_call_without_enc('loupe', img, x, y, w, h, zoom)
|
||||
|
|
@ -76,28 +76,28 @@ end
|
|||
class Tk::TreeCtrl::NotifyEvent
|
||||
# [ <'%' subst-key char>, <proc type char>, <instance var (accessor) name>]
|
||||
KEY_TBL = [
|
||||
[ ?c, ?n, :item_num ],
|
||||
[ ?d, ?s, :detail ],
|
||||
[ ?D, ?l, :items ],
|
||||
[ ?e, ?e, :event ],
|
||||
[ ?I, ?n, :id ],
|
||||
[ ?l, ?n, :lower_bound ],
|
||||
[ ?p, ?n, :active_id ],
|
||||
[ ?P, ?e, :pattern ],
|
||||
[ ?S, ?l, :sel_items ],
|
||||
[ ?T, ?w, :widget ],
|
||||
[ ?u, ?n, :upper_bound ],
|
||||
[ ?W, ?o, :object ],
|
||||
[ ??, ?x, :parm_info ],
|
||||
[ ?c, ?n, :item_num ],
|
||||
[ ?d, ?s, :detail ],
|
||||
[ ?D, ?l, :items ],
|
||||
[ ?e, ?e, :event ],
|
||||
[ ?I, ?n, :id ],
|
||||
[ ?l, ?n, :lower_bound ],
|
||||
[ ?p, ?n, :active_id ],
|
||||
[ ?P, ?e, :pattern ],
|
||||
[ ?S, ?l, :sel_items ],
|
||||
[ ?T, ?w, :widget ],
|
||||
[ ?u, ?n, :upper_bound ],
|
||||
[ ?W, ?o, :object ],
|
||||
[ ??, ?x, :parm_info ],
|
||||
nil
|
||||
]
|
||||
|
||||
# [ <proc type char>, <proc/method to convert tcl-str to ruby-obj>]
|
||||
PROC_TBL = [
|
||||
[ ?n, TkComm.method(:num_or_str) ],
|
||||
[ ?s, TkComm.method(:string) ],
|
||||
[ ?l, TkComm.method(:list) ],
|
||||
[ ?w, TkComm.method(:window) ],
|
||||
[ ?n, TkComm.method(:num_or_str) ],
|
||||
[ ?s, TkComm.method(:string) ],
|
||||
[ ?l, TkComm.method(:list) ],
|
||||
[ ?w, TkComm.method(:window) ],
|
||||
|
||||
[ ?e, proc{|val|
|
||||
case val
|
||||
|
|
@ -109,9 +109,9 @@ class Tk::TreeCtrl::NotifyEvent
|
|||
val
|
||||
end
|
||||
}
|
||||
],
|
||||
],
|
||||
|
||||
[ ?o, proc{|val| TkComm.tk_tcl2ruby(val)} ],
|
||||
[ ?o, proc{|val| TkComm.tk_tcl2ruby(val)} ],
|
||||
|
||||
[ ?x, proc{|val|
|
||||
begin
|
||||
|
|
@ -132,7 +132,7 @@ class Tk::TreeCtrl::NotifyEvent
|
|||
rescue
|
||||
val
|
||||
end
|
||||
} ],
|
||||
} ],
|
||||
|
||||
nil
|
||||
]
|
||||
|
|
@ -157,15 +157,15 @@ class Tk::TreeCtrl::NotifyEvent
|
|||
|
||||
# setup tables to be used by scan_args, _get_subst_key, _get_all_subst_keys
|
||||
#
|
||||
# _get_subst_key() and _get_all_subst_keys() generates key-string
|
||||
# which describe how to convert callback arguments to ruby objects.
|
||||
# When binding parameters are given, use _get_subst_key().
|
||||
# But when no parameters are given, use _get_all_subst_keys() to
|
||||
# create a Event class object as a callback parameter.
|
||||
# _get_subst_key() and _get_all_subst_keys() generates key-string
|
||||
# which describe how to convert callback arguments to ruby objects.
|
||||
# When binding parameters are given, use _get_subst_key().
|
||||
# But when no parameters are given, use _get_all_subst_keys() to
|
||||
# create a Event class object as a callback parameter.
|
||||
#
|
||||
# scan_args() is used when doing callback. It convert arguments
|
||||
# ( which are Tcl strings ) to ruby objects based on the key string
|
||||
# that is generated by _get_subst_key() or _get_all_subst_keys().
|
||||
# scan_args() is used when doing callback. It convert arguments
|
||||
# ( which are Tcl strings ) to ruby objects based on the key string
|
||||
# that is generated by _get_subst_key() or _get_all_subst_keys().
|
||||
#
|
||||
_setup_subst_table(KEY_TBL, PROC_TBL);
|
||||
end
|
||||
|
|
@ -185,7 +185,7 @@ module Tk::TreeCtrl::ConfigMethod
|
|||
if (obj.kind_of?(Tk::TreeCtrl::Column) ||
|
||||
obj.kind_of?(Tk::TreeCtrl::Element) ||
|
||||
obj.kind_of?(Tk::TreeCtrl::Item) ||
|
||||
obj.kind_of?(Tk::TreeCtrl::Style))
|
||||
obj.kind_of?(Tk::TreeCtrl::Style))
|
||||
obj = obj.id
|
||||
end
|
||||
|
||||
|
|
@ -236,7 +236,7 @@ module Tk::TreeCtrl::ConfigMethod
|
|||
def __item_cget_cmd(mixed_id)
|
||||
if mixed_id[0] == 'column' && mixed_id[1] == 'drag'
|
||||
return [self.path, 'column', 'dragcget']
|
||||
end
|
||||
end
|
||||
|
||||
if mixed_id[1].kind_of?(Array)
|
||||
id = mixed_id[1]
|
||||
|
|
@ -255,7 +255,7 @@ module Tk::TreeCtrl::ConfigMethod
|
|||
def __item_config_cmd(mixed_id)
|
||||
if mixed_id[0] == 'column' && mixed_id[1] == 'drag'
|
||||
return [self.path, 'column', 'dragconfigure']
|
||||
end
|
||||
end
|
||||
|
||||
if mixed_id[1].kind_of?(Array)
|
||||
id = mixed_id[1]
|
||||
|
|
@ -291,10 +291,10 @@ module Tk::TreeCtrl::ConfigMethod
|
|||
|
||||
def __item_configinfo_struct(id)
|
||||
if id.kind_of?(Array) && id[0].to_s == 'notify'
|
||||
{:key=>0, :alias=>nil, :db_name=>nil, :db_class=>nil,
|
||||
{:key=>0, :alias=>nil, :db_name=>nil, :db_class=>nil,
|
||||
:default_value=>nil, :current_value=>1}
|
||||
else
|
||||
{:key=>0, :alias=>1, :db_name=>1, :db_class=>2,
|
||||
{:key=>0, :alias=>1, :db_name=>1, :db_class=>2,
|
||||
:default_value=>3, :current_value=>4}
|
||||
end
|
||||
end
|
||||
|
|
@ -302,7 +302,7 @@ module Tk::TreeCtrl::ConfigMethod
|
|||
|
||||
|
||||
def __item_font_optkeys(id)
|
||||
if id.kind_of?(Array) && (id[0] == 'element' ||
|
||||
if id.kind_of?(Array) && (id[0] == 'element' ||
|
||||
(id[0].kind_of?(Array) && id[0][1] == 'element'))
|
||||
[]
|
||||
else
|
||||
|
|
@ -335,7 +335,7 @@ module Tk::TreeCtrl::ConfigMethod
|
|||
if id[1] == 'drag'
|
||||
['enable']
|
||||
else
|
||||
['button', 'expand', 'resize', 'squeeze', 'sunken',
|
||||
['button', 'expand', 'resize', 'squeeze', 'sunken',
|
||||
'visible', 'widthhack']
|
||||
end
|
||||
when 'element'
|
||||
|
|
@ -403,12 +403,12 @@ module Tk::TreeCtrl::ConfigMethod
|
|||
|
||||
def __item_keyonly_optkeys(id) # { def_key=>(undef_key|nil), ... }
|
||||
{
|
||||
'notreally'=>nil,
|
||||
'notreally'=>nil,
|
||||
'increasing'=>'decreasing',
|
||||
'decreasing'=>'increasing',
|
||||
'decreasing'=>'increasing',
|
||||
'ascii'=>nil,
|
||||
'dictionary'=>nil,
|
||||
'integer'=>nil,
|
||||
'dictionary'=>nil,
|
||||
'integer'=>nil,
|
||||
'real'=>nil
|
||||
}
|
||||
end
|
||||
|
|
@ -629,8 +629,8 @@ class Tk::TreeCtrl
|
|||
|
||||
def __boolval_optkeys
|
||||
[
|
||||
'itemwidthequal', 'usetheme',
|
||||
'showbuttons', 'showheader', 'showlines', 'showroot',
|
||||
'itemwidthequal', 'usetheme',
|
||||
'showbuttons', 'showheader', 'showlines', 'showroot',
|
||||
'showrootbutton', 'showrootlines',
|
||||
]
|
||||
end
|
||||
|
|
@ -651,7 +651,7 @@ class Tk::TreeCtrl
|
|||
|
||||
def create_self(keys)
|
||||
if keys and keys != None
|
||||
tk_call_without_enc(self.class::TkCommandNames[0], @path,
|
||||
tk_call_without_enc(self.class::TkCommandNames[0], @path,
|
||||
*hash_kv(keys, true))
|
||||
else
|
||||
tk_call_without_enc(self.class::TkCommandNames[0], @path)
|
||||
|
|
@ -680,7 +680,7 @@ class Tk::TreeCtrl
|
|||
end
|
||||
|
||||
def collapse_recurse(*dsc)
|
||||
tk_send_without_enc('collapse', '-recurse',
|
||||
tk_send_without_enc('collapse', '-recurse',
|
||||
*(dsc.map!{|d| _get_eval_string(d, true)}))
|
||||
self
|
||||
end
|
||||
|
|
@ -931,7 +931,7 @@ class Tk::TreeCtrl
|
|||
end
|
||||
|
||||
def item_collapse_recurse(item)
|
||||
tk_send_without_enc('item', 'collapse',
|
||||
tk_send_without_enc('item', 'collapse',
|
||||
_get_eval_string(item, true), '-recurse')
|
||||
self
|
||||
end
|
||||
|
|
@ -941,8 +941,8 @@ class Tk::TreeCtrl
|
|||
end
|
||||
|
||||
def item_complex(item, *args)
|
||||
tk_send_without_enc('item', 'complex',
|
||||
_get_eval_string(item, true),
|
||||
tk_send_without_enc('item', 'complex',
|
||||
_get_eval_string(item, true),
|
||||
*(args.map!{|arg| _get_eval_string(arg, true)}))
|
||||
self
|
||||
end
|
||||
|
|
@ -1008,12 +1008,12 @@ class Tk::TreeCtrl
|
|||
|
||||
def item_firstchild(parent, child=nil)
|
||||
if child
|
||||
tk_send_without_enc('item', 'firstchild',
|
||||
_get_eval_string(parent, true),
|
||||
tk_send_without_enc('item', 'firstchild',
|
||||
_get_eval_string(parent, true),
|
||||
_get_eval_string(child, true))
|
||||
self
|
||||
else
|
||||
id = num_or_str(tk_send_without_enc('item', 'firstchild',
|
||||
id = num_or_str(tk_send_without_enc('item', 'firstchild',
|
||||
_get_eval_string(parent, true)))
|
||||
Tk::TreeCtrl::Item.id2obj(self, id)
|
||||
end
|
||||
|
|
@ -1022,11 +1022,11 @@ class Tk::TreeCtrl
|
|||
|
||||
def item_hasbutton(item, st=None)
|
||||
if st == None
|
||||
bool(tk_send_without_enc('item', 'hasbutton',
|
||||
bool(tk_send_without_enc('item', 'hasbutton',
|
||||
_get_eval_string(item, true)))
|
||||
else
|
||||
tk_send_without_enc('item', 'hasbutton',
|
||||
_get_eval_string(item, true),
|
||||
tk_send_without_enc('item', 'hasbutton',
|
||||
_get_eval_string(item, true),
|
||||
_get_eval_string(st))
|
||||
self
|
||||
end
|
||||
|
|
@ -1086,12 +1086,12 @@ class Tk::TreeCtrl
|
|||
|
||||
def item_lastchild(parent, child=nil)
|
||||
if child
|
||||
tk_send_without_enc('item', 'lastchild',
|
||||
tk_send_without_enc('item', 'lastchild',
|
||||
_get_eval_string(parent, true),
|
||||
_get_eval_string(child, true))
|
||||
self
|
||||
else
|
||||
id = num_or_str(tk_send_without_enc('item', 'lastchild',
|
||||
id = num_or_str(tk_send_without_enc('item', 'lastchild',
|
||||
_get_eval_string(parent, true)))
|
||||
Tk::TreeCtrl::Item.id2obj(self, id)
|
||||
end
|
||||
|
|
@ -1110,7 +1110,7 @@ class Tk::TreeCtrl
|
|||
alias item_next_sibling item_nextsibling
|
||||
|
||||
def item_numchildren(item)
|
||||
number(tk_send_without_enc('item', 'numchildren',
|
||||
number(tk_send_without_enc('item', 'numchildren',
|
||||
_get_eval_string(item, true)))
|
||||
end
|
||||
alias item_num_children item_numchildren
|
||||
|
|
@ -1271,20 +1271,20 @@ class Tk::TreeCtrl
|
|||
def item_style_set(item, column=nil, *args)
|
||||
if args.empty?
|
||||
if column
|
||||
id = tk_send_without_enc('item', 'style', 'set',
|
||||
_get_eval_string(item, true),
|
||||
id = tk_send_without_enc('item', 'style', 'set',
|
||||
_get_eval_string(item, true),
|
||||
_get_eval_string(column, true))
|
||||
Tk::TreeCtrl::Style.id2obj(self, id)
|
||||
else
|
||||
list(tk_send_without_enc('item', 'style', 'set',
|
||||
list(tk_send_without_enc('item', 'style', 'set',
|
||||
_get_eval_string(item, true))).collect!{|id|
|
||||
Tk::TreeCtrl::Style.id2obj(self, id)
|
||||
}
|
||||
end
|
||||
else
|
||||
tk_send_without_enc('item', 'style', 'set',
|
||||
_get_eval_string(item, true),
|
||||
_get_eval_string(column, true),
|
||||
tk_send_without_enc('item', 'style', 'set',
|
||||
_get_eval_string(item, true),
|
||||
_get_eval_string(column, true),
|
||||
*(args.flatten.map!{|arg|
|
||||
_get_eval_string(arg, true)
|
||||
}))
|
||||
|
|
@ -1640,8 +1640,8 @@ class Tk::TreeCtrl
|
|||
tk_send('style', 'layout', style, elem, *hash_kv(keys))
|
||||
self
|
||||
else
|
||||
_conv_style_layout_val(keys,
|
||||
tk_send('style', 'layout',
|
||||
_conv_style_layout_val(keys,
|
||||
tk_send('style', 'layout',
|
||||
style, elem, "-#{keys}"))
|
||||
end
|
||||
else
|
||||
|
|
@ -1717,7 +1717,7 @@ class Tk::TreeCtrl::Column < TkObject
|
|||
keys = _symbolkey2str(keys)
|
||||
|
||||
Tk::TreeCtrl::Column::TreeCtrlColumnID.mutex.synchronize{
|
||||
@path = @id =
|
||||
@path = @id =
|
||||
keys.delete('tag') ||
|
||||
Tk::TreeCtrl::Column::TreeCtrlColumnID.join(TkCore::INTERP._ip_id_)
|
||||
Tk::TreeCtrl::Column::TreeCtrlColumnID[1].succ!
|
||||
|
|
@ -1726,7 +1726,7 @@ class Tk::TreeCtrl::Column < TkObject
|
|||
keys['tag'] = @id
|
||||
|
||||
Tk::TreeCtrl::Column::TreeCtrlColumnID_TBL.mutex.synchronize{
|
||||
Tk::TreeCtrl::Column::TreeCtrlColumnID_TBL[@tpath] ||= {}
|
||||
Tk::TreeCtrl::Column::TreeCtrlColumnID_TBL[@tpath] ||= {}
|
||||
Tk::TreeCtrl::Column::TreeCtrlColumnID_TBL[@tpath][@id] = self
|
||||
}
|
||||
|
||||
|
|
@ -1823,13 +1823,13 @@ class Tk::TreeCtrl::Element < TkObject
|
|||
@tpath = parent.path
|
||||
@type = type.to_s
|
||||
Tk::TreeCtrl::Element::TreeCtrlElementID.mutex.synchronize{
|
||||
@path = @id =
|
||||
@path = @id =
|
||||
Tk::TreeCtrl::Element::TreeCtrlElementID.join(TkCore::INTERP._ip_id_)
|
||||
Tk::TreeCtrl::Element::TreeCtrlElementID[1].succ!
|
||||
}
|
||||
|
||||
Tk::TreeCtrl::Element::TreeCtrlElementID_TBL.mutex.synchronize{
|
||||
Tk::TreeCtrl::Element::TreeCtrlElementID_TBL[@tpath] ||= {}
|
||||
Tk::TreeCtrl::Element::TreeCtrlElementID_TBL[@tpath] ||= {}
|
||||
Tk::TreeCtrl::Element::TreeCtrlElementID_TBL[@tpath][@id] = self
|
||||
}
|
||||
|
||||
|
|
@ -1938,7 +1938,7 @@ class Tk::TreeCtrl::Item < TkObject
|
|||
@path = @id = @tree.item_create(keys)
|
||||
|
||||
Tk::TreeCtrl::Item::TreeCtrlItemID_TBL.mutex.synchronize{
|
||||
Tk::TreeCtrl::Item::TreeCtrlItemID_TBL[@tpath] ||= {}
|
||||
Tk::TreeCtrl::Item::TreeCtrlItemID_TBL[@tpath] ||= {}
|
||||
Tk::TreeCtrl::Item::TreeCtrlItemID_TBL[@tpath][@id] = self
|
||||
}
|
||||
end
|
||||
|
|
@ -2247,13 +2247,13 @@ class Tk::TreeCtrl::Style < TkObject
|
|||
@tpath = parent.path
|
||||
|
||||
Tk::TreeCtrl::Style::TreeCtrlStyleID.mutex.synchronize{
|
||||
@path = @id =
|
||||
@path = @id =
|
||||
Tk::TreeCtrl::Style::TreeCtrlStyleID.join(TkCore::INTERP._ip_id_)
|
||||
Tk::TreeCtrl::Style::TreeCtrlStyleID[1].succ!
|
||||
}
|
||||
|
||||
Tk::TreeCtrl::Style::TreeCtrlStyleID_TBL.mutex.synchronize{
|
||||
Tk::TreeCtrl::Style::TreeCtrlStyleID_TBL[@tpath] ||= {}
|
||||
Tk::TreeCtrl::Style::TreeCtrlStyleID_TBL[@tpath] ||= {}
|
||||
Tk::TreeCtrl::Style::TreeCtrlStyleID_TBL[@tpath][@id] = self
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue