vedeu 0.6.8 → 0.6.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (140) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +9 -0
  3. data/README.md +1 -1
  4. data/docs/api.md +60 -67
  5. data/docs/configuration.md +8 -5
  6. data/docs/events.md +31 -15
  7. data/docs/events/application.md +12 -0
  8. data/docs/events/document.md +57 -0
  9. data/docs/events/drb.md +43 -0
  10. data/docs/events/focus.md +24 -0
  11. data/docs/events/menu.md +57 -0
  12. data/docs/events/movement.md +57 -0
  13. data/docs/events/refresh.md +25 -0
  14. data/docs/events/system.md +90 -0
  15. data/docs/events/visibility.md +68 -0
  16. data/lib/vedeu.rb +2 -2
  17. data/lib/vedeu/all.rb +3 -2
  18. data/lib/vedeu/api.rb +18 -18
  19. data/lib/vedeu/application/controller.rb +1 -1
  20. data/lib/vedeu/application/helper.rb +1 -1
  21. data/lib/vedeu/application/view.rb +1 -1
  22. data/lib/vedeu/bindings/application.rb +1 -12
  23. data/lib/vedeu/bindings/bindings.rb +3 -1
  24. data/lib/vedeu/bindings/document.rb +9 -62
  25. data/lib/vedeu/bindings/drb.rb +12 -56
  26. data/lib/vedeu/bindings/focus.rb +3 -28
  27. data/lib/vedeu/bindings/menus.rb +10 -66
  28. data/lib/vedeu/bindings/movement.rb +4 -69
  29. data/lib/vedeu/bindings/refresh.rb +3 -33
  30. data/lib/vedeu/bindings/system.rb +14 -100
  31. data/lib/vedeu/bindings/visibility.rb +20 -71
  32. data/lib/vedeu/borders/all.rb +4 -3
  33. data/lib/vedeu/borders/border.rb +39 -33
  34. data/lib/vedeu/borders/dsl.rb +40 -33
  35. data/lib/vedeu/borders/null.rb +2 -2
  36. data/lib/vedeu/borders/render.rb +29 -24
  37. data/lib/vedeu/borders/repository.rb +2 -2
  38. data/lib/vedeu/buffers/all.rb +8 -7
  39. data/lib/vedeu/buffers/buffer.rb +47 -39
  40. data/lib/vedeu/buffers/null.rb +2 -2
  41. data/lib/vedeu/buffers/refresh.rb +4 -3
  42. data/lib/vedeu/buffers/virtual_buffer.rb +122 -118
  43. data/lib/vedeu/buffers/virtual_buffers.rb +62 -56
  44. data/lib/vedeu/colours/background.rb +2 -1
  45. data/lib/vedeu/colours/colour.rb +21 -19
  46. data/lib/vedeu/colours/foreground.rb +2 -1
  47. data/lib/vedeu/colours/repository.rb +6 -5
  48. data/lib/vedeu/colours/translator.rb +39 -35
  49. data/lib/vedeu/configuration/api.rb +59 -51
  50. data/lib/vedeu/configuration/cli.rb +9 -7
  51. data/lib/vedeu/configuration/configuration.rb +41 -32
  52. data/lib/vedeu/cursors/cursor.rb +1 -1
  53. data/lib/vedeu/cursors/refresh.rb +20 -16
  54. data/lib/vedeu/distributed/server.rb +8 -6
  55. data/lib/vedeu/distributed/subprocess.rb +90 -86
  56. data/lib/vedeu/distributed/uri.rb +4 -3
  57. data/lib/vedeu/dsl/composition.rb +2 -2
  58. data/lib/vedeu/dsl/group.rb +4 -4
  59. data/lib/vedeu/dsl/interface.rb +5 -5
  60. data/lib/vedeu/dsl/presentation.rb +2 -2
  61. data/lib/vedeu/dsl/text.rb +1 -1
  62. data/lib/vedeu/editor/cropper.rb +4 -4
  63. data/lib/vedeu/editor/cursor.rb +6 -4
  64. data/lib/vedeu/editor/document.rb +20 -18
  65. data/lib/vedeu/editor/editor.rb +2 -2
  66. data/lib/vedeu/editor/line.rb +10 -5
  67. data/lib/vedeu/editor/lines.rb +2 -2
  68. data/lib/vedeu/internal_api.rb +4 -4
  69. data/lib/vedeu/models/focus.rb +197 -191
  70. data/lib/vedeu/models/group.rb +171 -159
  71. data/lib/vedeu/models/groups.rb +14 -10
  72. data/lib/vedeu/models/interface.rb +116 -110
  73. data/lib/vedeu/models/interfaces.rb +24 -20
  74. data/lib/vedeu/models/toggleable.rb +4 -4
  75. data/lib/vedeu/models/views/char.rb +1 -1
  76. data/lib/vedeu/models/views/composition.rb +1 -1
  77. data/lib/vedeu/models/views/line.rb +1 -1
  78. data/lib/vedeu/models/views/stream.rb +1 -1
  79. data/lib/vedeu/models/views/view.rb +1 -1
  80. data/lib/vedeu/null/interface.rb +1 -1
  81. data/lib/vedeu/null/view.rb +1 -1
  82. data/lib/vedeu/output/clear/named_interface.rb +1 -1
  83. data/lib/vedeu/output/compressor.rb +78 -73
  84. data/lib/vedeu/output/direct.rb +61 -57
  85. data/lib/vedeu/output/output.rb +34 -29
  86. data/lib/vedeu/output/{presentation.rb → presentation/presentation.rb} +2 -1
  87. data/lib/vedeu/output/presentation/style.rb +64 -18
  88. data/lib/vedeu/output/presentation/styles.rb +39 -0
  89. data/lib/vedeu/output/renderers/html.rb +2 -2
  90. data/lib/vedeu/output/renderers/json.rb +2 -1
  91. data/lib/vedeu/output/renderers/terminal.rb +3 -3
  92. data/lib/vedeu/output/renderers/text.rb +3 -3
  93. data/lib/vedeu/output/text.rb +186 -180
  94. data/lib/vedeu/output/wordwrap.rb +142 -138
  95. data/lib/vedeu/refresh/refresh.rb +2 -2
  96. data/lib/vedeu/templating/helpers.rb +11 -6
  97. data/lib/vedeu/templating/view_template.rb +1 -1
  98. data/lib/vedeu/terminal/terminal.rb +2 -2
  99. data/lib/vedeu/version.rb +1 -1
  100. data/test/lib/vedeu/borders/render_test.rb +1 -1
  101. data/test/lib/vedeu/buffers/buffer_test.rb +16 -14
  102. data/test/lib/vedeu/buffers/virtual_buffer_test.rb +105 -101
  103. data/test/lib/vedeu/buffers/virtual_buffers_test.rb +43 -39
  104. data/test/lib/vedeu/colours/colour_test.rb +4 -4
  105. data/test/lib/vedeu/cursors/cursor_test.rb +2 -2
  106. data/test/lib/vedeu/cursors/repository_test.rb +3 -3
  107. data/test/lib/vedeu/distributed/subprocess_test.rb +33 -29
  108. data/test/lib/vedeu/dsl/group_test.rb +3 -3
  109. data/test/lib/vedeu/dsl/interface_test.rb +6 -5
  110. data/test/lib/vedeu/dsl/line_test.rb +4 -2
  111. data/test/lib/vedeu/dsl/presentation_test.rb +2 -2
  112. data/test/lib/vedeu/dsl/text_test.rb +8 -8
  113. data/test/lib/vedeu/editor/document_test.rb +10 -6
  114. data/test/lib/vedeu/input/keymap_test.rb +1 -10
  115. data/test/lib/vedeu/models/focus_test.rb +177 -170
  116. data/test/lib/vedeu/models/group_test.rb +99 -95
  117. data/test/lib/vedeu/models/groups_test.rb +13 -9
  118. data/test/lib/vedeu/models/interface_test.rb +93 -87
  119. data/test/lib/vedeu/models/interfaces_test.rb +24 -20
  120. data/test/lib/vedeu/models/views/char_test.rb +2 -2
  121. data/test/lib/vedeu/models/views/line_test.rb +11 -7
  122. data/test/lib/vedeu/models/views/stream_test.rb +1 -1
  123. data/test/lib/vedeu/models/views/view_test.rb +1 -1
  124. data/test/lib/vedeu/output/clear/named_group_test.rb +1 -1
  125. data/test/lib/vedeu/output/clear/named_interface_test.rb +3 -1
  126. data/test/lib/vedeu/output/compressor_test.rb +126 -122
  127. data/test/lib/vedeu/output/direct_test.rb +49 -43
  128. data/test/lib/vedeu/output/output_test.rb +35 -31
  129. data/test/lib/vedeu/output/{presentation_test.rb → presentation/presentation_test.rb} +11 -7
  130. data/test/lib/vedeu/output/presentation/style_test.rb +88 -48
  131. data/test/lib/vedeu/output/presentation/styles_test.rb +84 -0
  132. data/test/lib/vedeu/output/text_test.rb +109 -105
  133. data/test/lib/vedeu/output/viewport_test.rb +3 -1
  134. data/test/lib/vedeu/output/wordwrap_test.rb +209 -205
  135. data/test/lib/vedeu/refresh/refresh_test.rb +3 -1
  136. data/test/lib/vedeu/templating/helpers_test.rb +6 -6
  137. data/test/lib/vedeu/templating/view_template_test.rb +1 -1
  138. metadata +17 -8
  139. data/lib/vedeu/output/style.rb +0 -76
  140. data/test/lib/vedeu/output/style_test.rb +0 -120
