Class: Exerb::Resource::GroupIcon
- Defined in:
- lib/exerb/resource/group_icon.rb
Overview
#
Defined Under Namespace
Classes: Entry
Instance Attribute Summary collapse
-
#entries ⇒ Object
readonly
Returns the value of attribute entries.
Instance Method Summary collapse
- #add(id, icon) ⇒ Object
-
#initialize ⇒ GroupIcon
constructor
A new instance of GroupIcon.
- #pack ⇒ Object
Methods inherited from Base
Constructor Details
#initialize ⇒ GroupIcon
Returns a new instance of GroupIcon.
22 23 24 25 |
# File 'lib/exerb/resource/group_icon.rb', line 22 def initialize super() @entries = [] end |
Instance Attribute Details
#entries ⇒ Object (readonly)
Returns the value of attribute entries.
27 28 29 |
# File 'lib/exerb/resource/group_icon.rb', line 27 def entries @entries end |
Instance Method Details
#add(id, icon) ⇒ Object
29 30 31 32 |
# File 'lib/exerb/resource/group_icon.rb', line 29 def add(id, icon) @entries << Entry.new(id, icon.width, icon.height, icon.bit_count, icon.size) return self end |
#pack ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/exerb/resource/group_icon.rb', line 34 def pack header = Exerb::Win32::Struct::IconHeader.new header.reserved = 0 header.type = 1 header.count = @entries.size packed_header = header.pack packed_entries = @entries.collect { |entry| entry.pack }.join return packed_header + packed_entries end |