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) ⇒ Client
constructor
A new instance of Client.
- #kill ⇒ Object
- #kill! ⇒ Object
- #moveresize ⇒ Object
- #name ⇒ Object
- #show ⇒ Object
- #to_s ⇒ Object
- #update_window_properties ⇒ Object
- #wclass ⇒ Object
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
#geo ⇒ Object
Returns the value of attribute geo.
9 10 11 |
# File 'lib/uh/wm/client.rb', line 9 def geo @geo end |
#unmap_count ⇒ Object
Returns the value of attribute unmap_count.
9 10 11 |
# File 'lib/uh/wm/client.rb', line 9 def unmap_count @unmap_count end |
#window ⇒ Object (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
#configure ⇒ Object
39 40 41 42 |
# File 'lib/uh/wm/client.rb', line 39 def configure @window.configure @geo self end |
#focus ⇒ Object
62 63 64 65 66 |
# File 'lib/uh/wm/client.rb', line 62 def focus @window.raise @window.focus self end |
#hidden? ⇒ Boolean
30 31 32 |
# File 'lib/uh/wm/client.rb', line 30 def hidden? @hide end |
#hide ⇒ Object
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 |
#kill ⇒ Object
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 |
#moveresize ⇒ Object
44 45 46 47 |
# File 'lib/uh/wm/client.rb', line 44 def moveresize @window.moveresize @geo self end |
#name ⇒ Object
22 23 24 |
# File 'lib/uh/wm/client.rb', line 22 def name @name ||= @window.name end |
#show ⇒ Object
49 50 51 52 53 |
# File 'lib/uh/wm/client.rb', line 49 def show @window.map @hide = false self end |
#to_s ⇒ Object
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_properties ⇒ Object
34 35 36 37 |
# File 'lib/uh/wm/client.rb', line 34 def update_window_properties @name = @window.name @wclass = @window.wclass end |
#wclass ⇒ Object
26 27 28 |
# File 'lib/uh/wm/client.rb', line 26 def wclass @wclass ||= @window.wclass end |