Skip to content

Instantly share code, notes, and snippets.

@genotrance
Created August 17, 2018 19:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save genotrance/2839cb49b3855c91aa835e4379ac73a5 to your computer and use it in GitHub Desktop.
Save genotrance/2839cb49b3855c91aa835e4379ac73a5 to your computer and use it in GitHub Desktop.
ui.nim
import strutils
const sourcePath = currentSourcePath().split({'\\', '/'})[0..^2].join("/")
{.passC: "-I\"" & sourcePath & "\"".}
{.passC: "-I\"" & sourcePath & "/common\"".}
const headerui = sourcePath & "/ui.h"
{.passC: "-DBUILD_SHARED_LIBS=OFF".}
{.passL: "-lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lcomctl32 -ld2d1 -ldwrite -lUxTheme -lusp10 -lgdi32 -luser32 -lkernel32 -lstdc++".}
{.compile: "nimui/common/areaevents.c".}
{.compile: "nimui/common/attribute.c".}
{.compile: "nimui/common/attrlist.c".}
{.compile: "nimui/common/attrstr.c".}
{.compile: "nimui/common/control.c".}
{.compile: "nimui/common/debug.c".}
{.compile: "nimui/common/matrix.c".}
#{.compile: "nimui/common/OLD_table.c".}
{.compile: "nimui/common/opentype.c".}
{.compile: "nimui/common/shouldquit.c".}
{.compile: "nimui/common/tablemodel.c".}
{.compile: "nimui/common/tablevalue.c".}
{.compile: "nimui/common/userbugs.c".}
{.compile: "nimui/common/utf.c".}
{.compile: "nimui/windows/alloc.cpp".}
{.compile: "nimui/windows/area.cpp".}
{.compile: "nimui/windows/areadraw.cpp".}
{.compile: "nimui/windows/areaevents.cpp".}
{.compile: "nimui/windows/areascroll.cpp".}
{.compile: "nimui/windows/areautil.cpp".}
{.compile: "nimui/windows/attrstr.cpp".}
{.compile: "nimui/windows/box.cpp".}
{.compile: "nimui/windows/button.cpp".}
{.compile: "nimui/windows/checkbox.cpp".}
{.compile: "nimui/windows/colorbutton.cpp".}
{.compile: "nimui/windows/colordialog.cpp".}
{.compile: "nimui/windows/combobox.cpp".}
{.compile: "nimui/windows/container.cpp".}
{.compile: "nimui/windows/control.cpp".}
{.compile: "nimui/windows/d2dscratch.cpp".}
{.compile: "nimui/windows/datetimepicker.cpp".}
{.compile: "nimui/windows/debug.cpp".}
{.compile: "nimui/windows/draw.cpp".}
{.compile: "nimui/windows/drawmatrix.cpp".}
{.compile: "nimui/windows/drawpath.cpp".}
{.compile: "nimui/windows/drawtext.cpp".}
{.compile: "nimui/windows/dwrite.cpp".}
{.compile: "nimui/windows/editablecombo.cpp".}
{.compile: "nimui/windows/entry.cpp".}
{.compile: "nimui/windows/events.cpp".}
{.compile: "nimui/windows/fontbutton.cpp".}
{.compile: "nimui/windows/fontdialog.cpp".}
{.compile: "nimui/windows/fontmatch.cpp".}
{.compile: "nimui/windows/form.cpp".}
{.compile: "nimui/windows/graphemes.cpp".}
{.compile: "nimui/windows/grid.cpp".}
{.compile: "nimui/windows/group.cpp".}
{.compile: "nimui/windows/image.cpp".}
{.compile: "nimui/windows/init.cpp".}
{.compile: "nimui/windows/label.cpp".}
{.compile: "nimui/windows/main.cpp".}
{.compile: "nimui/windows/menu.cpp".}
{.compile: "nimui/windows/multilineentry.cpp".}
{.compile: "nimui/windows/opentype.cpp".}
{.compile: "nimui/windows/parent.cpp".}
{.compile: "nimui/windows/progressbar.cpp".}
{.compile: "nimui/windows/radiobuttons.cpp".}
{.compile: "nimui/windows/separator.cpp".}
{.compile: "nimui/windows/sizing.cpp".}
{.compile: "nimui/windows/slider.cpp".}
{.compile: "nimui/windows/spinbox.cpp".}
{.compile: "nimui/windows/stddialogs.cpp".}
{.compile: "nimui/windows/tab.cpp".}
{.compile: "nimui/windows/table.cpp".}
{.compile: "nimui/windows/tabledispinfo.cpp".}
{.compile: "nimui/windows/tabledraw.cpp".}
{.compile: "nimui/windows/tableediting.cpp".}
{.compile: "nimui/windows/tablemetrics.cpp".}
{.compile: "nimui/windows/tabpage.cpp".}
{.compile: "nimui/windows/text.cpp".}
{.compile: "nimui/windows/utf16.cpp".}
{.compile: "nimui/windows/utilwin.cpp".}
{.compile: "nimui/windows/window.cpp".}
{.compile: "nimui/windows/winpublic.cpp".}
{.compile: "nimui/windows/winutil.cpp".}
{.link: "nimui/windows/resources.o".}
const
uiPi* = 3.141592653589793
uiDrawDefaultMiterLimit* = 10.0
type
UiForEach* = object
const
uiForEachContinue* = 0
uiForEachStop* = 1
type
UiInitOptions* {.importc: "uiInitOptions", header: headerui, bycopy.} = object
size* {.importc: "Size".}: csize
proc uiInit*(options: ptr UiInitOptions): cstring {.cdecl, importc: "uiInit",
header: headerui.}
proc uiUninit*() {.cdecl, importc: "uiUninit", header: headerui.}
proc uiFreeInitError*(err: cstring) {.cdecl, importc: "uiFreeInitError",
header: headerui.}
proc uiMain*() {.cdecl, importc: "uiMain", header: headerui.}
proc uiMainSteps*() {.cdecl, importc: "uiMainSteps", header: headerui.}
proc uiMainStep*(wait: cint): cint {.cdecl, importc: "uiMainStep", header: headerui.}
proc uiQuit*() {.cdecl, importc: "uiQuit", header: headerui.}
proc uiQueueMain*(f: proc (data: pointer) {.cdecl.}; data: pointer) {.cdecl,
importc: "uiQueueMain", header: headerui.}
proc uiTimer*(milliseconds: cint; f: proc (data: pointer): cint {.cdecl.};
data: pointer) {.cdecl, importc: "uiTimer", header: headerui.}
proc uiOnShouldQuit*(f: proc (data: pointer): cint {.cdecl.}; data: pointer) {.cdecl,
importc: "uiOnShouldQuit", header: headerui.}
proc uiFreeText*(text: cstring) {.cdecl, importc: "uiFreeText", header: headerui.}
type
UiControl* {.importc: "uiControl", header: headerui, bycopy.} = object
signature* {.importc: "Signature".}: uint32
oSSignature* {.importc: "OSSignature".}: uint32
typeSignature* {.importc: "TypeSignature".}: uint32
destroy* {.importc: "Destroy".}: proc (a2: ptr UiControl) {.cdecl.}
handle* {.importc: "Handle".}: proc (a2: ptr UiControl): ptr uint {.cdecl.}
parent* {.importc: "Parent".}: proc (a2: ptr UiControl): ptr UiControl {.cdecl.}
setParent* {.importc: "SetParent".}: proc (a2: ptr UiControl; a3: ptr UiControl) {.
cdecl.}
toplevel* {.importc: "Toplevel".}: proc (a2: ptr UiControl): cint {.cdecl.}
visible* {.importc: "Visible".}: proc (a2: ptr UiControl): cint {.cdecl.}
show* {.importc: "Show".}: proc (a2: ptr UiControl) {.cdecl.}
hide* {.importc: "Hide".}: proc (a2: ptr UiControl) {.cdecl.}
enabled* {.importc: "Enabled".}: proc (a2: ptr UiControl): cint {.cdecl.}
enable* {.importc: "Enable".}: proc (a2: ptr UiControl) {.cdecl.}
disable* {.importc: "Disable".}: proc (a2: ptr UiControl) {.cdecl.}
proc uiControlDestroy*(a2: ptr UiControl) {.cdecl, importc: "uiControlDestroy",
header: headerui.}
proc uiControlHandle*(a2: ptr UiControl): ptr uint {.cdecl,
importc: "uiControlHandle", header: headerui.}
proc uiControlParent*(a2: ptr UiControl): ptr UiControl {.cdecl,
importc: "uiControlParent", header: headerui.}
proc uiControlSetParent*(a2: ptr UiControl; a3: ptr UiControl) {.cdecl,
importc: "uiControlSetParent", header: headerui.}
proc uiControlToplevel*(a2: ptr UiControl): cint {.cdecl,
importc: "uiControlToplevel", header: headerui.}
proc uiControlVisible*(a2: ptr UiControl): cint {.cdecl,
importc: "uiControlVisible", header: headerui.}
proc uiControlShow*(a2: ptr UiControl) {.cdecl, importc: "uiControlShow",
header: headerui.}
proc uiControlHide*(a2: ptr UiControl) {.cdecl, importc: "uiControlHide",
header: headerui.}
proc uiControlEnabled*(a2: ptr UiControl): cint {.cdecl,
importc: "uiControlEnabled", header: headerui.}
proc uiControlEnable*(a2: ptr UiControl) {.cdecl, importc: "uiControlEnable",
header: headerui.}
proc uiControlDisable*(a2: ptr UiControl) {.cdecl, importc: "uiControlDisable",
header: headerui.}
proc uiAllocControl*(n: csize; oSsig: uint32; typesig: uint32; typenamestr: cstring): ptr UiControl {.
cdecl, importc: "uiAllocControl", header: headerui.}
proc uiFreeControl*(a2: ptr UiControl) {.cdecl, importc: "uiFreeControl",
header: headerui.}
proc uiControlVerifySetParent*(a2: ptr UiControl; a3: ptr UiControl) {.cdecl,
importc: "uiControlVerifySetParent", header: headerui.}
proc uiControlEnabledToUser*(a2: ptr UiControl): cint {.cdecl,
importc: "uiControlEnabledToUser", header: headerui.}
proc uiUserBugCannotSetParentOnToplevel*(`type`: cstring) {.cdecl,
importc: "uiUserBugCannotSetParentOnToplevel", header: headerui.}
type
UiWindow* = object
proc uiWindowTitle*(w: ptr UiWindow): cstring {.cdecl, importc: "uiWindowTitle",
header: headerui.}
proc uiWindowSetTitle*(w: ptr UiWindow; title: cstring) {.cdecl,
importc: "uiWindowSetTitle", header: headerui.}
proc uiWindowContentSize*(w: ptr UiWindow; width: ptr cint; height: ptr cint) {.cdecl,
importc: "uiWindowContentSize", header: headerui.}
proc uiWindowSetContentSize*(w: ptr UiWindow; width: cint; height: cint) {.cdecl,
importc: "uiWindowSetContentSize", header: headerui.}
proc uiWindowFullscreen*(w: ptr UiWindow): cint {.cdecl,
importc: "uiWindowFullscreen", header: headerui.}
proc uiWindowSetFullscreen*(w: ptr UiWindow; fullscreen: cint) {.cdecl,
importc: "uiWindowSetFullscreen", header: headerui.}
proc uiWindowOnContentSizeChanged*(w: ptr UiWindow; f: proc (a2: ptr UiWindow;
a3: pointer) {.cdecl.}; data: pointer) {.cdecl,
importc: "uiWindowOnContentSizeChanged", header: headerui.}
proc uiWindowOnClosing*(w: ptr UiWindow; f: proc (w: ptr UiWindow; data: pointer): cint {.
cdecl.}; data: pointer) {.cdecl, importc: "uiWindowOnClosing",
header: headerui.}
proc uiWindowBorderless*(w: ptr UiWindow): cint {.cdecl,
importc: "uiWindowBorderless", header: headerui.}
proc uiWindowSetBorderless*(w: ptr UiWindow; borderless: cint) {.cdecl,
importc: "uiWindowSetBorderless", header: headerui.}
proc uiWindowSetChild*(w: ptr UiWindow; child: ptr UiControl) {.cdecl,
importc: "uiWindowSetChild", header: headerui.}
proc uiWindowMargined*(w: ptr UiWindow): cint {.cdecl, importc: "uiWindowMargined",
header: headerui.}
proc uiWindowSetMargined*(w: ptr UiWindow; margined: cint) {.cdecl,
importc: "uiWindowSetMargined", header: headerui.}
proc uiNewWindow*(title: cstring; width: cint; height: cint; hasMenubar: cint): ptr UiWindow {.
cdecl, importc: "uiNewWindow", header: headerui.}
type
UiButton* = object
proc uiButtonText*(b: ptr UiButton): cstring {.cdecl, importc: "uiButtonText",
header: headerui.}
proc uiButtonSetText*(b: ptr UiButton; text: cstring) {.cdecl,
importc: "uiButtonSetText", header: headerui.}
proc uiButtonOnClicked*(b: ptr UiButton;
f: proc (b: ptr UiButton; data: pointer) {.cdecl.};
data: pointer) {.cdecl, importc: "uiButtonOnClicked",
header: headerui.}
proc uiNewButton*(text: cstring): ptr UiButton {.cdecl, importc: "uiNewButton",
header: headerui.}
type
UiBox* = object
proc uiBoxAppend*(b: ptr UiBox; child: ptr UiControl; stretchy: cint) {.cdecl,
importc: "uiBoxAppend", header: headerui.}
proc uiBoxDelete*(b: ptr UiBox; index: cint) {.cdecl, importc: "uiBoxDelete",
header: headerui.}
proc uiBoxPadded*(b: ptr UiBox): cint {.cdecl, importc: "uiBoxPadded",
header: headerui.}
proc uiBoxSetPadded*(b: ptr UiBox; padded: cint) {.cdecl, importc: "uiBoxSetPadded",
header: headerui.}
proc uiNewHorizontalBox*(): ptr UiBox {.cdecl, importc: "uiNewHorizontalBox",
header: headerui.}
proc uiNewVerticalBox*(): ptr UiBox {.cdecl, importc: "uiNewVerticalBox",
header: headerui.}
type
UiCheckbox* = object
proc uiCheckboxText*(c: ptr UiCheckbox): cstring {.cdecl, importc: "uiCheckboxText",
header: headerui.}
proc uiCheckboxSetText*(c: ptr UiCheckbox; text: cstring) {.cdecl,
importc: "uiCheckboxSetText", header: headerui.}
proc uiCheckboxOnToggled*(c: ptr UiCheckbox;
f: proc (c: ptr UiCheckbox; data: pointer) {.cdecl.};
data: pointer) {.cdecl, importc: "uiCheckboxOnToggled",
header: headerui.}
proc uiCheckboxChecked*(c: ptr UiCheckbox): cint {.cdecl,
importc: "uiCheckboxChecked", header: headerui.}
proc uiCheckboxSetChecked*(c: ptr UiCheckbox; checked: cint) {.cdecl,
importc: "uiCheckboxSetChecked", header: headerui.}
proc uiNewCheckbox*(text: cstring): ptr UiCheckbox {.cdecl,
importc: "uiNewCheckbox", header: headerui.}
type
UiEntry* = object
proc uiEntryText*(e: ptr UiEntry): cstring {.cdecl, importc: "uiEntryText",
header: headerui.}
proc uiEntrySetText*(e: ptr UiEntry; text: cstring) {.cdecl,
importc: "uiEntrySetText", header: headerui.}
proc uiEntryOnChanged*(e: ptr UiEntry;
f: proc (e: ptr UiEntry; data: pointer) {.cdecl.}; data: pointer) {.
cdecl, importc: "uiEntryOnChanged", header: headerui.}
proc uiEntryReadOnly*(e: ptr UiEntry): cint {.cdecl, importc: "uiEntryReadOnly",
header: headerui.}
proc uiEntrySetReadOnly*(e: ptr UiEntry; readonly: cint) {.cdecl,
importc: "uiEntrySetReadOnly", header: headerui.}
proc uiNewEntry*(): ptr UiEntry {.cdecl, importc: "uiNewEntry", header: headerui.}
proc uiNewPasswordEntry*(): ptr UiEntry {.cdecl, importc: "uiNewPasswordEntry",
header: headerui.}
proc uiNewSearchEntry*(): ptr UiEntry {.cdecl, importc: "uiNewSearchEntry",
header: headerui.}
type
UiLabel* = object
proc uiLabelText*(l: ptr UiLabel): cstring {.cdecl, importc: "uiLabelText",
header: headerui.}
proc uiLabelSetText*(l: ptr UiLabel; text: cstring) {.cdecl,
importc: "uiLabelSetText", header: headerui.}
proc uiNewLabel*(text: cstring): ptr UiLabel {.cdecl, importc: "uiNewLabel",
header: headerui.}
type
UiTab* = object
proc uiTabAppend*(t: ptr UiTab; name: cstring; c: ptr UiControl) {.cdecl,
importc: "uiTabAppend", header: headerui.}
proc uiTabInsertAt*(t: ptr UiTab; name: cstring; before: cint; c: ptr UiControl) {.cdecl,
importc: "uiTabInsertAt", header: headerui.}
proc uiTabDelete*(t: ptr UiTab; index: cint) {.cdecl, importc: "uiTabDelete",
header: headerui.}
proc uiTabNumPages*(t: ptr UiTab): cint {.cdecl, importc: "uiTabNumPages",
header: headerui.}
proc uiTabMargined*(t: ptr UiTab; page: cint): cint {.cdecl, importc: "uiTabMargined",
header: headerui.}
proc uiTabSetMargined*(t: ptr UiTab; page: cint; margined: cint) {.cdecl,
importc: "uiTabSetMargined", header: headerui.}
proc uiNewTab*(): ptr UiTab {.cdecl, importc: "uiNewTab", header: headerui.}
type
UiGroup* = object
proc uiGroupTitle*(g: ptr UiGroup): cstring {.cdecl, importc: "uiGroupTitle",
header: headerui.}
proc uiGroupSetTitle*(g: ptr UiGroup; title: cstring) {.cdecl,
importc: "uiGroupSetTitle", header: headerui.}
proc uiGroupSetChild*(g: ptr UiGroup; c: ptr UiControl) {.cdecl,
importc: "uiGroupSetChild", header: headerui.}
proc uiGroupMargined*(g: ptr UiGroup): cint {.cdecl, importc: "uiGroupMargined",
header: headerui.}
proc uiGroupSetMargined*(g: ptr UiGroup; margined: cint) {.cdecl,
importc: "uiGroupSetMargined", header: headerui.}
proc uiNewGroup*(title: cstring): ptr UiGroup {.cdecl, importc: "uiNewGroup",
header: headerui.}
type
UiSpinbox* = object
proc uiSpinboxValue*(s: ptr UiSpinbox): cint {.cdecl, importc: "uiSpinboxValue",
header: headerui.}
proc uiSpinboxSetValue*(s: ptr UiSpinbox; value: cint) {.cdecl,
importc: "uiSpinboxSetValue", header: headerui.}
proc uiSpinboxOnChanged*(s: ptr UiSpinbox;
f: proc (s: ptr UiSpinbox; data: pointer) {.cdecl.};
data: pointer) {.cdecl, importc: "uiSpinboxOnChanged",
header: headerui.}
proc uiNewSpinbox*(min: cint; max: cint): ptr UiSpinbox {.cdecl,
importc: "uiNewSpinbox", header: headerui.}
type
UiSlider* = object
proc uiSliderValue*(s: ptr UiSlider): cint {.cdecl, importc: "uiSliderValue",
header: headerui.}
proc uiSliderSetValue*(s: ptr UiSlider; value: cint) {.cdecl,
importc: "uiSliderSetValue", header: headerui.}
proc uiSliderOnChanged*(s: ptr UiSlider;
f: proc (s: ptr UiSlider; data: pointer) {.cdecl.};
data: pointer) {.cdecl, importc: "uiSliderOnChanged",
header: headerui.}
proc uiNewSlider*(min: cint; max: cint): ptr UiSlider {.cdecl, importc: "uiNewSlider",
header: headerui.}
type
UiProgressBar* = object
proc uiProgressBarValue*(p: ptr UiProgressBar): cint {.cdecl,
importc: "uiProgressBarValue", header: headerui.}
proc uiProgressBarSetValue*(p: ptr UiProgressBar; n: cint) {.cdecl,
importc: "uiProgressBarSetValue", header: headerui.}
proc uiNewProgressBar*(): ptr UiProgressBar {.cdecl, importc: "uiNewProgressBar",
header: headerui.}
type
UiSeparator* = object
proc uiNewHorizontalSeparator*(): ptr UiSeparator {.cdecl,
importc: "uiNewHorizontalSeparator", header: headerui.}
proc uiNewVerticalSeparator*(): ptr UiSeparator {.cdecl,
importc: "uiNewVerticalSeparator", header: headerui.}
type
UiCombobox* = object
proc uiComboboxAppend*(c: ptr UiCombobox; text: cstring) {.cdecl,
importc: "uiComboboxAppend", header: headerui.}
proc uiComboboxSelected*(c: ptr UiCombobox): cint {.cdecl,
importc: "uiComboboxSelected", header: headerui.}
proc uiComboboxSetSelected*(c: ptr UiCombobox; n: cint) {.cdecl,
importc: "uiComboboxSetSelected", header: headerui.}
proc uiComboboxOnSelected*(c: ptr UiCombobox; f: proc (c: ptr UiCombobox; data: pointer) {.
cdecl.}; data: pointer) {.cdecl, importc: "uiComboboxOnSelected",
header: headerui.}
proc uiNewCombobox*(): ptr UiCombobox {.cdecl, importc: "uiNewCombobox",
header: headerui.}
type
UiEditableCombobox* = object
proc uiEditableComboboxAppend*(c: ptr UiEditableCombobox; text: cstring) {.cdecl,
importc: "uiEditableComboboxAppend", header: headerui.}
proc uiEditableComboboxText*(c: ptr UiEditableCombobox): cstring {.cdecl,
importc: "uiEditableComboboxText", header: headerui.}
proc uiEditableComboboxSetText*(c: ptr UiEditableCombobox; text: cstring) {.cdecl,
importc: "uiEditableComboboxSetText", header: headerui.}
proc uiEditableComboboxOnChanged*(c: ptr UiEditableCombobox; f: proc (
c: ptr UiEditableCombobox; data: pointer) {.cdecl.}; data: pointer) {.cdecl,
importc: "uiEditableComboboxOnChanged", header: headerui.}
proc uiNewEditableCombobox*(): ptr UiEditableCombobox {.cdecl,
importc: "uiNewEditableCombobox", header: headerui.}
type
UiRadioButtons* = object
proc uiRadioButtonsAppend*(r: ptr UiRadioButtons; text: cstring) {.cdecl,
importc: "uiRadioButtonsAppend", header: headerui.}
proc uiRadioButtonsSelected*(r: ptr UiRadioButtons): cint {.cdecl,
importc: "uiRadioButtonsSelected", header: headerui.}
proc uiRadioButtonsSetSelected*(r: ptr UiRadioButtons; n: cint) {.cdecl,
importc: "uiRadioButtonsSetSelected", header: headerui.}
proc uiRadioButtonsOnSelected*(r: ptr UiRadioButtons; f: proc (a2: ptr UiRadioButtons;
a3: pointer) {.cdecl.}; data: pointer) {.cdecl,
importc: "uiRadioButtonsOnSelected", header: headerui.}
proc uiNewRadioButtons*(): ptr UiRadioButtons {.cdecl,
importc: "uiNewRadioButtons", header: headerui.}
type
Tm* {.importc: "tm", header: headerui, bycopy.} = object
UiDateTimePicker* = object
proc uiDateTimePickerTime*(d: ptr UiDateTimePicker; time: ptr Tm) {.cdecl,
importc: "uiDateTimePickerTime", header: headerui.}
proc uiDateTimePickerSetTime*(d: ptr UiDateTimePicker; time: ptr Tm) {.cdecl,
importc: "uiDateTimePickerSetTime", header: headerui.}
proc uiDateTimePickerOnChanged*(d: ptr UiDateTimePicker; f: proc (
a2: ptr UiDateTimePicker; a3: pointer) {.cdecl.}; data: pointer) {.cdecl,
importc: "uiDateTimePickerOnChanged", header: headerui.}
proc uiNewDateTimePicker*(): ptr UiDateTimePicker {.cdecl,
importc: "uiNewDateTimePicker", header: headerui.}
proc uiNewDatePicker*(): ptr UiDateTimePicker {.cdecl, importc: "uiNewDatePicker",
header: headerui.}
proc uiNewTimePicker*(): ptr UiDateTimePicker {.cdecl, importc: "uiNewTimePicker",
header: headerui.}
type
UiMultilineEntry* = object
proc uiMultilineEntryText*(e: ptr UiMultilineEntry): cstring {.cdecl,
importc: "uiMultilineEntryText", header: headerui.}
proc uiMultilineEntrySetText*(e: ptr UiMultilineEntry; text: cstring) {.cdecl,
importc: "uiMultilineEntrySetText", header: headerui.}
proc uiMultilineEntryAppend*(e: ptr UiMultilineEntry; text: cstring) {.cdecl,
importc: "uiMultilineEntryAppend", header: headerui.}
proc uiMultilineEntryOnChanged*(e: ptr UiMultilineEntry; f: proc (
e: ptr UiMultilineEntry; data: pointer) {.cdecl.}; data: pointer) {.cdecl,
importc: "uiMultilineEntryOnChanged", header: headerui.}
proc uiMultilineEntryReadOnly*(e: ptr UiMultilineEntry): cint {.cdecl,
importc: "uiMultilineEntryReadOnly", header: headerui.}
proc uiMultilineEntrySetReadOnly*(e: ptr UiMultilineEntry; readonly: cint) {.cdecl,
importc: "uiMultilineEntrySetReadOnly", header: headerui.}
proc uiNewMultilineEntry*(): ptr UiMultilineEntry {.cdecl,
importc: "uiNewMultilineEntry", header: headerui.}
proc uiNewNonWrappingMultilineEntry*(): ptr UiMultilineEntry {.cdecl,
importc: "uiNewNonWrappingMultilineEntry", header: headerui.}
type
UiMenuItem* = object
proc uiMenuItemEnable*(m: ptr UiMenuItem) {.cdecl, importc: "uiMenuItemEnable",
header: headerui.}
proc uiMenuItemDisable*(m: ptr UiMenuItem) {.cdecl, importc: "uiMenuItemDisable",
header: headerui.}
proc uiMenuItemOnClicked*(m: ptr UiMenuItem; f: proc (sender: ptr UiMenuItem;
window: ptr UiWindow; data: pointer) {.cdecl.}; data: pointer) {.cdecl,
importc: "uiMenuItemOnClicked", header: headerui.}
proc uiMenuItemChecked*(m: ptr UiMenuItem): cint {.cdecl,
importc: "uiMenuItemChecked", header: headerui.}
proc uiMenuItemSetChecked*(m: ptr UiMenuItem; checked: cint) {.cdecl,
importc: "uiMenuItemSetChecked", header: headerui.}
type
UiMenu* = object
proc uiMenuAppendItem*(m: ptr UiMenu; name: cstring): ptr UiMenuItem {.cdecl,
importc: "uiMenuAppendItem", header: headerui.}
proc uiMenuAppendCheckItem*(m: ptr UiMenu; name: cstring): ptr UiMenuItem {.cdecl,
importc: "uiMenuAppendCheckItem", header: headerui.}
proc uiMenuAppendQuitItem*(m: ptr UiMenu): ptr UiMenuItem {.cdecl,
importc: "uiMenuAppendQuitItem", header: headerui.}
proc uiMenuAppendPreferencesItem*(m: ptr UiMenu): ptr UiMenuItem {.cdecl,
importc: "uiMenuAppendPreferencesItem", header: headerui.}
proc uiMenuAppendAboutItem*(m: ptr UiMenu): ptr UiMenuItem {.cdecl,
importc: "uiMenuAppendAboutItem", header: headerui.}
proc uiMenuAppendSeparator*(m: ptr UiMenu) {.cdecl,
importc: "uiMenuAppendSeparator", header: headerui.}
proc uiNewMenu*(name: cstring): ptr UiMenu {.cdecl, importc: "uiNewMenu",
header: headerui.}
proc uiOpenFile*(parent: ptr UiWindow): cstring {.cdecl, importc: "uiOpenFile",
header: headerui.}
proc uiSaveFile*(parent: ptr UiWindow): cstring {.cdecl, importc: "uiSaveFile",
header: headerui.}
proc uiMsgBox*(parent: ptr UiWindow; title: cstring; description: cstring) {.cdecl,
importc: "uiMsgBox", header: headerui.}
proc uiMsgBoxError*(parent: ptr UiWindow; title: cstring; description: cstring) {.
cdecl, importc: "uiMsgBoxError", header: headerui.}
type
UiArea* = object
UiDrawContext* = object
UiModifiers* = object
UiAreaDrawParams* {.importc: "uiAreaDrawParams", header: headerui, bycopy.} = object
context* {.importc: "Context".}: ptr UiDrawContext
areaWidth* {.importc: "AreaWidth".}: cdouble
areaHeight* {.importc: "AreaHeight".}: cdouble
clipX* {.importc: "ClipX".}: cdouble
clipY* {.importc: "ClipY".}: cdouble
clipWidth* {.importc: "ClipWidth".}: cdouble
clipHeight* {.importc: "ClipHeight".}: cdouble
UiAreaMouseEvent* {.importc: "uiAreaMouseEvent", header: headerui, bycopy.} = object
x* {.importc: "X".}: cdouble
y* {.importc: "Y".}: cdouble
areaWidth* {.importc: "AreaWidth".}: cdouble
areaHeight* {.importc: "AreaHeight".}: cdouble
down* {.importc: "Down".}: cint
up* {.importc: "Up".}: cint
count* {.importc: "Count".}: cint
modifiers* {.importc: "Modifiers".}: UiModifiers
held1To64* {.importc: "Held1To64".}: uint64
UiExtKey* = object
UiAreaKeyEvent* {.importc: "uiAreaKeyEvent", header: headerui, bycopy.} = object
key* {.importc: "Key".}: char
extKey* {.importc: "ExtKey".}: UiExtKey
modifier* {.importc: "Modifier".}: UiModifiers
modifiers* {.importc: "Modifiers".}: UiModifiers
up* {.importc: "Up".}: cint
UiAreaHandler* {.importc: "uiAreaHandler", header: headerui, bycopy.} = object
draw* {.importc: "Draw".}: proc (a2: ptr UiAreaHandler; a3: ptr UiArea;
a4: ptr UiAreaDrawParams) {.cdecl.}
mouseEvent* {.importc: "MouseEvent".}: proc (a2: ptr UiAreaHandler; a3: ptr UiArea;
a4: ptr UiAreaMouseEvent) {.cdecl.}
mouseCrossed* {.importc: "MouseCrossed".}: proc (a2: ptr UiAreaHandler;
a3: ptr UiArea; left: cint) {.cdecl.}
dragBroken* {.importc: "DragBroken".}: proc (a2: ptr UiAreaHandler; a3: ptr UiArea) {.
cdecl.}
keyEvent* {.importc: "KeyEvent".}: proc (a2: ptr UiAreaHandler; a3: ptr UiArea;
a4: ptr UiAreaKeyEvent): cint {.cdecl.}
UiWindowResizeEdge* = object
const
uiWindowResizeEdgeLeft* = 0
uiWindowResizeEdgeTop* = 1
uiWindowResizeEdgeRight* = 2
uiWindowResizeEdgeBottom* = 3
uiWindowResizeEdgeTopLeft* = 4
uiWindowResizeEdgeTopRight* = 5
uiWindowResizeEdgeBottomLeft* = 6
uiWindowResizeEdgeBottomRight* = 7
proc uiAreaSetSize*(a: ptr UiArea; width: cint; height: cint) {.cdecl,
importc: "uiAreaSetSize", header: headerui.}
proc uiAreaQueueRedrawAll*(a: ptr UiArea) {.cdecl, importc: "uiAreaQueueRedrawAll",
header: headerui.}
proc uiAreaScrollTo*(a: ptr UiArea; x: cdouble; y: cdouble; width: cdouble;
height: cdouble) {.cdecl, importc: "uiAreaScrollTo",
header: headerui.}
proc uiAreaBeginUserWindowMove*(a: ptr UiArea) {.cdecl,
importc: "uiAreaBeginUserWindowMove", header: headerui.}
proc uiAreaBeginUserWindowResize*(a: ptr UiArea; edge: UiWindowResizeEdge) {.cdecl,
importc: "uiAreaBeginUserWindowResize", header: headerui.}
proc uiNewArea*(ah: ptr UiAreaHandler): ptr UiArea {.cdecl, importc: "uiNewArea",
header: headerui.}
proc uiNewScrollingArea*(ah: ptr UiAreaHandler; width: cint; height: cint): ptr UiArea {.
cdecl, importc: "uiNewScrollingArea", header: headerui.}
type
UiDrawPath* = object
UiDrawBrushType* = object
const
uiDrawBrushTypeSolid* = 0
uiDrawBrushTypeLinearGradient* = 1
uiDrawBrushTypeRadialGradient* = 2
uiDrawBrushTypeImage* = 3
type
UiDrawLineCap* = object
const
uiDrawLineCapFlat* = 0
uiDrawLineCapRound* = 1
uiDrawLineCapSquare* = 2
type
UiDrawLineJoin* = object
const
uiDrawLineJoinMiter* = 0
uiDrawLineJoinRound* = 1
uiDrawLineJoinBevel* = 2
type
UiDrawFillMode* = object
const
uiDrawFillModeWinding* = 0
uiDrawFillModeAlternate* = 1
type
UiDrawMatrix* {.importc: "uiDrawMatrix", header: headerui, bycopy.} = object
m11* {.importc: "M11".}: cdouble
m12* {.importc: "M12".}: cdouble
m21* {.importc: "M21".}: cdouble
m22* {.importc: "M22".}: cdouble
m31* {.importc: "M31".}: cdouble
m32* {.importc: "M32".}: cdouble
UiDrawBrush* {.importc: "uiDrawBrush", header: headerui, bycopy.} = object
`type`* {.importc: "Type".}: UiDrawBrushType
r* {.importc: "R".}: cdouble
g* {.importc: "G".}: cdouble
b* {.importc: "B".}: cdouble
a* {.importc: "A".}: cdouble
x0* {.importc: "X0".}: cdouble
y0* {.importc: "Y0".}: cdouble
x1* {.importc: "X1".}: cdouble
y1* {.importc: "Y1".}: cdouble
outerRadius* {.importc: "OuterRadius".}: cdouble
stops* {.importc: "Stops".}: ptr UiDrawBrushGradientStop
numStops* {.importc: "NumStops".}: csize
UiDrawBrushGradientStop* {.importc: "uiDrawBrushGradientStop", header: headerui,
bycopy.} = object
pos* {.importc: "Pos".}: cdouble
r* {.importc: "R".}: cdouble
g* {.importc: "G".}: cdouble
b* {.importc: "B".}: cdouble
a* {.importc: "A".}: cdouble
UiDrawStrokeParams* {.importc: "uiDrawStrokeParams", header: headerui, bycopy.} = object
cap* {.importc: "Cap".}: UiDrawLineCap
join* {.importc: "Join".}: UiDrawLineJoin
thickness* {.importc: "Thickness".}: cdouble
miterLimit* {.importc: "MiterLimit".}: cdouble
dashes* {.importc: "Dashes".}: ptr cdouble
numDashes* {.importc: "NumDashes".}: csize
dashPhase* {.importc: "DashPhase".}: cdouble
proc uiDrawNewPath*(fillMode: UiDrawFillMode): ptr UiDrawPath {.cdecl,
importc: "uiDrawNewPath", header: headerui.}
proc uiDrawFreePath*(p: ptr UiDrawPath) {.cdecl, importc: "uiDrawFreePath",
header: headerui.}
proc uiDrawPathNewFigure*(p: ptr UiDrawPath; x: cdouble; y: cdouble) {.cdecl,
importc: "uiDrawPathNewFigure", header: headerui.}
proc uiDrawPathNewFigureWithArc*(p: ptr UiDrawPath; xCenter: cdouble;
yCenter: cdouble; radius: cdouble;
startAngle: cdouble; sweep: cdouble; negative: cint) {.
cdecl, importc: "uiDrawPathNewFigureWithArc", header: headerui.}
proc uiDrawPathLineTo*(p: ptr UiDrawPath; x: cdouble; y: cdouble) {.cdecl,
importc: "uiDrawPathLineTo", header: headerui.}
proc uiDrawPathArcTo*(p: ptr UiDrawPath; xCenter: cdouble; yCenter: cdouble;
radius: cdouble; startAngle: cdouble; sweep: cdouble;
negative: cint) {.cdecl, importc: "uiDrawPathArcTo",
header: headerui.}
proc uiDrawPathBezierTo*(p: ptr UiDrawPath; c1x: cdouble; c1y: cdouble; c2x: cdouble;
c2y: cdouble; endX: cdouble; endY: cdouble) {.cdecl,
importc: "uiDrawPathBezierTo", header: headerui.}
proc uiDrawPathCloseFigure*(p: ptr UiDrawPath) {.cdecl,
importc: "uiDrawPathCloseFigure", header: headerui.}
proc uiDrawPathAddRectangle*(p: ptr UiDrawPath; x: cdouble; y: cdouble; width: cdouble;
height: cdouble) {.cdecl,
importc: "uiDrawPathAddRectangle", header: headerui.}
proc uiDrawPathEnd*(p: ptr UiDrawPath) {.cdecl, importc: "uiDrawPathEnd",
header: headerui.}
proc uiDrawStroke*(c: ptr UiDrawContext; path: ptr UiDrawPath; b: ptr UiDrawBrush;
p: ptr UiDrawStrokeParams) {.cdecl, importc: "uiDrawStroke",
header: headerui.}
proc uiDrawFill*(c: ptr UiDrawContext; path: ptr UiDrawPath; b: ptr UiDrawBrush) {.
cdecl, importc: "uiDrawFill", header: headerui.}
proc uiDrawMatrixSetIdentity*(m: ptr UiDrawMatrix) {.cdecl,
importc: "uiDrawMatrixSetIdentity", header: headerui.}
proc uiDrawMatrixTranslate*(m: ptr UiDrawMatrix; x: cdouble; y: cdouble) {.cdecl,
importc: "uiDrawMatrixTranslate", header: headerui.}
proc uiDrawMatrixScale*(m: ptr UiDrawMatrix; xCenter: cdouble; yCenter: cdouble;
x: cdouble; y: cdouble) {.cdecl,
importc: "uiDrawMatrixScale", header: headerui.}
proc uiDrawMatrixRotate*(m: ptr UiDrawMatrix; x: cdouble; y: cdouble; amount: cdouble) {.
cdecl, importc: "uiDrawMatrixRotate", header: headerui.}
proc uiDrawMatrixSkew*(m: ptr UiDrawMatrix; x: cdouble; y: cdouble; xamount: cdouble;
yamount: cdouble) {.cdecl, importc: "uiDrawMatrixSkew",
header: headerui.}
proc uiDrawMatrixMultiply*(dest: ptr UiDrawMatrix; src: ptr UiDrawMatrix) {.cdecl,
importc: "uiDrawMatrixMultiply", header: headerui.}
proc uiDrawMatrixInvertible*(m: ptr UiDrawMatrix): cint {.cdecl,
importc: "uiDrawMatrixInvertible", header: headerui.}
proc uiDrawMatrixInvert*(m: ptr UiDrawMatrix): cint {.cdecl,
importc: "uiDrawMatrixInvert", header: headerui.}
proc uiDrawMatrixTransformPoint*(m: ptr UiDrawMatrix; x: ptr cdouble; y: ptr cdouble) {.
cdecl, importc: "uiDrawMatrixTransformPoint", header: headerui.}
proc uiDrawMatrixTransformSize*(m: ptr UiDrawMatrix; x: ptr cdouble; y: ptr cdouble) {.
cdecl, importc: "uiDrawMatrixTransformSize", header: headerui.}
proc uiDrawTransform*(c: ptr UiDrawContext; m: ptr UiDrawMatrix) {.cdecl,
importc: "uiDrawTransform", header: headerui.}
proc uiDrawClip*(c: ptr UiDrawContext; path: ptr UiDrawPath) {.cdecl,
importc: "uiDrawClip", header: headerui.}
proc uiDrawSave*(c: ptr UiDrawContext) {.cdecl, importc: "uiDrawSave",
header: headerui.}
proc uiDrawRestore*(c: ptr UiDrawContext) {.cdecl, importc: "uiDrawRestore",
header: headerui.}
type
UiAttribute* = object
proc uiFreeAttribute*(a: ptr UiAttribute) {.cdecl, importc: "uiFreeAttribute",
header: headerui.}
type
UiAttributeType* = object
const
uiAttributeTypeFamily* = 0
uiAttributeTypeSize* = 1
uiAttributeTypeWeight* = 2
uiAttributeTypeItalic* = 3
uiAttributeTypeStretch* = 4
uiAttributeTypeColor* = 5
uiAttributeTypeBackground* = 6
uiAttributeTypeUnderline* = 7
uiAttributeTypeUnderlineColor* = 8
uiAttributeTypeFeatures* = 9
proc uiAttributeGetType*(a: ptr UiAttribute): UiAttributeType {.cdecl,
importc: "uiAttributeGetType", header: headerui.}
proc uiNewFamilyAttribute*(family: cstring): ptr UiAttribute {.cdecl,
importc: "uiNewFamilyAttribute", header: headerui.}
proc uiAttributeFamily*(a: ptr UiAttribute): cstring {.cdecl,
importc: "uiAttributeFamily", header: headerui.}
proc uiNewSizeAttribute*(size: cdouble): ptr UiAttribute {.cdecl,
importc: "uiNewSizeAttribute", header: headerui.}
proc uiAttributeSize*(a: ptr UiAttribute): cdouble {.cdecl,
importc: "uiAttributeSize", header: headerui.}
type
UiTextWeight* = object
const
uiTextWeightMinimum* = 0
uiTextWeightThin* = 100
uiTextWeightUltraLight* = 200
uiTextWeightLight* = 300
uiTextWeightBook* = 350
uiTextWeightNormal* = 400
uiTextWeightMedium* = 500
uiTextWeightSemiBold* = 600
uiTextWeightBold* = 700
uiTextWeightUltraBold* = 800
uiTextWeightHeavy* = 900
uiTextWeightUltraHeavy* = 950
uiTextWeightMaximum* = 1000
proc uiNewWeightAttribute*(weight: UiTextWeight): ptr UiAttribute {.cdecl,
importc: "uiNewWeightAttribute", header: headerui.}
proc uiAttributeWeight*(a: ptr UiAttribute): UiTextWeight {.cdecl,
importc: "uiAttributeWeight", header: headerui.}
type
UiTextItalic* = object
const
uiTextItalicNormal* = 0
uiTextItalicOblique* = 1
uiTextItalicItalic* = 2
proc uiNewItalicAttribute*(italic: UiTextItalic): ptr UiAttribute {.cdecl,
importc: "uiNewItalicAttribute", header: headerui.}
proc uiAttributeItalic*(a: ptr UiAttribute): UiTextItalic {.cdecl,
importc: "uiAttributeItalic", header: headerui.}
type
UiTextStretch* = object
const
uiTextStretchUltraCondensed* = 0
uiTextStretchExtraCondensed* = 1
uiTextStretchCondensed* = 2
uiTextStretchSemiCondensed* = 3
uiTextStretchNormal* = 4
uiTextStretchSemiExpanded* = 5
uiTextStretchExpanded* = 6
uiTextStretchExtraExpanded* = 7
uiTextStretchUltraExpanded* = 8
proc uiNewStretchAttribute*(stretch: UiTextStretch): ptr UiAttribute {.cdecl,
importc: "uiNewStretchAttribute", header: headerui.}
proc uiAttributeStretch*(a: ptr UiAttribute): UiTextStretch {.cdecl,
importc: "uiAttributeStretch", header: headerui.}
proc uiNewColorAttribute*(r: cdouble; g: cdouble; b: cdouble; a: cdouble): ptr UiAttribute {.
cdecl, importc: "uiNewColorAttribute", header: headerui.}
proc uiAttributeColor*(a: ptr UiAttribute; r: ptr cdouble; g: ptr cdouble; b: ptr cdouble;
alpha: ptr cdouble) {.cdecl, importc: "uiAttributeColor",
header: headerui.}
proc uiNewBackgroundAttribute*(r: cdouble; g: cdouble; b: cdouble; a: cdouble): ptr UiAttribute {.
cdecl, importc: "uiNewBackgroundAttribute", header: headerui.}
type
UiUnderline* = object
const
uiUnderlineNone* = 0
uiUnderlineSingle* = 1
uiUnderlineDouble* = 2
uiUnderlineSuggestion* = 3
proc uiNewUnderlineAttribute*(u: UiUnderline): ptr UiAttribute {.cdecl,
importc: "uiNewUnderlineAttribute", header: headerui.}
proc uiAttributeUnderline*(a: ptr UiAttribute): UiUnderline {.cdecl,
importc: "uiAttributeUnderline", header: headerui.}
type
UiUnderlineColor* = object
const
uiUnderlineColorCustom* = 0
uiUnderlineColorSpelling* = 1
uiUnderlineColorGrammar* = 2
uiUnderlineColorAuxiliary* = 3
proc uiNewUnderlineColorAttribute*(u: UiUnderlineColor; r: cdouble; g: cdouble;
b: cdouble; a: cdouble): ptr UiAttribute {.cdecl,
importc: "uiNewUnderlineColorAttribute", header: headerui.}
proc uiAttributeUnderlineColor*(a: ptr UiAttribute; u: ptr UiUnderlineColor;
r: ptr cdouble; g: ptr cdouble; b: ptr cdouble;
alpha: ptr cdouble) {.cdecl,
importc: "uiAttributeUnderlineColor", header: headerui.}
type
UiOpenTypeFeatures* = object
UiOpenTypeFeaturesForEachFunc* = proc (otf: ptr UiOpenTypeFeatures; a: char; b: char;
c: char; d: char; value: uint32; data: pointer): UiForEach {.
cdecl.}
proc uiNewOpenTypeFeatures*(): ptr UiOpenTypeFeatures {.cdecl,
importc: "uiNewOpenTypeFeatures", header: headerui.}
proc uiFreeOpenTypeFeatures*(otf: ptr UiOpenTypeFeatures) {.cdecl,
importc: "uiFreeOpenTypeFeatures", header: headerui.}
proc uiOpenTypeFeaturesClone*(otf: ptr UiOpenTypeFeatures): ptr UiOpenTypeFeatures {.
cdecl, importc: "uiOpenTypeFeaturesClone", header: headerui.}
proc uiOpenTypeFeaturesAdd*(otf: ptr UiOpenTypeFeatures; a: char; b: char; c: char;
d: char; value: uint32) {.cdecl,
importc: "uiOpenTypeFeaturesAdd", header: headerui.}
proc uiOpenTypeFeaturesRemove*(otf: ptr UiOpenTypeFeatures; a: char; b: char; c: char;
d: char) {.cdecl,
importc: "uiOpenTypeFeaturesRemove",
header: headerui.}
proc uiOpenTypeFeaturesGet*(otf: ptr UiOpenTypeFeatures; a: char; b: char; c: char;
d: char; value: ptr uint32): cint {.cdecl,
importc: "uiOpenTypeFeaturesGet", header: headerui.}
proc uiOpenTypeFeaturesForEach*(otf: ptr UiOpenTypeFeatures;
f: UiOpenTypeFeaturesForEachFunc; data: pointer) {.
cdecl, importc: "uiOpenTypeFeaturesForEach", header: headerui.}
proc uiNewFeaturesAttribute*(otf: ptr UiOpenTypeFeatures): ptr UiAttribute {.cdecl,
importc: "uiNewFeaturesAttribute", header: headerui.}
proc uiAttributeFeatures*(a: ptr UiAttribute): ptr UiOpenTypeFeatures {.cdecl,
importc: "uiAttributeFeatures", header: headerui.}
type
UiAttributedString* = object
UiAttributedStringForEachAttributeFunc* = proc (s: ptr UiAttributedString;
a: ptr UiAttribute; start: csize; `end`: csize; data: pointer): UiForEach {.cdecl.}
proc uiNewAttributedString*(initialString: cstring): ptr UiAttributedString {.
cdecl, importc: "uiNewAttributedString", header: headerui.}
proc uiFreeAttributedString*(s: ptr UiAttributedString) {.cdecl,
importc: "uiFreeAttributedString", header: headerui.}
proc uiAttributedStringString*(s: ptr UiAttributedString): cstring {.cdecl,
importc: "uiAttributedStringString", header: headerui.}
proc uiAttributedStringLen*(s: ptr UiAttributedString): csize {.cdecl,
importc: "uiAttributedStringLen", header: headerui.}
proc uiAttributedStringAppendUnattributed*(s: ptr UiAttributedString; str: cstring) {.
cdecl, importc: "uiAttributedStringAppendUnattributed", header: headerui.}
proc uiAttributedStringInsertAtUnattributed*(s: ptr UiAttributedString;
str: cstring; at: csize) {.cdecl,
importc: "uiAttributedStringInsertAtUnattributed",
header: headerui.}
proc uiAttributedStringDelete*(s: ptr UiAttributedString; start: csize; `end`: csize) {.
cdecl, importc: "uiAttributedStringDelete", header: headerui.}
proc uiAttributedStringSetAttribute*(s: ptr UiAttributedString; a: ptr UiAttribute;
start: csize; `end`: csize) {.cdecl,
importc: "uiAttributedStringSetAttribute", header: headerui.}
proc uiAttributedStringForEachAttribute*(s: ptr UiAttributedString; f: UiAttributedStringForEachAttributeFunc;
data: pointer) {.cdecl,
importc: "uiAttributedStringForEachAttribute", header: headerui.}
proc uiAttributedStringNumGraphemes*(s: ptr UiAttributedString): csize {.cdecl,
importc: "uiAttributedStringNumGraphemes", header: headerui.}
proc uiAttributedStringByteIndexToGrapheme*(s: ptr UiAttributedString; pos: csize): csize {.
cdecl, importc: "uiAttributedStringByteIndexToGrapheme", header: headerui.}
proc uiAttributedStringGraphemeToByteIndex*(s: ptr UiAttributedString; pos: csize): csize {.
cdecl, importc: "uiAttributedStringGraphemeToByteIndex", header: headerui.}
type
UiFontDescriptor* {.importc: "uiFontDescriptor", header: headerui, bycopy.} = object
family* {.importc: "Family".}: cstring
size* {.importc: "Size".}: cdouble
weight* {.importc: "Weight".}: UiTextWeight
italic* {.importc: "Italic".}: UiTextItalic
stretch* {.importc: "Stretch".}: UiTextStretch
UiDrawTextLayout* = object
UiDrawTextAlign* = object
const
uiDrawTextAlignLeft* = 0
uiDrawTextAlignCenter* = 1
uiDrawTextAlignRight* = 2
type
UiDrawTextLayoutParams* {.importc: "uiDrawTextLayoutParams", header: headerui,
bycopy.} = object
string* {.importc: "String".}: ptr UiAttributedString
defaultFont* {.importc: "DefaultFont".}: ptr UiFontDescriptor
width* {.importc: "Width".}: cdouble
align* {.importc: "Align".}: UiDrawTextAlign
proc uiDrawNewTextLayout*(params: ptr UiDrawTextLayoutParams): ptr UiDrawTextLayout {.
cdecl, importc: "uiDrawNewTextLayout", header: headerui.}
proc uiDrawFreeTextLayout*(tl: ptr UiDrawTextLayout) {.cdecl,
importc: "uiDrawFreeTextLayout", header: headerui.}
proc uiDrawText*(c: ptr UiDrawContext; tl: ptr UiDrawTextLayout; x: cdouble; y: cdouble) {.
cdecl, importc: "uiDrawText", header: headerui.}
proc uiDrawTextLayoutExtents*(tl: ptr UiDrawTextLayout; width: ptr cdouble;
height: ptr cdouble) {.cdecl,
importc: "uiDrawTextLayoutExtents", header: headerui.}
type
UiFontButton* = object
proc uiFontButtonFont*(b: ptr UiFontButton; desc: ptr UiFontDescriptor) {.cdecl,
importc: "uiFontButtonFont", header: headerui.}
proc uiFontButtonOnChanged*(b: ptr UiFontButton; f: proc (a2: ptr UiFontButton;
a3: pointer) {.cdecl.}; data: pointer) {.cdecl,
importc: "uiFontButtonOnChanged", header: headerui.}
proc uiNewFontButton*(): ptr UiFontButton {.cdecl, importc: "uiNewFontButton",
header: headerui.}
proc uiFreeFontButtonFont*(desc: ptr UiFontDescriptor) {.cdecl,
importc: "uiFreeFontButtonFont", header: headerui.}
const
uiModifierCtrl* = 1 shl 0
uiModifierAlt* = 1 shl 1
uiModifierShift* = 1 shl 2
uiModifierSuper* = 1 shl 3
const
uiExtKeyEscape* = 1
uiExtKeyInsert* = 2
uiExtKeyDelete* = 3
uiExtKeyHome* = 4
uiExtKeyEnd* = 5
uiExtKeyPageUp* = 6
uiExtKeyPageDown* = 7
uiExtKeyUp* = 8
uiExtKeyDown* = 9
uiExtKeyLeft* = 10
uiExtKeyRight* = 11
uiExtKeyF1* = 12
uiExtKeyF2* = 13
uiExtKeyF3* = 14
uiExtKeyF4* = 15
uiExtKeyF5* = 16
uiExtKeyF6* = 17
uiExtKeyF7* = 18
uiExtKeyF8* = 19
uiExtKeyF9* = 20
uiExtKeyF10* = 21
uiExtKeyF11* = 22
uiExtKeyF12* = 23
uiExtKeyN0* = 24
uiExtKeyN1* = 25
uiExtKeyN2* = 26
uiExtKeyN3* = 27
uiExtKeyN4* = 28
uiExtKeyN5* = 29
uiExtKeyN6* = 30
uiExtKeyN7* = 31
uiExtKeyN8* = 32
uiExtKeyN9* = 33
uiExtKeyNDot* = 34
uiExtKeyNEnter* = 35
uiExtKeyNAdd* = 36
uiExtKeyNSubtract* = 37
uiExtKeyNMultiply* = 38
uiExtKeyNDivide* = 39
type
UiColorButton* = object
proc uiColorButtonColor*(b: ptr UiColorButton; r: ptr cdouble; g: ptr cdouble;
bl: ptr cdouble; a: ptr cdouble) {.cdecl,
importc: "uiColorButtonColor", header: headerui.}
proc uiColorButtonSetColor*(b: ptr UiColorButton; r: cdouble; g: cdouble; bl: cdouble;
a: cdouble) {.cdecl, importc: "uiColorButtonSetColor",
header: headerui.}
proc uiColorButtonOnChanged*(b: ptr UiColorButton; f: proc (a2: ptr UiColorButton;
a3: pointer) {.cdecl.}; data: pointer) {.cdecl,
importc: "uiColorButtonOnChanged", header: headerui.}
proc uiNewColorButton*(): ptr UiColorButton {.cdecl, importc: "uiNewColorButton",
header: headerui.}
type
UiForm* = object
proc uiFormAppend*(f: ptr UiForm; label: cstring; c: ptr UiControl; stretchy: cint) {.
cdecl, importc: "uiFormAppend", header: headerui.}
proc uiFormDelete*(f: ptr UiForm; index: cint) {.cdecl, importc: "uiFormDelete",
header: headerui.}
proc uiFormPadded*(f: ptr UiForm): cint {.cdecl, importc: "uiFormPadded",
header: headerui.}
proc uiFormSetPadded*(f: ptr UiForm; padded: cint) {.cdecl,
importc: "uiFormSetPadded", header: headerui.}
proc uiNewForm*(): ptr UiForm {.cdecl, importc: "uiNewForm", header: headerui.}
type
UiAlign* = object
const
uiAlignFill* = 0
uiAlignStart* = 1
uiAlignCenter* = 2
uiAlignEnd* = 3
type
UiAt* = object
const
uiAtLeading* = 0
uiAtTop* = 1
uiAtTrailing* = 2
uiAtBottom* = 3
type
UiGrid* = object
proc uiGridAppend*(g: ptr UiGrid; c: ptr UiControl; left: cint; top: cint; xspan: cint;
yspan: cint; hexpand: cint; halign: UiAlign; vexpand: cint;
valign: UiAlign) {.cdecl, importc: "uiGridAppend",
header: headerui.}
proc uiGridInsertAt*(g: ptr UiGrid; c: ptr UiControl; existing: ptr UiControl; at: UiAt;
xspan: cint; yspan: cint; hexpand: cint; halign: UiAlign;
vexpand: cint; valign: UiAlign) {.cdecl,
importc: "uiGridInsertAt", header: headerui.}
proc uiGridPadded*(g: ptr UiGrid): cint {.cdecl, importc: "uiGridPadded",
header: headerui.}
proc uiGridSetPadded*(g: ptr UiGrid; padded: cint) {.cdecl,
importc: "uiGridSetPadded", header: headerui.}
proc uiNewGrid*(): ptr UiGrid {.cdecl, importc: "uiNewGrid", header: headerui.}
type
UiImage* = object
proc uiNewImage*(width: cdouble; height: cdouble): ptr UiImage {.cdecl,
importc: "uiNewImage", header: headerui.}
proc uiFreeImage*(i: ptr UiImage) {.cdecl, importc: "uiFreeImage", header: headerui.}
proc uiImageAppend*(i: ptr UiImage; pixels: pointer; pixelWidth: cint;
pixelHeight: cint; byteStride: cint) {.cdecl,
importc: "uiImageAppend", header: headerui.}
type
UiTableValue* = object
proc uiFreeTableValue*(v: ptr UiTableValue) {.cdecl, importc: "uiFreeTableValue",
header: headerui.}
type
UiTableValueType* = object
const
uiTableValueTypeString* = 0
uiTableValueTypeImage* = 1
uiTableValueTypeInt* = 2
uiTableValueTypeColor* = 3
proc uiTableValueGetType*(v: ptr UiTableValue): UiTableValueType {.cdecl,
importc: "uiTableValueGetType", header: headerui.}
proc uiNewTableValueString*(str: cstring): ptr UiTableValue {.cdecl,
importc: "uiNewTableValueString", header: headerui.}
proc uiTableValueString*(v: ptr UiTableValue): cstring {.cdecl,
importc: "uiTableValueString", header: headerui.}
proc uiNewTableValueImage*(img: ptr UiImage): ptr UiTableValue {.cdecl,
importc: "uiNewTableValueImage", header: headerui.}
proc uiTableValueImage*(v: ptr UiTableValue): ptr UiImage {.cdecl,
importc: "uiTableValueImage", header: headerui.}
proc uiNewTableValueInt*(i: cint): ptr UiTableValue {.cdecl,
importc: "uiNewTableValueInt", header: headerui.}
proc uiTableValueInt*(v: ptr UiTableValue): cint {.cdecl,
importc: "uiTableValueInt", header: headerui.}
proc uiNewTableValueColor*(r: cdouble; g: cdouble; b: cdouble; a: cdouble): ptr UiTableValue {.
cdecl, importc: "uiNewTableValueColor", header: headerui.}
proc uiTableValueColor*(v: ptr UiTableValue; r: ptr cdouble; g: ptr cdouble;
b: ptr cdouble; a: ptr cdouble) {.cdecl,
importc: "uiTableValueColor", header: headerui.}
type
UiTableModel* = object
UiTableModelHandler* {.importc: "uiTableModelHandler", header: headerui, bycopy.} = object
numColumns* {.importc: "NumColumns".}: proc (a2: ptr UiTableModelHandler;
a3: ptr UiTableModel): cint {.cdecl.}
columnType* {.importc: "ColumnType".}: proc (a2: ptr UiTableModelHandler;
a3: ptr UiTableModel; a4: cint): UiTableValueType {.cdecl.}
numRows* {.importc: "NumRows".}: proc (a2: ptr UiTableModelHandler;
a3: ptr UiTableModel): cint {.cdecl.}
cellValue* {.importc: "CellValue".}: proc (mh: ptr UiTableModelHandler;
m: ptr UiTableModel; row: cint; column: cint): ptr UiTableValue {.cdecl.}
setCellValue* {.importc: "SetCellValue".}: proc (a2: ptr UiTableModelHandler;
a3: ptr UiTableModel; a4: cint; a5: cint; a6: ptr UiTableValue) {.cdecl.}
proc uiNewTableModel*(mh: ptr UiTableModelHandler): ptr UiTableModel {.cdecl,
importc: "uiNewTableModel", header: headerui.}
proc uiFreeTableModel*(m: ptr UiTableModel) {.cdecl, importc: "uiFreeTableModel",
header: headerui.}
proc uiTableModelRowInserted*(m: ptr UiTableModel; newIndex: cint) {.cdecl,
importc: "uiTableModelRowInserted", header: headerui.}
proc uiTableModelRowChanged*(m: ptr UiTableModel; index: cint) {.cdecl,
importc: "uiTableModelRowChanged", header: headerui.}
proc uiTableModelRowDeleted*(m: ptr UiTableModel; oldIndex: cint) {.cdecl,
importc: "uiTableModelRowDeleted", header: headerui.}
type
UiTableTextColumnOptionalParams* {.importc: "uiTableTextColumnOptionalParams",
header: headerui, bycopy.} = object
colorModelColumn* {.importc: "ColorModelColumn".}: cint
UiTableParams* {.importc: "uiTableParams", header: headerui, bycopy.} = object
model* {.importc: "Model".}: ptr UiTableModel
rowBackgroundColorModelColumn* {.importc: "RowBackgroundColorModelColumn".}: cint
UiTable* = object
proc uiTableAppendTextColumn*(t: ptr UiTable; name: cstring; textModelColumn: cint;
textEditableModelColumn: cint;
textParams: ptr UiTableTextColumnOptionalParams) {.
cdecl, importc: "uiTableAppendTextColumn", header: headerui.}
proc uiTableAppendImageColumn*(t: ptr UiTable; name: cstring; imageModelColumn: cint) {.
cdecl, importc: "uiTableAppendImageColumn", header: headerui.}
proc uiTableAppendImageTextColumn*(t: ptr UiTable; name: cstring;
imageModelColumn: cint; textModelColumn: cint;
textEditableModelColumn: cint; textParams: ptr UiTableTextColumnOptionalParams) {.
cdecl, importc: "uiTableAppendImageTextColumn", header: headerui.}
proc uiTableAppendCheckboxColumn*(t: ptr UiTable; name: cstring;
checkboxModelColumn: cint;
checkboxEditableModelColumn: cint) {.cdecl,
importc: "uiTableAppendCheckboxColumn", header: headerui.}
proc uiTableAppendCheckboxTextColumn*(t: ptr UiTable; name: cstring;
checkboxModelColumn: cint;
checkboxEditableModelColumn: cint;
textModelColumn: cint;
textEditableModelColumn: cint; textParams: ptr UiTableTextColumnOptionalParams) {.
cdecl, importc: "uiTableAppendCheckboxTextColumn", header: headerui.}
proc uiTableAppendProgressBarColumn*(t: ptr UiTable; name: cstring;
progressModelColumn: cint) {.cdecl,
importc: "uiTableAppendProgressBarColumn", header: headerui.}
proc uiTableAppendButtonColumn*(t: ptr UiTable; name: cstring;
buttonModelColumn: cint;
buttonClickableModelColumn: cint) {.cdecl,
importc: "uiTableAppendButtonColumn", header: headerui.}
proc uiNewTable*(params: ptr UiTableParams): ptr UiTable {.cdecl,
importc: "uiNewTable", header: headerui.}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment