arcadia 0.9.3 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (186) hide show
  1. data/README +11 -10
  2. data/bin/arcadia +3 -0
  3. data/conf/arcadia.conf +117 -75
  4. data/conf/arcadia.res.rb +219 -58
  5. data/conf/theme-dark.conf +11 -8
  6. data/conf/theme-dark.res.rb +81 -10
  7. data/ext/ae-breakpoints/ae-breakpoints.rb +1 -1
  8. data/ext/ae-dir-projects/ae-dir-projects.conf +2 -2
  9. data/ext/ae-dir-projects/ae-dir-projects.rb +84 -47
  10. data/ext/ae-editor/ae-editor.rb +541 -190
  11. data/ext/ae-editor/langs/coderay.tokens +1 -0
  12. data/ext/ae-editor/langs/conf.lang +5 -4
  13. data/ext/ae-editor/langs/java.lang +2 -1
  14. data/ext/ae-editor/langs/python.lang +4 -0
  15. data/ext/ae-editor/langs/rhtml.lang +2 -1
  16. data/ext/ae-editor/langs/ruby.lang +45 -0
  17. data/ext/ae-editor/langs/tcl.lang +80 -2
  18. data/ext/ae-editor/langs/text.lang +2 -0
  19. data/ext/ae-editor/langs/xml.lang +1 -0
  20. data/ext/ae-file-history/ae-file-history.conf +2 -2
  21. data/ext/ae-file-history/ae-file-history.rb +66 -20
  22. data/ext/ae-output/ae-output.conf +3 -3
  23. data/ext/ae-output/ae-output.rb +37 -23
  24. data/ext/ae-rad/ae-rad-palette.rb +3 -3
  25. data/ext/ae-ruby-debug/ae-ruby-debug.conf +2 -2
  26. data/ext/ae-ruby-debug/ae-ruby-debug.rb +38 -42
  27. data/ext/ae-search-in-files/ae-search-in-files.conf +2 -2
  28. data/ext/ae-search-in-files/ae-search-in-files.rb +20 -9
  29. data/ext/ae-search-in-files/ext/ack-in-files/ack-in-files.conf +2 -2
  30. data/ext/ae-shell/ae-shell.conf +1 -1
  31. data/ext/ae-shell/ae-shell.rb +57 -46
  32. data/ext/ae-subprocess-inspector/ae-subprocess-inspector.rb +99 -46
  33. data/ext/ae-subprocess-inspector/process.res +0 -0
  34. data/lib/a-commons.rb +13 -9
  35. data/lib/a-contracts.rb +24 -1
  36. data/lib/a-core.rb +586 -196
  37. data/lib/a-tkcommons.rb +155 -55
  38. data/lib/anigif.rb +9 -0
  39. data/lib/ctags.exe +0 -0
  40. data/tcl/anigif/anigif.tcl +199 -0
  41. data/tcl/anigif/pkgIndex.tcl +3 -0
  42. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/ArrowButton.html +0 -0
  43. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/BWidget.html +0 -0
  44. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/Button.html +36 -2
  45. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/ButtonBox.html +9 -7
  46. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/ComboBox.html +0 -0
  47. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/Dialog.html +5 -11
  48. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/DragSite.html +0 -0
  49. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/DropSite.html +0 -0
  50. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/DynamicHelp.html +0 -0
  51. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/Entry.html +0 -0
  52. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/Label.html +32 -1
  53. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/LabelEntry.html +0 -0
  54. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/LabelFrame.html +0 -0
  55. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/ListBox.html +0 -0
  56. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/MainFrame.html +0 -0
  57. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/MessageDlg.html +0 -0
  58. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/NoteBook.html +0 -0
  59. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/PagesManager.html +0 -0
  60. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/PanedWindow.html +0 -0
  61. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/PanelFrame.html +0 -0
  62. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/PasswdDlg.html +0 -0
  63. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/ProgressBar.html +0 -0
  64. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/ProgressDlg.html +0 -0
  65. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/ScrollView.html +0 -0
  66. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/ScrollableFrame.html +0 -0
  67. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/ScrolledWindow.html +13 -1
  68. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/SelectColor.html +0 -0
  69. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/SelectFont.html +0 -0
  70. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/Separator.html +0 -0
  71. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/SpinBox.html +0 -0
  72. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/StatusBar.html +0 -0
  73. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/TitleFrame.html +0 -0
  74. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/Tree.html +0 -0
  75. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/Widget.html +0 -0
  76. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/contents.html +12 -1
  77. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/index.html +0 -0
  78. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/navtree.html +0 -0
  79. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/options.htm +0 -0
  80. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/CHANGES.txt +0 -0
  81. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/ChangeLog +70 -0
  82. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/LICENSE.txt +0 -0
  83. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/README.txt +0 -0
  84. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/arrow.tcl +0 -0
  85. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/bitmap.tcl +0 -0
  86. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/button.tcl +121 -53
  87. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/buttonbox.tcl +10 -5
  88. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/color.tcl +0 -0
  89. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/combobox.tcl +0 -0
  90. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/demo/basic.tcl +0 -0
  91. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/demo/bwidget.xbm +0 -0
  92. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/demo/demo.tcl +0 -0
  93. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/demo/dnd.tcl +0 -0
  94. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/demo/manager.tcl +0 -0
  95. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/demo/select.tcl +0 -0
  96. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/demo/tmpldlg.tcl +0 -0
  97. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/demo/tree.tcl +0 -0
  98. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/demo/x1.xbm +0 -0
  99. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/dialog.tcl +14 -2
  100. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/dragsite.tcl +0 -0
  101. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/dropsite.tcl +0 -0
  102. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/dynhelp.tcl +0 -0
  103. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/entry.tcl +0 -0
  104. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/font.tcl +0 -0
  105. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/bold.gif +0 -0
  106. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/copy.gif +0 -0
  107. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/cut.gif +0 -0
  108. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/dragfile.gif +0 -0
  109. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/dragicon.gif +0 -0
  110. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/error.gif +0 -0
  111. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/file.gif +0 -0
  112. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/folder.gif +0 -0
  113. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/hourglass.gif +0 -0
  114. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/info.gif +0 -0
  115. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/italic.gif +0 -0
  116. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/minus.xbm +0 -0
  117. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/new.gif +0 -0
  118. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/opcopy.xbm +0 -0
  119. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/open.gif +0 -0
  120. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/openfold.gif +0 -0
  121. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/oplink.xbm +0 -0
  122. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/opmove.xbm +0 -0
  123. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/overstrike.gif +0 -0
  124. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/palette.gif +0 -0
  125. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/passwd.gif +0 -0
  126. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/paste.gif +0 -0
  127. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/plus.xbm +0 -0
  128. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/print.gif +0 -0
  129. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/question.gif +0 -0
  130. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/redo.gif +0 -0
  131. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/save.gif +0 -0
  132. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/target.xbm +0 -0
  133. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/underline.gif +0 -0
  134. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/undo.gif +0 -0
  135. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/warning.gif +0 -0
  136. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/init.tcl +15 -1
  137. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/label.tcl +76 -18
  138. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/labelentry.tcl +0 -0
  139. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/labelframe.tcl +0 -0
  140. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/lang/da.rc +0 -0
  141. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/lang/de.rc +0 -0
  142. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/lang/en.rc +0 -0
  143. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/lang/es.rc +0 -0
  144. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/lang/fr.rc +0 -0
  145. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/lang/hu.rc +0 -0
  146. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/lang/nl.rc +0 -0
  147. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/lang/no.rc +0 -0
  148. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/lang/pl.rc +0 -0
  149. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/listbox.tcl +0 -0
  150. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/mainframe.tcl +3 -2
  151. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/messagedlg.tcl +0 -0
  152. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/notebook.tcl +0 -0
  153. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/pagesmgr.tcl +0 -0
  154. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/panedw.tcl +0 -0
  155. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/panelframe.tcl +0 -0
  156. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/passwddlg.tcl +0 -0
  157. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/pkgIndex.tcl +2 -2
  158. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/progressbar.tcl +0 -0
  159. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/progressdlg.tcl +0 -0
  160. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/scrollframe.tcl +0 -0
  161. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/scrollview.tcl +0 -0
  162. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/scrollw.tcl +37 -25
  163. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/separator.tcl +0 -0
  164. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/spinbox.tcl +0 -0
  165. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/statusbar.tcl +0 -0
  166. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/tests/entry.test +0 -0
  167. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/titleframe.tcl +0 -0
  168. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/tree.tcl +17 -9
  169. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/utils.tcl +0 -0
  170. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/widget.tcl +0 -0
  171. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/wizard.tcl +0 -0
  172. data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/xpm2image.tcl +0 -0
  173. data/tcl/fsdialog/de.msg +30 -0
  174. data/tcl/fsdialog/en.msg +31 -0
  175. data/tcl/fsdialog/fsdialog.tcl +1749 -0
  176. data/tcl/fsdialog/fsdlg-gif.tcl +259 -0
  177. data/tcl/fsdialog/fsdlg-png.tcl +265 -0
  178. data/tcl/fsdialog/sv.msg +32 -0
  179. data/tcl/fsdialog/tclIndex +6 -0
  180. metadata +179 -174
  181. data/ext/ae-editor/langs/erb.lang.bind +0 -1
  182. data/ext/ae-editor/langs/lang.lang.bind +0 -1
  183. data/ext/ae-editor/langs/pers.lang.bind +0 -1
  184. data/ext/ae-editor/langs/rb.lang +0 -73
  185. data/ext/ae-editor/langs/rbw.lang.bind +0 -1
  186. data/ext/ae-editor/langs/tokens.lang.bind +0 -1
data/conf/theme-dark.conf CHANGED
@@ -3,6 +3,7 @@ background=#33302e
3
3
  foreground=gray
4
4
  activebackground=#334b56
5
5
  activeforeground=yellow
6
+ inactiveforeground=#3ae13ae13ae1
6
7
  relief=flat
7
8
  borderwidth=0
8
9
 
@@ -14,6 +15,7 @@ borderwidth=0
14
15
 
15
16
 
16
17
  edit.background=#232323
18
+ #edit.background=#0000000030a4
17
19
  edit.foreground=white
18
20
  edit.relief=flat
19
21
  edit.borderwidth=0
@@ -22,7 +24,9 @@ text.insertbackground=#ffffff
22
24
 
23
25
 
24
26
  textline.background=#334b56
25
- titlelabel.background=#334b56
27
+ #textline.background=#0000ff
28
+ #titlelabel.background=#334b56
29
+ titlelabel.background=#6a3d6a3d6a3d
26
30
 
27
31
  titlemenu.relief=flat
28
32
  splitter.relief=flat
@@ -33,17 +37,16 @@ treepanel.selectforeground=yellow
33
37
  treepanel.selectbackground=#133e5e
34
38
 
35
39
 
36
- #scrollbar.troughcolor=#1c366e
37
- #scrollbar.background=#211834
38
40
  scrollbar.troughcolor=#383838
39
- scrollbar.background=#212121
40
- scrollbar.highlightbackground=blue
41
+ #scrollbar.background=#212121
42
+ scrollbar.background=#6a3d6a3d6a3d
43
+ scrollbar.highlightbackground=#333333
41
44
 
42
45
  scrollbar.borderwidth=0
43
46
  scrollbar.elementborderwidth=1
44
47
 
45
48
  #scrollbar.activebackground=#33305b
46
- scrollbar.activerelief=raised
49
+ scrollbar.activerelief=flat
47
50
 
48
51
 
49
52
  #scrollbar.highlightbackground=black
@@ -66,8 +69,8 @@ progress.relief=groove
66
69
  #:::::::::::::::::::::::::::::::::::::::::::::::::
67
70
 
68
71
  hightlight.reserved.foreground=#60f856
69
- #hightlight.comment.foreground=#007F00
70
- hightlight.comment.foreground=#21a648
72
+ #hightlight.comment.foreground=#21a648
73
+ hightlight.comment.foreground=#000058520000
71
74
  hightlight.string.foreground=#ec6bfc
72
75
  hightlight.symbol.foreground=#bdc175
73
76
  hightlight.operator.foreground=#d9feff
@@ -115,7 +115,7 @@ QYcNPHwk8BAmjQ4kewChgdKFxD8GJj5ccBDkD582TXb0KEMFCxkMAheE0EBD
115
115
  iQsIHCJEFphBSJYaFQxsJngDBoDRBQOgXi0wIAA7
116
116
  EOS
117
117
 
118
- TREE_NODE_DEF_GIF[0..-1]=<<EOS
118
+ TREE_NODE_METHOD_GIF[0..-1]=<<EOS
119
119
  R0lGODlhEAAQAIcAAHMhc3spe3sxe3sxhAD/AIwxjJQ5lJw5nIxCjJRKlJRS
120
120
  lKVKraVSpa1Srb1rvb1zvc5jztZr1oycrZylra21rbW9rc6Mzt6c3uec5++U
121
121
  7++c7/+c/+et5++l7++97/+t/8bGrc7OrdbWrefnre/nrff3rQAAAAAAAAAA
@@ -145,17 +145,25 @@ EOS
145
145
  #WrLG2q6y+85zbNPHSS76UgAAOw==
146
146
  #EOS
147
147
 
