Class: Windows::Engines::XWindow
- Inherits:
-
Object
- Object
- Windows::Engines::XWindow
- Extended by:
- Forwardable
- Defined in:
- lib/windows/engines/xwindow.rb
Instance Attribute Summary collapse
-
#command ⇒ Object
Returns the value of attribute command.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#engine ⇒ Object
readonly
Returns the value of attribute engine.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
- #action(*args) ⇒ Object
- #close ⇒ Object
- #create ⇒ Object
- #focus ⇒ Object
-
#initialize(command, options = {}, engine = nil) ⇒ XWindow
constructor
A new instance of XWindow.
- #maximize ⇒ Object
- #move(*args) ⇒ Object
- #not_on_top ⇒ Object
- #on_top ⇒ Object
- #undock ⇒ Object
- #window ⇒ Object
Constructor Details
Instance Attribute Details
#command ⇒ Object
Returns the value of attribute command.
13 14 15 |
# File 'lib/windows/engines/xwindow.rb', line 13 def command @command end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
12 13 14 |
# File 'lib/windows/engines/xwindow.rb', line 12 def created_at @created_at end |
#engine ⇒ Object (readonly)
Returns the value of attribute engine.
12 13 14 |
# File 'lib/windows/engines/xwindow.rb', line 12 def engine @engine end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
12 13 14 |
# File 'lib/windows/engines/xwindow.rb', line 12 def id @id end |
Instance Method Details
#action(*args) ⇒ Object
64 65 66 67 68 |
# File 'lib/windows/engines/xwindow.rb', line 64 def action(*args) create engine.action(id, *args) self end |
#close ⇒ Object
26 27 28 29 30 |
# File 'lib/windows/engines/xwindow.rb', line 26 def close action(:close) @id = false @created_at = false end |
#create ⇒ Object
40 41 42 43 44 45 46 47 48 49 |
# File 'lib/windows/engines/xwindow.rb', line 40 def create return false if created_at window = engine.find_window(command) window ||= engine.spawn_window(command) @id = window.id @created_at = Time.now self end |
#focus ⇒ Object
32 33 34 |
# File 'lib/windows/engines/xwindow.rb', line 32 def focus action(:activate) end |
#maximize ⇒ Object
70 71 72 |
# File 'lib/windows/engines/xwindow.rb', line 70 def maximize action(:change_state, "add", "maximized_vert", "maximized_horz") end |
#move(*args) ⇒ Object
20 21 22 23 24 |
# File 'lib/windows/engines/xwindow.rb', line 20 def move(*args) args = convert_units(args) undock action(:move_resize, 0, *args) end |
#not_on_top ⇒ Object
60 61 62 |
# File 'lib/windows/engines/xwindow.rb', line 60 def not_on_top action(:change_state, "remove", "above") end |
#on_top ⇒ Object
56 57 58 |
# File 'lib/windows/engines/xwindow.rb', line 56 def on_top action(:change_state, "add", "above") end |
#undock ⇒ Object
36 37 38 |
# File 'lib/windows/engines/xwindow.rb', line 36 def undock action(:change_state, "remove", "maximized_vert", "maximized_horz") end |
#window ⇒ Object
51 52 53 54 |
# File 'lib/windows/engines/xwindow.rb', line 51 def window create engine.find_window(id) end |