@@ -1,163 +1,175 @@
1
1
  module Vedeu
2
2
 
3
- # Interfaces can be associated with one another by being members of the same
4
- # Group. A Group is a collection of interface names.
5
- #
6
- class Group
7
-
8
- include Vedeu::Model
9
- include Vedeu::Toggleable
10
-
11
- # @!attribute [rw] name
12
- # @return [String]
13
- attr_accessor :name
14
-
15
- # Return a new instance of Vedeu::Group.
16
- #
17
- # @note
18
- # A group being visible or not may not necessarily mean the members are of
19
- # the same state.
20
- #
21
- # @param attributes [Hash]
22
- # @option attributes members [Set] A collection of names of interfaces
23
- # belonging to this group.
24
- # @option attributes name [String] The name of the group.
25
- # @option attributes repository [Vedeu::Repository] The storage for all
26
- # Group models.
27
- # @option attributes visible [Boolean] Whether the group is visible or not.
28
- # @return [Vedeu::Group]
29
- def initialize(attributes = {})
30
- @attributes = defaults.merge!(attributes)
31
-
32
- @attributes.each { |key, value| instance_variable_set("@#{key}", value) }
33
- end
34
-
35
- # Add a member to the group by name.
36
- #
37
- # @param member [String]
38
- # @return [Vedeu::Group]
39
- def add(member)
40
- attrs = attributes.merge!(members: members.add(member))
41
-
42
- Vedeu::Group.new(attrs).store
43
- end
44
-
45
- # Returns the attributes of the group.
46
- #
47
- # @return [Hash<Symbol => void>]
48
- def attributes
49
- {
50
- name: name,
51
- members: members,
52
- repository: repository,
53
- visible: visible,
54
- }
55
- end
56
-
57
- # Return the members of the group sorted by the zindex of the members.
58
- #
59
- # @return [Array<String>]
60
- def by_zindex
61
- interfaces.sort { |a, b| a.zindex <=> b.zindex }.map(&:name)
62
- end
63
-
64
- # Hide the named group of interfaces, or without a name, the group of the
65
- # currently focussed interface. Useful for hiding part of that which is
66
- # currently displaying in the terminal.
67
- #
68
- # @note
69
- # The action of showing a group will effectively clear the terminal and
70
- # show the new group, therefore hiding the group may not be necessary.
71
- #
72
- # @example
73
- # Vedeu.trigger(:_hide_group_, name)
74
- # Vedeu.hide_group(name)
75
- #
76
- # @return [Vedeu::Group]
77
- def hide
78
- super
79
-
80
- @members.each { |member| Vedeu::Interface.hide_interface(member) }
81
-
82
- self
83
- end
84
-
85
- # Return the members of the group.
86
- #
87
- # @return [Set]
88
- def members
89
- @_members ||= Set.new(@members)
90
- end
91
-
92
- # Remove a member from the group by name.
93
- #
94
- # @param member [String]
95
- # @return [Vedeu::Group]
96
- def remove(member)
97
- attrs = attributes.merge!(members: members.delete(member))
98
-
99
- Vedeu::Group.new(attrs).store
100
- end
101
-
102
- # Remove all members from the group.
103
- #
104
- # @return [Vedeu::Group]
105
- def reset
106
- attrs = defaults.merge!(name: name)
107
-
108
- Vedeu::Group.new(attrs).store
109
- end
110
-
111
- # Show the named group of interfaces, or without a name, the group of the
112
- # currently focussed interface.
113
- #
114
- # @example
115
- # Vedeu.trigger(:_show_group_, name)
116
- # Vedeu.show_group(name)
117
- #
118
- # @return [Vedeu::Group]
119
- def show
120
- super
121
-
122
- @members.each { |member| Vedeu::Interface.show_interface(member) }
123
-
124
- self
125
- end
126
-
127
- # Toggle the visibility of the group with the given name.
128
- #
129
- # @example
130
- # Vedeu.trigger(:_toggle_group, name)
131
- # Vedeu.toggle_group(name)
132
- #
133
- # @return [Vedeu::Group]
134
- def toggle
135
- super
136
-
137
- self
138
- end
139
-
140
- private
141
-
142
- # Returns the default options/attributes for this class.
143
- #
144
- # @return [Hash]
145
- def defaults
146
- {
147
- members: Set.new,
148
- name: '',
149
- repository: Vedeu.groups,
150
- visible: true,
151
- }
152
- end
153
-
154
- # Return the interfaces for all members of the group.
155
- #
156
- # @return [Array<Vedeu::Interface]
157
- def interfaces
158
- members.map { |name| Vedeu.interfaces.by_name(name) }
159
- end
160
-
161
- end # Group
3
+ module Models
4
+
5
+ # Interfaces can be associated with one another by being members
6
+ # of the same Group. A Group is a collection of interface names.
7
+ #
8
+ class Group
9
+
10
+ include Vedeu::Model
11
+ include Vedeu::Toggleable
12
+
13
+ # @!attribute [rw] name
14
+ # @return [String]
15
+ attr_accessor :name
16
+
17
+ # Return a new instance of Vedeu::Models::Group.
18
+ #
19
+ # @note
20
+ # A group being visible or not may not necessarily mean the
21
+ # members are of the same state.
22
+ #
23
+ # @param attributes [Hash]
24
+ # @option attributes members [Set] A collection of names of
25
+ # interfaces belonging to this group.
26
+ # @option attributes name [String] The name of the group.
27
+ # @option attributes repository [Vedeu::Repository] The storage
28
+ # for all Group models.
29
+ # @option attributes visible [Boolean] Whether the group is
30
+ # visible or not.
31
+ # @return [Vedeu::Models::Group]
32
+ def initialize(attributes = {})
33
+ @attributes = defaults.merge!(attributes)
34
+
35
+ @attributes.each do |key, value|
36
+ instance_variable_set("@#{key}", value)
37
+ end
38
+ end
39
+
40
+ # Add a member to the group by name.
41
+ #
42
+ # @param member [String]
43
+ # @return [Vedeu::Models::Group]
44
+ def add(member)
45
+ attrs = attributes.merge!(members: members.add(member))
46
+
47
+ Vedeu::Models::Group.new(attrs).store
48
+ end
49
+
50
+ # Returns the attributes of the group.
51
+ #
52
+ # @return [Hash<Symbol => void>]
53
+ def attributes
54
+ {
55
+ name: name,
56
+ members: members,
57
+ repository: repository,
58
+ visible: visible,
59
+ }
60
+ end
61
+
62
+ # Return the members of the group sorted by the zindex of the
63
+ # members.
64
+ #
65
+ # @return [Array<String>]
66
+ def by_zindex
67
+ interfaces.sort { |a, b| a.zindex <=> b.zindex }.map(&:name)
68
+ end
69
+
70
+ # Hide the named group of interfaces, or without a name, the group of the
71
+ # currently focussed interface. Useful for hiding part of that which is
72
+ # currently displaying in the terminal.
73
+ #
74
+ # @note
75
+ # The action of showing a group will effectively clear the terminal and
76
+ # show the new group, therefore hiding the group may not be necessary.
77
+ #
78
+ # @example
79
+ # Vedeu.trigger(:_hide_group_, name)
80
+ # Vedeu.hide_group(name)
81
+ #
82
+ # @return [Vedeu::Models::Group]
83
+ def hide
84
+ super
85
+
86
+ @members.each do |member|
87
+ Vedeu::Models::Interface.hide_interface(member)
88
+ end
89
+
90
+ self
91
+ end
92
+
93
+ # Return the members of the group.
94
+ #
95
+ # @return [Set]
96
+ def members
97
+ @_members ||= Set.new(@members)
98
+ end
99
+
100
+ # Remove a member from the group by name.
101
+ #
102
+ # @param member [String]
103
+ # @return [Vedeu::Models::Group]
104
+ def remove(member)
105
+ attrs = attributes.merge!(members: members.delete(member))
106
+
107
+ Vedeu::Models::Group.new(attrs).store
108
+ end
109
+
110
+ # Remove all members from the group.
111
+ #
112
+ # @return [Vedeu::Models::Group]
113
+ def reset
114
+ attrs = defaults.merge!(name: name)
115
+
116
+ Vedeu::Models::Group.new(attrs).store
117
+ end
118
+
119
+ # Show the named group of interfaces, or without a name, the group of the
120
+ # currently focussed interface.
121
+ #
122
+ # @example
123
+ # Vedeu.trigger(:_show_group_, name)
124
+ # Vedeu.show_group(name)
125
+ #
126
+ # @return [Vedeu::Models::Group]
127
+ def show
128
+ super
129
+
130
+ @members.each do |member|
131
+ Vedeu::Models::Interface.show_interface(member)
132
+ end
133
+
134
+ self
135
+ end
136
+
137
+ # Toggle the visibility of the group with the given name.
138
+ #
139
+ # @example
140
+ # Vedeu.trigger(:_toggle_group, name)
141
+ # Vedeu.toggle_group(name)
142
+ #
143
+ # @return [Vedeu::Models::Group]
144
+ def toggle
145
+ super
146
+
147
+ self
148
+ end
149
+
150
+ private
151
+
152
+ # Returns the default options/attributes for this class.
153
+ #
154
+ # @return [Hash]
155
+ def defaults
156
+ {
157
+ members: Set.new,
158
+ name: '',
159
+ repository: Vedeu.groups,
160
+ visible: true,
161
+ }
162
+ end
163
+
164
+ # Return the interfaces for all members of the group.
165
+ #
166
+ # @return [Array<Vedeu::Models::Interface]
167
+ def interfaces
168
+ members.map { |name| Vedeu.interfaces.by_name(name) }
169
+ end
170
+
171
+ end # Group
172
+
173
+ end # Models
162
174
 
163
175
  end # Vedeu
@@ -1,20 +1,24 @@
1
1
  module Vedeu
2
2
 
3
- # Allows the storing of view groups.
4
- #
5
- class Groups < Vedeu::Repository
3
+ module Models
6
4
 
7
- singleton_class.send(:alias_method, :groups, :repository)
5
+ # Allows the storing of view groups.
6
+ #
7
+ class Groups < Vedeu::Repository
8
8
 
9
- null Vedeu::Group
10
- real Vedeu::Group
9
+ singleton_class.send(:alias_method, :groups, :repository)
11
10
 
12
- end # Groups
11
+ null Vedeu::Models::Group
12
+ real Vedeu::Models::Group
13
13
 
14
- class Group
14
+ end # Groups
15
15
 
16
- repo Vedeu::Groups.repository
16
+ class Group
17
17
 
18
- end # Group
18
+ repo Vedeu::Models::Groups.repository
19
+
20
+ end # Group
21
+
22
+ end # Models
19
23
 
20
24
  end # Vedeu
@@ -1,125 +1,131 @@
1
1
  module Vedeu
2
2
 
3
- # An Interface represents a portion of the terminal defined by
4
- # {Vedeu::Geometry::Geometry}.
5
- #
6
- class Interface
3
+ module Models
7
4
 
