Class: Uh::WM::Client
- Inherits:
-
Object
- Object
- Uh::WM::Client
- Includes:
- GeoAccessors
- Defined in:
- lib/uh/wm/client.rb
Instance Attribute Summary collapse
-
#geo ⇒ Object
Returns the value of attribute geo.
-
#unmap_count ⇒ Object
Returns the value of attribute unmap_count.
-
#window ⇒ Object
readonly
Returns the value of attribute window.
Instance Method Summary collapse
- #configure ⇒ Object
- #focus ⇒ Object
- #hidden? ⇒ Boolean
- #hide ⇒ Object
-
#initialize(window, geo = nil) ⇒ Client
constructor
A new instance of Client.
- #kill ⇒ Object
- #kill! ⇒ Object
- #moveresize ⇒ Object
- #name ⇒ Object
- #show ⇒ Object
- #to_s ⇒ Object
- #update_window_properties ⇒ Object
- #visible? ⇒ Boolean
- #wclass ⇒ Object
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
#geo ⇒ Object
Returns the value of attribute geo.
7 8 9 |
# File 'lib/uh/wm/client.rb', line 7 def geo @geo end |
#unmap_count ⇒ Object
Returns the value of attribute unmap_count.
7 8 9 |
# File 'lib/uh/wm/client.rb', line 7 def unmap_count @unmap_count end |
#window ⇒ Object (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
#configure ⇒ Object
41 42 43 44 |
# File 'lib/uh/wm/client.rb', line 41 def configure @window.configure @geo self end |
#focus ⇒ Object
64 65 66 67 68 |
# File 'lib/uh/wm/client.rb', line 64 def focus @window.raise @window.focus self end |
#hidden? ⇒ Boolean
24 25 26 |
# File 'lib/uh/wm/client.rb', line 24 def hidden? not visible? end |
#hide ⇒ Object
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 |
#kill ⇒ Object
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 |
#moveresize ⇒ Object
46 47 48 49 |
# File 'lib/uh/wm/client.rb', line 46 def moveresize @window.moveresize @geo self end |
#name ⇒ Object
28 29 30 |
# File 'lib/uh/wm/client.rb', line 28 def name @wname ||= @window.name end |
#show ⇒ Object
51 52 53 54 55 |
# File 'lib/uh/wm/client.rb', line 51 def show @window.map @visible = true self end |
#to_s ⇒ Object
16 17 18 |
# File 'lib/uh/wm/client.rb', line 16 def to_s "<#{name}> (#{wclass}) #{@geo} win: #{@window}" end |
#update_window_properties ⇒ Object
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
20 21 22 |
# File 'lib/uh/wm/client.rb', line 20 def visible? @visible end |
#wclass ⇒ Object
32 33 34 |
# File 'lib/uh/wm/client.rb', line 32 def wclass @wclass ||= @window.wclass end |