Module: LibUI::FFI

Extended by:
Fiddle::Importer
Defined in:
lib/libui/ffi.rb

Constant Summary collapse

InitOptions =
struct [
  'size_t Size'
]
Control =
struct [
  'uint32_t Signature',
  'uint32_t OSSignature',
  'uint32_t TypeSignature',
  'void (*Destroy)(uiControl *)',
  'uintptr_t (*Handle)(uiControl *)',
  'uiControl *(*Parent)(uiControl *)',
  'void (*SetParent)(uiControl *, uiControl *)',
  'int (*Toplevel)(uiControl *)',
  'int (*Visible)(uiControl *)',
  'void (*Show)(uiControl *)',
  'void (*Hide)(uiControl *)',
  'int (*Enabled)(uiControl *)',
  'void (*Enable)(uiControl *)',
  'void (*Disable)(uiControl *)'
]
TM =

time.h

if Fiddle::WINDOWS
  struct [
    'int tm_sec',
    'int tm_min',
    'int tm_hour',
    'int tm_mday',
    'int tm_mon',
    'int tm_year',
    'int tm_wday',
    'int tm_yday',
    'int tm_isdst'
  ]
else # The GNU C Library (glibc)
  struct [
    'int tm_sec',
    'int tm_min',
    'int tm_hour',
    'int tm_mday',
    'int tm_mon',
    'int tm_year',
    'int tm_wday',
    'int tm_yday',
    'int tm_isdst',
    'long tm_gmtoff',
    'const char *tm_zone'
  ]
end
AreaHandler =

uiArea

struct [
  'void (*Draw)(uiAreaHandler *, uiArea *, uiAreaDrawParams *)',
  'void (*MouseEvent)(uiAreaHandler *, uiArea *, uiAreaMouseEvent *)',
  'void (*MouseCrossed)(uiAreaHandler *, uiArea *, int left)',
  'void (*DragBroken)(uiAreaHandler *, uiArea *)',
  'int (*KeyEvent)(uiAreaHandler *, uiArea *, uiAreaKeyEvent *)'
]
AreaDrawParams =
struct [
  'uiDrawContext *Context',
  'double AreaWidth',
  'double AreaHeight',
  'double ClipX',
  'double ClipY',
  'double ClipWidth',
  'double ClipHeight'
]
DrawMatrix =
struct [
  'double M11',
  'double M12',
  'double M21',
  'double M22',
  'double M31',
  'double M32'
]
DrawBrush =
struct [
  'uiDrawBrushType Type',
  'double R',
  'double G',
  'double B',
  'double A',
  'double X0',
  'double Y0',
  'double X1',
  'double Y1',
  'double OuterRadius',
  'uiDrawBrushGradientStop *Stops',
  'size_t NumStops'
]
DrawBrushGradientStop =
struct [
  'double Pos',
  'double R',
  'double G',
  'double B',
  'double A'
]
DrawStrokeParams =
struct [
  'uiDrawLineCap Cap',
  'uiDrawLineJoin Join',
  'double Thickness',
  'double MiterLimit',
  'double *Dashes',
  'size_t NumDashes',
  'double DashPhase'
]
FontDescriptor =

uiFont

struct [
  'char *Family',
  'double Size',
  'uiTextWeight Weight',
  'uiTextItalic Italic',
  'uiTextStretch Stretch'
]
DrawTextLayoutParams =
struct [
  'uiAttributedString *String',
  'uiFontDescriptor *DefaultFont',
  'double Width',
  'uiDrawTextAlign Align'
]
AreaMouseEvent =
struct [
  'double X',
  'double Y',
  'double AreaWidth',
  'double AreaHeight',
  'int Down',
  'int Up',
  'int Count',
  'uiModifiers Modifiers',
  'uint64_t Held1To64'
]
AreaKeyEvent =
struct [
  'char Key',
  'uiExtKey ExtKey',
  'uiModifiers Modifier',
  'uiModifiers Modifiers',
  'int Up'
]
TableModelHandler =
struct [
  'int (*NumColumns)(uiTableModelHandler *, uiTableModel *)',
  'uiTableValueType (*ColumnType)(uiTableModelHandler *, uiTableModel *, int)',
  'int (*NumRows)(uiTableModelHandler *, uiTableModel *)',
  'uiTableValue *(*CellValue)(uiTableModelHandler *mh, uiTableModel *m, int row, int column)',
  'void (*SetCellValue)(uiTableModelHandler *, uiTableModel *, int, int, const uiTableValue *)'
]
TableTextColumnOptionalParams =
struct [
  'int ColorModelColumn'
]
TableParams =
struct [
  'uiTableModel *Model',
  'int RowBackgroundColorModelColumn'
]
TableSelection =
struct [
  'int NumRows',
  'int *Rows'
]

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.func_mapObject (readonly)

Returns the value of attribute func_map.



16
17
18
# File 'lib/libui/ffi.rb', line 16

def func_map
  @func_map
end

Class Method Details

.ffi_methodsObject



24
25
26
# File 'lib/libui/ffi.rb', line 24

def ffi_methods
  @ffi_methods ||= func_map.each_key.to_a
end

.try_extern(signature, *opts) ⇒ Object



18
19
20
21
22
# File 'lib/libui/ffi.rb', line 18

def try_extern(signature, *opts)
  extern(signature, *opts)
rescue StandardError => e
  warn "#{e.class.name}: #{e.message}"
end