8
- include Vedeu::Model
9
- include Vedeu::Presentation
10
- include Vedeu::Toggleable
11
-
12
- # @!attribute [r] attributes
13
- # @return [Hash]
14
- attr_reader :attributes
15
-
16
- # @!attribute [rw] client
17
- # @return [Fixnum|Float]
18
- attr_accessor :client
19
-
20
- # @!attribute [rw] delay
21
- # @return [Fixnum|Float]
22
- attr_accessor :delay
23
-
24
- # @!attribute [rw] group
25
- # @return [Symbol|String]
26
- attr_accessor :group
27
-
28
- # @!attribute [rw] name
29
- # @return [String]
30
- attr_accessor :name
31
-
32
- # @!attribute [rw] parent
33
- # @return [Vedeu::Views::Composition]
34
- attr_accessor :parent
35
-
36
- # @!attribute [rw] zindex
37
- # @return [Fixnum]
38
- attr_accessor :zindex
39
-
40
- # Return a new instance of Vedeu::Interface.
41
- #
42
- # @param attributes [Hash]
43
- # @option attributes client [Vedeu::Client]
44
- # @option attributes colour [Vedeu::Colours::Colour]
45
- # @option attributes delay [Float]
46
- # @option attributes group [String]
47
- # @option attributes name [String]
48
- # @option attributes parent [Vedeu::Views::Composition]
49
- # @option attributes repository [Vedeu::Interfaces]
50
- # @option attributes style [Vedeu::Style]
51
- # @option attributes visible [Boolean]
52
- # @option attributes zindex [Fixnum]
53
- # @return [Vedeu::Interface]
54
- def initialize(attributes = {})
55
- @attributes = defaults.merge!(attributes)
56
-
57
- @attributes.each { |key, value| instance_variable_set("@#{key}", value) }
58
- end
59
-
60
- # Hide a named interface buffer, or without a name, the buffer of the
61
- # currently focussed interface.
62
- #
63
- # @example
64
- # Vedeu.hide_interface(name)
5
+ # An Interface represents a portion of the terminal defined by
6
+ # {Vedeu::Geometry::Geometry}.
65
7
  #
