FixGUI Documentation

Back to summary

C API

Types

typedef Script *(*WorkerLoadFunc)(Heap **heap, const char *fname, Value *error, void *data);
Callback to create a heap for a new worker thread with given script name.
typedef void (*MainThreadFunc)(Heap *heap, void *data);
Used for running native code on the main GUI thread.

Functions

void fixgui_register_functions(Heap *heap, WorkerLoadFunc load_func, void *load_data);
Registers GUI functions to given heap.
void fixgui_register_worker_functions(Heap *heap);
Registers worker functions to given heap (used for worker heaps).
void fixgui_run_in_main_thread(MainThreadFunc func, void *data);
Runs the given callback in the main GUI thread.
void fixgui_init_virtual(Heap *heap, LoadScriptFunc func, void *data);
Used to initialize the scripts for "virtual" targets that don't use the native widgets (such as web).
void fixgui_integrate_io_event_loop(Heap *heap);
Integrates the FixIO event loop with the GUI event loop.

Entry points

The application must provide these global functions to start the program instead of the regular main function.

int app_main(int argc, char **argv);
Provides an entry point for the GUI application.
int console_main(int argc, char **argv);
Provides a fallback entry point on platforms where GUI may not be available.