Class: Uh::WM::Client

Inherits:
Object
  • Object
show all
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.



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

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

Instance Attribute Details

#geoObject

Returns the value of attribute geo.



5
6
7
# File 'lib/uh/wm/client.rb', line 5

def geo
  @geo
end

#windowObject (readonly)

Returns the value of attribute window.



4
5
6
# File 'lib/uh/wm/client.rb', line 4

def window
  @window
end

Instance Method Details

#configureObject



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

def configure
  window.configure geo
  self
end

#focusObject



55
56
57
58
59
# File 'lib/uh/wm/client.rb', line 55

def focus
  window.raise
  window.focus
  self
end

#hidden?Boolean

Returns:

  • (Boolean)


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

def hidden?
  @hide
end

#hideObject



49
50
51
52
53
# File 'lib/uh/wm/client.rb', line 49

def hide
  window.unmap
  @hide = true
  self
end

#killObject



61
62
63
64
65
66
67
68
# File 'lib/uh/wm/client.rb', line 61

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

#kill!Object



70
71
72
73
# File 'lib/uh/wm/client.rb', line 70

def kill!
  window.kill
  self
end

#moveresizeObject



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

def moveresize
  window.moveresize geo
  self
end

#nameObject



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

def name
  @name ||= window.name
end

#showObject



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

def show
  window.map
  @hide = false
  self
end

#to_sObject



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

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

#update_window_propertiesObject



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

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

#wclassObject



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

def wclass
  @wclass ||= window.wclass
end