rute 0.0.4

UI library implemented on top of Qt
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// This file is auto-generated by rute_gen. DO NOT EDIT
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#include "../rute_base.h"
#include "../rute_manual.h"
#include <QWindow>
#include "window_ffi.h"

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void window_set_object_surface_type(struct RUBase* self_c, int surface_type) {
    WRWindow* qt_value = (WRWindow*)self_c;
    qt_value->setSurfaceType((QSurface::SurfaceType)s_surface_type_lookup[surface_type]);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static int window_surface_type(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    auto ret_value = qt_value->surfaceType();
    return s_surface_type_lookup[(int)ret_value];
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static bool window_is_visible(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    auto ret_value = qt_value->isVisible();
    return ret_value;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static int window_visibility(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    auto ret_value = qt_value->visibility();
    return s_visibility_lookup[(int)ret_value];
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void window_set_visibility(struct RUBase* self_c, int v) {
    WRWindow* qt_value = (WRWindow*)self_c;
    qt_value->setVisibility((QWindow::Visibility)s_visibility_lookup[v]);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void window_create(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    qt_value->create();
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static uint64_t window_win_id(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    auto ret_value = qt_value->winId();
    return ret_value;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static struct RUWindow window_parent(struct RUBase* self_c, int mode) {
    WRWindow* qt_value = (WRWindow*)self_c;
    auto ret_value = qt_value->parent((QWindow::AncestorMode)s_ancestor_mode_lookup[mode]);
    struct RUWindow ctl;
    ctl.qt_data = (struct RUBase*)ret_value;
    ctl.host_data = (struct RUBase*)s_host_data_lookup[(void*)ret_value];
    ctl.all_funcs = &s_window_all_funcs;
    return ctl;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static struct RUWindow window_parent_2(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    auto ret_value = qt_value->parent();
    struct RUWindow ctl;
    ctl.qt_data = (struct RUBase*)ret_value;
    ctl.host_data = (struct RUBase*)s_host_data_lookup[(void*)ret_value];
    ctl.all_funcs = &s_window_all_funcs;
    return ctl;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void window_set_parent(struct RUBase* self_c, struct RUBase* parent) {
    WRWindow* qt_value = (WRWindow*)self_c;
    qt_value->setParent((QWindow*)parent);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static bool window_is_top_level(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    auto ret_value = qt_value->isTopLevel();
    return ret_value;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static bool window_is_modal(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    auto ret_value = qt_value->isModal();
    return ret_value;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static int window_modality(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    auto ret_value = qt_value->modality();
    return s_window_modality_lookup[(int)ret_value];
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void window_set_modality(struct RUBase* self_c, int modality) {
    WRWindow* qt_value = (WRWindow*)self_c;
    qt_value->setModality((Qt::WindowModality)s_window_modality_lookup[modality]);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void window_set_object_format(struct RUBase* self_c, struct RUBase* format) {
    WRWindow* qt_value = (WRWindow*)self_c;
    qt_value->setFormat(*((QSurfaceFormat*)format));
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static struct RUSurfaceFormat window_format(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    auto ret_value = qt_value->format();
    WRSurfaceFormat* new_val = new WRSurfaceFormat();
    *new_val = ret_value;
    struct RUSurfaceFormat ctl;
    ctl.qt_data = (struct RUBase*)new_val;
    ctl.host_data = (struct RUBase*)s_host_data_lookup[(void*)new_val];
    ctl.all_funcs = &s_surface_format_all_funcs;
    return ctl;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static struct RUSurfaceFormat window_requested_format(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    auto ret_value = qt_value->requestedFormat();
    WRSurfaceFormat* new_val = new WRSurfaceFormat();
    *new_val = ret_value;
    struct RUSurfaceFormat ctl;
    ctl.qt_data = (struct RUBase*)new_val;
    ctl.host_data = (struct RUBase*)s_host_data_lookup[(void*)new_val];
    ctl.all_funcs = &s_surface_format_all_funcs;
    return ctl;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void window_set_flags(struct RUBase* self_c, int flags) {
    WRWindow* qt_value = (WRWindow*)self_c;
    qt_value->setFlags((Qt::WindowFlags)s_window_flags_lookup[flags]);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static int window_flags(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    auto ret_value = qt_value->flags();
    return s_window_flags_lookup[(int)ret_value];
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static const char* window_title(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    auto ret_value = qt_value->title();
    return q_string_to_const_char(ret_value);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void window_set_opacity(struct RUBase* self_c, float level) {
    WRWindow* qt_value = (WRWindow*)self_c;
    qt_value->setOpacity(level);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static float window_opacity(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    auto ret_value = qt_value->opacity();
    return ret_value;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void window_set_mask(struct RUBase* self_c, struct RUBase* region) {
    WRWindow* qt_value = (WRWindow*)self_c;
    qt_value->setMask(*((QRegion*)region));
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static struct RURegion window_mask(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    auto ret_value = qt_value->mask();
    WRRegion* new_val = new WRRegion();
    *new_val = ret_value;
    struct RURegion ctl;
    ctl.qt_data = (struct RUBase*)new_val;
    ctl.host_data = (struct RUBase*)s_host_data_lookup[(void*)new_val];
    ctl.all_funcs = &s_region_all_funcs;
    return ctl;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static bool window_is_active(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    auto ret_value = qt_value->isActive();
    return ret_value;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void window_report_content_orientation_change(struct RUBase* self_c, int orientation) {
    WRWindow* qt_value = (WRWindow*)self_c;
    qt_value->reportContentOrientationChange((Qt::ScreenOrientation)s_screen_orientation_lookup[orientation]);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static int window_content_orientation(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    auto ret_value = qt_value->contentOrientation();
    return s_screen_orientation_lookup[(int)ret_value];
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static float window_device_pixel_ratio(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    auto ret_value = qt_value->devicePixelRatio();
    return ret_value;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static int window_window_state(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    auto ret_value = qt_value->windowState();
    return s_window_state_lookup[(int)ret_value];
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static int window_window_states(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    auto ret_value = qt_value->windowStates();
    return s_window_states_lookup[(int)ret_value];
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void window_set_window_state(struct RUBase* self_c, int state) {
    WRWindow* qt_value = (WRWindow*)self_c;
    qt_value->setWindowState((Qt::WindowState)s_window_state_lookup[state]);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void window_set_window_states(struct RUBase* self_c, int states) {
    WRWindow* qt_value = (WRWindow*)self_c;
    qt_value->setWindowStates((Qt::WindowStates)s_window_states_lookup[states]);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void window_set_transient_parent(struct RUBase* self_c, struct RUBase* parent) {
    WRWindow* qt_value = (WRWindow*)self_c;
    qt_value->setTransientParent((QWindow*)parent);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static bool window_is_ancestor_of(struct RUBase* self_c, struct RUBase* child, int mode) {
    WRWindow* qt_value = (WRWindow*)self_c;
    auto ret_value = qt_value->isAncestorOf((QWindow*)child, (QWindow::AncestorMode)s_ancestor_mode_lookup[mode]);
    return ret_value;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static bool window_is_exposed(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    auto ret_value = qt_value->isExposed();
    return ret_value;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static int window_minimum_width(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    auto ret_value = qt_value->minimumWidth();
    return ret_value;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static int window_minimum_height(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    auto ret_value = qt_value->minimumHeight();
    return ret_value;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static int window_maximum_width(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    auto ret_value = qt_value->maximumWidth();
    return ret_value;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static int window_maximum_height(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    auto ret_value = qt_value->maximumHeight();
    return ret_value;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static struct RUSize window_minimum_size(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    auto ret_value = qt_value->minimumSize();
    WRSize* new_val = new WRSize();
    *new_val = ret_value;
    struct RUSize ctl;
    ctl.qt_data = (struct RUBase*)new_val;
    ctl.host_data = (struct RUBase*)s_host_data_lookup[(void*)new_val];
    ctl.all_funcs = &s_size_all_funcs;
    return ctl;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static struct RUSize window_maximum_size(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    auto ret_value = qt_value->maximumSize();
    WRSize* new_val = new WRSize();
    *new_val = ret_value;
    struct RUSize ctl;
    ctl.qt_data = (struct RUBase*)new_val;
    ctl.host_data = (struct RUBase*)s_host_data_lookup[(void*)new_val];
    ctl.all_funcs = &s_size_all_funcs;
    return ctl;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static struct RUSize window_base_size(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    auto ret_value = qt_value->baseSize();
    WRSize* new_val = new WRSize();
    *new_val = ret_value;
    struct RUSize ctl;
    ctl.qt_data = (struct RUBase*)new_val;
    ctl.host_data = (struct RUBase*)s_host_data_lookup[(void*)new_val];
    ctl.all_funcs = &s_size_all_funcs;
    return ctl;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static struct RUSize window_size_increment(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    auto ret_value = qt_value->sizeIncrement();
    WRSize* new_val = new WRSize();
    *new_val = ret_value;
    struct RUSize ctl;
    ctl.qt_data = (struct RUBase*)new_val;
    ctl.host_data = (struct RUBase*)s_host_data_lookup[(void*)new_val];
    ctl.all_funcs = &s_size_all_funcs;
    return ctl;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void window_set_minimum_size(struct RUBase* self_c, struct RUBase* size) {
    WRWindow* qt_value = (WRWindow*)self_c;
    qt_value->setMinimumSize(*((QSize*)size));
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void window_set_maximum_size(struct RUBase* self_c, struct RUBase* size) {
    WRWindow* qt_value = (WRWindow*)self_c;
    qt_value->setMaximumSize(*((QSize*)size));
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void window_set_base_size(struct RUBase* self_c, struct RUBase* size) {
    WRWindow* qt_value = (WRWindow*)self_c;
    qt_value->setBaseSize(*((QSize*)size));
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void window_set_size_increment(struct RUBase* self_c, struct RUBase* size) {
    WRWindow* qt_value = (WRWindow*)self_c;
    qt_value->setSizeIncrement(*((QSize*)size));
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static struct RUMargins window_frame_margins(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    auto ret_value = qt_value->frameMargins();
    WRMargins* new_val = new WRMargins();
    *new_val = ret_value;
    struct RUMargins ctl;
    ctl.qt_data = (struct RUBase*)new_val;
    ctl.host_data = (struct RUBase*)s_host_data_lookup[(void*)new_val];
    ctl.all_funcs = &s_margins_all_funcs;
    return ctl;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static struct RUPoint window_frame_position(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    auto ret_value = qt_value->framePosition();
    WRPoint* new_val = new WRPoint();
    *new_val = ret_value;
    struct RUPoint ctl;
    ctl.qt_data = (struct RUBase*)new_val;
    ctl.host_data = (struct RUBase*)s_host_data_lookup[(void*)new_val];
    ctl.all_funcs = &s_point_all_funcs;
    return ctl;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void window_set_frame_position(struct RUBase* self_c, struct RUBase* point) {
    WRWindow* qt_value = (WRWindow*)self_c;
    qt_value->setFramePosition(*((QPoint*)point));
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static int window_width(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    auto ret_value = qt_value->width();
    return ret_value;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static int window_height(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    auto ret_value = qt_value->height();
    return ret_value;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static int window_x(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    auto ret_value = qt_value->x();
    return ret_value;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static int window_y(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    auto ret_value = qt_value->y();
    return ret_value;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static struct RUSize window_size(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    auto ret_value = qt_value->size();
    WRSize* new_val = new WRSize();
    *new_val = ret_value;
    struct RUSize ctl;
    ctl.qt_data = (struct RUBase*)new_val;
    ctl.host_data = (struct RUBase*)s_host_data_lookup[(void*)new_val];
    ctl.all_funcs = &s_size_all_funcs;
    return ctl;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static struct RUPoint window_position(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    auto ret_value = qt_value->position();
    WRPoint* new_val = new WRPoint();
    *new_val = ret_value;
    struct RUPoint ctl;
    ctl.qt_data = (struct RUBase*)new_val;
    ctl.host_data = (struct RUBase*)s_host_data_lookup[(void*)new_val];
    ctl.all_funcs = &s_point_all_funcs;
    return ctl;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void window_set_position(struct RUBase* self_c, struct RUBase* pt) {
    WRWindow* qt_value = (WRWindow*)self_c;
    qt_value->setPosition(*((QPoint*)pt));
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void window_set_position_2(struct RUBase* self_c, int posx, int posy) {
    WRWindow* qt_value = (WRWindow*)self_c;
    qt_value->setPosition(posx, posy);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void window_resize(struct RUBase* self_c, struct RUBase* new_size) {
    WRWindow* qt_value = (WRWindow*)self_c;
    qt_value->resize(*((QSize*)new_size));
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void window_resize_2(struct RUBase* self_c, int w, int h) {
    WRWindow* qt_value = (WRWindow*)self_c;
    qt_value->resize(w, h);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void window_set_file_path(struct RUBase* self_c, const char* file_path) {
    WRWindow* qt_value = (WRWindow*)self_c;
    qt_value->setFilePath(QString::fromUtf8(file_path));
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static const char* window_file_path(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    auto ret_value = qt_value->filePath();
    return q_string_to_const_char(ret_value);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void window_set_icon(struct RUBase* self_c, struct RUBase* icon) {
    WRWindow* qt_value = (WRWindow*)self_c;
    qt_value->setIcon(*((QIcon*)icon));
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static struct RUIcon window_icon(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    auto ret_value = qt_value->icon();
    WRIcon* new_val = new WRIcon();
    *new_val = ret_value;
    struct RUIcon ctl;
    ctl.qt_data = (struct RUBase*)new_val;
    ctl.host_data = (struct RUBase*)s_host_data_lookup[(void*)new_val];
    ctl.all_funcs = &s_icon_all_funcs;
    return ctl;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static bool window_set_keyboard_grab_enabled(struct RUBase* self_c, bool grab) {
    WRWindow* qt_value = (WRWindow*)self_c;
    auto ret_value = qt_value->setKeyboardGrabEnabled(grab);
    return ret_value;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static bool window_set_mouse_grab_enabled(struct RUBase* self_c, bool grab) {
    WRWindow* qt_value = (WRWindow*)self_c;
    auto ret_value = qt_value->setMouseGrabEnabled(grab);
    return ret_value;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static struct RUScreen window_screen(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    auto ret_value = qt_value->screen();
    struct RUScreen ctl;
    ctl.qt_data = (struct RUBase*)ret_value;
    ctl.host_data = (struct RUBase*)s_host_data_lookup[(void*)ret_value];
    ctl.all_funcs = &s_screen_all_funcs;
    return ctl;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void window_set_screen(struct RUBase* self_c, struct RUBase* screen) {
    WRWindow* qt_value = (WRWindow*)self_c;
    qt_value->setScreen((QScreen*)screen);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static struct RUObject window_focus_object(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    auto ret_value = qt_value->focusObject();
    struct RUObject ctl;
    ctl.qt_data = (struct RUBase*)ret_value;
    ctl.host_data = (struct RUBase*)s_host_data_lookup[(void*)ret_value];
    ctl.all_funcs = &s_object_all_funcs;
    return ctl;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static struct RUPoint window_map_to_global(struct RUBase* self_c, struct RUBase* pos) {
    WRWindow* qt_value = (WRWindow*)self_c;
    auto ret_value = qt_value->mapToGlobal(*((QPoint*)pos));
    WRPoint* new_val = new WRPoint();
    *new_val = ret_value;
    struct RUPoint ctl;
    ctl.qt_data = (struct RUBase*)new_val;
    ctl.host_data = (struct RUBase*)s_host_data_lookup[(void*)new_val];
    ctl.all_funcs = &s_point_all_funcs;
    return ctl;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static struct RUPoint window_map_from_global(struct RUBase* self_c, struct RUBase* pos) {
    WRWindow* qt_value = (WRWindow*)self_c;
    auto ret_value = qt_value->mapFromGlobal(*((QPoint*)pos));
    WRPoint* new_val = new WRPoint();
    *new_val = ret_value;
    struct RUPoint ctl;
    ctl.qt_data = (struct RUBase*)new_val;
    ctl.host_data = (struct RUBase*)s_host_data_lookup[(void*)new_val];
    ctl.all_funcs = &s_point_all_funcs;
    return ctl;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static struct RUCursor window_cursor(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    auto ret_value = qt_value->cursor();
    WRCursor* new_val = new WRCursor();
    *new_val = ret_value;
    struct RUCursor ctl;
    ctl.qt_data = (struct RUBase*)new_val;
    ctl.host_data = (struct RUBase*)s_host_data_lookup[(void*)new_val];
    ctl.all_funcs = &s_cursor_all_funcs;
    return ctl;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void window_set_cursor(struct RUBase* self_c, struct RUBase* arg0) {
    WRWindow* qt_value = (WRWindow*)self_c;
    qt_value->setCursor(*((QCursor*)arg0));
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void window_unset_cursor(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    qt_value->unsetCursor();
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static struct RUWindow window_from_win_id(struct RUBase* self_c, uint64_t id) {
    WRWindow* qt_value = (WRWindow*)self_c;
    auto ret_value = qt_value->fromWinId(id);
    struct RUWindow ctl;
    ctl.qt_data = (struct RUBase*)ret_value;
    ctl.host_data = (struct RUBase*)s_host_data_lookup[(void*)ret_value];
    ctl.all_funcs = &s_window_all_funcs;
    return ctl;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void window_request_activate(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    qt_value->requestActivate();
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void window_set_visible(struct RUBase* self_c, bool visible) {
    WRWindow* qt_value = (WRWindow*)self_c;
    qt_value->setVisible(visible);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void window_show(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    qt_value->show();
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void window_hide(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    qt_value->hide();
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void window_show_minimized(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    qt_value->showMinimized();
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void window_show_maximized(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    qt_value->showMaximized();
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void window_show_full_screen(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    qt_value->showFullScreen();
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void window_show_normal(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    qt_value->showNormal();
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static bool window_close(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    auto ret_value = qt_value->close();
    return ret_value;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void window_raise(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    qt_value->raise();
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void window_lower(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    qt_value->lower();
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void window_set_title(struct RUBase* self_c, const char* arg0) {
    WRWindow* qt_value = (WRWindow*)self_c;
    qt_value->setTitle(QString::fromUtf8(arg0));
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void window_set_x(struct RUBase* self_c, int arg) {
    WRWindow* qt_value = (WRWindow*)self_c;
    qt_value->setX(arg);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void window_set_y(struct RUBase* self_c, int arg) {
    WRWindow* qt_value = (WRWindow*)self_c;
    qt_value->setY(arg);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void window_set_width(struct RUBase* self_c, int arg) {
    WRWindow* qt_value = (WRWindow*)self_c;
    qt_value->setWidth(arg);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void window_set_height(struct RUBase* self_c, int arg) {
    WRWindow* qt_value = (WRWindow*)self_c;
    qt_value->setHeight(arg);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void window_set_minimum_width(struct RUBase* self_c, int w) {
    WRWindow* qt_value = (WRWindow*)self_c;
    qt_value->setMinimumWidth(w);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void window_set_minimum_height(struct RUBase* self_c, int h) {
    WRWindow* qt_value = (WRWindow*)self_c;
    qt_value->setMinimumHeight(h);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void window_set_maximum_width(struct RUBase* self_c, int w) {
    WRWindow* qt_value = (WRWindow*)self_c;
    qt_value->setMaximumWidth(w);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void window_set_maximum_height(struct RUBase* self_c, int h) {
    WRWindow* qt_value = (WRWindow*)self_c;
    qt_value->setMaximumHeight(h);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void window_alert(struct RUBase* self_c, int msec) {
    WRWindow* qt_value = (WRWindow*)self_c;
    qt_value->alert(msec);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void window_request_update(struct RUBase* self_c) {
    WRWindow* qt_value = (WRWindow*)self_c;
    qt_value->requestUpdate();
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void set_window_screen_changed_event(void* object, void* user_data, void* wrapped_func, void (*event)(void*, void* self_c, struct RUBase* screen)) {
    QSlotWrapperSignal_self_ScreenType_void* wrap = new QSlotWrapperSignal_self_ScreenType_void(user_data, (Signal_self_ScreenType_void)event, (void*)wrapped_func);
    QObject* q_obj = (QObject*)object;
    QObject::connect(q_obj, SIGNAL(screenChanged(QScreen*)), wrap, SLOT(method(QScreen*)));
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void set_window_window_title_changed_event(void* object, void* user_data, void* wrapped_func, void (*event)(void*, void* self_c, const char* title)) {
    QSlotWrapperSignal_self_string_void* wrap = new QSlotWrapperSignal_self_string_void(user_data, (Signal_self_string_void)event, (void*)wrapped_func);
    QObject* q_obj = (QObject*)object;
    QObject::connect(q_obj, SIGNAL(windowTitleChanged(QString)), wrap, SLOT(method(QString)));
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void set_window_x_changed_event(void* object, void* user_data, void* wrapped_func, void (*event)(void*, void* self_c, int arg)) {
    QSlotWrapperSignal_self_int_void* wrap = new QSlotWrapperSignal_self_int_void(user_data, (Signal_self_int_void)event, (void*)wrapped_func);
    QObject* q_obj = (QObject*)object;
    QObject::connect(q_obj, SIGNAL(xChanged(int)), wrap, SLOT(method(int)));
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void set_window_y_changed_event(void* object, void* user_data, void* wrapped_func, void (*event)(void*, void* self_c, int arg)) {
    QSlotWrapperSignal_self_int_void* wrap = new QSlotWrapperSignal_self_int_void(user_data, (Signal_self_int_void)event, (void*)wrapped_func);
    QObject* q_obj = (QObject*)object;
    QObject::connect(q_obj, SIGNAL(yChanged(int)), wrap, SLOT(method(int)));
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void set_window_width_changed_event(void* object, void* user_data, void* wrapped_func, void (*event)(void*, void* self_c, int arg)) {
    QSlotWrapperSignal_self_int_void* wrap = new QSlotWrapperSignal_self_int_void(user_data, (Signal_self_int_void)event, (void*)wrapped_func);
    QObject* q_obj = (QObject*)object;
    QObject::connect(q_obj, SIGNAL(widthChanged(int)), wrap, SLOT(method(int)));
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void set_window_height_changed_event(void* object, void* user_data, void* wrapped_func, void (*event)(void*, void* self_c, int arg)) {
    QSlotWrapperSignal_self_int_void* wrap = new QSlotWrapperSignal_self_int_void(user_data, (Signal_self_int_void)event, (void*)wrapped_func);
    QObject* q_obj = (QObject*)object;
    QObject::connect(q_obj, SIGNAL(heightChanged(int)), wrap, SLOT(method(int)));
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void set_window_minimum_width_changed_event(void* object, void* user_data, void* wrapped_func, void (*event)(void*, void* self_c, int arg)) {
    QSlotWrapperSignal_self_int_void* wrap = new QSlotWrapperSignal_self_int_void(user_data, (Signal_self_int_void)event, (void*)wrapped_func);
    QObject* q_obj = (QObject*)object;
    QObject::connect(q_obj, SIGNAL(minimumWidthChanged(int)), wrap, SLOT(method(int)));
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void set_window_minimum_height_changed_event(void* object, void* user_data, void* wrapped_func, void (*event)(void*, void* self_c, int arg)) {
    QSlotWrapperSignal_self_int_void* wrap = new QSlotWrapperSignal_self_int_void(user_data, (Signal_self_int_void)event, (void*)wrapped_func);
    QObject* q_obj = (QObject*)object;
    QObject::connect(q_obj, SIGNAL(minimumHeightChanged(int)), wrap, SLOT(method(int)));
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void set_window_maximum_width_changed_event(void* object, void* user_data, void* wrapped_func, void (*event)(void*, void* self_c, int arg)) {
    QSlotWrapperSignal_self_int_void* wrap = new QSlotWrapperSignal_self_int_void(user_data, (Signal_self_int_void)event, (void*)wrapped_func);
    QObject* q_obj = (QObject*)object;
    QObject::connect(q_obj, SIGNAL(maximumWidthChanged(int)), wrap, SLOT(method(int)));
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void set_window_maximum_height_changed_event(void* object, void* user_data, void* wrapped_func, void (*event)(void*, void* self_c, int arg)) {
    QSlotWrapperSignal_self_int_void* wrap = new QSlotWrapperSignal_self_int_void(user_data, (Signal_self_int_void)event, (void*)wrapped_func);
    QObject* q_obj = (QObject*)object;
    QObject::connect(q_obj, SIGNAL(maximumHeightChanged(int)), wrap, SLOT(method(int)));
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void set_window_visible_changed_event(void* object, void* user_data, void* wrapped_func, void (*event)(void*, void* self_c, bool arg)) {
    QSlotWrapperSignal_self_bool_void* wrap = new QSlotWrapperSignal_self_bool_void(user_data, (Signal_self_bool_void)event, (void*)wrapped_func);
    QObject* q_obj = (QObject*)object;
    QObject::connect(q_obj, SIGNAL(visibleChanged(bool)), wrap, SLOT(method(bool)));
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void set_window_active_changed_event(void* object, void* user_data, void* wrapped_func, void (*event)(void*, void* self_c)) {
    QSlotWrapperSignal_self_void* wrap = new QSlotWrapperSignal_self_void(user_data, (Signal_self_void)event, (void*)wrapped_func);
    QObject* q_obj = (QObject*)object;
    QObject::connect(q_obj, SIGNAL(activeChanged()), wrap, SLOT(method()));
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void set_window_focus_object_changed_event(void* object, void* user_data, void* wrapped_func, void (*event)(void*, void* self_c, struct RUBase* object)) {
    QSlotWrapperSignal_self_ObjectType_void* wrap = new QSlotWrapperSignal_self_ObjectType_void(user_data, (Signal_self_ObjectType_void)event, (void*)wrapped_func);
    QObject* q_obj = (QObject*)object;
    QObject::connect(q_obj, SIGNAL(focusObjectChanged(QObject*)), wrap, SLOT(method(QObject*)));
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void set_window_opacity_changed_event(void* object, void* user_data, void* wrapped_func, void (*event)(void*, void* self_c, float opacity)) {
    QSlotWrapperSignal_self_float_void* wrap = new QSlotWrapperSignal_self_float_void(user_data, (Signal_self_float_void)event, (void*)wrapped_func);
    QObject* q_obj = (QObject*)object;
    QObject::connect(q_obj, SIGNAL(opacityChanged(float)), wrap, SLOT(method(float)));
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void set_window_expose_event(void* object, void* user_data, void* wrapped_func, void (*trampoline_func)(void*, void* self_c, struct RUBase* arg0)) {
    WRWindow* qt_object = (WRWindow*)object;
    qt_object->m_expose_event = trampoline_func;
    qt_object->m_expose_event_user_data = user_data;
    qt_object->m_expose_event_wrapped_func = wrapped_func;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void remove_window_expose_event(void* object) {
    WRWindow* qt_object = (WRWindow*)object;
    qt_object->m_expose_event = nullptr;
    qt_object->m_expose_event_user_data = nullptr;
    qt_object->m_expose_event_wrapped_func = nullptr;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void set_window_resize_event(void* object, void* user_data, void* wrapped_func, void (*trampoline_func)(void*, void* self_c, struct RUBase* arg0)) {
    WRWindow* qt_object = (WRWindow*)object;
    qt_object->m_resize_event = trampoline_func;
    qt_object->m_resize_event_user_data = user_data;
    qt_object->m_resize_event_wrapped_func = wrapped_func;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void remove_window_resize_event(void* object) {
    WRWindow* qt_object = (WRWindow*)object;
    qt_object->m_resize_event = nullptr;
    qt_object->m_resize_event_user_data = nullptr;
    qt_object->m_resize_event_wrapped_func = nullptr;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void set_window_move_event(void* object, void* user_data, void* wrapped_func, void (*trampoline_func)(void*, void* self_c, struct RUBase* arg0)) {
    WRWindow* qt_object = (WRWindow*)object;
    qt_object->m_move_event = trampoline_func;
    qt_object->m_move_event_user_data = user_data;
    qt_object->m_move_event_wrapped_func = wrapped_func;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void remove_window_move_event(void* object) {
    WRWindow* qt_object = (WRWindow*)object;
    qt_object->m_move_event = nullptr;
    qt_object->m_move_event_user_data = nullptr;
    qt_object->m_move_event_wrapped_func = nullptr;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void set_window_focus_in_event(void* object, void* user_data, void* wrapped_func, void (*trampoline_func)(void*, void* self_c, struct RUBase* arg0)) {
    WRWindow* qt_object = (WRWindow*)object;
    qt_object->m_focus_in_event = trampoline_func;
    qt_object->m_focus_in_event_user_data = user_data;
    qt_object->m_focus_in_event_wrapped_func = wrapped_func;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void remove_window_focus_in_event(void* object) {
    WRWindow* qt_object = (WRWindow*)object;
    qt_object->m_focus_in_event = nullptr;
    qt_object->m_focus_in_event_user_data = nullptr;
    qt_object->m_focus_in_event_wrapped_func = nullptr;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void set_window_focus_out_event(void* object, void* user_data, void* wrapped_func, void (*trampoline_func)(void*, void* self_c, struct RUBase* arg0)) {
    WRWindow* qt_object = (WRWindow*)object;
    qt_object->m_focus_out_event = trampoline_func;
    qt_object->m_focus_out_event_user_data = user_data;
    qt_object->m_focus_out_event_wrapped_func = wrapped_func;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void remove_window_focus_out_event(void* object) {
    WRWindow* qt_object = (WRWindow*)object;
    qt_object->m_focus_out_event = nullptr;
    qt_object->m_focus_out_event_user_data = nullptr;
    qt_object->m_focus_out_event_wrapped_func = nullptr;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void set_window_show_event(void* object, void* user_data, void* wrapped_func, void (*trampoline_func)(void*, void* self_c, struct RUBase* arg0)) {
    WRWindow* qt_object = (WRWindow*)object;
    qt_object->m_show_event = trampoline_func;
    qt_object->m_show_event_user_data = user_data;
    qt_object->m_show_event_wrapped_func = wrapped_func;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void remove_window_show_event(void* object) {
    WRWindow* qt_object = (WRWindow*)object;
    qt_object->m_show_event = nullptr;
    qt_object->m_show_event_user_data = nullptr;
    qt_object->m_show_event_wrapped_func = nullptr;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void set_window_hide_event(void* object, void* user_data, void* wrapped_func, void (*trampoline_func)(void*, void* self_c, struct RUBase* arg0)) {
    WRWindow* qt_object = (WRWindow*)object;
    qt_object->m_hide_event = trampoline_func;
    qt_object->m_hide_event_user_data = user_data;
    qt_object->m_hide_event_wrapped_func = wrapped_func;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void remove_window_hide_event(void* object) {
    WRWindow* qt_object = (WRWindow*)object;
    qt_object->m_hide_event = nullptr;
    qt_object->m_hide_event_user_data = nullptr;
    qt_object->m_hide_event_wrapped_func = nullptr;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void set_window_key_press_event(void* object, void* user_data, void* wrapped_func, void (*trampoline_func)(void*, void* self_c, struct RUBase* arg0)) {
    WRWindow* qt_object = (WRWindow*)object;
    qt_object->m_key_press_event = trampoline_func;
    qt_object->m_key_press_event_user_data = user_data;
    qt_object->m_key_press_event_wrapped_func = wrapped_func;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void remove_window_key_press_event(void* object) {
    WRWindow* qt_object = (WRWindow*)object;
    qt_object->m_key_press_event = nullptr;
    qt_object->m_key_press_event_user_data = nullptr;
    qt_object->m_key_press_event_wrapped_func = nullptr;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void set_window_key_release_event(void* object, void* user_data, void* wrapped_func, void (*trampoline_func)(void*, void* self_c, struct RUBase* arg0)) {
    WRWindow* qt_object = (WRWindow*)object;
    qt_object->m_key_release_event = trampoline_func;
    qt_object->m_key_release_event_user_data = user_data;
    qt_object->m_key_release_event_wrapped_func = wrapped_func;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void remove_window_key_release_event(void* object) {
    WRWindow* qt_object = (WRWindow*)object;
    qt_object->m_key_release_event = nullptr;
    qt_object->m_key_release_event_user_data = nullptr;
    qt_object->m_key_release_event_wrapped_func = nullptr;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void set_window_mouse_press_event(void* object, void* user_data, void* wrapped_func, void (*trampoline_func)(void*, void* self_c, struct RUBase* arg0)) {
    WRWindow* qt_object = (WRWindow*)object;
    qt_object->m_mouse_press_event = trampoline_func;
    qt_object->m_mouse_press_event_user_data = user_data;
    qt_object->m_mouse_press_event_wrapped_func = wrapped_func;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void remove_window_mouse_press_event(void* object) {
    WRWindow* qt_object = (WRWindow*)object;
    qt_object->m_mouse_press_event = nullptr;
    qt_object->m_mouse_press_event_user_data = nullptr;
    qt_object->m_mouse_press_event_wrapped_func = nullptr;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void set_window_mouse_release_event(void* object, void* user_data, void* wrapped_func, void (*trampoline_func)(void*, void* self_c, struct RUBase* arg0)) {
    WRWindow* qt_object = (WRWindow*)object;
    qt_object->m_mouse_release_event = trampoline_func;
    qt_object->m_mouse_release_event_user_data = user_data;
    qt_object->m_mouse_release_event_wrapped_func = wrapped_func;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void remove_window_mouse_release_event(void* object) {
    WRWindow* qt_object = (WRWindow*)object;
    qt_object->m_mouse_release_event = nullptr;
    qt_object->m_mouse_release_event_user_data = nullptr;
    qt_object->m_mouse_release_event_wrapped_func = nullptr;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void set_window_mouse_double_click_event(void* object, void* user_data, void* wrapped_func, void (*trampoline_func)(void*, void* self_c, struct RUBase* arg0)) {
    WRWindow* qt_object = (WRWindow*)object;
    qt_object->m_mouse_double_click_event = trampoline_func;
    qt_object->m_mouse_double_click_event_user_data = user_data;
    qt_object->m_mouse_double_click_event_wrapped_func = wrapped_func;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void remove_window_mouse_double_click_event(void* object) {
    WRWindow* qt_object = (WRWindow*)object;
    qt_object->m_mouse_double_click_event = nullptr;
    qt_object->m_mouse_double_click_event_user_data = nullptr;
    qt_object->m_mouse_double_click_event_wrapped_func = nullptr;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void set_window_mouse_move_event(void* object, void* user_data, void* wrapped_func, void (*trampoline_func)(void*, void* self_c, struct RUBase* arg0)) {
    WRWindow* qt_object = (WRWindow*)object;
    qt_object->m_mouse_move_event = trampoline_func;
    qt_object->m_mouse_move_event_user_data = user_data;
    qt_object->m_mouse_move_event_wrapped_func = wrapped_func;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void remove_window_mouse_move_event(void* object) {
    WRWindow* qt_object = (WRWindow*)object;
    qt_object->m_mouse_move_event = nullptr;
    qt_object->m_mouse_move_event_user_data = nullptr;
    qt_object->m_mouse_move_event_wrapped_func = nullptr;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void set_window_wheel_event(void* object, void* user_data, void* wrapped_func, void (*trampoline_func)(void*, void* self_c, struct RUBase* arg0)) {
    WRWindow* qt_object = (WRWindow*)object;
    qt_object->m_wheel_event = trampoline_func;
    qt_object->m_wheel_event_user_data = user_data;
    qt_object->m_wheel_event_wrapped_func = wrapped_func;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void remove_window_wheel_event(void* object) {
    WRWindow* qt_object = (WRWindow*)object;
    qt_object->m_wheel_event = nullptr;
    qt_object->m_wheel_event_user_data = nullptr;
    qt_object->m_wheel_event_wrapped_func = nullptr;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void set_window_touch_event(void* object, void* user_data, void* wrapped_func, void (*trampoline_func)(void*, void* self_c, struct RUBase* arg0)) {
    WRWindow* qt_object = (WRWindow*)object;
    qt_object->m_touch_event = trampoline_func;
    qt_object->m_touch_event_user_data = user_data;
    qt_object->m_touch_event_wrapped_func = wrapped_func;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void remove_window_touch_event(void* object) {
    WRWindow* qt_object = (WRWindow*)object;
    qt_object->m_touch_event = nullptr;
    qt_object->m_touch_event_user_data = nullptr;
    qt_object->m_touch_event_wrapped_func = nullptr;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void set_window_tablet_event(void* object, void* user_data, void* wrapped_func, void (*trampoline_func)(void*, void* self_c, struct RUBase* arg0)) {
    WRWindow* qt_object = (WRWindow*)object;
    qt_object->m_tablet_event = trampoline_func;
    qt_object->m_tablet_event_user_data = user_data;
    qt_object->m_tablet_event_wrapped_func = wrapped_func;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void remove_window_tablet_event(void* object) {
    WRWindow* qt_object = (WRWindow*)object;
    qt_object->m_tablet_event = nullptr;
    qt_object->m_tablet_event_user_data = nullptr;
    qt_object->m_tablet_event_wrapped_func = nullptr;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static struct RUWindow create_window(
    struct RUBase* priv_data,
    RUDeleteCallback delete_callback,
    void* private_user_data)
{
    auto ctl = generic_create_func_with_delete<struct RUWindow, WRWindow>(priv_data, delete_callback, private_user_data);
    ctl.all_funcs = &s_window_all_funcs;
    return ctl;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void destroy_window(struct RUBase* priv_data) {
    destroy_generic<WRWindow>(priv_data);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static struct RUWindow get_window(struct RUBase* priv_data) {
    (void)priv_data;
    RUWindow ctl;
    ctl.qt_data = nullptr;
    ctl.host_data = nullptr;
    ctl.all_funcs = &s_window_all_funcs;
    return ctl;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

struct RUWindowFuncs s_window_funcs = {
    destroy_window,
    window_set_object_surface_type,
    window_surface_type,
    window_is_visible,
    window_visibility,
    window_set_visibility,
    window_create,
    window_win_id,
    window_parent,
    window_parent_2,
    window_set_parent,
    window_is_top_level,
    window_is_modal,
    window_modality,
    window_set_modality,
    window_set_object_format,
    window_format,
    window_requested_format,
    window_set_flags,
    window_flags,
    window_title,
    window_set_opacity,
    window_opacity,
    window_set_mask,
    window_mask,
    window_is_active,
    window_report_content_orientation_change,
    window_content_orientation,
    window_device_pixel_ratio,
    window_window_state,
    window_window_states,
    window_set_window_state,
    window_set_window_states,
    window_set_transient_parent,
    window_is_ancestor_of,
    window_is_exposed,
    window_minimum_width,
    window_minimum_height,
    window_maximum_width,
    window_maximum_height,
    window_minimum_size,
    window_maximum_size,
    window_base_size,
    window_size_increment,
    window_set_minimum_size,
    window_set_maximum_size,
    window_set_base_size,
    window_set_size_increment,
    window_frame_margins,
    window_frame_position,
    window_set_frame_position,
    window_width,
    window_height,
    window_x,
    window_y,
    window_size,
    window_position,
    window_set_position,
    window_set_position_2,
    window_resize,
    window_resize_2,
    window_set_file_path,
    window_file_path,
    window_set_icon,
    window_icon,
    window_set_keyboard_grab_enabled,
    window_set_mouse_grab_enabled,
    window_screen,
    window_set_screen,
    window_focus_object,
    window_map_to_global,
    window_map_from_global,
    window_cursor,
    window_set_cursor,
    window_unset_cursor,
    window_from_win_id,
    window_request_activate,
    window_set_visible,
    window_show,
    window_hide,
    window_show_minimized,
    window_show_maximized,
    window_show_full_screen,
    window_show_normal,
    window_close,
    window_raise,
    window_lower,
    window_set_title,
    window_set_x,
    window_set_y,
    window_set_width,
    window_set_height,
    window_set_minimum_width,
    window_set_minimum_height,
    window_set_maximum_width,
    window_set_maximum_height,
    window_alert,
    window_request_update,
    set_window_screen_changed_event,
    set_window_window_title_changed_event,
    set_window_x_changed_event,
    set_window_y_changed_event,
    set_window_width_changed_event,
    set_window_height_changed_event,
    set_window_minimum_width_changed_event,
    set_window_minimum_height_changed_event,
    set_window_maximum_width_changed_event,
    set_window_maximum_height_changed_event,
    set_window_visible_changed_event,
    set_window_active_changed_event,
    set_window_focus_object_changed_event,
    set_window_opacity_changed_event,
    set_window_expose_event,
    remove_window_expose_event,
    set_window_resize_event,
    remove_window_resize_event,
    set_window_move_event,
    remove_window_move_event,
    set_window_focus_in_event,
    remove_window_focus_in_event,
    set_window_focus_out_event,
    remove_window_focus_out_event,
    set_window_show_event,
    remove_window_show_event,
    set_window_hide_event,
    remove_window_hide_event,
    set_window_key_press_event,
    remove_window_key_press_event,
    set_window_key_release_event,
    remove_window_key_release_event,
    set_window_mouse_press_event,
    remove_window_mouse_press_event,
    set_window_mouse_release_event,
    remove_window_mouse_release_event,
    set_window_mouse_double_click_event,
    remove_window_mouse_double_click_event,
    set_window_mouse_move_event,
    remove_window_mouse_move_event,
    set_window_wheel_event,
    remove_window_wheel_event,
    set_window_touch_event,
    remove_window_touch_event,
    set_window_tablet_event,
    remove_window_tablet_event,
};

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

struct RUWindowAllFuncs s_window_all_funcs = {
    &s_object_funcs,
    &s_surface_funcs,
    &s_window_funcs,
};