148
- SYNCICON20_GIF[0..-1]=<<EOS
149
- R0lGODlhEAAQAKUoACBuDSBvDiBwDiRyEACAACmLEEGGMkWHNUqKPEikJk2j
150
- Kl2zM4PKXX3YR37ZR4rfV43tR5LuUJXuVZrvXKPwa6bxca3yfLzroLHzgrjz
151
- jbn0jsj2p8z3rc73ss/3s976y+L60OL60eX71eX71u/85fL96vT97vf+8v//
152
- ////////////////////////////////////////////////////////////
153
- /////////////////////////////////yH+EUNyZWF0ZWQgd2l0aCBHSU1Q
154
- ACH5BAEKAD8ALAAAAAAQABAAAAZvwJ9wSCwOC8ikkVgglUynwpL5CY2kQmSx
155
- cNlwPNgCSIQVJiwYgCbM6TAMQsBjAvgB6tlMRhCHQPBMFBV4AH6ARxEShA5/
156
- R1IFEA14BwqGQgQQkBALCEMBDY0/mH4NA0V3Q6OhU6INrpKsdnezsVNBADs=
148
+ #SYNCICON20_GIF[0..-1]=<<EOS
149
+ #R0lGODlhEAAQAKUoACBuDSBvDiBwDiRyEACAACmLEEGGMkWHNUqKPEikJk2j
150
+ #Kl2zM4PKXX3YR37ZR4rfV43tR5LuUJXuVZrvXKPwa6bxca3yfLzroLHzgrjz
151
+ #jbn0jsj2p8z3rc73ss/3s976y+L60OL60eX71eX71u/85fL96vT97vf+8v//
152
+ #////////////////////////////////////////////////////////////
153
+ #/////////////////////////////////yH+EUNyZWF0ZWQgd2l0aCBHSU1Q
154
+ #ACH5BAEKAD8ALAAAAAAQABAAAAZvwJ9wSCwOC8ikkVgglUynwpL5CY2kQmSx
155
+ #cNlwPNgCSIQVJiwYgCbM6TAMQsBjAvgB6tlMRhCHQPBMFBV4AH6ARxEShA5/
156
+ #R1IFEA14BwqGQgQQkBALCEMBDY0/mH4NA0V3Q6OhU6INrpKsdnezsVNBADs=
157
+ #EOS
158
+
159
+ SYNC_GIF[0..-1]=<<EOS
160
+ R0lGODlhEAAQALMPAL2EFqpvEKZrEPzssfvll/zxw/3xw/797/zqqf321bqX
161
+ Jv743v743f343fvssf///yH5BAEAAA8ALAAAAAAQABAAAARN8MkHwLyYHpsx
162
+ OFt3AUyzVGg1FobBFi8cXAFiB3g+YwFB7KJJD0hRiHAjgDE4+ag8qUpiypEA
163
+ Bo6BdrutPgTgsMBHEDC/PvN5rF63HxEAOw==
157
164
  EOS
158
165
 
166
+
159
167
  CLEAR_GIF[0..-1]=<<EOS
160
168
  R0lGODlhEAAQALMAAAAAAAD/AIQAAISEAISEhNbWzv8AAP//AP//////////
161
169
  /////////////////////yH5BAEAAAEALAAAAAAQABAAAAQ+MMhJq53AmLzF
@@ -163,6 +171,69 @@ R0lGODlhEAAQALMAAAAAAAD/AIQAAISEAISEhNbWzv8AAP//AP//////////
163
171
  WsOrdsulRAAAOw==
164
172
  EOS
165
173
 
174
+ SAVE_GIF[0..-1]=<<EOS
175
+ R0lGODlhEAAQAPUzADNmmTVomzZpnDlsnztuoTxvokF0p0J1qEV4q0d6rUp9
176
+ sE+CtVSHuleKvViLvl2Qw2CTxmSXymaZzGibzmmcz22g03Kl2Heq3X2w44CA
177
+ gIyMjJmZmaKiooK16Ii77o3A85LF+JbJ/JnM/6HQ/6zW/7/Z8rnc/8zMzNPT
178
+ 093d3dDd6sTi/8zm/93u/+fn5+7u7uTx/+72//j8/////wAAAAAAAAAAAAAA
179
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAADQALAAAAAAQABAAAAad
180
+ QJpwSCwKJZQRybRisVYm0ogiEUZEs6x2K4oIISGZeEwOQYQPUGzNboMeQscH
181
+ Rq/bPw4hw1Nq+f9+JR4MQgsdFRKJiokVHQtCChiSk5SSCkIIFxcqL52eKpoI
182
+ QgYWEy4AAC6qqhMWBkIFFQ0pBwcpt7cNFQVCAxQJKA0NKMTECRQDQwEEJ4kn
183
+ z88EEgFEBBkaGxwcGxoZBAIARuJEQQA7
184
+ EOS
185
+
186
+ SEARCH_GIF[0..-1]=<<EOS
187
+ R0lGODlhEAAQAOZBAAAzmQBmzP///1o7AJlmAOazAMTz/9mmAEW5//nNT+W5
188
+ ToPV/5TW/cyZAAyf/7Dp/yOn/2jD/q3h/le8/sz3/5zg/7bt/73l/7Xs/2fH
189
+ /4DT///bnZXb/97//2rK/wWb/8np/6zf/1S//77x/73w/8Xv/1+//wmc/1jA
190
+ /5Db/5LV/6rn/6Xb/zCt/33O/9X3/4LO/7jj/4PT/x+m/7nk/3XP/3PJ/3bQ
191
+ /6Tb/5Td/zCv/3fM/029/4za/6Pf/ZHc/6Pk/////wAAAAAAAAAAAAAAAAAA
192
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
193
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
194
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
195
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAEEA
196
+ LAAAAAAQABAAAAeYgEGCg4IBhgGEiUGGERETE4aKiwwxFyYtEDMQiIkBOCAC
197
+ LCcfDg6cgwEMKiE0MDoIPAgIp5M7LjYoHgs9Cwu0ABIyGSI1OQ8kDz4AhMAc
198
+ GjcpKwYdBgbLzBUVP0AYBhQU14IEBAACAiUWIy/m4QQKGwUA5eYC8oPuCQUH
199
+ A0Hy9vcK8h1owE9SEAICCRoUNECfwoUMBxSEGAgAOw==
200
+ EOS
201
+
202
+ EXIT_GIF[0..-1]=<<EOS
203
+ R0lGODlhEAAQAOepAAADDS8AAA4NGBQQHBkQEhISHRoRExsRFAAaJQsYIhsf
204
+ MCAfI8YNDf8AANkUFglKgPMUDglPhghPjwdQnrkoHwtTig5TjvklG+gqHegs
205
+ I+suIkVWifQuFSpcpERabhtgsO8wJB1krOc3Lv8yIAZvqiBopPQ3IfI4IyFp
206
+ sO86J/Q6IvI8HxduwSVts/88IfBAOxh0vP8+L/8/KylytxN4zSh2qix3uy97
207
+ rzp5qC98vz+AshuJzByJyxyJzDSDwxuKzTeEthyKzR2KzR2Kzh2LzzWGyB+M
208
+ zrRnhh+Mz/NcQh+NzyKOzxmP4/FfSSKP0COP0O9fWCCS2EmJuSeR0huU2ByU
209
+ 1h2U1huV1ieS0iST1mOGnimS0z2OwiuT1CCW1/dlRfZnSu9pXCKZ3SWZ2PZp
210
+ TiGa5C6Y1h+c3z6VzESTzyCc4/FtYyKe5i2c2jaa1fFvZUWYzT2a0vBwZjGf
211
+ 20qZ01eZxPR3Zk+f1yqo9Uii5DCp9Uul2kmn20un3f9/Xkuo6lWn3E6q4Uuu
212
+ 4U6t5lau3nynu1iv3/+KY12w4GCv4l6y4GGy4ly152K04k268Gi34mm442q4
213
+ 5HO/5nO/53TA523E8nfD6ozB3YHF6oHG6nfK9YDL7HPS+oTS+I/Q8JnT8ZXU
214
+ 85HZ/Zrb+KPe9Z3g/6Dk/7rr/q/y//Hq5P//////////////////////////
215
+ ////////////////////////////////////////////////////////////
216
+ ////////////////////////////////////////////////////////////
217
+ ////////////////////////////////////////////////////////////
218
+ ////////////////////////////////////////////////////////////
219
+ ////////////////////////////////////////////////////////////
220
+ /////////////////////yH+EUNyZWF0ZWQgd2l0aCBHSU1QACH5BAEKAP8A
221
+ LAAAAAAQABAAAAjkAP8JHDhoDxwuQG6g6cMo0MCBfxQs8KCl0KVPphI9FJhH
222
+ QJ1TpEqJAjUK0MZ/egpICZUJk0tPdx42+IdngI5OkihRmrSJzsMXMZgkwKHp
223
+ ESRIkSylgfJmjZwmh44AqFEJkaJGiwQVsfMFDJkkK/xQKOGIkCE+bub4CMNB
224
+ hYkTKVzI2MApjpktXdrkEIEhgwYQIy4EIIEKRhYsU8bYeOgAQgcEFqIgeeJk
225
+ iZcZDxn8o3GgAhsjSpQYsdLiJAsDEcoIIUJkCBUUJz8QeKCGR5AgPaqEOClQ
226
+ wpkdP37suMJb4AQxJwMCADs=
227
+ EOS
228
+
229
+ PARENTFOLDER_GIF[0..-1]=<<EOS
230
+ R0lGODlhEAAQAPMIAE1NTWZmZv9ma/+Fi/9wdf+6vP9eYf+FhwAAAAAAAAAA
231
+ AAAAAAAAAAAAAAAAAAAAACH5BAEAAAgALAAAAAAQABAAAARAEMlJq53h3lCA
232
+ ppwheF8oCARphcEoHCpWGAEw2nDVZrbX6wJeCvHTSQBD4oeYXDJjFYBUOoBS
233
+ AINs1jqZTp3gCAA7
234
+ EOS
235
+
236
+
166
237
  D_STEP_INTO_GIF[0..-1]=<<EOS
167
238
  R0lGODlhEAAQAIQSAE9ZXzpDX1aJtGd8laJtFfzjn/zlp6t4Gfzos7OAG/3s
168
239
  wP3wz/7129bAff745/7679K6d9nFj///////////////////////////////
@@ -15,7 +15,7 @@ class Breakpoints < ArcadiaExt
15
15
  # load_persistent_breakpoints
16
16
  end
17
17
 
18
- def on_after_build(_event)
18
+ def on_initialize(_event)
19
19
  load_persistent_breakpoints
20
20
  end
21
21
 
@@ -14,5 +14,5 @@ color.background=#ffffff
14
14
  color.foreground=#000000
15
15
  freebsd::font=courier 12 italic
16
16
  freebsd::font.bold=courier 12 bold
17
- win::font={Courier New} 9
18
- win::font.bold={Courier New} 9 bold
17
+ win|mingw::font={Courier New} 9
18
+ win|mingw::font.bold={Courier New} 9 bold
@@ -51,14 +51,15 @@ class DirProjects < ArcadiaExt
51
51
  padx 0
52
52
  pady 0
53
53
  background Arcadia.conf('panel.background')
54
- }.place('x'=>32,'height'=> 28)
55
-
54
+ }.place('x'=>0)
55
+ TkWinfo.parent(@button_box).configure(:background => Arcadia.conf('panel.background'))
56
+
56
57
  @button_box.add(Arcadia.style('toolbarbutton').update({
57
58
  'name'=>'new_proj',
58
59
  'anchor' => 'nw',
59
60
  'command'=>proc{self.do_new_project},
60
61
  'helptext'=>'New dir Project',
61
- 'image'=> TkPhotoImage.new('dat' => NEW_GIF)})
62
+ 'image'=> Arcadia.image_res(NEW_GIF)})
62
63
  )
63
64
 
64
65
  @button_box.add(Arcadia.style('toolbarbutton').update({
@@ -66,7 +67,7 @@ class DirProjects < ArcadiaExt
66
67
  'anchor' => 'nw',
67
68
  'command'=>proc{self.do_open_project},
68
69
  'helptext'=>'Open dir as Project',
69
- 'image'=> TkPhotoImage.new('dat' => OPEN_GIF)})
70
+ 'image'=> Arcadia.image_res(OPEN_PROJECT_GIF)})
70
71
  )
71
72
 
72
73
  @button_box.add(Arcadia.style('toolbarbutton').update({
@@ -74,18 +75,26 @@ class DirProjects < ArcadiaExt
74
75
  'anchor' => 'nw',
75
76
  'command'=>proc{self.do_goto_parent_folder},
76
77
  'helptext'=>'Go to parent folder',
77
- 'image'=> TkPhotoImage.new('dat' => PARENTFOLDER_GIF)})
78
+ 'image'=> Arcadia.image_res(PARENTFOLDER_GIF)})
78
79
  )
79
- #--- button_box
80
80
 