66
- # @return [void]
67
- def hide
68
- super
8
+ class Interface
9
+
10
+ include Vedeu::Model
11
+ include Vedeu::Presentation
12
+ include Vedeu::Toggleable
13
+
14
+ # @!attribute [r] attributes
15
+ # @return [Hash]
16
+ attr_reader :attributes
17
+
18
+ # @!attribute [rw] client
19
+ # @return [Fixnum|Float]
20
+ attr_accessor :client
21
+
22
+ # @!attribute [rw] delay
23
+ # @return [Fixnum|Float]
24
+ attr_accessor :delay
25
+
26
+ # @!attribute [rw] group
27
+ # @return [Symbol|String]
28
+ attr_accessor :group
29
+
30
+ # @!attribute [rw] name
31
+ # @return [String]
32
+ attr_accessor :name
33
+
34
+ # @!attribute [rw] parent
35
+ # @return [Vedeu::Views::Composition]
36
+ attr_accessor :parent
37
+
38
+ # @!attribute [rw] zindex
39
+ # @return [Fixnum]
40
+ attr_accessor :zindex
41
+
42
+ # Return a new instance of Vedeu::Models::Interface.
43
+ #
44
+ # @param attributes [Hash]
45
+ # @option attributes client [Vedeu::Client]
46
+ # @option attributes colour [Vedeu::Colours::Colour]
47
+ # @option attributes delay [Float]
48
+ # @option attributes group [String]
49
+ # @option attributes name [String]
50
+ # @option attributes parent [Vedeu::Views::Composition]
51
+ # @option attributes repository [Vedeu::Models::Interfaces]
52
+ # @option attributes style [Vedeu::Presentation::Style]
53
+ # @option attributes visible [Boolean]
54
+ # @option attributes zindex [Fixnum]
55
+ # @return [Vedeu::Models::Interface]
56
+ def initialize(attributes = {})
57
+ @attributes = defaults.merge!(attributes)
58
+
59
+ @attributes.each do |key, value|
60
+ instance_variable_set("@#{key}", value)
61
+ end
62
+ end
69
63
 
