Class: Uh::WM::Client

Inherits:
Object
  • Object
show all
Includes:
GeoAccessors
Defined in:
lib/uh/wm/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(window) ⇒ Client

Returns a new instance of Client.



11
12
13
14
# File 'lib/uh/wm/client.rb', line 11

def initialize(window)
  @window = window
  @hide   = true
end

Instance Attribute Details

#geoObject

Returns the value of attribute geo.



9
10
11
# File 'lib/uh/wm/client.rb', line 9

def geo
  @geo
end

#windowObject (readonly)

Returns the value of attribute window.



8
9
10
# File 'lib/uh/wm/client.rb', line 8

def window
  @window
end

Instance Method Details

#configureObject



37
38
39
40
# File 'lib/uh/wm/client.rb', line 37

def configure
  window.configure geo
  self
end

#focusObject



59
60
61
62
63
# File 'lib/uh/wm/client.rb', line 59

def focus
  window.raise
  window.focus
  self
end

#hidden?Boolean

Returns:

  • (Boolean)


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

def hidden?
  @hide
end

#hideObject



53
54
55
56
57
# File 'lib/uh/wm/client.rb', line 53

def hide
  window.unmap
  @hide = true
  self
end

#killObject



65
66
67
68
69
70
71
72
# File 'lib/uh/wm/client.rb', line 65

def kill
  if window.icccm_wm_protocols.include? :WM_DELETE_WINDOW
    window.icccm_wm_delete
  else
    window.kill!
  end
  self
end

#kill!Object



74
75
76
77
# File 'lib/uh/wm/client.rb', line 74

def kill!
  window.kill
  self
end

#moveresizeObject



42
43
44
45
# File 'lib/uh/wm/client.rb', line 42

def moveresize
  window.moveresize geo
  self
end

#nameObject



20
21
22
# File 'lib/uh/wm/client.rb', line 20

def name
  @name ||= window.name
end

#showObject



47
48
49
50
51
# File 'lib/uh/wm/client.rb', line 47

def show
  window.map
  @hide = false
  self
end

#to_sObject



16
17
18
# File 'lib/uh/wm/client.rb', line 16

def to_s
  '<%s> (%s) window: %s, geo: %s' % [name, wclass, window, geo]
end

#update_window_propertiesObject



32
33
34
35
# File 'lib/uh/wm/client.rb', line 32

def update_window_properties
  @name   = @window.name
  @wclass = @window.wclass
end

#wclassObject



24
25
26
# File 'lib/uh/wm/client.rb', line 24

def wclass
  @wclass ||= window.wclass
end