Module: LibHokusai
- Extended by:
- FFI::Library
- Defined in:
- ui/lib/lib_hokusai.rb
Defined Under Namespace
Classes: Error, HmlAst, HmlAstClassList, HmlAstCondition, HmlAstEvent, HmlAstFuncCall, HmlAstList, HmlAstLoop, HmlAstProp, HmlDoubleVec2, HmlInput, HmlInputKeyboard, HmlInputKeyboardKey, HmlInputKeyboardKeyWithChar, HmlInputMouse, HmlInputMouseButton, HmlRect, HmlStyle, HmlStyleAttribute, HmlVec2, HokuChar, HokuClamping, HokuCursorPosition, HokuGroup, HokuGroupCode, HokuGroupImage, HokuGroupLink, HokuGroupListItem, HokuSegment, HokuSelection
Constant Summary
collapse
- GROUP_NORMAL =
1 << 0
- GROUP_BOLD =
1 << 1
- GROUP_ITALICS =
1 << 2
- GROUP_LINK =
1 << 3
- GROUP_IMAGE =
1 << 4
- GROUP_CODE =
1 << 5
- GROUP_LIST_ITEM =
1 << 6
Class Method Summary
collapse
Class Method Details
.const_missing(sym) ⇒ Object
297
298
299
300
301
|
# File 'ui/lib/lib_hokusai.rb', line 297
def LibHokusai.const_missing( sym )
value = enum_value( sym )
return super unless value
value
end
|
.parse_style(template) ⇒ Object
30
31
32
33
34
35
36
37
38
39
40
|
# File 'ui/lib/lib_hokusai.rb', line 30
def self.parse_style(template)
ptr = FFI::MemoryPointer.new :pointer
code = LibHokusai.hoku_style_from_template(ptr, template)
raise LibHokusai::Error.new("Couldn't parse style template") unless code.zero?
a_ptr = ptr.get_pointer(0)
LibHokusai::HmlStyle.new FFI::AutoPointer.new(a_ptr, LibHokusai.method(:hoku_style_free))
ensure
ptr.free
end
|
.parse_template(name, template) ⇒ Object
18
19
20
21
22
23
24
25
26
27
28
|
# File 'ui/lib/lib_hokusai.rb', line 18
def self.parse_template(name, template)
ptr = FFI::MemoryPointer.new :pointer
code = LibHokusai.hoku_ast_from_template(ptr, name, template)
raise LibHokusai::Error.new("Couldn't parse template") unless code.zero?
a_ptr = ptr.get_pointer(0)
LibHokusai::HmlAst.new FFI::AutoPointer.new(a_ptr, LibHokusai.method(:hoku_ast_free))
ensure
ptr.free
end
|