Class: Uh::WM::Testing::XClient
- Inherits:
-
Object
- Object
- Uh::WM::Testing::XClient
- Defined in:
- lib/uh/wm/testing/x_client.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #destroy ⇒ Object
-
#initialize(name = object_id) ⇒ XClient
constructor
A new instance of XClient.
- #map ⇒ Object
- #sync ⇒ Object
- #terminate ⇒ Object
- #unmap ⇒ Object
- #window ⇒ Object
- #window_class=(wclass) ⇒ Object
- #window_id ⇒ Object
- #window_name ⇒ Object
- #window_name=(name) ⇒ Object
Constructor Details
#initialize(name = object_id) ⇒ XClient
Returns a new instance of XClient.
9 10 11 12 13 |
# File 'lib/uh/wm/testing/x_client.rb', line 9 def initialize name = object_id @name = "#{self.class.name.split('::').last}/#{name}" @geo = Geo.new(0, 0, 640, 480) @display = Display.new.open end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/uh/wm/testing/x_client.rb', line 7 def name @name end |
Instance Method Details
#destroy ⇒ Object
55 56 57 58 |
# File 'lib/uh/wm/testing/x_client.rb', line 55 def destroy window.destroy self end |
#map ⇒ Object
45 46 47 48 |
# File 'lib/uh/wm/testing/x_client.rb', line 45 def map window.map self end |
#sync ⇒ Object
19 20 21 22 |
# File 'lib/uh/wm/testing/x_client.rb', line 19 def sync @display.sync false self end |
#terminate ⇒ Object
15 16 17 |
# File 'lib/uh/wm/testing/x_client.rb', line 15 def terminate @display.close end |
#unmap ⇒ Object
50 51 52 53 |
# File 'lib/uh/wm/testing/x_client.rb', line 50 def unmap window.unmap self end |
#window ⇒ Object
24 25 26 |
# File 'lib/uh/wm/testing/x_client.rb', line 24 def window @window ||= @display.create_window(@geo).tap { |o| o.name = @name } end |
#window_class=(wclass) ⇒ Object
41 42 43 |
# File 'lib/uh/wm/testing/x_client.rb', line 41 def window_class= wclass window.wclass = [wclass] * 2 end |
#window_id ⇒ Object
28 29 30 |
# File 'lib/uh/wm/testing/x_client.rb', line 28 def window_id window.id end |
#window_name ⇒ Object
32 33 34 |
# File 'lib/uh/wm/testing/x_client.rb', line 32 def window_name @name end |
#window_name=(name) ⇒ Object
36 37 38 39 |
# File 'lib/uh/wm/testing/x_client.rb', line 36 def window_name= name @name = window.name = name window.name end |