rute 0.0.6

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

#include "../rute_base.h"
#include "../rute_manual.h"
#include <QCoreApplication>
#include "core_application_ffi.h"

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

static void core_application_set_organization_domain(struct RUBase* self_c, const char* org_domain) {
    QCoreApplication* qt_value = (QCoreApplication*)self_c;
    qt_value->setOrganizationDomain(QString::fromUtf8(org_domain));
}

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

static const char* core_application_organization_domain(struct RUBase* self_c) {
    QCoreApplication* qt_value = (QCoreApplication*)self_c;
    auto ret_value = qt_value->organizationDomain();
    return q_string_to_const_char(ret_value);
}

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

static void core_application_set_organization_name(struct RUBase* self_c, const char* org_name) {
    QCoreApplication* qt_value = (QCoreApplication*)self_c;
    qt_value->setOrganizationName(QString::fromUtf8(org_name));
}

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

static const char* core_application_organization_name(struct RUBase* self_c) {
    QCoreApplication* qt_value = (QCoreApplication*)self_c;
    auto ret_value = qt_value->organizationName();
    return q_string_to_const_char(ret_value);
}

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

static void core_application_set_application_name(struct RUBase* self_c, const char* application) {
    QCoreApplication* qt_value = (QCoreApplication*)self_c;
    qt_value->setApplicationName(QString::fromUtf8(application));
}

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

static const char* core_application_application_name(struct RUBase* self_c) {
    QCoreApplication* qt_value = (QCoreApplication*)self_c;
    auto ret_value = qt_value->applicationName();
    return q_string_to_const_char(ret_value);
}

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

static void core_application_set_application_version(struct RUBase* self_c, const char* version) {
    QCoreApplication* qt_value = (QCoreApplication*)self_c;
    qt_value->setApplicationVersion(QString::fromUtf8(version));
}

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

static const char* core_application_application_version(struct RUBase* self_c) {
    QCoreApplication* qt_value = (QCoreApplication*)self_c;
    auto ret_value = qt_value->applicationVersion();
    return q_string_to_const_char(ret_value);
}

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

static void core_application_set_setuid_allowed(struct RUBase* self_c, bool allow) {
    QCoreApplication* qt_value = (QCoreApplication*)self_c;
    qt_value->setSetuidAllowed(allow);
}

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

static bool core_application_is_setuid_allowed(struct RUBase* self_c) {
    QCoreApplication* qt_value = (QCoreApplication*)self_c;
    auto ret_value = qt_value->isSetuidAllowed();
    return ret_value;
}

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

static struct RUCoreApplication core_application_instance(struct RUBase* self_c) {
    QCoreApplication* qt_value = (QCoreApplication*)self_c;
    auto ret_value = qt_value->instance();
    struct RUCoreApplication ctl;
    ctl.qt_data = (struct RUBase*)ret_value;
    ctl.host_data = (struct RUBase*)s_host_data_lookup[(void*)ret_value];
    ctl.all_funcs = &s_core_application_all_funcs;
    return ctl;
}

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

static int core_application_exec(struct RUBase* self_c) {
    QCoreApplication* qt_value = (QCoreApplication*)self_c;
    auto ret_value = qt_value->exec();
    return ret_value;
}

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

static void core_application_exit(struct RUBase* self_c, int retcode) {
    QCoreApplication* qt_value = (QCoreApplication*)self_c;
    qt_value->exit(retcode);
}

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

static bool core_application_send_event(struct RUBase* self_c, struct RUBase* receiver, struct RUBase* event) {
    QCoreApplication* qt_value = (QCoreApplication*)self_c;
    auto ret_value = qt_value->sendEvent((WRObject*)receiver, (QEvent*)event);
    return ret_value;
}

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

static void core_application_post_event(struct RUBase* self_c, struct RUBase* receiver, struct RUBase* event, int priority) {
    QCoreApplication* qt_value = (QCoreApplication*)self_c;
    qt_value->postEvent((WRObject*)receiver, (QEvent*)event, priority);
}

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

static void core_application_send_posted_events(struct RUBase* self_c, struct RUBase* receiver, int event_type) {
    QCoreApplication* qt_value = (QCoreApplication*)self_c;
    qt_value->sendPostedEvents((WRObject*)receiver, event_type);
}

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

