Class: Uh::WM::Testing::XClient

Inherits:
Object
  • Object
show all
Defined in:
lib/uh/wm/testing/x_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject (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

#destroyObject



55
56
57
58
# File 'lib/uh/wm/testing/x_client.rb', line 55

def destroy
  window.destroy
  self
end

#mapObject



45
46
47
48
# File 'lib/uh/wm/testing/x_client.rb', line 45

def map
  window.map
  self
end

#syncObject



19
20
21
22
# File 'lib/uh/wm/testing/x_client.rb', line 19

def sync
  @display.sync false
  self
end

#terminateObject



15
16
17
# File 'lib/uh/wm/testing/x_client.rb', line 15

def terminate
  @display.close
end

#unmapObject



50
51
52
53
# File 'lib/uh/wm/testing/x_client.rb', line 50

def unmap
  window.unmap
  self
end

#windowObject



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_idObject



28
29
30
# File 'lib/uh/wm/testing/x_client.rb', line 28

def window_id
  window.id
end

#window_nameObject



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