fxri 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- data/fxri +260 -258
- data/fxri.gemspec +16 -16
- data/fxri.kpf +66 -0
- data/lib/Empty_Text_Field_Handler.rb +57 -57
- data/lib/FoxDisplayer.rb +146 -146
- data/lib/FoxTextFormatter.rb +270 -260
- data/lib/Globals.rb +3 -2
- data/lib/Icon_Loader.rb +30 -30
- data/lib/Packet_Item.rb +167 -167
- data/lib/Packet_List.rb +187 -187
- data/lib/Recursive_Open_Struct.rb +205 -205
- data/lib/RiManager.rb +133 -133
- data/lib/Search_Engine.rb +159 -159
- data/lib/fxirb.rb +321 -332
- metadata +51 -42
data/fxri.gemspec
CHANGED
@@ -2,23 +2,23 @@
|
|
2
2
|
require 'rubygems'
|
3
3
|
|
4
4
|
spec = Gem::Specification.new do |s|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
5
|
+
s.name = "fxri"
|
6
|
+
s.add_dependency('fxruby', ['>= 1.2.0', '< 1.3'])
|
7
|
+
s.version = "0.3.3"
|
8
|
+
s.date = "2006-02-02"
|
9
|
+
s.summary = "Graphical interface to the RI documentation, with search engine."
|
10
|
+
s.require_paths = ["lib"]
|
11
|
+
s.email = "markus.prinz@qsig.org"
|
12
|
+
s.homepage = "http://fxri.rubyforge.org/"
|
13
|
+
s.rubyforge_project = "fxri"
|
14
|
+
s.description = "FxRi is an FXRuby interface to the RI documentation, with a search engine that allows for search-on-typing."
|
15
|
+
s.has_rdoc = false
|
16
|
+
s.files = Dir.glob("**/*")
|
17
|
+
s.bindir = "."
|
18
|
+
s.executables = ["fxri"]
|
19
19
|
end
|
20
20
|
|
21
21
|
if __FILE__ == $0
|
22
|
-
|
23
|
-
|
22
|
+
Gem.manage_gems
|
23
|
+
Gem::Builder.new(spec).build
|
24
24
|
end
|
data/fxri.kpf
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!-- Komodo Project File - DO NOT EDIT -->
|
3
|
+
<project id="13B1D036-7DF3-47F1-B6E3-B0CF1F1E1CE9" name="fxri" kpf_version="2">
|
4
|
+
<preference-set id="">
|
5
|
+
<string id="import_dirname">M:\ruby\fxri\trunk</string>
|
6
|
+
</preference-set>
|
7
|
+
<file url="fxri.gemspec" id="E2334747-E97F-44EA-AFBB-04E46668390B" name="fxri.gemspec">
|
8
|
+
</file>
|
9
|
+
<file url="fxri.rb" id="130418AD-B2A2-4248-9454-EFD42F04ED10" name="fxri.rb">
|
10
|
+
<preference-set id="">
|
11
|
+
<string id="lastInvocation">default</string>
|
12
|
+
<preference-set id="Invocations">
|
13
|
+
<preference-set id="default">
|
14
|
+
<string id="postparams"></string>
|
15
|
+
<string id="getparams"></string>
|
16
|
+
<boolean id="use-console">0</boolean>
|
17
|
+
<string id="filename">M:\ruby\fxri\trunk\fxri.rb</string>
|
18
|
+
<string id="executable-params">-w</string>
|
19
|
+
<boolean id="show-dialog">1</boolean>
|
20
|
+
<string id="request-method">GET</string>
|
21
|
+
<string id="params"></string>
|
22
|
+
<string id="mpostparams"></string>
|
23
|
+
<string id="posttype">application/x-www-form-urlencoded</string>
|
24
|
+
<string id="documentRoot"></string>
|
25
|
+
<string id="cookieparams"></string>
|
26
|
+
<string id="userEnvironment"></string>
|
27
|
+
<boolean id="sim-cgi">0</boolean>
|
28
|
+
<string id="cwd">M:\ruby\fxri\trunk</string>
|
29
|
+
<string id="userCGIEnvironment"></string>
|
30
|
+
</preference-set>
|
31
|
+
</preference-set>
|
32
|
+
</preference-set>
|
33
|
+
</file>
|
34
|
+
<folder url="lib" id="97CE90C3-E9DC-4E12-8F44-324DF72BD5A1" name="lib">
|
35
|
+
<file url="lib/FoxDisplayer.rb" id="F8341CAC-3BD6-4DA0-8122-0806ACC6BFF4" name="FoxDisplayer.rb">
|
36
|
+
</file>
|
37
|
+
<file url="lib/Recursive_Open_Struct.rb" id="2C97A27A-0697-4083-A488-5EDDA2E93898" name="Recursive_Open_Struct.rb">
|
38
|
+
</file>
|
39
|
+
<file url="lib/RiManager.rb" id="DD76A12C-B377-44C4-8E6D-1E44EB4833D6" name="RiManager.rb">
|
40
|
+
</file>
|
41
|
+
<file url="lib/Globals.rb" id="7A0620E0-0411-4FDA-9C6E-D1B0E1660DAA" name="Globals.rb">
|
42
|
+
</file>
|
43
|
+
<file url="lib/fxirb.rb" id="6F3F3AD6-E3DF-43BF-B244-A9F7F7C534C0" name="fxirb.rb">
|
44
|
+
</file>
|
45
|
+
<file url="lib/Packet_Item.rb" id="1C6953B3-0F08-496E-82AA-51D9BC7194A2" name="Packet_Item.rb">
|
46
|
+
</file>
|
47
|
+
<file url="lib/Search_Engine.rb" id="31549F31-3FF3-45ED-93F4-EB297230E813" name="Search_Engine.rb">
|
48
|
+
</file>
|
49
|
+
<file url="lib/Empty_Text_Field_Handler.rb" id="873100DD-C05D-4C7E-B858-0D280727531C" name="Empty_Text_Field_Handler.rb">
|
50
|
+
</file>
|
51
|
+
<file url="lib/FoxTextFormatter.rb" id="55619700-A8E8-47B8-98AA-2FA25C4B7E97" name="FoxTextFormatter.rb">
|
52
|
+
</file>
|
53
|
+
<file url="lib/Packet_List.rb" id="2B49F0A2-E2C9-4DD2-8CAA-CC249AC851EA" name="Packet_List.rb">
|
54
|
+
</file>
|
55
|
+
<file url="lib/Icon_Loader.rb" id="7B33B520-9A94-4F00-A948-414802C751F2" name="Icon_Loader.rb">
|
56
|
+
</file>
|
57
|
+
<folder url="lib/icons" id="41A260CA-D552-47B6-A29C-C9634137A30E" name="icons">
|
58
|
+
<file url="lib/icons/module.png" id="A87A66BD-9DCA-4DE8-B244-99A7777847B0" name="module.png">
|
59
|
+
</file>
|
60
|
+
<file url="lib/icons/method.png" id="F5D238AC-0184-4A96-950F-165215182217" name="method.png">
|
61
|
+
</file>
|
62
|
+
<file url="lib/icons/class.png" id="F6720160-D9CA-49F6-8DDA-F107FAF0E6DC" name="class.png">
|
63
|
+
</file>
|
64
|
+
</folder>
|
65
|
+
</folder>
|
66
|
+
</project>
|
@@ -1,63 +1,63 @@
|
|
1
1
|
# Copyright (c) 2004, 2005 Martin Ankerl
|
2
|
-
# Shows a grey text in an FXTextField if the user did not enter any input. This is a nice way to
|
2
|
+
# Shows a grey text in an FXTextField if the user did not enter any input. This is a nice way to
|
3
3
|
# give the user more information about what to enter into a text field, without the need of additional
|
4
4
|
# space in the GUI.
|
5
5
|
class Empty_Text_Field_Handler
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
7
|
+
# Create a new handler for the specified textfield, with the given text. From now on you have to use the
|
8
|
+
# created object to get and set text, not the textfield or this handler would come out of sync
|
9
|
+
def initialize(textField, myText)
|
10
|
+
@textField = textField
|
11
|
+
@myText = myText
|
12
|
+
@isEmpty = true
|
13
|
+
onTextFieldFocusOut
|
14
|
+
# create connections
|
15
|
+
@textField.connect(SEL_FOCUSIN, method(:onTextFieldFocusIn))
|
16
|
+
@textField.connect(SEL_FOCUSOUT, method(:onTextFieldFocusOut))
|
17
|
+
end
|
18
|
+
|
19
|
+
# Check if textfield is empty (no user input).
|
20
|
+
def empty?
|
21
|
+
@isEmpty
|
22
|
+
end
|
23
|
+
|
24
|
+
# Set new text for the textfield
|
25
|
+
def text=(newText)
|
26
|
+
onTextFieldFocusIn
|
27
|
+
@textField.text = newText.to_s
|
28
|
+
onTextFieldFocusOut
|
29
|
+
end
|
30
|
+
|
31
|
+
# Get the textfield's text, if the user has entered something.
|
32
|
+
def text
|
33
|
+
if empty? && !@inside
|
34
|
+
""
|
35
|
+
else
|
36
|
+
@textField.text
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
# Set focus to the textfield.
|
41
|
+
def setFocus
|
42
|
+
@textField.setFocus
|
43
|
+
end
|
44
|
+
|
45
|
+
private
|
46
|
+
|
47
|
+
def onTextFieldFocusIn(*args)
|
48
|
+
@inside = true
|
49
|
+
return if !@isEmpty
|
50
|
+
@textField.textColor = FXColor::Black
|
51
|
+
@textField.text = ""
|
52
|
+
end
|
53
|
+
|
54
|
+
def onTextFieldFocusOut(*args)
|
55
|
+
@inside = false
|
56
|
+
@textField.killSelection
|
57
|
+
@isEmpty = @textField.text == ""
|
58
|
+
return if !@isEmpty
|
59
|
+
@textField.textColor = FXColor::DarkGrey
|
60
|
+
@textField.text = @myText
|
61
|
+
@isEmpty = true
|
62
|
+
end
|
63
63
|
end
|
data/lib/FoxDisplayer.rb
CHANGED
@@ -1,148 +1,148 @@
|
|
1
1
|
class FoxDisplayer
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
2
|
+
attr_accessor :reader
|
3
|
+
|
4
|
+
def initialize(text_field)
|
5
|
+
@text_field = text_field
|
6
|
+
@formatter = FoxTextFormatter.new(70, "") do |arg, style|
|
7
|
+
startpos = @str.size
|
8
|
+
@str << arg
|
9
|
+
@formats.push [startpos, arg.size, style]
|
10
|
+
end
|
11
|
+
@reader = nil
|
12
|
+
end
|
13
|
+
|
14
|
+
def width=(newWidth)
|
15
|
+
@formatter.width = newWidth
|
16
|
+
end
|
17
|
+
|
18
|
+
def no_info_available
|
19
|
+
@text_field.text="nothing here, move on!"
|
20
|
+
end
|
21
|
+
|
22
|
+
def init_text
|
23
|
+
@str = ""
|
24
|
+
@formats = Array.new
|
25
|
+
end
|
26
|
+
|
27
|
+
# Sets a new text, and all styles
|
28
|
+
def set_text
|
29
|
+
@text_field.text = @str
|
30
|
+
@formats.each do |start, n, style|
|
31
|
+
case style
|
32
|
+
when FoxTextFormatter::STYLE_BOLD
|
33
|
+
@text_field.changeStyle(start, n, 2)
|
34
|
+
when FoxTextFormatter::STYLE_H1
|
35
|
+
@text_field.changeStyle(start, n, 3)
|
36
|
+
when FoxTextFormatter::STYLE_H2
|
37
|
+
@text_field.changeStyle(start, n, 4)
|
38
|
+
when FoxTextFormatter::STYLE_H3
|
39
|
+
@text_field.changeStyle(start, n, 5)
|
40
|
+
when FoxTextFormatter::STYLE_TELETYPE
|
41
|
+
@text_field.changeStyle(start, n, 6)
|
42
|
+
when FoxTextFormatter::STYLE_CODE
|
43
|
+
@text_field.changeStyle(start, n, 7)
|
44
|
+
when FoxTextFormatter::STYLE_EMPHASIS
|
45
|
+
@text_field.changeStyle(start, n, 8)
|
46
|
+
when FoxTextFormatter::STYLE_CLASS
|
47
|
+
@text_field.changeStyle(start, n, 9)
|
48
|
+
else
|
49
|
+
@text_field.changeStyle(start, n, 1)
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
# Display method information
|
56
|
+
def display_method_info(method)
|
57
|
+
init_text
|
58
|
+
@formatter.draw_line(method.full_name)
|
59
|
+
@formatter.display_params(method)
|
60
|
+
@formatter.draw_line
|
61
|
+
display_flow(method.comment)
|
62
|
+
|
63
|
+
if method.aliases && !method.aliases.empty?
|
64
|
+
@formatter.blankline
|
65
|
+
aka = "(also known as "
|
66
|
+
aka << method.aliases.map {|a| a.name }.join(", ")
|
67
|
+
aka << ")"
|
68
|
+
@formatter.wrap(aka)
|
69
|
+
end
|
70
|
+
set_text
|
71
|
+
end
|
72
|
+
|
73
|
+
def display_information(message)
|
74
|
+
init_text
|
75
|
+
display_flow(message)
|
76
|
+
set_text
|
77
|
+
end
|
78
|
+
|
79
|
+
def display_class_info(klass)
|
80
|
+
init_text
|
81
|
+
superclass = klass.superclass_string
|
82
|
+
if superclass
|
83
|
+
superclass = " < " + superclass
|
84
|
+
else
|
85
|
+
superclass = ""
|
86
|
+
end
|
87
|
+
@formatter.draw_line(klass.display_name + ": " + klass.full_name + superclass)
|
88
|
+
display_flow(klass.comment)
|
89
|
+
@formatter.draw_line
|
90
|
+
|
91
|
+
unless klass.includes.empty?
|
92
|
+
@formatter.blankline
|
93
|
+
@formatter.display_heading("Includes:", 2, "")
|
94
|
+
incs = []
|
95
|
+
klass.includes.each do |inc|
|
96
|
+
inc_desc = @reader.find_class_by_name(inc.name)
|
97
|
+
if inc_desc
|
98
|
+
str = inc.name + "("
|
99
|
+
str << inc_desc.instance_methods.map{|m| m.name}.join(", ")
|
100
|
+
str << ")"
|
101
|
+
incs << str
|
102
|
+
else
|
103
|
+
incs << inc.name
|
104
|
+
end
|
105
|
+
end
|
106
|
+
@formatter.wrap(incs.sort.join(', '))
|
107
|
+
end
|
108
|
+
|
109
|
+
unless klass.constants.empty?
|
110
|
+
@formatter.blankline
|
111
|
+
@formatter.display_heading("Constants:", 2, "")
|
112
|
+
len = 0
|
113
|
+
klass.constants.each { |c| len = c.name.length if c.name.length > len }
|
114
|
+
len += 2
|
115
|
+
klass.constants.each do |c|
|
116
|
+
@formatter.wrap(c.value, @formatter.indent+((c.name+":").ljust(len)))
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
unless klass.class_methods.empty?
|
121
|
+
@formatter.blankline
|
122
|
+
@formatter.display_heading("Class methods:", 2, "")
|
123
|
+
@formatter.wrap(klass.class_methods.map{|m| m.name}.sort.join(', '))
|
124
|
+
end
|
125
|
+
|
126
|
+
unless klass.instance_methods.empty?
|
127
|
+
@formatter.blankline
|
128
|
+
@formatter.display_heading("Instance methods:", 2, "")
|
129
|
+
@formatter.wrap(klass.instance_methods.map{|m| m.name}.sort.join(', '))
|
130
|
+
end
|
131
|
+
|
132
|
+
unless klass.attributes.empty?
|
133
|
+
@formatter.blankline
|
134
|
+
@formatter.wrap("Attributes:", "")
|
135
|
+
@formatter.wrap(klass.attributes.map{|a| a.name}.sort.join(', '))
|
136
|
+
end
|
137
|
+
|
138
|
+
set_text
|
139
|
+
end
|
140
|
+
|
141
|
+
def display_flow(flow)
|
142
|
+
if !flow || flow.empty?
|
143
|
+
@formatter.wrap("(no description...)\n")
|
144
|
+
else
|
145
|
+
@formatter.display_flow(flow)
|
146
|
+
end
|
147
|
+
end
|
148
148
|
end
|