70
- Vedeu.buffers.by_name(name).hide
71
- end
64
+ # Hide a named interface buffer, or without a name, the buffer of the
65
+ # currently focussed interface.
66
+ #
67
+ # @example
68
+ # Vedeu.hide_interface(name)
69
+ #
70
+ # @return [void]
71
+ def hide
72
+ super
73
+
74
+ Vedeu.buffers.by_name(name).hide
75
+ end
72
76
 
73
- # Show the named interface buffer, or without a name, the buffer of the
74
- # currently focussed interface.
75
- #
76
- # @example
77
- # Vedeu.show_interface(name)
78
- #
79
- # @return [void]
80
- def show
81
- super
77
+ # Show the named interface buffer, or without a name, the buffer of the
78
+ # currently focussed interface.
79
+ #
80
+ # @example
81
+ # Vedeu.show_interface(name)
82
+ #
83
+ # @return [void]
84
+ def show
85
+ super
86
+
87
+ Vedeu.buffers.by_name(name).show
88
+ end
82
89
 
83
- Vedeu.buffers.by_name(name).show
84
- end
90
+ # Toggle the visibility of the interface with the given name.
91
+ #
92
+ # @example
93
+ # Vedeu.toggle_interface(name)
94
+ #
95
+ # @return [void]
96
+ def toggle
97
+ if visible?
98
+ hide
85
99
 
