#pragma once
#include "../ui/toolkit.h"
#include <queue>
#include <mutex>
#include <condition_variable>
typedef struct UiJob {
UiObject* obj;
ui_threadfunc job_func;
void* job_data;
ui_callback finish_callback;
void* finish_data;
} UiJob;
struct UiThreadpool
{
std::queue<UiJob*> queue;
std::mutex mutex;
std::condition_variable condition;
UiThreadpool(
int nthreads);
void EnqueueJob(UiJob* job);
UiJob* GetJob();
};
typedef void(*ui_eventfunc)(
void*,
void*);
void ui_app_run_startup();
extern "C" void destroy_ui_window_wrapper(
void* ptr);
extern "C" void destroy_ui_widget_wrapper(
void* ptr);
void ui_context_add_window_destructor(UiContext* ctx, UiWindow* win);
void ui_context_add_widget_destructor(UiContext* ctx, UiWidget* widget);
void ui_context_add_container_destructor(UiContext* ctx, UiContainer *container);
UiEvent ui_create_int_event(UiObject* obj,
int64_t i);
void ui_set_widget_groups(UiContext *ctx,
UIWIDGET widget,
const int *groups);
void ui_set_widget_ngroups(UiContext *ctx,
UIWIDGET widget,
const int *groups,
size_t ngroups);