81
- @cb_sync = TkCheckButton.new(self.frame.hinner_frame, Arcadia.style('checkbox')){
81
+ @button_box.add(Arcadia.style('toolbarbutton').update({
82
+ 'name'=>'parent_folder',
83
+ 'anchor' => 'nw',
84
+ 'command'=>proc{self.do_search_files},
85
+ 'helptext'=>'Search in files from current folder',
86
+ 'image'=> Arcadia.image_res(SEARCH_FILES_GIF)})
87
+ )
88
+
89
+ #--- button_box
90
+ @panel = self.frame.root.add_panel(self.frame.name, "sync");
91
+ @cb_sync = TkCheckButton.new(@panel, Arcadia.style('checkbox').update('background'=>@panel.background)){
82
92
  text 'Sync'
83
93
  justify 'left'
84
94
  indicatoron 0
85
- offrelief 'raised'
86
- image TkPhotoImage.new('dat' => SYNCICON20_GIF)
87
- #pack('anchor'=>'n')
88
- place('x' => 0,'y' => 0,'height' => 26, 'width' => 26)
95
+ offrelief 'flat'
96
+ image Arcadia.image_res(SYNC_GIF)
97
+ pack
89
98
  }
90
99
 
91
100
  Tk::BWidget::DynamicHelp::add(@cb_sync,
@@ -126,19 +135,19 @@ class DirProjects < ArcadiaExt
126
135
 
127
136
  do_open_folder_cmd = proc{|_node| do_open_folder(_node)}
128
137
  do_close_folder_cmd = proc{|_node| do_close_folder(_node)}
129
-
130
- # @htree = Tk::BWidget::Tree.new(self.frame.hinner_frame, Arcadia.style('treepanel')){
131
- @htree = BWidgetTreePatched.new(self.frame.hinner_frame, Arcadia.style('treepanel')){
138
+ @htree = BWidgetTreePatched.new(self.frame.hinner_frame, Arcadia.style('treepanel')){
132
139
  showlines false
133
140
  deltay 18
134
141
  opencmd do_open_folder_cmd
135
142
  closecmd do_close_folder_cmd
136
143
  selectcommand do_select_item
144
+ crosscloseimage Arcadia.image_res(PLUS_GIF)
145
+ crossopenimage Arcadia.image_res(MINUS_GIF)
137
146
  }
138
- @htree.extend(TkScrollableWidget).show(0,26)
147
+ @htree.extend(TkScrollableWidget).show(0,22)
139
148
  self.pop_up_menu_tree
140
- @image_kdir = TkPhotoImage.new('dat' => ICON_FOLDER_OPEN_GIF)
141
- @image_kdir_closed = TkPhotoImage.new('dat' => FOLDER_GIF)
149
+ @image_kdir = Arcadia.image_res(ICON_FOLDER_OPEN_GIF)
150
+ @image_kdir_closed = Arcadia.image_res(FOLDER_GIF)
142
151
  self.load_projects
143
152
  @htree.areabind_append('KeyPress',proc{|k|
144
153
  key_press(k)
@@ -146,7 +155,7 @@ class DirProjects < ArcadiaExt
146
155
 
147
156
  do_double_click = proc{
148
157
  _selected = @htree.selected
149
- if File.ftype(node2file(_selected)) == 'directory'
158
+ if _selected && File.ftype(node2file(_selected)) == 'directory'
150
159
  if !_selected.nil? && @htree.open?(node2file(_selected))
151
160
  @htree.close_tree(node2file(_selected))
152
161
  elsif !_selected.nil?
@@ -189,7 +198,7 @@ class DirProjects < ArcadiaExt
189
198
  end
190
199
 
191
200
  def node2file(_node)
192
- if _node[0..0]=='{' && _node[-1..-1]=='}'
201
+ if !_node.nil? && _node[0..0]=='{' && _node[-1..-1]=='}'
193
202
  return _node[1..-2]
194
203
  else
195
204
  return _node
@@ -377,13 +386,7 @@ class DirProjects < ArcadiaExt
377
386
  :command,
378
387
  :label=>'Find in files...',
379
388
  :hidemargin => false,
380
- :command=> proc{
381
- _target = @htree.selected
382
- if _target
383
- _target = File.dirname(_target) if File.ftype(_target) == 'file'
384
- Arcadia.process_event(SearchInFilesEvent.new(self,'dir'=>_target))
385
- end
386
- }
389
+ :command=> proc{ do_search_files }
387
390
  )
388
391
 
389
392
  sub_ref_search.insert('end',
@@ -456,6 +459,14 @@ class DirProjects < ArcadiaExt
456
459
  "%x %y")
457
460
  end
458
461
 
462
+ def do_search_files
463
+ _target = @htree.selected
464
+ if _target
465
+ _target = File.dirname(_target) if File.ftype(_target) == 'file'
466
+ Arcadia.process_event(SearchInFilesEvent.new(self,'dir'=>_target))
467
+ end
468
+ end
469
+
459
470
  def do_goto_parent_folder
460
471
  if @current_opened_folder && @current_opened_folder != @last_current_opened_folder
461
472
  shure_select_node(@current_opened_folder)
@@ -738,28 +749,53 @@ class DirProjects < ArcadiaExt
738
749
  end
739
750
 
740
751
  def add_node(_parent, _node, _kind)
741
- return if @htree.exist?(_node)
742
- @node_parent[_node] = _parent
743
- # _name = _node.split(File::SEPARATOR)[-1]
744
- _name = File.basename(_node)
745
- _drawcross = 'auto'
746
- if _kind == "project" || _kind == "directory"
747
- num = Dir.entries(_node).length-2
748
- if num > 0
749
- _drawcross = 'always'
752
+ if @htree.exist?(_node)
753
+ if ['project','directory'].include?(_kind) && @node_parent[_node]!=_parent && !_node.include?('phantom_')
754
+ _phantom_node = "phantom_#{_node}"
755
+ j = 0
756
+ while @htree.exist?(_phantom_node)
757
+ _phantom_node= "phantom_#{j}_#{_node}"
758
+ j = j +1
759
+ end
760
+ _name = File.basename(_node)
761
+ selectable = _kind == 'project'
762
+ _drawcross = 'auto'
763
+ @htree.insert('end', _parent ,_phantom_node, {
764
+ 'text' => _name ,
765
+ 'helptext' => _node,
766
+ 'drawcross'=>_drawcross,
767
+ 'selectable'=>selectable,
768
+ 'deltax'=>-1,
769
+ 'image'=> image(_kind, _node)
770
+ }.update(Arcadia.style('treeitem').update({'fill'=>Arcadia.conf('inactiveforeground')}))
771
+ )
750
772
  end
751
- end
752
- @htree.insert('end', _parent ,_node, {
753
- 'text' => _name ,
754
- 'helptext' => _node,
755
- 'drawcross'=>_drawcross,
756
- 'deltax'=>-1,
757
- 'image'=> image(_kind, _node)
758
- }.update(Arcadia.style('treeitem'))
759
- )
760
- if _kind == "project" || _kind == "directory"
761
- if @opened_folder.include?(_node)
762
- do_open_folder(_node, true)
773
+ else
774
+ @node_parent[_node] = _parent
775
+ # _name = _node.split(File::SEPARATOR)[-1]
776
+ _name = File.basename(_node)
777
+ _drawcross = 'auto'
778
+ if _kind == "project" || _kind == "directory"
779
+ begin
780
+ num = Dir.entries(_node).length-2
781
+ if num > 0
782
+ _drawcross = 'always'
783
+ end
784
+ rescue Errno::EACCES
785
+ end
786
+ end
787
+ @htree.insert('end', _parent ,_node, {
788
+ 'text' => _name ,
789
+ 'helptext' => _node,
790
+ 'drawcross'=>_drawcross,
791
+ 'deltax'=>-1,
792
+ 'image'=> image(_kind, _node)
793
+ }.update(Arcadia.style('treeitem'))
794
+ )
795
+ if _kind == "project" || _kind == "directory"
796
+ if @opened_folder.include?(_node)
797
+ do_open_folder(_node, true)
798
+ end
763
799
  end
764
800
  end
765
801
  end
@@ -812,6 +848,7 @@ class DirProjects < ArcadiaExt
812
848
  @htree.configure('selectcommand'=>_proc)
813
849
  @selecting_node = false
814
850
  end
851
+ @htree.call_after_next_show_h_scroll(proc{Tk.update;@htree.see(_node)})
815
852
  end
816
853
 
817
854
  def del_project(_dir)
@@ -3,7 +3,7 @@
3
3
  # by Antonio Galeone <antonio-galeone@rubyforge.org>
4
4
  #
5
5
  # &require_dir_ref=../..
6
- # &require_omissis=conf/arcadia.init
6
+ # &require_omissis=#{Dir.pwd}/conf/arcadia.init
7
7
 
8
8
  require 'tk'
9
9
  require 'tktext'
@@ -12,16 +12,16 @@ require "#{Dir.pwd}/lib/a-tkcommons"
12
12
  require "#{Dir.pwd}/lib/a-core"
13
13
  require "#{Dir.pwd}/ext/ae-editor/lib/rbeautify"
14
14
 
15
- class TreeNode
15
+ class SourceTreeNode
16
16
  attr_reader :sons
17
17
  attr_reader :parent
18
18
  attr_reader :kind
19
- attr_reader :rif, :rif_end, :label, :helptext
20
- attr_writer :rif, :rif_end, :label, :helptext
21
- def initialize(parent=nil, kind='KClass')
19
+ attr_accessor :rif, :rif_end, :label, :helptext, :sortable
20
+ def initialize(parent=nil, kind='class', sortable=true)
22
21
  @sons = Array.new
23
22
  @parent = parent
24
23
  @kind = kind
24
+ @sortable = sortable
25
25
  if @parent !=nil
26
26
  @parent.sons << self
27
27
  end
@@ -29,15 +29,23 @@ class TreeNode
29
29
  end
30
30
 
31
31
  def <=> (other)
32
- self.label.strip <=> other.label.strip
32
+ if self.sortable && other.sortable
33
+ self.label.strip <=> other.label.strip
34
+ elsif !self.sortable
35
+ -1
36
+ elsif !other.sortable
37
+ 1
38
+ end
33
39
  end
40
+
34
41
  end
35
42
 
43
+
36
44
  class SourceStructure
37
45
  attr_reader :root
38
46
 
39
47
  def initialize
40
- @root = TreeNode.new(nil, 'KRoot'){|_node|
48
+ @root = SourceTreeNode.new(nil, 'root'){|_node|
41
49
  _node.rif= 'root'
42
50
  _node.label=''
43
51
  }
@@ -77,7 +85,7 @@ class SourceStructure
77
85
  def class_node_by_line(_line)
78
86
  line_node = node_by_line(@root, _line)
79
87
  class_node = line_node
80
- while class_node != nil && class_node.kind != "KClass"
88
+ while class_node != nil && class_node.kind != "class"
81
89
  class_node = class_node.parent
82
90
  end
83
91
  return class_node
@@ -86,30 +94,116 @@ class SourceStructure
86
94
  end
87
95
 
88
96
  class CtagsSourceStructure < SourceStructure
89
- def initialize(_file)
97
+ SUPPORTED_LANG = ['Ant','Asm','Asp','Awk','Basic','BETA','C','C++','C#','Cobol','DosBatch','Eiffel','Erlang','Flex','Fortran','HTML','Java','JavaScript','Lisp','Lua','Make','MatLab','OCaml','Pascal','Perl','PHP','Python','REXX','Ruby','Scheme','Sh','SLang','SML','SQL','Tcl','Tex','Vera','Verilog','VHDL','Vim','YACC']
98
+ def initialize(_file, _ctags_string='ctags', _language=nil)
90
99
  super()
91
100
  @file = _file
101
+ @ctags_string = _ctags_string
102
+ @language = (_language.nil?)?nil:_language.capitalize
103
+ @classes = Hash.new
104
+ @last_root = @root
105
+ @last_class_node = @root
106
+ @last_node = @root
92
107
  build_structure
93
108
  end
94
109
 
95
110
  def build_structure
96
111
  output = ctags
97
112
  output.each {|line|
98
- p line.split("\t")
99
- }
113
+ b1,brest = line.split("/^")
114
+ b2,b3 = brest.split('$/;"')
115
+ name,file = b1.strip.split("\t")
116
+ definition = b2.strip
117
+ fields_raw = b3.strip.split("\t")
118
+ fields = Hash.new
119
+ fields_raw.each{|item|
120
+ k,v=item.split(":")
121
+ fields[k.strip]=v.strip if !k.nil? && !v.nil?
122
+ }
123
+ if fields['class'] != nil
124
+ parent = @classes[fields['class']]
125
+ elsif fields['interface'] != nil
126
+ parent = @classes[fields['interface']]
127
+ elsif ['method','singleton method'].include?(fields['kind'])
128
+ parent = @last_class_node
129
+ else
130
+ parent = @last_root
131
+ end
132
+
133
+ node = SourceTreeNode.new(parent, fields['kind'])
134
+ node.label = name
135
+ node.helptext = definition
136
+ node.rif = fields['line']
137
+ @last_node.rif_end = (node.rif.to_i-1).to_s
138
+
139
+ if ['class','module','interface','package'].include?(fields['kind'])
140
+ if fields['class'] != nil
141
+ @classes["#{fields['class']}.#{name}"]=node
142
+ else
143
+ @classes[name]=node
144
+ end
145
+ @last_class_node = node
146
+ end
147
+ node.sortable = !['package','field'].include?(fields['kind'])
148
+ @last_node = node
149
+ }
150
+
151
+
100
152
  end
101
153
 
102
154
  def ctags
103
- _cmd_ = "|ctags -x -u #{@file}"
155
+ if @language != nil && SUPPORTED_LANG.include?(@language)
156
+ @ctags_string = "#{@ctags_string} --language-force=#{@language}"
157
+ end
158
+ _cmd_ = "|#{@ctags_string} --fields=+a+f+m+i+k+K+n+s+S+t+z -uf - #{@file}"
104
159
  to_ret = ''
105
- open(_cmd_, "r"){|f|
106
- to_ret = f.readlines
107
- }
160
+ begin
161
+ open(_cmd_, "r"){|f|
162
+ to_ret = f.readlines
163
+ }
164
+ rescue RuntimeError => e
165
+ Arcadia.runtime_error(e)
166
+ end
108
167
  to_ret
109
168
  end
110
169
  end
111
170
 
112
171
 
172
+ class RubyCtagsSourceStructure < CtagsSourceStructure
173
+ attr_reader :injected_row
174
+
175
+ def initialize(_file, _ctags_string='ctags')
176
+ super(_file, _ctags_string, 'Ruby')
177
+ end
178
+
179
+ def scheletor_from_node(_node, _source='', _injected_source='', _injected_class='')
180
+ _hinner_source = ''
181
+ #_sons = _node.sons.sort
182
+ _sons = _node.sons
183
+ for inode in 0.._sons.length - 1
184
+ _son = _sons[inode]
185
+ if _son.kind == 'class'
186
+ _hinner_source = "#{_hinner_source}#{_son.helptext}\n"
187
+ elsif _son.kind == 'module'
188
+ _hinner_source = "#{_hinner_source}#{_son.helptext}\n"
189
+ elsif _son.kind == 'method' && _son.label != 'initialize'
190
+ _hinner_source = "#{_hinner_source} def #{_son.label}\n"
191
+ _hinner_source = "#{_hinner_source} end\n"
192
+ elsif _son.kind == 'singleton method'
193
+ _hinner_source = "#{_hinner_source} def #{_son.label}\n"
194
+ _hinner_source = "#{_hinner_source} end\n"
195
+ end
196
+ _hinner_source= scheletor_from_node(_son, _hinner_source, _injected_source, _injected_class)
197
+ end
198
+ _source = "#{_source}#{_hinner_source}" if _hinner_source.strip.length>0
199
+ if _node.kind == 'class' && _node.label == _injected_class
200
+ _source = "#{_source} def initialize\n #{_injected_source} end\n"
201
+ @injected_row = _source.split("\n").length-2
202
+ end
203
+ _source = "#{_source}end\n" if _node.kind == 'class' || _node.kind == 'module'
204
+ _source
205
+ end
206
+ end
113
207
 
114
208
  class RubySourceStructure < SourceStructure
115
209
  attr_reader :injected_row
@@ -124,10 +218,6 @@ class RubySourceStructure < SourceStructure
124
218
  _row = 1
125
219
  _liv = 0
126
220
  _livs = Array.new
127
- # @root = TreeNode.new(nil, 'KRoot'){|_node|
128
- # _node.rif= 'root'
129
- # _node.label=''
130
- # }
131
221
  _livs[_liv]=@root
132
222
  _source.each_line{|line|
133
223
  line = "\s"+line.split("#")[0]+"\s"
@@ -152,7 +242,7 @@ class RubySourceStructure < SourceStructure
152
242
  _label = _helptext
153
243
  end
154
244
  if (m[0].strip[0..4] == "class" && m.pre_match.strip.length==0)
155
- _kind = 'KClass'
245
+ _kind = 'class'
156
246
  if m.post_match.strip[0..1]=='<<'
157
247
  hinner_class = true
158
248
  else
@@ -163,7 +253,7 @@ class RubySourceStructure < SourceStructure
163
253
  _liv = _liv - 1
164
254
  next
165
255
  elsif (m[0].strip[0..5] == "module" && m.pre_match.strip.length==0)
166
- _kind = 'KModule'
256
+ _kind = 'module'
167
257
  elsif (m[0].strip[0..5] == "module" && m.pre_match.strip.length>0)
168
258
  _row = _row +1
169
259
  _liv = _liv - 1
@@ -176,9 +266,9 @@ class RubySourceStructure < SourceStructure
176
266
  _liv = _liv - 1
177
267
  next
178
268
  elsif (m[0].strip[0..2] == "def" && m.pre_match.strip.length==0)
179
- _kind = 'KDef'
269
+ _kind = 'method'
180
270
  if _label.include?(_parent.label + '.')
181
- _kind = 'KDefClass'
271
+ _kind = 'singleton method'
182
272
  end
183
273
  # elsif (m[0].strip[0..10] == "attr_reader" && m.pre_match.strip.length==0)
184
274
  # _kind = 'KAttr_reader'
@@ -186,15 +276,15 @@ class RubySourceStructure < SourceStructure
186
276
  # _row = _row +1
187
277
  end
188
278
 
189
- if _livs[_liv-1] && (_livs[_liv-1].kind != 'KDef' || (_livs[_liv-1].kind == 'KDef' && _kind == 'KClass' && hinner_class))
190
- TreeNode.new(_parent, _kind){|_node|
279
+ if _livs[_liv-1] && (_livs[_liv-1].kind != 'method' || (_livs[_liv-1].kind == 'method' && _kind == 'class' && hinner_class))
280
+ SourceTreeNode.new(_parent, _kind){|_node|
191
281
  _node.label = _label
192
282
  _node.helptext = _helptext
193
283
  _node.rif = _row.to_s
194
284
  _livs[_pliv + 1]=_node
195
285
  }
196
286
  else
197
- TreeNode.new(_livs[_liv-3], _kind){|_node|
287
+ SourceTreeNode.new(_livs[_liv-3], _kind){|_node|
198
288
  _node.label = _label
199
289
  _node.helptext = _helptext
200
290
  _node.rif = _row.to_s
@@ -227,26 +317,26 @@ class RubySourceStructure < SourceStructure
227
317
  _sons = _node.sons
228
318
  for inode in 0.._sons.length - 1
229
319
  _son = _sons[inode]
230
- if _son.kind == 'KClass'
320
+ if _son.kind == 'class'
231
321
  _hinner_source = "#{_hinner_source}class #{_son.helptext}\n"
232
- elsif _son.kind == 'KModule'
322
+ elsif _son.kind == 'module'
233
323
  _hinner_source = "#{_hinner_source}module #{_son.helptext}\n"
234
- elsif _son.kind == 'KDef' && _son.helptext != 'initialize'
324
+ elsif _son.kind == 'method' && _son.helptext != 'initialize'
235
325
 
236
326
  _hinner_source = "#{_hinner_source} def #{_son.helptext}\n"
237
327
  _hinner_source = "#{_hinner_source} end\n"
238
- elsif _son.kind == 'KDefClass'
328
+ elsif _son.kind == 'singleton method'
239
329
  _hinner_source = "#{_hinner_source} def #{_son.helptext}\n"
240
330
  _hinner_source = "#{_hinner_source} end\n"
241
331
  end
242
332
  _hinner_source= scheletor_from_node(_son, _hinner_source, _injected_source, _injected_class)
243
333
  end
244
334
  _source = "#{_source}#{_hinner_source}" if _hinner_source.strip.length>0
245
- if _node.kind == 'KClass' && _node.label == _injected_class
335
+ if _node.kind == 'class' && _node.label == _injected_class
246
336
  _source = "#{_source} def initialize\n #{_injected_source} end\n"
247
337
  @injected_row = _source.split("\n").length-2
248
338
  end
249
- _source = "#{_source}end\n" if _node.kind == 'KClass' || _node.kind == 'KModule'
339
+ _source = "#{_source}end\n" if _node.kind == 'class' || _node.kind == 'module'
250
340
  _source
251
341
  end
252
342
 
@@ -263,12 +353,22 @@ end
263
353
  class SafeCompleteCode
264
354
  attr_reader :modified_row, :modified_col
265
355
  attr_reader :filter
266
- def initialize(_source, _row, _col, _file=nil)
267
- @source = _source
268
- @file = _file
356
+ def initialize(_editor, _row, _col)
357
+ @editor = _editor
358
+ @source = _editor.text_value
359
+ #@file = _file
269
360
  @row = _row.to_i
270
361
  @col = _col.to_i
271
- @ss = RubySourceStructure.new(_source)
362
+ if _editor && _editor.has_ctags?
363
+ tmp_file = _editor.create_temp_file
364
+ begin
365
+ @ss = RubyCtagsSourceStructure.new(tmp_file, _editor.ctags_string)
366
+ ensure
367
+ File.delete(tmp_file)
368
+ end
369
+ else
370
+ @ss = RubySourceStructure.new(_source)
371
+ end
272
372
  @filter=''
273
373
  @words = Array.new
274
374
  process_source
@@ -390,6 +490,7 @@ class SafeCompleteCode
390
490
  source_array = @source.split("\n")
391
491
  #---------------------------------
392
492
  focus_line = source_array[@row-1]
493
+ focus_line = focus_line[0..@col] if focus_line
393
494
  focus_line = '' if focus_line.nil?
394
495
  focus_world = ''
395
496
  if focus_line && focus_line.strip.length > 0
@@ -415,7 +516,7 @@ class SafeCompleteCode
415
516
  end
416
517
  @class_node = @ss.class_node_by_line(@row)
417
518
  #---------------------------------
418
- @modified_source = "#{@modified_source}Dir.chdir('#{File.dirname(@file)}')\n" if @file
519
+ @modified_source = "#{@modified_source}Dir.chdir('#{File.dirname(@editor.file)}')\n" if @editor.file
419
520
  @modified_row = @modified_row+1
420
521
  source_array.each_with_index{|line,j|
421
522
  # 0) if a comment I do not consider it
@@ -430,7 +531,7 @@ class SafeCompleteCode
430
531
  m = /&require_omissis=[\s]*(.)*/.match(line)
431
532
  if m
432
533
  require_omissis=line.split('&require_omissis=')[1].strip
433
- @modified_source = "#{@modified_source}require '#{require_omissis}'\n"
534
+ @modified_source = "#{@modified_source}require \"#{require_omissis}\"\n"
434
535
  @modified_row = @modified_row+1
435
536
  end
436
537
 
@@ -460,12 +561,15 @@ class SafeCompleteCode
460
561
  re = Regexp::new('[\s\n\t\;]('+focus_world.strip+')[\s\t]*=(.)*')
461
562
  source_array.each_with_index do |line,j|
462
563
  #m = /[\s\n\t\;](#{focus_world})[\s\t]*=(.)*/.match(line)
463
-
464
- m = re.match("\s#{line}")
465
- if m
466
- @dec_line = line
467
- @class_dec_line_node = @ss.class_node_by_line(j+1)
564
+ if j >= @row-1
468
565
  break
566
+ else
567
+ m = re.match("\s#{line}")
568
+ if m
569
+ @dec_line = line
570
+ @class_dec_line_node = @ss.class_node_by_line(j+1)
571
+ break
572
+ end
469
573
  end
470
574
  end
471
575
  rescue Exception => e
@@ -508,8 +612,6 @@ class SafeCompleteCode
508
612
  else
509
613
  @modified_source = "#{@modified_source}$SAFE = 3\n"
510
614
  if @dec_line
511
-
512
-
513
615
  @modified_source = "#{@modified_source}#{declaration(@dec_line)}\n"
514
616
  @modified_row = @modified_row+1
515
617
  end
@@ -557,9 +659,9 @@ class SafeCompleteCode
557
659
  end
558
660
 
559
661
  def candidates(_show_error = false)
560
- temp_file = create_modified_temp_file(@file)
662
+ temp_file = create_modified_temp_file(@editor.file)
561
663
  begin
562
- Arcadia.is_windows??ruby='rubyw':ruby='ruby'
664
+ Arcadia.is_windows??ruby='rubyw':ruby=Arcadia.ruby
563
665
  _cmp_s = "|#{ruby} '#{temp_file}'"
564
666
  _ret = nil
565
667
  open(_cmp_s,"r") do |f|
@@ -577,6 +679,7 @@ class SafeCompleteCode
577
679
  end
578
680
  _ret.sort
579
681
  rescue Exception => e
682
+ Arcadia.runtime_error(e)
580
683
  #Arcadia.console(self, 'msg'=>e.to_s, 'level'=>'error')
581
684
  ensure
582
685
  File.delete(temp_file) if File.exist?(temp_file)
@@ -585,9 +688,10 @@ class SafeCompleteCode
585
688
 
586
689
  def create_modified_temp_file(_base_file=nil)
587
690
  if _base_file
588
- _file = _base_file+'~~'
691
+ File.basename(_base_file)
692
+ _file = File.join(File.dirname(_base_file),'~~'+File.basename(_base_file))
589
693
  else
590
- _file = File.join(Arcadia.instance.local_dir,'buffer~~')
694
+ _file = File.join(Arcadia.instance.local_dir,'~~buffer')
591
695
  end
592
696
  f = File.new(_file, "w")
593
697
  begin
@@ -697,16 +801,17 @@ end
697
801
 
698
802
  class AgEditorOutlineToolbar
699
803
  attr_accessor :sync
700
- def initialize(_frame, _controller)
804
+ def initialize(_controller)
701
805
  @controller = _controller
702
- @cb_sync = TkCheckButton.new(_frame, Arcadia.style('checkbox')){
806
+ @panel = @controller.frame(1).root.add_panel(@controller.frame(1).name, "sync");
807
+ @cb_sync = TkCheckButton.new(@panel, Arcadia.style('checkbox').update('background'=>@panel.background)){
703
808
  text 'Sync'
704
809
  justify 'left'
705
810
  indicatoron 0
706
- offrelief 'raised'
707
- image TkPhotoImage.new('dat' => SYNCICON20_GIF)
708
- place('x' => 0,'y' => 0,'height' => 26, 'width' => 26)
709
- }
811
+ offrelief 'flat'
812
+ image Arcadia.image_res(SYNC_GIF)
813
+ pack
814
+ }
710
815
  Tk::BWidget::DynamicHelp::add(@cb_sync,
711
816
  'text'=>'Link open editors with content in the Navigator')
712
817
 
@@ -742,10 +847,12 @@ end
742
847
  class AgEditorOutline
743
848
  attr_reader :last_row
744
849
  attr_reader :tree_exp
745
- def initialize(_editor, _frame, _bar)
850
+ attr_reader :ss
851
+ def initialize(_editor, _frame, _bar, _lang=nil)
746
852
  @editor = _editor
747
853
  @frame = _frame
748
854
  @bar = _bar
855
+ @lang = _lang
749
856
  initialize_tree(_frame)
750
857
  end
751
858
 
@@ -779,10 +886,12 @@ class AgEditorOutline
779
886
  @tree_exp.close_tree(to_open) if to_open && !@opened
780
887
 
781
888
  @tree_exp.see(_node.rif)
889
+
782
890
  ensure
783
891
  @tree_exp.selectcommand(_proc)
784
892
  @selecting_node = false
785
893
  end
894
+ @tree_exp.call_after_next_show_h_scroll(proc{Tk.update;@tree_exp.see(_node.rif)})
786
895
  end
787
896
 
788
897
  def select_without_event(_line)
@@ -830,6 +939,8 @@ class AgEditorOutline
830
939
  deltay 18
831
940
  dragenabled true
832
941
  selectcommand proc{ _tree_goto.call(self) }
942
+ crosscloseimage Arcadia.image_res(ARROWRIGHT_GIF)
943
+ crossopenimage Arcadia.image_res(ARROWDOWN_GIF)
833
944
  }
834
945
  @tree_exp.extend(TkScrollableWidget)
835
946
  self.show
@@ -843,7 +954,7 @@ class AgEditorOutline
843
954
 
844
955
  def show
845
956
  #@tree_scroll_wrapper.show(0,26)
846
- @tree_exp.show(0,26)
957
+ @tree_exp.show(0,0)
847
958
  Tk.update
848
959
  end
849
960
 
@@ -853,22 +964,22 @@ class AgEditorOutline
853
964
  end
854
965
 
855
966
  def build_tree_from_node(_node, _label_match=nil)
856
- @image_kclass = TkPhotoImage.new('dat' => TREE_NODE_CLASS_GIF)
857
- @image_kmodule = TkPhotoImage.new('dat' => TREE_NODE_MODULE_GIF)
858
- @image_kdef = TkPhotoImage.new('dat' => TREE_NODE_DEF_GIF)
859
- @image_kdefclass = TkPhotoImage.new('dat' => TREE_NODE_DEFCLASS_GIF)
967
+ @image_class = Arcadia.image_res(TREE_NODE_CLASS_GIF)
968
+ @image_module = Arcadia.image_res(TREE_NODE_MODULE_GIF)
969
+ @image_method = Arcadia.image_res(TREE_NODE_METHOD_GIF)
970
+ @image_singleton_method = Arcadia.image_res(TREE_NODE_SINGLETON_METHOD_GIF)
860
971
 
861
- _sorted_sons = _node.sons.sort
972
+ _sorted_sons = _node.sons.sort
862
973
  for inode in 0.._sorted_sons.length - 1
863
974
  _son = _sorted_sons[inode]
864
- if _son.kind == 'KClass'
865
- _image = @image_kclass
866
- elsif _son.kind == 'KModule'
867
- _image = @image_kmodule
868
- elsif _son.kind == 'KDef'
869
- _image = @image_kdef
870
- elsif _son.kind == 'KDefClass'
871
- _image = @image_kdefclass
975
+ if _son.kind == 'class'
976
+ _image = @image_class
977
+ elsif _son.kind == 'module'
978
+ _image = @image_module
979
+ elsif _son.kind == 'method' || _son.kind == 'procedure'
980
+ _image = @image_method
981
+ elsif _son.kind == 'singleton method'
982
+ _image = @image_singleton_method
872
983
  end
873
984
  @tree_exp.insert('end', _son.parent.rif ,_son.rif, {
874
985
  'text' => _son.label ,
@@ -899,12 +1010,21 @@ class AgEditorOutline
899
1010
  end
900
1011
 
901
1012
 
902
- #(re)build tree
903
1013
  _txt = @editor.text.get('1.0','end')
904
- #@root = build_tree_from_source(_txt)
905
- #CtagsSourceStructure.new(@editor.file)
906
- @ss = RubySourceStructure.new(_txt)
907
- #@root = @ss.root
1014
+ if @editor.has_ctags?
1015
+ if @editor.file
1016
+ @ss = CtagsSourceStructure.new(@editor.file, @editor.ctags_string)
1017
+ else
1018
+ tmp_file = @editor.create_temp_file
1019
+ begin
1020
+ @ss = CtagsSourceStructure.new(tmp_file, @editor.ctags_string, @lang)
1021
+ ensure
1022
+ File.delete(tmp_file)
1023
+ end
1024
+ end
1025
+ else
1026
+ @ss = RubySourceStructure.new(_txt)
1027
+ end
908
1028
  @selected = nil
909
1029
  build_tree_from_node(@ss.root, _label_sel)
910
1030
  if @selected
@@ -950,6 +1070,8 @@ class AgEditor
950
1070
  attr_reader :outline
951
1071
  attr_reader :highlighting
952
1072
  attr_reader :last_tmp_file
1073
+ attr_reader :lang
1074
+ attr_reader :file_info
953
1075
  def initialize(_controller, _page_frame)
954
1076
  @controller = _controller
955
1077
  @page_frame = _page_frame
@@ -961,6 +1083,7 @@ class AgEditor
961
1083
  @font_metrics_bold = TkFont.new(@font_bold).metrics
962
1084
  @highlighting = false
963
1085
  @classbrowsing = false
1086
+ @codeinsight = false
964
1087
  @find = @controller.get_find
965
1088
  @read_only=false
966
1089
  @loading=false
@@ -968,6 +1091,7 @@ class AgEditor
968
1091
  @spaces_show = false
969
1092
  @line_numbers_visible = @controller.conf('line-numbers') == 'yes'
970
1093
  @id = -1
1094
+ @file_info = Hash.new
971
1095
  end
972
1096
 
973
1097
  def modified_from_opening?
@@ -1022,6 +1146,7 @@ class AgEditor
1022
1146
  padx 0
1023
1147
  tabs $arcadia['conf']['editor.tabs']
1024
1148
  }
1149
+
1025
1150
  _self_editor = self
1026
1151
  class << @text
1027
1152
  attr_accessor :editor
@@ -1047,26 +1172,47 @@ class AgEditor
1047
1172
  @buffer = text_value
1048
1173
  pop_up_menu
1049
1174
  @text.extend(TkScrollableWidget).show
1175
+ @text.extend(TkInputThrow)
1050
1176
  begin
1051
1177
  @text_cursor = @text.cget('cursor')
1052
1178
  rescue RuntimeError => e
1053
- p "RuntimeError : #{e.message}"
1179
+ Arcadia.runtime_error(e)
1180
+ #p "RuntimeError : #{e.message}"
1054
1181
  end
1055
1182
  end
1056
1183
 
1057
1184
  def create_temp_file
1058
1185
  if @file
1059
1186
  n=0
1060
- while File.exist?("#{@file}#{n*'_'}~~")
1187
+ while File.exist?("#{File.join(File.dirname(@file),'~~'+File.basename(@file))}#{'_'*n}")
1061
1188
  n+=1
1062
1189
  end
1063
- _file = "#{@file}#{n*'_'}~~"
1190
+ _file = "#{File.join(File.dirname(@file),'~~'+File.basename(@file))}#{'_'*n}"
1191
+ # while File.exist?("~~#{@file}#{n*'_'}")
1192
+ # n+=1
1193
+ # end
1194
+ # _file = "~~#{@file}#{n*'_'}"
1064
1195
  else
1065
- n=0
1066
- while File.exist?(File.join(Arcadia.instance.local_dir,"buffer#{n}~~"))
1067
- n+=1
1196
+ if @lang == 'java'
1197
+ m = Regexp::new(/(class[\s][\s]*)[A-Za-z0-9_]*[\s]*/).match(text_value)
1198
+ if m && m.length > 0
1199
+ a = m[0].split
1200
+ if a && a.length > 1
1201
+ tmp_dir = "~~#{a[1].strip.downcase}"
1202
+ full_tmp_dir = File.join(Arcadia.instance.local_dir,tmp_dir)
1203
+ Dir.mkdir(full_tmp_dir) if !File.exist?(full_tmp_dir)
1204
+ basename = File.join(tmp_dir,"#{a[1].strip}.java")
1205
+ end
1206
+ end
1207
+ basename = "~~buffer.java" if basename.nil?
1208
+ else
1209
+ n=0
1210
+ while File.exist?(File.join(Arcadia.instance.local_dir,"~~buffer#{n}"))
1211
+ n+=1
1212
+ end
1213
+ basename = "~~buffer#{n}"
1068
1214
  end
1069
- _file = File.join(Arcadia.instance.local_dir,"buffer#{n}~~")
1215
+ _file = File.join(Arcadia.instance.local_dir, basename)
1070
1216
  end
1071
1217
  f = File.new(_file, "w")
1072
1218
  begin
@@ -1100,9 +1246,9 @@ class AgEditor
1100
1246
  Arcadia.console(self, 'msg'=>_custom_text)
1101
1247
 
1102
1248
  if @file
1103
- _file = @file+'~~'
1249
+ _file = "#{File.join(File.dirname(@file),'~~'+File.basename(@file))}"
1104
1250
  else
1105
- _file = 'buffer~~'
1251
+ _file = File.join(Arcadia.instance.local_dir,'~~buffer')
1106
1252
  end
1107
1253
  f = File.new(_file, "w")
1108
1254
  begin
@@ -1132,7 +1278,7 @@ class AgEditor
1132
1278
  @do_complete = @do_complete && @controller.accept_complete_code
1133
1279
  if @do_complete
1134
1280
  line, col = @text.index('insert').split('.')
1135
- mss = SafeCompleteCode.new(text_value, line.to_i, col.to_i, @file)
1281
+ mss = SafeCompleteCode.new(self, line.to_i, col.to_i)
1136
1282
  candidates = mss.candidates
1137
1283
  raise_complete_code(candidates, line.to_s, col.to_s, mss.filter) if candidates && candidates.length > 0
1138
1284
  end
@@ -1170,6 +1316,18 @@ class AgEditor
1170
1316
  _target = @text.get('insert - 1 chars wordstart','insert')
1171
1317
  if _target.strip == '('
1172
1318
  _target = @text.get('insert - 2 chars wordstart','insert')
1319
+ else
1320
+ _line = @text.get("insert linestart",'insert lineend')
1321
+ ei = _line.index(_target)
1322
+ if !ei.nil?
1323
+ j=1
1324
+ pre_target = ''
1325
+ while ei-j>=0 && _line[ei-j..ei-j]!="\s"
1326
+ pre_target = _line[ei-j..ei-j] + pre_target
1327
+ j+=1
1328
+ end
1329
+ _target= pre_target + _target
1330
+ end
1173
1331
  end
1174
1332
  if _target.strip.length > 0 && _target != '.'
1175
1333
  extra_len = _target.length.+@
@@ -1508,7 +1666,7 @@ class AgEditor
1508
1666
  when 'g'
1509
1667
  Arcadia.process_event(GoToLineBufferEvent.new(self))
1510
1668
  when 'n'
1511
- $arcadia['main.action.new_file'] # necessary? Is there an event for this?
1669
+ Arcadia.process_event(NewBufferEvent.new(self))
1512
1670
  when 'w'
1513
1671
  Arcadia.process_event(CloseCurrentTabEvent.new(self))
1514
1672
  end
@@ -1643,8 +1801,7 @@ class AgEditor
1643
1801
  if ['Control_L', 'Control_V', 'BackSpace', 'Delete'].include?(e.keysym)
1644
1802
  do_line_update
1645
1803
  end
1646
- if @highlighting && /\w/.match(e.keysym)
1647
- # rehighlightline(@text.index('insert').split('.')[0].to_i)
1804
+ if @highlighting
1648
1805
  row = @text.index('insert').split('.')[0].to_i
1649
1806
  rehighlightlines(row, row)
1650
1807
  end
@@ -1729,14 +1886,14 @@ class AgEditor
1729
1886
 
1730
1887
  @text.tag_bind('selected', 'Enter', proc{@text.tag_remove('selected','1.0','end')})
1731
1888
 
1732
- @text.bind("Enter", proc{do_enter})
1889
+ @text.bind_append("Enter", proc{do_enter})
1733
1890
 
1734
1891
  @text.bind("<Modified>"){|e|
1735
1892
  check_modify
1736
1893
  }
1737
1894
  activate_key_binding
1738
1895
  @text.bind_append("1"){
1739
- Arcadia.process_event(InputEnterEvent.new(self,'receiver'=>@text))
1896
+ #Arcadia.process_event(InputEnterEvent.new(self,'receiver'=>@text))
1740
1897
  refresh_outline
1741
1898
  }
1742
1899
  end
@@ -1748,11 +1905,12 @@ class AgEditor
1748
1905
  end
1749
1906
 
1750
1907
  def run_buffer
1751
- if !@file
1752
- Arcadia.process_event(RunCmdEvent.new(self, {'file'=>'*CURR', 'runner_name'=>'ruby_file', 'persistent'=>false}))
1908
+ if !@file
1909
+ @lang='ruby' if !@lang
1910
+ RunCmdEvent.new(self, {'file'=>'*CURR', 'persistent'=>false, 'lang'=>@lang}).go!
1753
1911
  else
1754
- save if !@read_only
1755
- Arcadia.process_event(RunCmdEvent.new(self, {'file'=>@file}))
1912
+ save if !@read_only && modified?
1913
+ RunCmdEvent.new(self, {'file'=>@file, 'lang'=>@lang}).go!
1756
1914
  end
1757
1915
  end
1758
1916
 
@@ -1776,7 +1934,12 @@ class AgEditor
1776
1934
  'bordermode'=>'outside'
1777
1935
  )
1778
1936
  }
1779
- delta = (@font_metrics_bold[2][1]-@font_metrics[2][1])
1937
+ if Arcadia.conf("textline.spacing3")
1938
+ @text_line_spacing3 = Arcadia.conf("textline.spacing3").to_i
1939
+ else
1940
+ @text_line_spacing3 = 0
1941
+ end
1942
+ delta = (@font_metrics_bold[2][1]-@font_metrics[2][1]) + @text_line_spacing3
1780
1943
  @text_line_num.tag_configure('normal_case', 'justify'=>'right')
1781
1944
  @text_line_num.tag_configure('bold_case', 'spacing3'=>delta, 'justify'=>'right')
1782
1945
  @text_line_num.tag_configure('breakpoint', 'background'=>'red','foreground'=>'yellow','borderwidth'=>1, 'relief'=>'raised')
@@ -2003,7 +2166,8 @@ class AgEditor
2003
2166
  begin
2004
2167
  @text.tag_configure(_name, h)
2005
2168
  rescue RuntimeError => e
2006
- p "RuntimeError : #{e.message}"
2169
+ Arcadia.runtime_error(e)
2170
+ #p "RuntimeError : #{e.message}"
2007
2171
  end
2008
2172
  end
2009
2173
 
@@ -2047,7 +2211,8 @@ class AgEditor
2047
2211
  begin
2048
2212
  @text.tag_configure(_name, h)
2049
2213
  rescue RuntimeError => e
2050
- p "RuntimeError : #{e.message}"
2214
+ Arcadia.runtime_error(e)
2215
+ #p "RuntimeError : #{e.message}"
2051
2216
  end
2052
2217
  end
2053
2218
 
@@ -2219,7 +2384,7 @@ class AgEditor
2219
2384
  if _data.length > 0
2220
2385
  _b = TkButton.new(@text,
2221
2386
  'command'=>proc{_b.destroy},
2222
- 'image'=> TkPhotoImage.new('data' => _data),
2387
+ 'image'=> Arcadia.image_res(_data),
2223
2388
  'relief'=>'groove')
2224
2389
  TkTextWindow.new(@text, _r[0][1], 'window'=> _b)
2225
2390
  end
@@ -2687,7 +2852,10 @@ class AgEditor
2687
2852
  def reset_modify(_reset_tab=true)
2688
2853
  @controller.change_tab_reset_modify(@page_frame) if _reset_tab
2689
2854
  @set_mod = false
2690
- @file_last_access_time = File.mtime(@file) if @file
2855
+ @file_info['mtime'] = File.mtime(@file) if @file
2856
+ #@file_last_access_time = File.mtime(@file) if @file
2857
+ @controller.refresh_status
2858
+ update_toolbar
2691
2859
  end
2692
2860
 
2693
2861
  def pos_to_index(_txt, _pos)
@@ -2776,7 +2944,7 @@ class AgEditor
2776
2944
  delta = w_ry_e - w_ry_b
2777
2945
  if delta > 1
2778
2946
  _tag = "wrap_case_#{j}"
2779
- @text_line_num.tag_configure(_tag, 'spacing3'=>delta)
2947
+ @text_line_num.tag_configure(_tag, 'spacing3'=>delta + @text_line_spacing3)
2780
2948
  _tags << _tag
2781
2949
  end
2782
2950
  end
@@ -2803,25 +2971,24 @@ class AgEditor
2803
2971
  end
2804
2972
  _line_end=row('end')
2805
2973
  line_end_chars = _line_end.to_s.length
2806
- if @last_line_end_chars != line_end_chars
2807
- if @line_num_rx_e.nil?
2974
+ if @last_line_end_chars != line_end_chars || @need_recalc
2975
+ if @line_num_rx_e.nil? || @need_recalc
2808
2976
  @line_num_rx_e, @line_num_ry_e, @line_num_width_e, @line_num_heigth_e = @text_line_num.bbox("0.1 lineend - 1 chars");
2809
- if @line_num_rx_e.nil?
2810
- @line_num_rx_e = 0
2811
- end
2812
2977
  if @line_num_width_e.nil?
2813
- linfo_x, linfo_y, linfo_w, linfo_h, linfo_b = @text_line_num.dlineinfo('0.1')
2814
- if linfo_w
2815
- @line_num_width_e = linfo_w.to_f/(line_end_chars+1.5)
2816
- end
2978
+ @line_num_width_e = @font.split()[-1].strip.to_i
2979
+ @need_recalc = true
2980
+ # linfo_x, linfo_y, linfo_w, linfo_h, linfo_b = @text_line_num.dlineinfo('0.1')
2981
+ # if linfo_w
2982
+ # @line_num_width_e = linfo_w.to_f/(line_end_chars+1.5)
2983
+ # end
2984
+ else
2985
+ @need_recalc = false
2817
2986
  end
2818
2987
  end
2819
2988
 
2820
2989
 
2821
- if @line_num_rx_e && @line_num_width_e && line_end_chars >0
2822
- actual_width = @line_num_rx_e + @line_num_width_e
2990
+ if @line_num_width_e && line_end_chars >0
2823
2991
  need_width = (line_end_chars+1)*@line_num_width_e
2824
- delta = actual_width - need_width
2825
2992
  @fm1.resize_left(need_width)
2826
2993
  @last_line_end_chars = line_end_chars
2827
2994
  else
@@ -2986,21 +3153,27 @@ class AgEditor
2986
3153
  end
2987
3154
  end
2988
3155
 
3156
+ def update_toolbar
3157
+ save = Arcadia.toolbar_item('save')
3158
+ save.enable=@set_mod if save
3159
+ end
3160
+
2989
3161
  def check_modify
2990
3162
  return if @loading
2991
- if modified?
3163
+ if modified?
2992
3164
  set_modify if !@set_mod
2993
3165
  else
2994
3166
  reset_modify
2995
3167
  end
3168
+ update_toolbar
2996
3169
  end
2997
3170
 
2998
3171
  def modified_by_others?
2999
3172
  ret = false
3000
- if @file_last_access_time && @file
3173
+ if @file_info['mtime'] && @file
3001
3174
  if File.exist?(@file)
3002
3175
  ftime = File.mtime(@file)
3003
- ret = @file_last_access_time != ftime
3176
+ ret = @file_info['mtime'] != ftime
3004
3177
  else
3005
3178
  ret = true
3006
3179
  end
@@ -3011,9 +3184,9 @@ class AgEditor
3011
3184
  def reset_file_last_access_time
3012
3185
  if @file
3013
3186
  if File.exist?(@file)
3014
- @file_last_access_time = File.mtime(@file)
3187
+ @file_info['mtime'] = File.mtime(@file)
3015
3188
  else
3016
- @file_last_access_time = nil
3189
+ @file_info['mtime'] = nil
3017
3190
  @file = nil
3018
3191
  end
3019
3192
  end
@@ -3022,9 +3195,9 @@ class AgEditor
3022
3195
  def check_file_last_access_time
3023
3196
  if @file
3024
3197
  file_exist = File.exist?(@file)
3025
- if @file_last_access_time && file_exist
3198
+ if @file_info['mtime'] && file_exist
3026
3199
  ftime = File.mtime(@file)
3027
- if @file_last_access_time != ftime
3200
+ if @file_info['mtime'] != ftime
3028
3201
  msg = 'File "'+@file+'" is changed! Reload?'
3029
3202
  ans = Tk.messageBox('icon' => 'error', 'type' => 'yesno',
3030
3203
  'title' => '(Arcadia) Libs', 'parent' => @text,
@@ -3032,7 +3205,7 @@ class AgEditor
3032
3205
  if ans == 'yes'
3033
3206
  reload
3034
3207
  else
3035
- @file_last_access_time = ftime
3208
+ @file_info['mtime'] = ftime
3036
3209
  end
3037
3210
  end
3038
3211
  elsif !file_exist
@@ -3058,11 +3231,33 @@ class AgEditor
3058
3231
  @text.see(pos_index)
3059
3232
  @text.set_insert(pos_index)
3060
3233
  end
3234
+
3235
+ def has_ctags?
3236
+ @controller.has_ctags
3237
+ end
3238
+
3239
+ def ctags_string
3240
+ @controller.ctags_string
3241
+ end
3061
3242
 
3062
- def init_editing(_ext='rb')
3063
- @is_ruby = _ext=='rb'|| _ext=='rbw'
3064
- @classbrowsing = @is_ruby
3065
- @lang_hash = @controller.languages_hash(_ext)
3243
+ def initialize_editing(_ext=nil, _lang=nil)
3244
+ if _lang
3245
+ @is_ruby = _lang=='ruby'
3246
+ else
3247
+ @is_ruby = _ext=='rb' || _ext=='rbw'
3248
+ end
3249
+ @classbrowsing = @is_ruby || has_ctags?
3250
+ @codeinsight = @is_ruby
3251
+ if _lang
3252
+ @lang_hash = @controller.language_hash_by_lang(_lang)
3253
+ else
3254
+ @lang_hash = @controller.language_hash_by_ext(_ext)
3255
+ end
3256
+ if @lang_hash
3257
+ @lang = @lang_hash['language']
3258
+ else
3259
+ @lang = 'ruby'
3260
+ end
3066
3261
  # @highlight_scanner = @controller.highlight_scanner(_ext)
3067
3262
  # if !_ext.nil? && @is_ruby
3068
3263
  # @fm = AGTkVSplittedFrames.new(@page_frame,_w1)
@@ -3084,7 +3279,7 @@ class AgEditor
3084
3279
  if @outline
3085
3280
  @outline.show
3086
3281
  else
3087
- @outline=AgEditorOutline.new(self,@controller.frame(1).hinner_frame,@controller.outline_bar)
3282
+ @outline=AgEditorOutline.new(self, @controller.frame(1).hinner_frame, @controller.outline_bar, @lang)
3088
3283
  refresh
3089
3284
  end
3090
3285
  end
@@ -3105,7 +3300,6 @@ class AgEditor
3105
3300
  begin
3106
3301
  @file = _filename
3107
3302
  if _filename
3108
- #init_editing(file_extension(_filename))
3109
3303
  File::open(_filename,'rb'){ |file|
3110
3304
  @text.insert('end',file.readlines.collect!{| line | line.chomp}.join("\n"))
3111
3305
  #@text.insert('end',file.read)
@@ -3207,19 +3401,44 @@ class ReHighlightScanner < HighlightScanner
3207
3401
  end
3208
3402
 
3209
3403
 
3210
- def find_tag(_tag, _row, _txt)
3404
+ def find_tag(_tag, _row, _line_txt)
3405
+ _txt = _line_txt
3211
3406
  to_ret = []
3212
3407
  _re = @h_re[_tag]
3213
3408
  m = _re.match(_txt)
3214
3409
  _end = 0
3410
+ # index = _line_txt.index("oldaccel1")
3411
+ # stampa = index && index >0
3412
+ # stampa=true
3413
+ # p "_line_txt=#{_line_txt}" if stampa
3414
+ # p "_tag=#{_tag}" if stampa
3215
3415
  while m && (_txt=m.post_match)
3216
3416
  if !defined?(_old_txt) || _txt != _old_txt
3217
- _old_txt = _txt
3218
- _ibegin = _row.to_s+'.'+(m.begin(0)+_end).to_s
3219
- _end = m.end(0) + _end
3220
- _iend = _row.to_s+'.'+(_end.to_s)
3221
- to_ret << [_ibegin, _iend]
3222
- if @op_only_first.include?(_tag)
3417
+ b1 = _line_txt[m.begin(0)+_end-1..m.begin(0)+_end-1]
3418
+ b2 = _line_txt[m.begin(0)+_end..m.begin(0)+_end]
3419
+ e1 = _line_txt[m.end(0)+_end..m.end(0)+_end]
3420
+ e2 = _line_txt[m.end(0)-1+_end..m.end(0)+_end-1]
3421
+ achar = ["\s","\t","\n",nil,')',']','}','',':','=',">","<"]
3422
+
3423
+ ok = (achar.include?(b1)||achar.include?(b2)) && (achar.include?(e1)||achar.include?(e2))
3424
+ ok = ok || _line_txt[m.begin(0)+_end..m.end(0)+_end-1].strip.length==1
3425
+
3426
+
3427
+
3428
+ # p "" if stampa
3429
+ # p "_line_txt[m.begin(0)+_end..m.begin(0)+_end]=#{_line_txt[m.begin(0)+_end..m.begin(0)+_end]}" if stampa
3430
+ # p "_line_txt[m.end(0)+_end..m.end(0)+_end]=#{_line_txt[m.end(0)+_end..m.end(0)+_end]}" if stampa
3431
+ # p "_line_txt[m.begin(0)+_end..m.end(0)+_end]=#{_line_txt[m.begin(0)+_end..m.end(0)+_end]}" if stampa
3432
+ # p "ok=#{ok}" if stampa
3433
+
3434
+ if ok
3435
+ _old_txt = _txt
3436
+ _ibegin = _row.to_s+'.'+(m.begin(0)+_end).to_s
3437
+ _end = m.end(0) + _end
3438
+ _iend = _row.to_s+'.'+(_end.to_s)
3439
+ to_ret << [_ibegin, _iend]
3440
+ end
3441
+ if @op_only_first.include?(_tag) && ok
3223
3442
  m = nil
3224
3443
  else
3225
3444
  m = _re.match(_txt)
@@ -3331,13 +3550,22 @@ class AgMultiEditor < ArcadiaExt
3331
3550
  # attr_reader :breakpoints
3332
3551
  attr_reader :splitted_frame
3333
3552
  attr_reader :outline_bar
3553
+ attr_reader :has_ctags, :ctags_string
3334
3554
  def on_before_build(_event)
3555
+ Arcadia.is_windows? ? @ctags_string="lib/ctags.exe" : @ctags_string='ctags'
3556
+ @has_ctags = !Arcadia.which(@ctags_string).nil?
3557
+ if !@has_ctags
3558
+ msg = "\"ctags\" package is required by class browsing, without it only ruby language is supported!"
3559
+ ArcadiaProblemEvent.new(self, "type"=>ArcadiaProblemEvent::DEPENDENCE_MISSING_TYPE,"title"=>"Ctags missing!", "detail"=>msg).go!
3560
+ end
3335
3561
  @breakpoints =Array.new
3336
3562
  @tabs_file =Hash.new
3337
3563
  @tabs_editor =Hash.new
3338
3564
  @raw_buffer_name = Hash.new
3339
3565
  @editor_seq=-1
3340
3566
  @editors =Array.new
3567
+ initialize_status
3568
+ #@statusbar_item.pack('side'=>'left','anchor'=>'e','expand'=>'yes')
3341
3569
  Arcadia.attach_listener(self, BufferEvent)
3342
3570
  Arcadia.attach_listener(self, DebugEvent)
3343
3571
  # Arcadia.attach_listener(self, RunRubyFileEvent)
@@ -3346,7 +3574,6 @@ class AgMultiEditor < ArcadiaExt
3346
3574
  Arcadia.attach_listener(self, FocusEvent)
3347
3575
  end
3348
3576
 
3349
-
3350
3577
  # def on_before_run_ruby_file(_event)
3351
3578
  # _filename = _event.file
3352
3579
  # if _filename.nil?
@@ -3423,6 +3650,8 @@ class AgMultiEditor < ArcadiaExt
3423
3650
  if _event.cmd.nil?
3424
3651
  if _event.runner_name
3425
3652
  runner = Arcadia.runner(_event.runner_name)
3653
+ elsif _event.lang && Arcadia.runner_for_lang(_event.lang)
3654
+ runner = Arcadia.runner_for_lang(_event.lang)
3426
3655
  else
3427
3656
  runner = Arcadia.runner_for_file(_event.file)
3428
3657
  end
@@ -3432,6 +3661,9 @@ class AgMultiEditor < ArcadiaExt
3432
3661
  _event.cmd = _event.file
3433
3662
  end
3434
3663
  end
3664
+ if _event.file && _event.cmd.include?('<<RUBY>>')
3665
+ _event.cmd = _event.cmd.gsub('<<RUBY>>',Arcadia.ruby)
3666
+ end
3435
3667
  if _event.file && _event.cmd.include?('<<FILE>>')
3436
3668
  _event.cmd = _event.cmd.gsub('<<FILE>>',_event.file)
3437
3669
  end
@@ -3458,16 +3690,17 @@ class AgMultiEditor < ArcadiaExt
3458
3690
 
3459
3691
  def on_build(_event)
3460
3692
  @main_frame = AgMultiEditorView.new(self.frame.hinner_frame)
3461
- @outline_bar = AgEditorOutlineToolbar.new(self.frame(1).hinner_frame, self)
3693
+ @outline_bar = AgEditorOutlineToolbar.new(self)
3462
3694
  create_find # this is the "find within current file" one
3463
3695
  pop_up_menu
3464
- @buffer_menu = frame.root.add_menu_button(self.name, 'files', DOCUMENT_COMBO_GIF, 'right', {'relief'=>:raised, 'borderwidth'=>1}).cget('menu')
3465
- frame.root.add_sep(self.name, 1)
3466
3696
  frame.root.add_button(
3467
3697
  self.name,
3468
3698
  'close current',
3469
3699
  proc{Arcadia.process_event(CloseCurrentTabEvent.new(self))},
3470
3700
  CLOSE_DOCUMENT_GIF)
3701
+ frame.root.add_sep(self.name, 1)
3702
+ @buffer_menu = frame.root.add_menu_button(self.name, 'files', DOCUMENT_COMBO_GIF, 'right', {'relief'=>:raised, 'borderwidth'=>1}).cget('menu')
3703
+ load_languages_hash
3471
3704
  end
3472
3705
 
3473
3706
  def add_buffer_menu_item(_filename, is_file=true)
@@ -3479,7 +3712,7 @@ class AgMultiEditor < ArcadiaExt
3479
3712
  if type != 'separator'
3480
3713
  #label = @buffer_menu.entrycget(j,'label')
3481
3714
  #if label > _filename
3482
- value = @buffer_menu.entrycget(j,'value')
3715
+ value = @buffer_menu.entrycget(j,'value').to_s
3483
3716
  if value > _filename
3484
3717
  index=j
3485
3718
  break
@@ -3487,7 +3720,7 @@ class AgMultiEditor < ArcadiaExt
3487
3720
  end
3488
3721
  }
3489
3722
  end
3490
-
3723
+
3491
3724
  @buffer_menu.insert(index,:radio,
3492
3725
  :label=>File.basename(_filename),
3493
3726
  # :variable=>TkVariable.new(_filename),
@@ -3523,8 +3756,9 @@ class AgMultiEditor < ArcadiaExt
3523
3756
  @buffer_menu.delete(to_del) if to_del != -1
3524
3757
  end
3525
3758
 
3526
- def on_after_build(_event)
3759
+ def on_initialize(_event)
3527
3760
  self.open_last_files
3761
+ reset_status if @main_frame.enb.pages.empty?
3528
3762
  end
3529
3763
 
3530
3764
  def on_exit_query(_event)
@@ -3558,7 +3792,7 @@ class AgMultiEditor < ArcadiaExt
3558
3792
  return nil if _ext.nil?
3559
3793
  scanner = nil
3560
3794
  @highlight_scanner_hash = Hash.new if !defined?(@highlight_scanner_hash)
3561
- lh = languages_hash(_ext)
3795
+ lh = language_hash_by_ext(_ext)
3562
3796
  if lh && lh['language'] && lh['scanner']
3563
3797
  if @highlight_scanner_hash[lh['language']].nil?
3564
3798
  case lh['scanner']
@@ -3573,40 +3807,78 @@ class AgMultiEditor < ArcadiaExt
3573
3807
  scanner
3574
3808
  end
3575
3809
 
3576
- def languages_hash(_ext=nil)
3577
- @@langs_hash = Hash.new if !defined?(@@langs_hash)
3578
- return nil if _ext.nil?
3579
- if @@langs_hash[_ext].nil?
3580
- #_ext='' if _ext.nil?
3581
- lang_file = File.dirname(__FILE__)+'/langs/'+_ext+'.lang'
3582
- if File.exist?(lang_file)
3583
- @@langs_hash[_ext] = properties_file2hash(lang_file)
3584
- elsif File.exist?(lang_file+'.bind')
3585
- b= properties_file2hash(lang_file+'.bind')
3586
- if b
3587
- if @@langs_hash[b['bind']].nil?
3588
- lang_file_bind = File.dirname(__FILE__)+'/langs/'+b['bind']+".lang"
3589
- if File.exist?(lang_file_bind)
3590
- @@langs_hash[b['bind']]=properties_file2hash(lang_file_bind)
3591
- @@langs_hash[_ext]=@@langs_hash[b['bind']]
3592
- end
3593
- else
3594
- @@langs_hash[_ext]=@@langs_hash[b['bind']]
3810
+ def load_languages_hash
3811
+ @langs_hash_by_ext = Hash.new
3812
+ @langs_hash_by_lang = Hash.new
3813
+ lang_files_dir = "#{File.dirname(__FILE__)}/langs"
3814
+ files = Dir["#{lang_files_dir}/*"].sort
3815
+ files.each{|lang_file|
3816
+ af = lang_file.split('.')
3817
+ if af[-1] == 'lang'
3818
+ lang_props = properties_file2hash(lang_file)
3819
+ if lang_props && lang_props['@include'] != nil
3820
+ include_file = "#{lang_files_dir}/#{lang_props['@include']}"
3821
+ if File.exist?(include_file)
3822
+ include_hash = properties_file2hash(include_file)
3823
+ lang_props = include_hash.merge(lang_props)
3595
3824
  end
3596
- end
3825
+ end
3826
+ self.resolve_properties_link(lang_props, Arcadia.instance['conf']) if lang_props
3827
+ lang = lang_props['language']
3828
+ lang_exts = lang_props['exts'].split(',').collect{|x| x.strip} if lang_props['exts']
3829
+ @langs_hash_by_lang[lang] = lang_props if lang
3830
+ lang_exts.each{|ext|
3831
+ @langs_hash_by_ext[ext] = lang_props
3832
+ } if lang_exts
3833
+
3834
+
3835
+
3597
3836
  end
3598
- if @@langs_hash[_ext] && @@langs_hash[_ext]['@include'] != nil
3599
- include_file = "#{File.dirname(__FILE__)}/langs/#{@@langs_hash[_ext]['@include']}"
3600
- if File.exist?(include_file)
3601
- include_hash = properties_file2hash(include_file)
3602
- @@langs_hash[_ext] = include_hash.merge(@@langs_hash[_ext])
3603
- end
3604
- end
3605
- self.resolve_properties_link(@@langs_hash[_ext], Arcadia.instance['conf']) if @@langs_hash[_ext]
3606
- end
3607
- @@langs_hash[_ext]
3837
+ }
3608
3838
  end
3609
3839
 
3840
+ def language_hash_by_ext(_ext=nil)
3841
+ @langs_hash_by_ext[_ext]
3842
+ end
3843
+
3844
+ def language_hash_by_lang(_lang=nil)
3845
+ @langs_hash_by_lang[_lang]
3846
+ end
3847
+
3848
+ # def languages_hash(_ext=nil)
3849
+ # @langs_hash = Hash.new if !defined?(@langs_hash)
3850
+ # return nil if _ext.nil?
3851
+ # if @langs_hash[_ext].nil?
3852
+ # #_ext='' if _ext.nil?
3853
+ # lang_file = File.dirname(__FILE__)+'/langs/'+_ext+'.lang'
3854
+ # if File.exist?(lang_file)
3855
+ # @langs_hash[_ext] = properties_file2hash(lang_file)
3856
+ # elsif File.exist?(lang_file+'.bind')
3857
+ # b= properties_file2hash(lang_file+'.bind')
3858
+ # if b
3859
+ # if @langs_hash[b['bind']].nil?
3860
+ # lang_file_bind = File.dirname(__FILE__)+'/langs/'+b['bind']+".lang"
3861
+ # if File.exist?(lang_file_bind)
3862
+ # @langs_hash[b['bind']]=properties_file2hash(lang_file_bind)
3863
+ # @langs_hash[_ext]=@langs_hash[b['bind']]
3864
+ # end
3865
+ # else
3866
+ # @langs_hash[_ext]=@langs_hash[b['bind']]
3867
+ # end
3868
+ # end
3869
+ # end
3870
+ # if @langs_hash[_ext] && @langs_hash[_ext]['@include'] != nil
3871
+ # include_file = "#{File.dirname(__FILE__)}/langs/#{@langs_hash[_ext]['@include']}"
3872
+ # if File.exist?(include_file)
3873
+ # include_hash = properties_file2hash(include_file)
3874
+ # @langs_hash[_ext] = include_hash.merge(@langs_hash[_ext])
3875
+ # end
3876
+ # end
3877
+ # self.resolve_properties_link(@langs_hash[_ext], Arcadia.instance['conf']) if @langs_hash[_ext]
3878
+ # end
3879
+ # @langs_hash[_ext]
3880
+ # end
3881
+
3610
3882
 
3611
3883
  def pop_up_menu
3612
3884
  @pop_up = TkMenu.new(
@@ -3792,7 +4064,7 @@ class AgMultiEditor < ArcadiaExt
3792
4064
  #Arcadia.new_error_msg(self, "on_buffer #{_event.class}")
3793
4065
  case _event
3794
4066
  when NewBufferEvent
3795
- self.open_buffer
4067
+ self.open_buffer(nil, nil, nil, _event.lang)
3796
4068
  when OpenBufferEvent
3797
4069
  if _event.file
3798
4070
  if _event.row
@@ -3811,7 +4083,20 @@ class AgMultiEditor < ArcadiaExt
3811
4083
  @last_transient_file = nil
3812
4084
  end
3813
4085
  end
3814
- self.open_file(_event.file, _index)
4086
+ if _event.select_index.nil?
4087
+ select_index = true
4088
+ else
4089
+ select_index = _event.select_index
4090
+ end
4091
+ if _event.file == '*CURR'
4092
+ er = raised
4093
+ if er && _index != nil
4094
+ er.text_see(_index)
4095
+ er.mark_selected(_index) if select_index
4096
+ end
4097
+ else
4098
+ self.open_file(_event.file, _index, select_index)
4099
+ end
3815
4100
  elsif _event.text
3816
4101
  if _event.title
3817
4102
  _tab_name = self.tab_name(_event.title)
@@ -3827,7 +4112,7 @@ class AgMultiEditor < ArcadiaExt
3827
4112
  self.open_file(_event.file)
3828
4113
  end
3829
4114
  when CloseBufferEvent
3830
- if _event.file
4115
+ if _event.file
3831
4116
  self.close_file(_event.file)
3832
4117
  end
3833
4118
  when SaveAsBufferEvent
@@ -3934,8 +4219,13 @@ class AgMultiEditor < ArcadiaExt
3934
4219
  def clear_temp_files
3935
4220
  files = Dir[File.join(Arcadia.instance.local_dir,"*")]
3936
4221
  files.each{|f|
3937
- if File.stat(f).file? && f[-2..-1] == '~~'
4222
+ if File.stat(f).file? && File.basename(f)[0..1] == '~~'
3938
4223
  File.delete(f)
4224
+ elsif File.stat(f).directory? && File.basename(f)[0..1] == '~~'
4225
+ Dir[File.join(f,"*")].each{|file|
4226
+ File.delete(file)
4227
+ }
4228
+ Dir.delete(f)
3939
4229
  end
3940
4230
  }
3941
4231
  end
@@ -4249,13 +4539,49 @@ class AgMultiEditor < ArcadiaExt
4249
4539
  else
4250
4540
  _new_caption = _title
4251
4541
  end
4542
+ _lang = _e.lang
4543
+ _e.update_toolbar
4252
4544
  end
4253
4545
  change_frame_caption(_new_caption)
4546
+ refresh_status
4254
4547
  _title = @tabs_file[_name] != nil ? File.basename(@tabs_file[_name]) :_name
4255
- Arcadia.broadcast_event(BufferRaisedEvent.new(self,'title'=>_title, 'file'=>@tabs_file[_name]))
4548
+ Arcadia.broadcast_event(BufferRaisedEvent.new(self, 'title'=>_title, 'file'=>@tabs_file[_name], 'lang'=>_lang ))
4549
+ Arcadia.process_event(InputEnterEvent.new(self,'receiver'=>_e.text)) if _e
4550
+
4256
4551
  #EditorContract.instance.buffer_raised(self, 'title'=>_title, 'file'=>@tabs_file[_name])
4257
4552
  end
4258
4553
 
4554
+ def initialize_status
4555
+ @statusbar_items = Hash.new
4556
+ @statusbar_items['file_size'] = Arcadia.new_statusbar_item("File size")
4557
+ @statusbar_items['file_mtime'] = Arcadia.new_statusbar_item("File modification time")
4558
+ @statusbar_items['file_name'] = Arcadia.new_statusbar_item("File name")
4559
+ # @statusbar_item = Arcadia.new_statusbar_item
4560
+ # @statusbar_item.relief('flat')
4561
+ end
4562
+
4563
+ def reset_status
4564
+ @statusbar_items['file_name'].text = '?'
4565
+ @statusbar_items['file_mtime'].text = '?'
4566
+ @statusbar_items['file_size'].text = '?'
4567
+ end
4568
+
4569
+ def refresh_status
4570
+ #@statusbar_item.text("#{_title} | #{_e.file_info['mtime'].strftime("%d/%m/%Y %H:%m:%S") if _e}")
4571
+ if raised && raised.file
4572
+ size = File.size(raised.file)
4573
+ if size > 1024
4574
+ size_str = "#{size/1024} kb"
4575
+ else
4576
+ size_str = "#{size} b"
4577
+ end
4578
+ @statusbar_items['file_name'].text(File.basename(raised.file))
4579
+ @statusbar_items['file_mtime'].text = raised.file_info['mtime'].localtime
4580
+ @statusbar_items['file_size'].text = size_str
4581
+ #@statusbar_item.text("#{File.basename(raised.file)} | #{raised.file_info['mtime'].localtime} | #{size_str}")
4582
+ end
4583
+ end
4584
+
4259
4585
  def editor_of(_filename)
4260
4586
  _ret = nil
4261
4587
  @editors.each{|e|
@@ -4326,9 +4652,10 @@ class AgMultiEditor < ArcadiaExt
4326
4652
  begin
4327
4653
  @tabs_editor[_tab_name].load_file(_filename)
4328
4654
  rescue RuntimeError => e
4329
- Arcadia.dialog(self,'type'=>'ok', 'level'=>'error','title' => 'RuntimeError', 'msg'=>"RuntimeError : #{e.message}")
4655
+ #Arcadia.dialog(self,'type'=>'ok', 'level'=>'error','title' => 'RuntimeError', 'msg'=>"RuntimeError : #{e.message}")
4330
4656
  #p "RuntimeError : #{e.message}"
4331
4657
  close_editor(@tabs_editor[_tab_name], true)
4658
+ Arcadia.runtime_error(e)
4332
4659
  end
4333
4660
  end
4334
4661
  editor = @tabs_editor[_tab_name]
@@ -4341,7 +4668,7 @@ class AgMultiEditor < ArcadiaExt
4341
4668
  end
4342
4669
 
4343
4670
 
4344
- def open_buffer(_buffer_name = nil, _title = nil, _filename=nil)
4671
+ def open_buffer(_buffer_name = nil, _title = nil, _filename=nil, _lang=nil)
4345
4672
  _index = @main_frame.enb.index(resolve_tab_name(_buffer_name))
4346
4673
  if _buffer_name == nil
4347
4674
  _title_new = '*new'
@@ -4364,10 +4691,19 @@ class AgMultiEditor < ArcadiaExt
4364
4691
  end
4365
4692
  if _title == nil
4366
4693
  _title = _title_new
4694
+ if _lang
4695
+ _image = Arcadia.lang_icon(_lang)
4696
+ else
4697
+ _image = Arcadia.lang_icon('Ruby')
4698
+ end
4699
+ _ext = language_hash_by_lang(_lang)
4700
+ else
4701
+ _image = Arcadia.file_icon(_title)
4367
4702
  end
4368
4703
  _tab = @main_frame.enb.insert('end', _buffer_name ,
4369
4704
  'text'=> _title,
4370
- 'image'=> Arcadia.file_icon(_title),
4705
+ 'image'=> _image,
4706
+ # 'image'=> Arcadia.file_icon(lang_sign),
4371
4707
  'background'=> Arcadia.style("tabpanel")["background"],
4372
4708
  'foreground'=> Arcadia.style("tabpanel")["foreground"],
4373
4709
  'raisecmd'=>proc{do_buffer_raise(_buffer_name, _title)}
@@ -4384,15 +4720,21 @@ class AgMultiEditor < ArcadiaExt
4384
4720
  @editors[@editor_seq]=_e
4385
4721
  ext = Arcadia.file_extension(_title)
4386
4722
  ext='rb' if ext.nil?
4387
- _e.init_editing(ext)
4723
+ _e.initialize_editing(ext, _lang)
4388
4724
  _e.text.set_focus
4389
4725
  #@tabs_file[_buffer_name]= nil
4390
4726
  @tabs_editor[_buffer_name]=_e
4391
4727
  end
4392
- if raised != @tabs_editor[resolve_tab_name(_buffer_name)]
4393
- @main_frame.enb.move(resolve_tab_name(_buffer_name), 1)
4394
- @main_frame.enb.raise(resolve_tab_name(_buffer_name)) if frame_visible?
4395
- @main_frame.enb.see(resolve_tab_name(_buffer_name))
4728
+ begin
4729
+ if raised != @tabs_editor[resolve_tab_name(_buffer_name)]
4730
+ @main_frame.enb.move(resolve_tab_name(_buffer_name), 0)
4731
+ @main_frame.enb.raise(resolve_tab_name(_buffer_name)) if frame_visible?
4732
+ @main_frame.enb.see(resolve_tab_name(_buffer_name))
4733
+ else
4734
+ @main_frame.enb.move(resolve_tab_name(_buffer_name), 0)
4735
+ end
4736
+ rescue Exception => e
4737
+ Arcadia.runtime_error(e)
4396
4738
  end
4397
4739
  return _tab
4398
4740
  end
@@ -4461,6 +4803,7 @@ class AgMultiEditor < ArcadiaExt
4461
4803
  'msg'=>message)
4462
4804
  if r=="yes"
4463
4805
  _editor.reset_file_last_access_time
4806
+ refresh_status
4464
4807
  ret = !_editor.modified_by_others?
4465
4808
  else
4466
4809
  ret = false
@@ -4472,8 +4815,12 @@ class AgMultiEditor < ArcadiaExt
4472
4815
 
4473
4816
  def close_editor(_editor, _force=false)
4474
4817
  if _force || can_close_editor?(_editor)
4818
+ file = _editor.file
4819
+ index = _editor.text.index("@0,0")
4820
+ r,c = index.split('.')
4475
4821
  _editor.destroy_outline
4476
4822
  close_buffer(_editor.page_frame)
4823
+ BufferClosedEvent.new(self,'file'=>file,'row'=>r.to_i, 'col'=>c.to_i).shot!
4477
4824
  else
4478
4825
  return
4479
4826
  end
@@ -4496,6 +4843,7 @@ class AgMultiEditor < ArcadiaExt
4496
4843
  @main_frame.enb.raise(@main_frame.enb.pages[_index-1]) if TkWinfo.mapped?(@main_frame.enb)
4497
4844
  else
4498
4845
  frame.root.top_text('') if TkWinfo.mapped?(frame.hinner_frame)
4846
+ reset_status
4499
4847
  end
4500
4848
  end
4501
4849
 
@@ -4558,7 +4906,9 @@ class Findview < TkFloatTitledFrame
4558
4906
  }
4559
4907
  @e_what_entry = TkWinfo.children(@e_what)[0]
4560
4908
 
4561
- @e_what_entry.bind_append("1",proc{Arcadia.process_event(InputEnterEvent.new(self,'receiver'=>@e_what_entry))})
4909
+ #@e_what_entry.bind_append("1",proc{Arcadia.process_event(InputEnterEvent.new(self,'receiver'=>@e_what_entry))})
4910
+ @e_what_entry.extend(TkInputThrow)
4911
+
4562
4912
 
4563
4913
  y0 = y0 + d
4564
4914
  TkLabel.new(self.frame, Arcadia.style('label')){
@@ -4577,9 +4927,8 @@ class Findview < TkFloatTitledFrame
4577
4927
  place('relwidth' => 1, 'width'=>-16,'x' => 8,'y' => y0,'height' => 19)
4578
4928
  }
4579
4929
  @e_with_entry = TkWinfo.children(@e_with)[0]
4580
-
4581
- @e_with_entry.bind_append("1",proc{Arcadia.process_event(InputEnterEvent.new(self,'receiver'=>@e_with_entry))})
4582
-
4930
+ #@e_with_entry.bind_append("1",proc{Arcadia.process_event(InputEnterEvent.new(self,'receiver'=>@e_with_entry))})
4931
+ @e_with_entry.extend(TkInputThrow)
4583
4932
  y0 = y0 + d
4584
4933
  @cb_reg = TkCheckButton.new(self.frame, Arcadia.style('checkbox')){|_cb_reg|
4585
4934
  text 'Use Regular Expression'
@@ -4776,7 +5125,8 @@ class Finder < Findview
4776
5125
  if (_editor != @editor_caller)
4777
5126
  @last_index='insert'
4778
5127
  @editor_caller = _editor
4779
- _title = File.basename(_editor.file)
5128
+ _title = '?'
5129
+ _title = File.basename(_editor.file) if _editor.file
4780
5130
  title(_title)
4781
5131
  @goto_line_dialog.title(_title) if @goto_line_dialog
4782
5132
  end
@@ -4880,7 +5230,8 @@ class GoToLine < TkFloatTitledFrame
4880
5230
  #relief 'ridge'
4881
5231
  place('relwidth' => 1, 'width'=>-16,'x' => 8,'y' => y0,'height' => 19)
4882
5232
  }
4883
- @e_line.bind_append("1",proc{Arcadia.process_event(InputEnterEvent.new(self,'receiver'=>@e_line))})
5233
+ #@e_line.bind_append("1",proc{Arcadia.process_event(InputEnterEvent.new(self,'receiver'=>@e_line))})
5234
+ @e_line.extend(TkInputThrow)
4884
5235
 
4885
5236
  y0 = y0 + d
4886
5237
  y0 = y0 + d