Class: RBGL::GUI::Wayland::WlBuffer
- Inherits:
-
WaylandObject
- Object
- WaylandObject
- RBGL::GUI::Wayland::WlBuffer
- Defined in:
- lib/rbgl/gui/wayland/protocol_objects/shm.rb
Instance Attribute Summary
Attributes inherited from WaylandObject
Instance Method Summary collapse
- #available? ⇒ Boolean
- #busy? ⇒ Boolean
- #destroy ⇒ Object
- #handle_release ⇒ Object
-
#initialize(connection, id) ⇒ WlBuffer
constructor
A new instance of WlBuffer.
- #mark_in_use ⇒ Object
- #on_release(&block) ⇒ Object
Methods inherited from WaylandObject
Constructor Details
#initialize(connection, id) ⇒ WlBuffer
Returns a new instance of WlBuffer.
40 41 42 43 44 45 46 |
# File 'lib/rbgl/gui/wayland/protocol_objects/shm.rb', line 40 def initialize(connection, id) super @busy = false @destroy_requested = false @destroyed = false @release_callbacks = [] end |
Instance Method Details
#available? ⇒ Boolean
56 57 58 |
# File 'lib/rbgl/gui/wayland/protocol_objects/shm.rb', line 56 def available? !@busy && !@destroy_requested && !@destroyed end |
#busy? ⇒ Boolean
60 61 62 |
# File 'lib/rbgl/gui/wayland/protocol_objects/shm.rb', line 60 def busy? @busy end |
#destroy ⇒ Object
70 71 72 73 74 75 76 77 78 |
# File 'lib/rbgl/gui/wayland/protocol_objects/shm.rb', line 70 def destroy return if @destroyed || @destroy_requested if @busy @destroy_requested = true else finalize_destroy end end |
#handle_release ⇒ Object
64 65 66 67 68 |
# File 'lib/rbgl/gui/wayland/protocol_objects/shm.rb', line 64 def handle_release @busy = false @release_callbacks.each(&:call) finalize_destroy if @destroy_requested end |
#mark_in_use ⇒ Object
52 53 54 |
# File 'lib/rbgl/gui/wayland/protocol_objects/shm.rb', line 52 def mark_in_use @busy = true end |
#on_release(&block) ⇒ Object
48 49 50 |
# File 'lib/rbgl/gui/wayland/protocol_objects/shm.rb', line 48 def on_release(&block) @release_callbacks << block if block end |