Home

Awesome

libui-euphoria

libui bindings for Euphoria

Status

This wrapper should be stable but keep in mind that libui is still in alpha status.

History

February 22, 2018

December 9, 2016

June 17, 2016

June 13, 2016

June 9, 2016

June 8, 2016

June 7, 2016

June 6, 2016

Notes

Wrapper Style

A keen observer might notice the seemingly unorthodox C wrapper code used in ui.e. What I've done here, is use a map to provide string lookups for function names instead of using constants. This is an experiment in providing a cleaner C library wrapper. The calls to define_c_func/proc look a lot more like attributes used in C# or VB.NET. I have not compared this method to using constants, so I'm not sure if or by how much this might be slower.

Original Code

constant _uiNewWindow = define_c_func( libui, "uiNewWindow", {C_POINTER,C_INT,C_INT,C_INT}, C_POINTER )
public function uiNewWindow( sequence title, atom width, atom height, atom hasMenubar )
    return c_func( _uiNewWindow, {allocate_string(title,1),width,height,hasMenubar} )
end function

Wrapper Code

define_c_func( libui, "uiNewWindow", {C_POINTER,C_INT,C_INT,C_INT}, C_POINTER )
public function uiNewWindow( sequence title, atom width, atom height, atom hasMenubar )
    return c_func( "uiNewWindow", {allocate_string(title,1),width,height,hasMenubar} )
end function