86
- # Toggle the visibility of the interface with the given name.
87
- #
88
- # @example
89
- # Vedeu.toggle_interface(name)
90
- #
91
- # @return [void]
92
- def toggle
93
- if visible?
94
- hide
100
+ else
101
+ show
95
102
 
96
- else
97
- show
103
+ end
104
+ end
98
105
 
106
+ private
107
+
108
+ # The default values for a new instance of this class.
109
+ #
110
+ # @return [Hash]
111
+ def defaults
112
+ {
113
+ client: nil,
114
+ colour: Vedeu::Colours::Colour.coerce(background: :default,
115
+ foreground: :default),
116
+ delay: 0.0,
117
+ group: '',
118
+ name: '',
119
+ parent: nil,
120
+ repository: Vedeu.interfaces,
121
+ style: :normal,
122
+ visible: true,
123
+ zindex: 0,
124
+ }
99
125
  end
100
- end
101
126
 
102
- private
127
+ end # Interface
103
128
 
104
- # The default values for a new instance of this class.
105
- #
106
- # @return [Hash]
107
- def defaults
108
- {
109
- client: nil,
110
- colour: Vedeu::Colours::Colour.coerce(background: :default,
111
- foreground: :default),
112
- delay: 0.0,
113
- group: '',
114
- name: '',
115
- parent: nil,
116
- repository: Vedeu.interfaces,
117
- style: :normal,
118
- visible: true,
119
- zindex: 0,
120
- }
121
- end
122
-
123
- end # Interface
129
+ end # Models
124
130
 
125
131
  end # Vedeu