Class: RBGL::GUI::Wayland::ShmBuffer
- Inherits:
-
Object
- Object
- RBGL::GUI::Wayland::ShmBuffer
- Defined in:
- lib/rbgl/gui/wayland/protocol_objects/shm.rb
Instance Attribute Summary collapse
-
#wl_buffer ⇒ Object
readonly
Returns the value of attribute wl_buffer.
Instance Method Summary collapse
- #available? ⇒ Boolean
- #destroy ⇒ Object
- #id ⇒ Object
-
#initialize(file, pool, wl_buffer) ⇒ ShmBuffer
constructor
A new instance of ShmBuffer.
- #mark_in_use ⇒ Object
- #write(data) ⇒ Object
Constructor Details
#initialize(file, pool, wl_buffer) ⇒ ShmBuffer
Returns a new instance of ShmBuffer.
93 94 95 96 97 98 99 100 101 102 |
# File 'lib/rbgl/gui/wayland/protocol_objects/shm.rb', line 93 def initialize(file, pool, wl_buffer) @file = file @pool = pool @wl_buffer = wl_buffer @destroy_requested = false @destroyed = false @file.binmode @file.seek(0) @wl_buffer.on_release { handle_release } end |
Instance Attribute Details
#wl_buffer ⇒ Object (readonly)
Returns the value of attribute wl_buffer.
91 92 93 |
# File 'lib/rbgl/gui/wayland/protocol_objects/shm.rb', line 91 def wl_buffer @wl_buffer end |
Instance Method Details
#available? ⇒ Boolean
110 111 112 |
# File 'lib/rbgl/gui/wayland/protocol_objects/shm.rb', line 110 def available? @wl_buffer.available? end |
#destroy ⇒ Object
122 123 124 125 126 127 128 |
# File 'lib/rbgl/gui/wayland/protocol_objects/shm.rb', line 122 def destroy return if @destroyed @destroy_requested = true @wl_buffer.destroy finalize_destroy unless @wl_buffer.busy? end |
#id ⇒ Object
118 119 120 |
# File 'lib/rbgl/gui/wayland/protocol_objects/shm.rb', line 118 def id @wl_buffer.id end |
#mark_in_use ⇒ Object
114 115 116 |
# File 'lib/rbgl/gui/wayland/protocol_objects/shm.rb', line 114 def mark_in_use @wl_buffer.mark_in_use end |
#write(data) ⇒ Object
104 105 106 107 108 |
# File 'lib/rbgl/gui/wayland/protocol_objects/shm.rb', line 104 def write(data) @file.seek(0) @file.write(data) @file.flush end |