Class: Emfsvg::ObjectTable
- Inherits:
-
Object
- Object
- Emfsvg::ObjectTable
- Defined in:
- lib/emfsvg/object_table.rb
Overview
1-indexed GDI object table (matches EMF's handle numbering). SELECTOBJECT copies from the table into the current DeviceContext. DELETEOBJECT removes the slot.
Defined Under Namespace
Classes: Entry
Instance Method Summary collapse
- #delete(index) ⇒ Object
-
#initialize ⇒ ObjectTable
constructor
A new instance of ObjectTable.
- #lookup(index) ⇒ Object
- #size ⇒ Object
- #store(index, type, object) ⇒ Object
Constructor Details
#initialize ⇒ ObjectTable
Returns a new instance of ObjectTable.
22 23 24 |
# File 'lib/emfsvg/object_table.rb', line 22 def initialize @entries = [] # 0-indexed internally; EMF indices are 1-based end |
Instance Method Details
#delete(index) ⇒ Object
35 36 37 |
# File 'lib/emfsvg/object_table.rb', line 35 def delete(index) @entries[index - 1] = nil end |
#lookup(index) ⇒ Object
31 32 33 |
# File 'lib/emfsvg/object_table.rb', line 31 def lookup(index) @entries[index - 1] end |
#size ⇒ Object
39 40 41 |
# File 'lib/emfsvg/object_table.rb', line 39 def size @entries.compact.size end |