aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/lua/luaqttypes.h
blob: 9df10e1a0295750ebf341fd45f342ae7c31e4175 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright (C) 2024 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#pragma once

// DO NOT INCLUDE THIS YOURSELF!!1!

#include "lua_global.h"

#include <QColor>
#include <QList>
#include <QRect>
#include <QString>

#define SOL_CONVERSION_FUNCTIONS(TYPE) \
    bool LUA_EXPORT sol_lua_check(sol::types<TYPE>, \
                                  lua_State *L, \
                                  int index, \
                                  std::function<sol::check_handler_type> handler, \
                                  sol::stack::record &tracking); \
    TYPE LUA_EXPORT sol_lua_get(sol::types<TYPE>, \
                                lua_State *L, \
                                int index, \
                                sol::stack::record &tracking); \
    int LUA_EXPORT sol_lua_push(sol::types<TYPE>, lua_State *L, const TYPE &rect);

SOL_CONVERSION_FUNCTIONS(QString)

SOL_CONVERSION_FUNCTIONS(QRect)
SOL_CONVERSION_FUNCTIONS(QSize)
SOL_CONVERSION_FUNCTIONS(QPoint)
SOL_CONVERSION_FUNCTIONS(QRectF)
SOL_CONVERSION_FUNCTIONS(QSizeF)
SOL_CONVERSION_FUNCTIONS(QPointF)
SOL_CONVERSION_FUNCTIONS(QColor)

SOL_CONVERSION_FUNCTIONS(QStringList)

#undef SOL_CONVERSION_FUNCTIONS