naksh 0.2.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.
- data/AUTHORS +1 -0
- data/COPYING +674 -0
- data/COPYING-DOCS +15 -0
- data/README.md +45 -0
- data/Rakefile +129 -0
- data/TODO +19 -0
- data/bin/naksh +2 -0
- data/data/default.mo +0 -0
- data/data/default.po +16 -0
- data/data/default2.mo +0 -0
- data/data/default2.po +27 -0
- data/data/starter.pot +29 -0
- data/docs/bash_flow.dia +0 -0
- data/docs/gtk_manual.txt +13 -0
- data/docs/master_plan.dia +0 -0
- data/docs/master_plan.png +0 -0
- data/docs/master_plan.svg +74 -0
- data/docs/master_plan.svgz +0 -0
- data/docs/userguide/en/about.xml +42 -0
- data/docs/userguide/en/gnu-fdl-1.2.xml +543 -0
- data/docs/userguide/en/naksh.xml +881 -0
- data/docs/userguide/en/naksh_start_window.png +0 -0
- data/docs/userguide/en/old_naksh.xml +180 -0
- data/docs/userguide/en/userguide-en.omf +37 -0
- data/lib/naksh.rb +165 -0
- data/lib/naksh/buffer.rb +153 -0
- data/lib/naksh/command_handling.rb +117 -0
- data/lib/naksh/commands/bash/README +2 -0
- data/lib/naksh/commands/bash/echo.nkc.rb +50 -0
- data/lib/naksh/commands/bsd.rb +25 -0
- data/lib/naksh/commands/dos.rb +25 -0
- data/lib/naksh/commands/fuse.rb +25 -0
- data/lib/naksh/commands/gnu.rb +30 -0
- data/lib/naksh/commands/gnu/README +2 -0
- data/lib/naksh/commands/gnu/cat.nkc.rb +50 -0
- data/lib/naksh/commands/gnu/cd.nkc.rb +11 -0
- data/lib/naksh/commands/gnu/echo.documentation.json +57 -0
- data/lib/naksh/commands/gnu/echo.documentation.rb +60 -0
- data/lib/naksh/commands/gnu/echo.nkc.rb +52 -0
- data/lib/naksh/commands/gnu/ls.nkc.rb +11 -0
- data/lib/naksh/commands/gnu/mv.nkc.rb +15 -0
- data/lib/naksh/commands/gnu/pwd.nkc.rb +11 -0
- data/lib/naksh/commands/naksh/addpath.nkc.rb +15 -0
- data/lib/naksh/commands/naksh/broken.nkc.rb +10 -0
- data/lib/naksh/commands/naksh/empty.nkc.rb +4 -0
- data/lib/naksh/commands/naksh/exit.nkc.rb +10 -0
- data/lib/naksh/commands/naksh/help.nkc.rb +21 -0
- data/lib/naksh/commands/naksh/man.nkc.rb +8 -0
- data/lib/naksh/commands/ruby.rb +31 -0
- data/lib/naksh/commands/unix.rb +131 -0
- data/lib/naksh/configuration/gconf.rb +51 -0
- data/lib/naksh/configuration/hash.rb +38 -0
- data/lib/naksh/defaults.rb +40 -0
- data/lib/naksh/history.rb +85 -0
- data/lib/naksh/interfaces.rb +59 -0
- data/lib/naksh/interfaces/fox.rb +49 -0
- data/lib/naksh/interfaces/gtk.rb +103 -0
- data/lib/naksh/interfaces/gtk/abtwin.rb +53 -0
- data/lib/naksh/interfaces/gtk/gnomeapp.rb +31 -0
- data/lib/naksh/interfaces/gtk/helpwin.rb +70 -0
- data/lib/naksh/interfaces/gtk/io.rb +94 -0
- data/lib/naksh/interfaces/gtk/mainwin.rb +56 -0
- data/lib/naksh/interfaces/gtk/mainwin/console.rb +121 -0
- data/lib/naksh/interfaces/gtk/mainwin/main_menu.rb +143 -0
- data/lib/naksh/interfaces/gtk/optwin.rb +78 -0
- data/lib/naksh/interfaces/tab.rb +58 -0
- data/lib/naksh/interfaces/wxw.rb +75 -0
- data/lib/naksh/interfaces/wxw/abtwin.rb +38 -0
- data/lib/naksh/interfaces/wxw/helpwin.rb +40 -0
- data/lib/naksh/interfaces/wxw/io.rb +61 -0
- data/lib/naksh/interfaces/wxw/mainwin.rb +42 -0
- data/lib/naksh/interfaces/wxw/mainwin/main_menu.rb +126 -0
- data/lib/naksh/interfaces/wxw/mainwin/sessions.rb +49 -0
- data/lib/naksh/interfaces/wxw/optwin.rb +37 -0
- data/lib/naksh/path_entry.rb +101 -0
- data/lib/naksh/regexp.rb +31 -0
- data/lib/naksh/session.rb +72 -0
- data/lib/naksh/stdlibext.rb +48 -0
- data/lib/naksh/syntax.rb +57 -0
- data/lib/naksh/syntax/bash.rb +219 -0
- data/lib/naksh/syntax/bash/antlr/bottomup.g +24 -0
- data/lib/naksh/syntax/bash/antlr/topdown.g +52 -0
- data/lib/naksh/syntax/bash/dhaka/evaluator.rb +353 -0
- data/lib/naksh/syntax/bash/dhaka/grammar.rb +71 -0
- data/lib/naksh/syntax/bash/dhaka/lexer.rb +52 -0
- data/lib/naksh/syntax/bash/treetop/bash.treetop +17 -0
- data/lib/old/abbr_call.rb +39 -0
- data/lib/old/autocomplete.rb +29 -0
- data/lib/old/command.rb +106 -0
- data/lib/old/command_holder.rb +75 -0
- data/lib/old/commands.rb +24 -0
- data/lib/old/old_executor.rb +95 -0
- data/lib/old/options.rb +31 -0
- data/lib/old/rush.rb +113 -0
- data/lib/old/sortissimo.rb +205 -0
- data/lib/old/systems.rb +25 -0
- data/lib/old/systems/ruby.rb +26 -0
- data/lib/old/un.rb +240 -0
- data/lib/rust/Rakefile +6 -0
- data/lib/rust/commands/builtins.rb +46 -0
- data/lib/rust/commands/builtins/cd.rb +17 -0
- data/lib/rust/commands/builtins/exit.rb +13 -0
- data/lib/rust/commands/builtins/help.rb +14 -0
- data/lib/rust/commands/builtins/parser.rb +13 -0
- data/lib/rust/commands/builtins/pwd.rb +13 -0
- data/lib/rust/commands/builtins/type.rb +13 -0
- data/lib/rust/commands/commands/ls.rb +13 -0
- data/lib/rust/commands/commands/read.rb +13 -0
- data/lib/rust/commands/commands/rm.rb +14 -0
- data/lib/rust/commands/commands/test.rb +20 -0
- data/lib/rust/helpers/array.rb +10 -0
- data/lib/rust/helpers/command_center.rb +78 -0
- data/lib/rust/helpers/constants.rb +58 -0
- data/lib/rust/helpers/io.rb +132 -0
- data/lib/rust/helpers/parser.rb +45 -0
- data/lib/rust/helpers/rush_control.rb +40 -0
- data/lib/rust/helpers/string.rb +50 -0
- data/lib/rust/helpers/trollop.rb +475 -0
- data/lib/rust/parsers/bash.rb +220 -0
- data/lib/rust/parsers/bash/stdlibext.rb +32 -0
- data/lib/rust/parsers/ren.rb +57 -0
- data/lib/rust/rust.rb +75 -0
- data/lib/rust/syntax/command.rb +23 -0
- data/lib/rust/syntax/paths.rb +31 -0
- data/lib/rust/syntax/pipes.rb +148 -0
- data/naksh.gemspec +55 -0
- data/test/naksh/arg_parser.rspec.rb +27 -0
- data/test/naksh/commands/bash/echo.rspec.rb +32 -0
- data/test/naksh/commands/sortlist +127 -0
- data/test/naksh/external_command.rspec.rb +46 -0
- data/test/naksh/send_error.rspec.rb +60 -0
- data/test/naksh/suggest.rspec.rb +38 -0
- data/test/naksh/syntax/bash.rspec.rb +69 -0
- data/test/naksh/syntax/bash/execute.rspec.rb +51 -0
- data/test/naksh/syntax/rspec.rb +63 -0
- data/test/run_rspecs.rb +20 -0
- metadata +217 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
#!/usr/local/bin/ruby
|
|
2
|
+
# 2011 Mahmut Bulut
|
|
3
|
+
|
|
4
|
+
# This file is part of Naksh.
|
|
5
|
+
#
|
|
6
|
+
# Naksh is free software: you can redistribute it and/or modify
|
|
7
|
+
# it under the terms of the GNU General Public License as published by
|
|
8
|
+
# the Free Software Foundation, either version 3 of the License, or
|
|
9
|
+
# (at your option) any later version.
|
|
10
|
+
#
|
|
11
|
+
# Naksh is distributed in the hope that it will be useful,
|
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
# GNU General Public License for more details.
|
|
15
|
+
#
|
|
16
|
+
# You should have received a copy of the GNU General Public License
|
|
17
|
+
# along with Naksh. If not, see <http://www.gnu.org/licenses/>.
|
|
18
|
+
|
|
19
|
+
module Naksh
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# call this whenever your going to change the history position or
|
|
23
|
+
# modify Naksh.interface.in
|
|
24
|
+
def Naksh.refresh_history
|
|
25
|
+
csh=Naksh.current_session.history
|
|
26
|
+
puts "NOTICE: refresh_history, position=(#{csh.position})"
|
|
27
|
+
if csh.position+1==csh.length and csh[csh.position]!=csh.last
|
|
28
|
+
csh<<Naksh.interface.in
|
|
29
|
+
csh.position=csh.length-1
|
|
30
|
+
end
|
|
31
|
+
puts "NOTICE: refresh_history, position=(#{csh.position})"
|
|
32
|
+
true
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
#an a subclass of Array which represents a record of entered scripts
|
|
37
|
+
class History<Array
|
|
38
|
+
|
|
39
|
+
def initialize *a
|
|
40
|
+
super
|
|
41
|
+
a.empty? ? nil : @position=length-1
|
|
42
|
+
self
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
attr_accessor :position
|
|
47
|
+
|
|
48
|
+
def at!(index)
|
|
49
|
+
@position=index
|
|
50
|
+
self[@position]
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def first!
|
|
54
|
+
@position=0
|
|
55
|
+
self[@position]
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def last!
|
|
59
|
+
@position=length-1
|
|
60
|
+
self[@position]
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def back
|
|
64
|
+
return self[@position-1] unless @position<1
|
|
65
|
+
nil
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
def back!
|
|
69
|
+
@position-=1 unless @position < 1
|
|
70
|
+
self[@position]
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
def forward
|
|
74
|
+
return self[@position+1] unless position+1==length
|
|
75
|
+
nil
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
def forward!
|
|
79
|
+
@position+=1 unless @position+1==length
|
|
80
|
+
self[@position]
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
end
|
|
85
|
+
end
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
#!/usr/local/bin/ruby
|
|
2
|
+
# 2011 Mahmut Bulut
|
|
3
|
+
|
|
4
|
+
# This file is part of Naksh.
|
|
5
|
+
#
|
|
6
|
+
# Naksh is free software: you can redistribute it and/or modify
|
|
7
|
+
# it under the terms of the GNU General Public License as published by
|
|
8
|
+
# the Free Software Foundation, either version 3 of the License, or
|
|
9
|
+
# (at your option) any later version.
|
|
10
|
+
#
|
|
11
|
+
# Naksh is distributed in the hope that it will be useful,
|
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
# GNU General Public License for more details.
|
|
15
|
+
#
|
|
16
|
+
# You should have received a copy of the GNU General Public License
|
|
17
|
+
# along with Naksh. If not, see <http://www.gnu.org/licenses/>.
|
|
18
|
+
|
|
19
|
+
module Naksh
|
|
20
|
+
|
|
21
|
+
# REQUIRED METHODS
|
|
22
|
+
#Naksh.interface.run
|
|
23
|
+
#Naksh.interface.main.show
|
|
24
|
+
#Naksh.interface.main.hide
|
|
25
|
+
#Naksh.interface.options.show
|
|
26
|
+
#Naksh.interface.options.hide
|
|
27
|
+
#Naksh.interface.help.show
|
|
28
|
+
#Naksh.interface.help.hide
|
|
29
|
+
#Naksh.interface.about.show
|
|
30
|
+
#Naksh.interface.about.hide
|
|
31
|
+
#Naksh.interface.new_prompt
|
|
32
|
+
#Naksh.interface.in
|
|
33
|
+
#Naksh.interface.in=
|
|
34
|
+
#Naksh.interface.out.print
|
|
35
|
+
#Naksh.interface.out.pretty_print
|
|
36
|
+
#Naksh.interface.err.print
|
|
37
|
+
#Naksh.interface.err.pretty_print
|
|
38
|
+
#Naksh.interface.quit
|
|
39
|
+
|
|
40
|
+
#anything that handles input and output
|
|
41
|
+
module Interfaces
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
@interface = nil
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
#set a new syntax ruleset
|
|
49
|
+
#currently no way to combine syntax rulesets except by method overwriting
|
|
50
|
+
def Naksh.interface=(new_interface)
|
|
51
|
+
@interface=new_interface
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def Naksh.interface
|
|
56
|
+
@interface
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
end
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
#!/usr/local/bin/ruby
|
|
2
|
+
# 2011 Mahmut Bulut
|
|
3
|
+
|
|
4
|
+
# This file is part of Naksh.
|
|
5
|
+
#
|
|
6
|
+
# Naksh is free software: you can redistribute it and/or modify
|
|
7
|
+
# it under the terms of the GNU General Public License as published by
|
|
8
|
+
# the Free Software Foundation, either version 3 of the License, or
|
|
9
|
+
# (at your option) any later version.
|
|
10
|
+
#
|
|
11
|
+
# Naksh is distributed in the hope that it will be useful,
|
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
# GNU General Public License for more details.
|
|
15
|
+
#
|
|
16
|
+
# You should have received a copy of the GNU General Public License
|
|
17
|
+
# along with Naksh. If not, see <http://www.gnu.org/licenses/>.
|
|
18
|
+
|
|
19
|
+
require 'fox16'
|
|
20
|
+
|
|
21
|
+
module Naksh
|
|
22
|
+
module Interfaces
|
|
23
|
+
module Fx
|
|
24
|
+
@mainapp=Fox::FXApp.new
|
|
25
|
+
@mainwin=Fox::FXMainWindow.new @mainapp,'Naksh Terminal Emulator'
|
|
26
|
+
Fox::FXToolTip.new(@fxapp)
|
|
27
|
+
@mainapp.create
|
|
28
|
+
@mainwin.show
|
|
29
|
+
@optwin=Fox::FXWindow.new(@fxapp,'Naksh Options')
|
|
30
|
+
@optwin.hide
|
|
31
|
+
@abtwin=Fox::FXWindow.new(@fxapp,'About Naksh')
|
|
32
|
+
@abtwin.hide
|
|
33
|
+
#run the Fox GUI with main window
|
|
34
|
+
def Fx.run
|
|
35
|
+
@mainapp.run
|
|
36
|
+
end
|
|
37
|
+
#the principal Terminal Emulator window
|
|
38
|
+
def Fx.main_window
|
|
39
|
+
@mainwin
|
|
40
|
+
end
|
|
41
|
+
def Fx.option_window
|
|
42
|
+
@optwin
|
|
43
|
+
end
|
|
44
|
+
def Fx.about_window
|
|
45
|
+
@abtwin
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
#!/usr/local/bin/ruby
|
|
2
|
+
# 2011 Mahmut Bulut
|
|
3
|
+
|
|
4
|
+
# This file is part of Naksh.
|
|
5
|
+
#
|
|
6
|
+
# Naksh is free software: you can redistribute it and/or modify
|
|
7
|
+
# it under the terms of the GNU General Public License as published by
|
|
8
|
+
# the Free Software Foundation, either version 3 of the License, or
|
|
9
|
+
# (at your option) any later version.
|
|
10
|
+
#
|
|
11
|
+
# Naksh is distributed in the hope that it will be useful,
|
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
# GNU General Public License for more details.
|
|
15
|
+
#
|
|
16
|
+
# You should have received a copy of the GNU General Public License
|
|
17
|
+
# along with Naksh. If not, see <http://www.gnu.org/licenses/>.
|
|
18
|
+
|
|
19
|
+
require 'gtk2'
|
|
20
|
+
require 'naksh/interfaces/gtk/gnomeapp.rb'
|
|
21
|
+
|
|
22
|
+
module Naksh
|
|
23
|
+
module Interfaces
|
|
24
|
+
module Rbgtk
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def Rbgtk.quit
|
|
29
|
+
Gtk.main_quit
|
|
30
|
+
true
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
# I don't really like this
|
|
35
|
+
def Rbgtk.on_pre_submit
|
|
36
|
+
@console.buffer.insert(@console.buffer.end_iter,"\n")
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
@tabbed = false
|
|
41
|
+
|
|
42
|
+
def Rbgtk.potential_autocomplete_key config_entry
|
|
43
|
+
case Naksh.config[config_entry]
|
|
44
|
+
when 'autocomplete'
|
|
45
|
+
if @tabbed
|
|
46
|
+
Naksh.interface.out.pp Naksh.suggestions(Naksh.interface.in)
|
|
47
|
+
Naksh.interface.new_prompt
|
|
48
|
+
else
|
|
49
|
+
Naksh.interface.in=Naksh.autocomplete(Naksh.interface.in)
|
|
50
|
+
@tabbed=true
|
|
51
|
+
end
|
|
52
|
+
return true
|
|
53
|
+
when 'char'
|
|
54
|
+
return false
|
|
55
|
+
else
|
|
56
|
+
$stderr.puts _("Naksh.config[%s] has unrecognized value: %s")%[config_entry,Naksh.config[config_entry].inspect]
|
|
57
|
+
end
|
|
58
|
+
nil
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def Rbgtk.back
|
|
63
|
+
(@console.buffer.get_iter_at_mark(@console.buffer.get_mark('current_input_start'))==@console.buffer.get_iter_at_mark(@console.buffer.get_mark('insert'))) ? true : false
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def Rbgtk.console
|
|
68
|
+
@console
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
def Rbgtk.new_prompt
|
|
74
|
+
@console.buffer.text=@console.buffer.text<<Naksh.replace_vars(Naksh.config['/interface/tty/prompt'])
|
|
75
|
+
@console.buffer.create_mark('current_input_start',@console.buffer.end_iter,true)
|
|
76
|
+
@console.scroll_to_mark @console.buffer.get_mark('current_input_start'),0.3,false,1,1
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
require 'naksh/interfaces/gtk/mainwin.rb'
|
|
80
|
+
require 'naksh/interfaces/gtk/optwin.rb'
|
|
81
|
+
require 'naksh/interfaces/gtk/abtwin.rb'
|
|
82
|
+
require 'naksh/interfaces/gtk/helpwin.rb'
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
#run the Gtk GUI with main window
|
|
88
|
+
def Rbgtk.run *a
|
|
89
|
+
a.each do |i|
|
|
90
|
+
#Rbgtk.new_tab i
|
|
91
|
+
end
|
|
92
|
+
Gtk.main
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
require 'naksh/interfaces/gtk/io.rb'
|
|
98
|
+
|
|
99
|
+
Rbgtk.new_prompt
|
|
100
|
+
@console.grab_focus
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
end
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
#!/usr/local/bin/ruby
|
|
2
|
+
# 2011 Mahmut Bulut
|
|
3
|
+
|
|
4
|
+
# This file is part of Naksh.
|
|
5
|
+
#
|
|
6
|
+
# Naksh is free software: you can redistribute it and/or modify
|
|
7
|
+
# it under the terms of the GNU General Public License as published by
|
|
8
|
+
# the Free Software Foundation, either version 3 of the License, or
|
|
9
|
+
# (at your option) any later version.
|
|
10
|
+
#
|
|
11
|
+
# Naksh is distributed in the hope that it will be useful,
|
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
# GNU General Public License for more details.
|
|
15
|
+
#
|
|
16
|
+
# You should have received a copy of the GNU General Public License
|
|
17
|
+
# along with Naksh. If not, see <http://www.gnu.org/licenses/>.
|
|
18
|
+
|
|
19
|
+
require 'gtk2'
|
|
20
|
+
|
|
21
|
+
module Naksh
|
|
22
|
+
module Interfaces
|
|
23
|
+
module Rbgtk
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@abtwin=Gtk::AboutDialog.new
|
|
27
|
+
@abtwin.show_all
|
|
28
|
+
@abtwin.hide
|
|
29
|
+
#for some reason the close button doesn\'t work automatically
|
|
30
|
+
@abtwin.children[0].children[-1].children[-1].signal_connect "clicked" do |*a|
|
|
31
|
+
@abtwin.hide
|
|
32
|
+
end
|
|
33
|
+
@abtwin.name= Naksh.config['/meta/name']
|
|
34
|
+
@abtwin.version= Naksh.config['/meta/version']
|
|
35
|
+
@abtwin.copyright= Naksh.config['/meta/copyright']
|
|
36
|
+
@abtwin.comments= "Naksh is currently intended only for developers.\nTry typing `help' and pressing `return'"
|
|
37
|
+
@abtwin.license= (Pathname.new(Naksh.config['/dir'])+'COPYING').read
|
|
38
|
+
@abtwin.website= Naksh.config['/meta/website']
|
|
39
|
+
@abtwin.authors= (Pathname.new(Naksh.config['/dir'])+'AUTHORS').readlines.collect do|i|;i.chop;end
|
|
40
|
+
#@abtwin.artists
|
|
41
|
+
#@abtwin.translator_credits
|
|
42
|
+
#@abtwin.documenters
|
|
43
|
+
#@abtwin.logo
|
|
44
|
+
#@abtwin.logo_icon_name
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def Rbgtk.about
|
|
48
|
+
@abtwin
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#!/usr/local/bin/ruby
|
|
2
|
+
# 2011 Mahmut Bulut
|
|
3
|
+
|
|
4
|
+
# This file is part of Naksh.
|
|
5
|
+
#
|
|
6
|
+
# Naksh is free software: you can redistribute it and/or modify
|
|
7
|
+
# it under the terms of the GNU General Public License as published by
|
|
8
|
+
# the Free Software Foundation, either version 3 of the License, or
|
|
9
|
+
# (at your option) any later version.
|
|
10
|
+
#
|
|
11
|
+
# Naksh is distributed in the hope that it will be useful,
|
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
# GNU General Public License for more details.
|
|
15
|
+
#
|
|
16
|
+
# You should have received a copy of the GNU General Public License
|
|
17
|
+
# along with Naksh. If not, see <http://www.gnu.org/licenses/>.
|
|
18
|
+
|
|
19
|
+
require 'gnome2'
|
|
20
|
+
|
|
21
|
+
module Naksh
|
|
22
|
+
module Interfaces
|
|
23
|
+
module Rbgtk
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
gnomeprog = Gnome::Program.new(Naksh.config['/meta/name'],Naksh.config['/meta/version'])
|
|
27
|
+
#gnomeprog.app_datadir = Naksh.config['/gnome_dir']
|
|
28
|
+
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
#!/usr/local/bin/ruby
|
|
2
|
+
# 2011 Mahmut Bulut
|
|
3
|
+
|
|
4
|
+
# This file is part of Naksh.
|
|
5
|
+
#
|
|
6
|
+
# Naksh is free software: you can redistribute it and/or modify
|
|
7
|
+
# it under the terms of the GNU General Public License as published by
|
|
8
|
+
# the Free Software Foundation, either version 3 of the License, or
|
|
9
|
+
# (at your option) any later version.
|
|
10
|
+
#
|
|
11
|
+
# Naksh is distributed in the hope that it will be useful,
|
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
# GNU General Public License for more details.
|
|
15
|
+
#
|
|
16
|
+
# You should have received a copy of the GNU General Public License
|
|
17
|
+
# along with Naksh. If not, see <http://www.gnu.org/licenses/>.
|
|
18
|
+
|
|
19
|
+
require 'gnome2'
|
|
20
|
+
require 'pathname'
|
|
21
|
+
|
|
22
|
+
module Naksh
|
|
23
|
+
module Interfaces
|
|
24
|
+
module Rbgtk
|
|
25
|
+
|
|
26
|
+
=begin
|
|
27
|
+
@helpwin=Gtk::Window.new 'Naksh Help'
|
|
28
|
+
vp=Gtk::VBox.new
|
|
29
|
+
|
|
30
|
+
help_message=Gtk::TextView.new
|
|
31
|
+
#this doesn't work - WHY?
|
|
32
|
+
help_message.buffer.text=(Pathname.new(Naksh.config['/dir'])+'docs'+'gtk_manual.txt').read
|
|
33
|
+
help_message.editable=true
|
|
34
|
+
vp<<help_message
|
|
35
|
+
|
|
36
|
+
ok_button=Gtk::Button.new(Gtk::Stock::OK)
|
|
37
|
+
ok_button.signal_connect 'clicked' do
|
|
38
|
+
apply_button.clicked
|
|
39
|
+
@helpwin.hide
|
|
40
|
+
end
|
|
41
|
+
vp<<ok_button
|
|
42
|
+
|
|
43
|
+
@helpwin<<vp
|
|
44
|
+
@helpwin.show_all
|
|
45
|
+
@helpwin.hide
|
|
46
|
+
=end
|
|
47
|
+
#this will be great
|
|
48
|
+
class HelpWindowInterface
|
|
49
|
+
def initialize(file_name)
|
|
50
|
+
@file_name=file_name
|
|
51
|
+
end
|
|
52
|
+
def show
|
|
53
|
+
Gnome::Help.display 'naksh',nil
|
|
54
|
+
0
|
|
55
|
+
end
|
|
56
|
+
def hide
|
|
57
|
+
$stderr.puts _('Naksh\'s GTK interface cannot close its help window')
|
|
58
|
+
1
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
@helpwin=HelpWindowInterface.new Pathname.new(Naksh.config['/dir'])+'docs'+'userguide'+Naksh.config['/env/locale']+'naksh.xml'
|
|
62
|
+
|
|
63
|
+
def Rbgtk.help
|
|
64
|
+
@helpwin
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|