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
15
# File 'lib/uh/wm/client.rb', line 11

def initialize(window)
  @window       = window
  @hide         = true
  @unmap_count  = 0
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

#unmap_countObject

Returns the value of attribute unmap_count.



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

def unmap_count
  @unmap_count
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



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

def configure
  @window.configure @geo
  self
end

#focusObject



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

def focus
  @window.raise
  @window.focus
  self
end

#hidden?Boolean

Returns:

  • (Boolean)


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

def hidden?
  @hide
end

#hideObject



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

def hide
  @window.unmap
  @hide = true
  @unmap_count += 1
  self
end

#killObject



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

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

#kill!Object



77
78
79
80
# File 'lib/uh/wm/client.rb', line 77

def kill!
  @window.kill
  self
end

#moveresizeObject



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

def moveresize
  @window.moveresize @geo
  self
end

#nameObject



22
23
24
# File 'lib/uh/wm/client.rb', line 22

def name
  @name ||= @window.name
end

#showObject



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

def show
  @window.map
  @hide = false
  self
end

#to_sObject



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

def to_s
  '<%s> (%s) %s win: %s unmaps: %d' %
    [name, wclass, @geo, @window, @unmap_count]
end

#update_window_propertiesObject



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

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

#wclassObject



26
27
28
# File 'lib/uh/wm/client.rb', line 26

def wclass
  @wclass ||= @window.wclass
end