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, geo = nil) ⇒ Client

Returns a new instance of Client.



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

def initialize window, geo = nil
  @window       = window
  @geo          = geo
  @visible      = false
  @unmap_count  = 0
end

Instance Attribute Details

#geoObject

Returns the value of attribute geo.



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

def geo
  @geo
end

#unmap_countObject

Returns the value of attribute unmap_count.



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

def unmap_count
  @unmap_count
end

#windowObject (readonly)

Returns the value of attribute window.



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

def window
  @window
end

Instance Method Details

#configureObject



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

def configure
  @window.configure @geo
  self
end

#focusObject



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

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?
  not visible?
end

#hideObject



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

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

#killObject



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

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

#kill!Object



79
80
81
82
# File 'lib/uh/wm/client.rb', line 79

def kill!
  window.kill
  self
end

#moveresizeObject



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

def moveresize
  @window.moveresize @geo
  self
end

#nameObject



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

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

#showObject



51
52
53
54
55
# File 'lib/uh/wm/client.rb', line 51

def show
  @window.map
  @visible = true
  self
end

#to_sObject



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

def to_s
  "<#{name}> (#{wclass}) #{@geo} win: #{@window}"
end

#update_window_propertiesObject



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

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

#visible?Boolean

Returns:

  • (Boolean)


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

def visible?
  @visible
end

#wclassObject



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

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