Module: LibUI

Defined in:
lib/libui.rb,
lib/libui/ffi.rb,
lib/libui/utils.rb,
lib/libui/version.rb,
lib/libui/libui_base.rb,
lib/libui/fiddle_patch.rb

Defined Under Namespace

Modules: FFI, Utils Classes: Error

Constant Summary collapse

ForEachContinue =

ForEach

0
ForEachStop =
1
WindowResizeEdgeLeft =

WindowResizeEdge

0
WindowResizeEdgeTop =
1
WindowResizeEdgeRight =
2
WindowResizeEdgeBottom =
3
WindowResizeEdgeTopLeft =
4
WindowResizeEdgeTopRight =
5
WindowResizeEdgeBottomLeft =
6
WindowResizeEdgeBottomRight =
7
DrawBrushTypeSolid =

DrawBrushType

0
DrawBrushTypeLinearGradient =
1
DrawBrushTypeRadialGradient =
2
DrawBrushTypeImage =
3
DrawLineCapFlat =

DrawLineCap

0
DrawLineCapRound =
1
DrawLineCapSquare =
2
DrawLineJoinMiter =

DrawLineJoin

0
DrawLineJoinRound =
1
DrawLineJoinBevel =
2
DrawDefaultMiterLimit =
10.0
DrawFillModeWinding =

DrawFillMode

0
DrawFillModeAlternate =
1
AttributeTypeFamily =

AttributeType

0
AttributeTypeSize =
1
AttributeTypeWeight =
2
AttributeTypeItalic =
3
AttributeTypeStretch =
4
AttributeTypeColor =
5
AttributeTypeBackground =
6
AttributeTypeUnderline =
7
AttributeTypeUnderlineColor =
8
AttributeTypeFeatures =
9
TextWeightMinimum =

TextWeight

0
TextWeightThin =
100
TextWeightUltraLight =
200
TextWeightLight =
300
TextWeightBook =
350
TextWeightNormal =
400
TextWeightMedium =
500
TextWeightSemiBold =
600
TextWeightBold =
700
TextWeightUltraBold =
800
TextWeightHeavy =
900
TextWeightUltraHeavy =
950
TextWeightMaximum =
1000
TextItalicNormal =

TextItalic

0
TextItalicOblique =
1
TextItalicItalic =
2
TextStretchUltraCondensed =

TextStretch

0
TextStretchExtraCondensed =
1
TextStretchCondensed =
2
TextStretchSemiCondensed =
3
TextStretchNormal =
4
TextStretchSemiExpanded =
5
TextStretchExpanded =
6
TextStretchExtraExpanded =
7
TextStretchUltraExpanded =
8
UnderlineNone =

Underline

0
UnderlineSingle =
1
UnderlineDouble =
2
UnderlineSuggestion =
3
UnderlineColorCustom =

UnderlineColor

0
UnderlineColorSpelling =
1
UnderlineColorGrammar =
2
UnderlineColorAuxiliary =
3
DrawTextAlignLeft =

DrawTextAlign

0
DrawTextAlignCenter =
1
DrawTextAlignRight =
2
ModifierCtrl =

Modifiers

(1 << 0)
ModifierAlt =
(1 << 1)
ModifierShift =
(1 << 2)
ModifierSuper =
(1 << 3)
ExtKeyEscape =

ExtKey

1
ExtKeyInsert =
2
ExtKeyDelete =
3
ExtKeyHome =
4
ExtKeyEnd =
5
ExtKeyPageUp =
6
ExtKeyPageDown =
7
ExtKeyUp =
8
ExtKeyDown =
9
ExtKeyLeft =
10
ExtKeyRight =
11
ExtKeyF1 =
12
ExtKeyF2 =
13
ExtKeyF3 =
14
ExtKeyF4 =
15
ExtKeyF5 =
16
ExtKeyF6 =
17
ExtKeyF7 =
18
ExtKeyF8 =
19
ExtKeyF9 =
20
ExtKeyF10 =
21
ExtKeyF11 =
22
ExtKeyF12 =
23
ExtKeyN0 =
24
ExtKeyN1 =
25
ExtKeyN2 =
26
ExtKeyN3 =
27
ExtKeyN4 =
28
ExtKeyN5 =
29
ExtKeyN6 =
30
ExtKeyN7 =
31
ExtKeyN8 =
32
ExtKeyN9 =
33
ExtKeyNDot =
34
ExtKeyNEnter =
35
ExtKeyNAdd =
36
ExtKeyNSubtract =
37
ExtKeyNMultiply =
38
ExtKeyNDivide =
39
AlignFill =

Align

0
AlignStart =
1
AlignCenter =
2
AlignEnd =
3
AtLeading =

At

0
AtTop =
1
AtTrailing =
2
AtBottom =
3
TableValueTypeString =

TableValueType

0
TableValueTypeImage =
1
TableValueTypeInt =
2
TableValueTypeColor =
3
TableModelColumnNeverEditable =

editable

-1
TableModelColumnAlwaysEditable =
-2
VERSION =
'0.0.12'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.ffi_libObject

Returns the value of attribute ffi_lib.



10
11
12
# File 'lib/libui.rb', line 10

def ffi_lib
  @ffi_lib
end

Class Method Details

.init(opt = nil) ⇒ Object



27
28
29
30
31
32
33
34
35
36
37
# File 'lib/libui.rb', line 27

def init(opt = nil)
  unless opt
    opt = FFI::InitOptions.malloc
    opt.to_ptr.free = Fiddle::RUBY_FREE
  end
  i = super(opt)
  return if i.size.zero?

  warn 'error'
  warn UI.free_init_error(init)
end