Sha256: 34d077263724960dd51b32ab48e052f49c9868f8dfc006fea8e7eb6a72f40caf
Contents?: true
Size: 718 Bytes
Versions: 3
Compression:
Stored size: 718 Bytes
Contents
require 'gir_ffi/builders/enum_builder' require 'gir_ffi/flags_base' module GirFFI module Builders # Implements the creation of a flags type. The type will be # attached to the appropriate namespace module, and will be defined # as a bit_mask for FFI. class FlagsBuilder < EnumBuilder def setup_ffi_type optionally_define_constant klass, :BitMask do lib.bit_mask(enum_sym, value_spec) end end def value_spec info.values.map do|vinfo| val = GirFFI::ArgHelper.cast_uint32_to_int32(vinfo.value) { vinfo.name.to_sym => val } end.reduce(:merge) end def superclass FlagsBase end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
gir_ffi-0.9.2 | lib/gir_ffi/builders/flags_builder.rb |
gir_ffi-0.9.1 | lib/gir_ffi/builders/flags_builder.rb |
gir_ffi-0.9.0 | lib/gir_ffi/builders/flags_builder.rb |