static void core_application_remove_posted_events(struct RUBase* self_c, struct RUBase* receiver, int event_type) {
    QCoreApplication* qt_value = (QCoreApplication*)self_c;
    qt_value->removePostedEvents((WRObject*)receiver, event_type);
}

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

static bool core_application_has_pending_events(struct RUBase* self_c) {
    QCoreApplication* qt_value = (QCoreApplication*)self_c;
    auto ret_value = qt_value->hasPendingEvents();
    return ret_value;
}

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

static bool core_application_starting_up(struct RUBase* self_c) {
    QCoreApplication* qt_value = (QCoreApplication*)self_c;
    auto ret_value = qt_value->startingUp();
    return ret_value;
}

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

static bool core_application_closing_down(struct RUBase* self_c) {
    QCoreApplication* qt_value = (QCoreApplication*)self_c;
    auto ret_value = qt_value->closingDown();
    return ret_value;
}

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

static const char* core_application_application_dir_path(struct RUBase* self_c) {
    QCoreApplication* qt_value = (QCoreApplication*)self_c;
    auto ret_value = qt_value->applicationDirPath();
    return q_string_to_const_char(ret_value);
}

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

static const char* core_application_application_file_path(struct RUBase* self_c) {
    QCoreApplication* qt_value = (QCoreApplication*)self_c;
    auto ret_value = qt_value->applicationFilePath();
    return q_string_to_const_char(ret_value);
}

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

static int64_t core_application_application_pid(struct RUBase* self_c) {
    QCoreApplication* qt_value = (QCoreApplication*)self_c;
    auto ret_value = qt_value->applicationPid();
    return ret_value;
}

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

static void core_application_add_library_path(struct RUBase* self_c, const char* arg0) {
    QCoreApplication* qt_value = (QCoreApplication*)self_c;
    qt_value->addLibraryPath(QString::fromUtf8(arg0));
}

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

static void core_application_remove_library_path(struct RUBase* self_c, const char* arg0) {
    QCoreApplication* qt_value = (QCoreApplication*)self_c;
    qt_value->removeLibraryPath(QString::fromUtf8(arg0));
}

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

static void core_application_flush(struct RUBase* self_c) {
    QCoreApplication* qt_value = (QCoreApplication*)self_c;
    qt_value->flush();
}

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

static bool core_application_is_quit_lock_enabled(struct RUBase* self_c) {
    QCoreApplication* qt_value = (QCoreApplication*)self_c;
    auto ret_value = qt_value->isQuitLockEnabled();
    return ret_value;
}

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

static void core_application_set_quit_lock_enabled(struct RUBase* self_c, bool enabled) {
    QCoreApplication* qt_value = (QCoreApplication*)self_c;
    qt_value->setQuitLockEnabled(enabled);
}

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

static void core_application_quit(struct RUBase* self_c) {
    QCoreApplication* qt_value = (QCoreApplication*)self_c;
    qt_value->quit();
}

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

static void set_core_application_about_to_quit_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(aboutToQuit()), wrap, SLOT(method()));
}

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

static struct RUCoreApplication get_core_application(struct RUBase* priv_data) {
    (void)priv_data;
    RUCoreApplication ctl;
    ctl.qt_data = nullptr;
    ctl.host_data = nullptr;
    ctl.all_funcs = &s_core_application_all_funcs;
    return ctl;
}

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

struct RUCoreApplicationFuncs s_core_application_funcs = {
    core_application_set_organization_domain,
    core_application_organization_domain,
    core_application_set_organization_name,
    core_application_organization_name,
    core_application_set_application_name,
    core_application_application_name,
    core_application_set_application_version,
    core_application_application_version,
    core_application_set_setuid_allowed,
    core_application_is_setuid_allowed,
    core_application_instance,
    core_application_exec,
    core_application_exit,
    core_application_send_event,
    core_application_post_event,
    core_application_send_posted_events,
    core_application_remove_posted_events,
    core_application_has_pending_events,
    core_application_starting_up,
    core_application_closing_down,
    core_application_application_dir_path,
    core_application_application_file_path,
    core_application_application_pid,
    core_application_add_library_path,
    core_application_remove_library_path,
    core_application_flush,
    core_application_is_quit_lock_enabled,
    core_application_set_quit_lock_enabled,
    core_application_quit,
    set_core_application_about_to_quit_event,
};

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

struct RUCoreApplicationAllFuncs s_core_application_all_funcs = {
    &s_object_funcs,
    &s_core_application_funcs,
};