<commit_before>#pragma once

#ifdef __cplusplus
extern "C" {
#endif

#define GU_EVENT_RELEASED "2released()"

typedef struct GUObject {
	// private data
	void* p;
	int (*connect)(void* sender, const char* id, void* reciver, void* func);
	//int (*connect_event)(void* recvier, const char* id, void* reciver, void* func);
} GUObject;

typedef struct GUWidget {
	GUObject* o;
	void (*set_size)(struct GUWidget* widget, int width, int height);
} GUWidget;

typedef struct GUWindow {
	GUWidget* base;
} GUIWindow;

typedef struct GUPushButton {
	GUWidget* base;
	void (*set_default)(struct GUPushButton* button, int state);
} GUPushButton;

typedef struct GUApplication {
	// private data
	void* p;
	int (*run)(void* p);
} GUApplication;

typedef struct Wrui {
	GUApplication* (*application_create)();
	GUIWindow* (*window_create)();
	GUPushButton* (*push_button_create)(const char* label);
} Wrui;

// Windowing

#define gu_create_window(funcs) funs->create_window()

// Generic window stuff

#define gu_set_size(widget, x, y) widget->base->set_size(widget->base, x, y)
#define gu_set_parent(widget, parent) widget->base->set_parent(widget->base, widget->base)
#define gu_push_button_crate(funcs, label) funcs->push_button_create(label)

// Connection API

#define gu_connect(widget, id, data, func) widget->base->o->connect(widget->base->o, id, data, (void*)func)

// Application

#define gu_application_crate(api) api->application_create()
#define gu_application_run(app) app->run(app->p)

// Should be the only exported symbol

extern Wrui* wrui_get();

#ifdef __cplusplus
}
#endif
<commit_msg>WIP<commit_after>#pragma once

#ifdef __cplusplus
extern "C" {
#endif

#define GU_EVENT_RELEASED "2released()"

typedef struct GUObjectFuncs {
	int (*connect)(struct GUWidget* widget, const char* id, void* reciver, void* func);
} GUObjectFuncs;

typedef struct GUWidgetFuncs {
	void (*set_size)(struct GUWidget* widget, int width, int height);
} GUWidgetFuncs;

typedef struct GUPushButtonFuncs {
	void (*set_default)(struct GUPushButton* button, int state);
} GUPushButtonFuncs;

typedef struct GUApplicationFuncs {
	int (*run)(void* p);
} GUApplicationFuncs;

typedef struct GUObject {
	void* p;
	GUObjectFuncs* funcs;
} GUObject;

typedef struct GUWidget {
	GUObject object;
	GUWidgetFuncs* funcs;
} GUWidget;

typedef struct GUWindow {
	GUWidget base;
} GUIWindow;

typedef struct GUPushButton {
	GUWidget base;
	GUPushButtonFuncs* funcs;
} GUPushButton;

typedef struct GUApplication {
	void* p; // private data
	GUApplicationFuncs* funcs;
} GUApplication;

typedef struct Wrui {
	GUApplication* (*application_create)();
	GUIWindow* (*window_create)();
	GUPushButton* (*push_button_create)(const char* label);
} Wrui;

// Windowing

#define gu_window_create(funcs) funcs->create_window()

// Generic window stuff

#define gu_set_size(widget, x, y) widget->base.funcs->set_size(widget->base, x, y)
#define gu_set_parent(widget, parent) widget->base->set_parent(widget->base, widget->base)
#define gu_push_button_create(funcs, label) funcs->push_button_create(label)

// Connection API

#define gu_connect(widget, id, data, func) widget->base->o->connect(widget->base->o, id, data, (void*)func)

// Application

#define gu_application_crate(api) api->application_create()
#define gu_application_run(app) app->run(app->p)

// Should be the only exported symbol

extern Wrui* wrui_get();

#ifdef __cplusplus
}
#endif

{'fraction_non_alphanumeric': 0.13046027557900908, 'fraction_numerical': 0.0005863383172090296, 'mean_word_length': 5.94908350305499, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6386111', 'n_tokens_mistral': 1240, 'n_tokens_neox': 1175, 'n_words': 305}