| | | @@ -0,0 +1,955 @@ |
| 1 | + | /* |
| 2 | + | * Copyright (c) 2010-2017 OTClient <https://github.com/edubart/otclient> |
| 3 | + | * |
| 4 | + | * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 5 | + | * of this software and associated documentation files (the "Software"), to deal |
| 6 | + | * in the Software without restriction, including without limitation the rights |
| 7 | + | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 8 | + | * copies of the Software, and to permit persons to whom the Software is |
| 9 | + | * furnished to do so, subject to the following conditions: |
| 10 | + | * |
| 11 | + | * The above copyright notice and this permission notice shall be included in |
| 12 | + | * all copies or substantial portions of the Software. |
| 13 | + | * |
| 14 | + | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 15 | + | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 16 | + | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 17 | + | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 18 | + | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 19 | + | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 20 | + | * THE SOFTWARE. |
| 21 | + | */ |
| 22 | + | |
| 23 | + | #include <framework/core/application.h> |
| 24 | + | #include <framework/core/adaptiverenderer.h> |
| 25 | + | #include <framework/luaengine/luainterface.h> |
| 26 | + | #include <framework/core/eventdispatcher.h> |
| 27 | + | #include <framework/core/configmanager.h> |
| 28 | + | #include <framework/core/config.h> |
| 29 | + | #include <framework/otml/otml.h> |
| 30 | + | #include <framework/core/modulemanager.h> |
| 31 | + | #include <framework/core/module.h> |
| 32 | + | #include <framework/util/crypt.h> |
| 33 | + | #include <framework/core/resourcemanager.h> |
| 34 | + | #include <framework/graphics/texturemanager.h> |
| 35 | + | #include <framework/stdext/net.h> |
| 36 | + | #include <framework/platform/platform.h> |
| 37 | + | #include <framework/util/stats.h> |
| 38 | + | #include <regex> |
| 39 | + | |
| 40 | + | #ifdef FW_SOUND |
| 41 | + | #include <framework/sound/soundmanager.h> |
| 42 | + | #include <framework/sound/soundsource.h> |
| 43 | + | #include <framework/sound/soundchannel.h> |
| 44 | + | #include <framework/sound/combinedsoundsource.h> |
| 45 | + | #include <framework/sound/streamsoundsource.h> |
| 46 | + | #endif |
| 47 | + | |
| 48 | + | #ifdef FW_GRAPHICS |
| 49 | + | #include <framework/graphics/graphics.h> |
| 50 | + | #include <framework/graphics/atlas.h> |
| 51 | + | #include <framework/platform/platformwindow.h> |
| 52 | + | #include <framework/graphics/fontmanager.h> |
| 53 | + | #include <framework/graphics/shadermanager.h> |
| 54 | + | #include <framework/ui/ui.h> |
| 55 | + | #include <framework/input/mouse.h> |
| 56 | + | #endif |
| 57 | + | |
| 58 | + | #include <framework/net/server.h> |
| 59 | + | #include <framework/net/protocol.h> |
| 60 | + | #include <framework/http/http.h> |
| 61 | + | #include <framework/proxy/proxy.h> |
| 62 | + | |
| 63 | + | #include <framework/util/extras.h> |
| 64 | + | |
| 65 | + | void Application::registerLuaFunctions() |
| 66 | + | { |
| 67 | + | // conversion globals |
| 68 | + | g_lua.bindGlobalFunction("torect", [](const std::string& v) { return stdext::from_string<Rect>(v); }); |
| 69 | + | g_lua.bindGlobalFunction("topoint", [](const std::string& v) { return stdext::from_string<Point>(v); }); |
| 70 | + | g_lua.bindGlobalFunction("tocolor", [](const std::string& v) { return stdext::from_string<Color>(v); }); |
| 71 | + | g_lua.bindGlobalFunction("tosize", [](const std::string& v) { return stdext::from_string<Size>(v); }); |
| 72 | + | g_lua.bindGlobalFunction("recttostring", [](const Rect& v) { return stdext::to_string(v); }); |
| 73 | + | g_lua.bindGlobalFunction("pointtostring", [](const Point& v) { return stdext::to_string(v); }); |
| 74 | + | g_lua.bindGlobalFunction("colortostring", [](const Color& v) { return stdext::to_string(v); }); |
| 75 | + | g_lua.bindGlobalFunction("sizetostring", [](const Size& v) { return stdext::to_string(v); }); |
| 76 | + | g_lua.bindGlobalFunction("iptostring", [](uint32 v) { return stdext::ip_to_string(v); }); |
| 77 | + | g_lua.bindGlobalFunction("stringtoip", [](const std::string& v) { return stdext::string_to_ip(v); }); |
| 78 | + | g_lua.bindGlobalFunction("listSubnetAddresses", [](uint32 a, uint8 b) { return stdext::listSubnetAddresses(a, b); }); |
| 79 | + | g_lua.bindGlobalFunction("ucwords", [](std::string s) { return stdext::ucwords(s); }); |
| 80 | + | g_lua.bindGlobalFunction("regexMatch", [](std::string s, const std::string& exp) { |
| 81 | + | int limit = 10000; |
| 82 | + | std::vector<std::vector<std::string>> ret; |
| 83 | + | if (s.empty() || exp.empty()) |
| 84 | + | return ret; |
| 85 | + | try { |
| 86 | + | std::smatch m; |
| 87 | + | std::regex e(exp, std::regex::ECMAScript); |
| 88 | + | while (std::regex_search (s,m,e)) { |
| 89 | + | ret.push_back(std::vector<std::string>()); |
| 90 | + | for (auto x:m) |
| 91 | + | ret[ret.size() - 1].push_back(x); |
| 92 | + | s = m.suffix().str(); |
| 93 | + | if (--limit == 0) |
| 94 | + | return ret; |
| 95 | + | } |
| 96 | + | } catch (...) { |
| 97 | + | } |
| 98 | + | return ret; |
| 99 | + | }); |
| 100 | + | |
| 101 | + | // Platform |
| 102 | + | g_lua.registerSingletonClass("g_platform"); |
| 103 | + | #ifdef UNSAFE_LUA_FUNCTIONS |
| 104 | + | g_lua.bindSingletonFunction("g_platform", "spawnProcess", &Platform::spawnProcess, &g_platform); |
| 105 | + | g_lua.bindSingletonFunction("g_platform", "copyFile", &Platform::copyFile, &g_platform); |
| 106 | + | g_lua.bindSingletonFunction("g_platform", "fileExists", &Platform::fileExists, &g_platform); |
| 107 | + | g_lua.bindSingletonFunction("g_platform", "removeFile", &Platform::removeFile, &g_platform); |
| 108 | + | g_lua.bindSingletonFunction("g_platform", "killProcess", &Platform::killProcess, &g_platform); |
| 109 | + | #endif |
| 110 | + | g_lua.bindSingletonFunction("g_platform", "getProcessId", &Platform::getProcessId, &g_platform); |
| 111 | + | g_lua.bindSingletonFunction("g_platform", "isProcessRunning", &Platform::isProcessRunning, &g_platform); |
| 112 | + | g_lua.bindSingletonFunction("g_platform", "getTempPath", &Platform::getTempPath, &g_platform); |
| 113 | + | g_lua.bindSingletonFunction("g_platform", "openUrl", &Platform::openUrl, &g_platform); |
| 114 | + | g_lua.bindSingletonFunction("g_platform", "openDir", &Platform::openDir, &g_platform); |
| 115 | + | g_lua.bindSingletonFunction("g_platform", "getCPUName", &Platform::getCPUName, &g_platform); |
| 116 | + | g_lua.bindSingletonFunction("g_platform", "getTotalSystemMemory", &Platform::getTotalSystemMemory, &g_platform); |
| 117 | + | g_lua.bindSingletonFunction("g_platform", "getMemoryUsage", &Platform::getMemoryUsage, &g_platform); |
| 118 | + | g_lua.bindSingletonFunction("g_platform", "getOSName", &Platform::getOSName, &g_platform); |
| 119 | + | g_lua.bindSingletonFunction("g_platform", "getFileModificationTime", &Platform::getFileModificationTime, &g_platform); |
| 120 | + | g_lua.bindSingletonFunction("g_platform", "getMacAddresses", &Platform::getMacAddresses, &g_platform); |
| 121 | + | g_lua.bindSingletonFunction("g_platform", "getUserName", &Platform::getUserName, &g_platform); |
| 122 | + | #ifdef UNSAFE_LUA_FUNCTIONS |
| 123 | + | g_lua.bindSingletonFunction("g_platform", "getDlls", &Platform::getDlls, &g_platform); |
| 124 | + | g_lua.bindSingletonFunction("g_platform", "getProcesses", &Platform::getProcesses, &g_platform); |
| 125 | + | g_lua.bindSingletonFunction("g_platform", "getWindows", &Platform::getWindows, &g_platform); |
| 126 | + | #endif |
| 127 | + | |
| 128 | + | // Application |
| 129 | + | g_lua.registerSingletonClass("g_app"); |
| 130 | + | g_lua.bindSingletonFunction("g_app", "setName", &Application::setName, static_cast<Application*>(&g_app)); |
| 131 | + | g_lua.bindSingletonFunction("g_app", "setCompactName", &Application::setCompactName, static_cast<Application*>(&g_app)); |
| 132 | + | g_lua.bindSingletonFunction("g_app", "setVersion", &Application::setVersion, static_cast<Application*>(&g_app)); |
| 133 | + | g_lua.bindSingletonFunction("g_app", "isRunning", &Application::isRunning, static_cast<Application*>(&g_app)); |
| 134 | + | g_lua.bindSingletonFunction("g_app", "isStopping", &Application::isStopping, static_cast<Application*>(&g_app)); |
| 135 | + | g_lua.bindSingletonFunction("g_app", "getName", &Application::getName, static_cast<Application*>(&g_app)); |
| 136 | + | g_lua.bindSingletonFunction("g_app", "getCompactName", &Application::getCompactName, static_cast<Application*>(&g_app)); |
| 137 | + | g_lua.bindSingletonFunction("g_app", "getVersion", &Application::getVersion, static_cast<Application*>(&g_app)); |
| 138 | + | g_lua.bindSingletonFunction("g_app", "getBuildCompiler", &Application::getBuildCompiler, static_cast<Application*>(&g_app)); |
| 139 | + | g_lua.bindSingletonFunction("g_app", "getBuildDate", &Application::getBuildDate, static_cast<Application*>(&g_app)); |
| 140 | + | g_lua.bindSingletonFunction("g_app", "getBuildRevision", &Application::getBuildRevision, static_cast<Application*>(&g_app)); |
| 141 | + | g_lua.bindSingletonFunction("g_app", "getBuildCommit", &Application::getBuildCommit, static_cast<Application*>(&g_app)); |
| 142 | + | g_lua.bindSingletonFunction("g_app", "getBuildType", &Application::getBuildType, static_cast<Application*>(&g_app)); |
| 143 | + | g_lua.bindSingletonFunction("g_app", "getBuildArch", &Application::getBuildArch, static_cast<Application*>(&g_app)); |
| 144 | + | g_lua.bindSingletonFunction("g_app", "getAuthor", &Application::getAuthor, static_cast<Application*>(&g_app)); |
| 145 | + | g_lua.bindSingletonFunction("g_app", "getOs", &Application::getOs, static_cast<Application*>(&g_app)); |
| 146 | + | g_lua.bindSingletonFunction("g_app", "getStartupOptions", &Application::getStartupOptions, static_cast<Application*>(&g_app)); |
| 147 | + | g_lua.bindSingletonFunction("g_app", "exit", &Application::exit, static_cast<Application*>(&g_app)); |
| 148 | + | g_lua.bindSingletonFunction("g_app", "quick_exit", &Application::quick_exit, static_cast<Application*>(&g_app)); |
| 149 | + | g_lua.bindSingletonFunction("g_app", "isMobile", &Application::isMobile, static_cast<Application*>(&g_app)); |
| 150 | + | g_lua.bindSingletonFunction("g_app", "restart", &Application::restart, static_cast<Application*>(&g_app)); |
| 151 | + | g_lua.bindSingletonFunction("g_app", "restartArgs", &Application::restartArgs, static_cast<Application*>(&g_app)); |
| 152 | + | |
| 153 | + | // Crypt |
| 154 | + | g_lua.registerSingletonClass("g_crypt"); |
| 155 | + | g_lua.bindSingletonFunction("g_crypt", "genUUID", &Crypt::genUUID, &g_crypt); |
| 156 | + | g_lua.bindSingletonFunction("g_crypt", "setMachineUUID", &Crypt::setMachineUUID, &g_crypt); |
| 157 | + | g_lua.bindSingletonFunction("g_crypt", "getMachineUUID", &Crypt::getMachineUUID, &g_crypt); |
| 158 | + | g_lua.bindSingletonFunction("g_crypt", "encrypt", &Crypt::encrypt, &g_crypt); |
| 159 | + | g_lua.bindSingletonFunction("g_crypt", "decrypt", &Crypt::decrypt, &g_crypt); |
| 160 | + | g_lua.bindSingletonFunction("g_crypt", "sha1Encode", &Crypt::sha1Encode, &g_crypt); |
| 161 | + | g_lua.bindSingletonFunction("g_crypt", "md5Encode", &Crypt::md5Encode, &g_crypt); |
| 162 | + | g_lua.bindSingletonFunction("g_crypt", "crc32", &Crypt::crc32, &g_crypt); |
| 163 | + | g_lua.bindSingletonFunction("g_crypt", "rsaGenerateKey", &Crypt::rsaGenerateKey, &g_crypt); |
| 164 | + | g_lua.bindSingletonFunction("g_crypt", "rsaSetPublicKey", &Crypt::rsaSetPublicKey, &g_crypt); |
| 165 | + | g_lua.bindSingletonFunction("g_crypt", "rsaSetPrivateKey", &Crypt::rsaSetPrivateKey, &g_crypt); |
| 166 | + | g_lua.bindSingletonFunction("g_crypt", "rsaCheckKey", &Crypt::rsaCheckKey, &g_crypt); |
| 167 | + | g_lua.bindSingletonFunction("g_crypt", "rsaGetSize", &Crypt::rsaGetSize, &g_crypt); |
| 168 | + | |
| 169 | + | // Clock |
| 170 | + | g_lua.registerSingletonClass("g_clock"); |
| 171 | + | g_lua.bindSingletonFunction("g_clock", "micros", &Clock::micros, &g_clock); |
| 172 | + | g_lua.bindSingletonFunction("g_clock", "millis", &Clock::millis, &g_clock); |
| 173 | + | g_lua.bindSingletonFunction("g_clock", "seconds", &Clock::seconds, &g_clock); |
| 174 | + | g_lua.bindSingletonFunction("g_clock", "realMillis", &Clock::realMillis, &g_clock); |
| 175 | + | g_lua.bindSingletonFunction("g_clock", "realMicros", &Clock::realMicros, &g_clock); |
| 176 | + | |
| 177 | + | // ConfigManager |
| 178 | + | g_lua.registerSingletonClass("g_configs"); |
| 179 | + | g_lua.bindSingletonFunction("g_configs", "getSettings", &ConfigManager::getSettings, &g_configs); |
| 180 | + | g_lua.bindSingletonFunction("g_configs", "get", &ConfigManager::get, &g_configs); |
| 181 | + | g_lua.bindSingletonFunction("g_configs", "loadSettings", &ConfigManager::loadSettings, &g_configs); |
| 182 | + | g_lua.bindSingletonFunction("g_configs", "load", &ConfigManager::load, &g_configs); |
| 183 | + | g_lua.bindSingletonFunction("g_configs", "unload", &ConfigManager::unload, &g_configs); |
| 184 | + | g_lua.bindSingletonFunction("g_configs", "create", &ConfigManager::create, &g_configs); |
| 185 | + | |
| 186 | + | // Logger |
| 187 | + | g_lua.registerSingletonClass("g_logger"); |
| 188 | + | g_lua.bindSingletonFunction("g_logger", "log", &Logger::log, &g_logger); |
| 189 | + | g_lua.bindSingletonFunction("g_logger", "fireOldMessages", &Logger::fireOldMessages, &g_logger); |
| 190 | + | g_lua.bindSingletonFunction("g_logger", "setLogFile", &Logger::setLogFile, &g_logger); |
| 191 | + | g_lua.bindSingletonFunction("g_logger", "setOnLog", &Logger::setOnLog, &g_logger); |
| 192 | + | g_lua.bindSingletonFunction("g_logger", "debug", &Logger::debug, &g_logger); |
| 193 | + | g_lua.bindSingletonFunction("g_logger", "info", &Logger::info, &g_logger); |
| 194 | + | g_lua.bindSingletonFunction("g_logger", "warning", &Logger::warning, &g_logger); |
| 195 | + | g_lua.bindSingletonFunction("g_logger", "error", &Logger::error, &g_logger); |
| 196 | + | g_lua.bindSingletonFunction("g_logger", "fatal", &Logger::fatal, &g_logger); |
| 197 | + | g_lua.bindSingletonFunction("g_logger", "getLastLog", &Logger::getLastLog, &g_logger); |
| 198 | + | |
| 199 | + | // Lua stats |
| 200 | + | g_lua.registerSingletonClass("g_stats"); |
| 201 | + | g_lua.bindSingletonFunction("g_stats", "types", &Stats::types, &g_stats); |
| 202 | + | g_lua.bindSingletonFunction("g_stats", "get", &Stats::get, &g_stats); |
| 203 | + | g_lua.bindSingletonFunction("g_stats", "clear", &Stats::clear, &g_stats); |
| 204 | + | g_lua.bindSingletonFunction("g_stats", "clearAll", &Stats::clearAll, &g_stats); |
| 205 | + | g_lua.bindSingletonFunction("g_stats", "getSlow", &Stats::getSlow, &g_stats); |
| 206 | + | g_lua.bindSingletonFunction("g_stats", "clearSlow", &Stats::clearSlow, &g_stats); |
| 207 | + | g_lua.bindSingletonFunction("g_stats", "getSleepTime", &Stats::getSleepTime, &g_stats); |
| 208 | + | g_lua.bindSingletonFunction("g_stats", "resetSleepTime", &Stats::resetSleepTime, &g_stats); |
| 209 | + | g_lua.bindSingletonFunction("g_stats", "getWidgetsInfo", &Stats::getWidgetsInfo, &g_stats); |
| 210 | + | |
| 211 | + | g_lua.registerSingletonClass("g_extras"); |
| 212 | + | g_lua.bindSingletonFunction("g_extras", "set", &Extras::set, &g_extras); |
| 213 | + | g_lua.bindSingletonFunction("g_extras", "get", &Extras::get, &g_extras); |
| 214 | + | g_lua.bindSingletonFunction("g_extras", "getDescription", &Extras::getDescription, &g_extras); |
| 215 | + | g_lua.bindSingletonFunction("g_extras", "getAll", &Extras::getAll, &g_extras); |
| 216 | + | |
| 217 | + | g_lua.registerSingletonClass("g_atlas"); |
| 218 | + | g_lua.bindSingletonFunction("g_atlas", "getStats", &Atlas::getStats, &g_atlas); |
| 219 | + | |
| 220 | + | // ModuleManager |
| 221 | + | g_lua.registerSingletonClass("g_modules"); |
| 222 | + | g_lua.bindSingletonFunction("g_modules", "discoverModules", &ModuleManager::discoverModules, &g_modules); |
| 223 | + | g_lua.bindSingletonFunction("g_modules", "autoLoadModules", &ModuleManager::autoLoadModules, &g_modules); |
| 224 | + | g_lua.bindSingletonFunction("g_modules", "discoverModule", &ModuleManager::discoverModule, &g_modules); |
| 225 | + | g_lua.bindSingletonFunction("g_modules", "ensureModuleLoaded", &ModuleManager::ensureModuleLoaded, &g_modules); |
| 226 | + | g_lua.bindSingletonFunction("g_modules", "unloadModules", &ModuleManager::unloadModules, &g_modules); |
| 227 | + | g_lua.bindSingletonFunction("g_modules", "reloadModules", &ModuleManager::reloadModules, &g_modules); |
| 228 | + | g_lua.bindSingletonFunction("g_modules", "getModule", &ModuleManager::getModule, &g_modules); |
| 229 | + | g_lua.bindSingletonFunction("g_modules", "getModules", &ModuleManager::getModules, &g_modules); |
| 230 | + | |
| 231 | + | // EventDispatcher |
| 232 | + | g_lua.registerSingletonClass("g_dispatcher"); |
| 233 | + | g_lua.bindSingletonFunction("g_dispatcher", "addEvent", &EventDispatcher::addEventEx, &g_dispatcher); |
| 234 | + | g_lua.bindSingletonFunction("g_dispatcher", "scheduleEvent", &EventDispatcher::scheduleEventEx, &g_dispatcher); |
| 235 | + | g_lua.bindSingletonFunction("g_dispatcher", "cycleEvent", &EventDispatcher::cycleEventEx, &g_dispatcher); |
| 236 | + | |
| 237 | + | // ResourceManager |
| 238 | + | g_lua.registerSingletonClass("g_resources"); |
| 239 | + | g_lua.bindSingletonFunction("g_resources", "fileExists", &ResourceManager::fileExists, &g_resources); |
| 240 | + | g_lua.bindSingletonFunction("g_resources", "directoryExists", &ResourceManager::directoryExists, &g_resources); |
| 241 | + | g_lua.bindSingletonFunction("g_resources", "getWorkDir", &ResourceManager::getWorkDir, &g_resources); |
| 242 | + | g_lua.bindSingletonFunction("g_resources", "getWriteDir", &ResourceManager::getWriteDir, &g_resources); |
| 243 | + | g_lua.bindSingletonFunction("g_resources", "getBinaryName", &ResourceManager::getBinaryName, &g_resources); |
| 244 | + | g_lua.bindSingletonFunction("g_resources", "listDirectoryFiles", &ResourceManager::listDirectoryFiles, &g_resources); |
| 245 | + | g_lua.bindSingletonFunction("g_resources", "isFileType", &ResourceManager::isFileType, &g_resources); |
| 246 | + | g_lua.bindSingletonFunction("g_resources", "readFileContents", &ResourceManager::readFileContentsSafe, &g_resources); |
| 247 | + | g_lua.bindSingletonFunction("g_resources", "writeFileContents", &ResourceManager::writeFileContents, &g_resources); |
| 248 | + | g_lua.bindSingletonFunction("g_resources", "guessFilePath", &ResourceManager::guessFilePath, &g_resources); |
| 249 | + | g_lua.bindSingletonFunction("g_resources", "makeDir", &ResourceManager::makeDir, &g_resources); |
| 250 | + | g_lua.bindSingletonFunction("g_resources", "deleteFile", &ResourceManager::deleteFile, &g_resources); |
| 251 | + | g_lua.bindSingletonFunction("g_resources", "readCrashLog", [] { return std::string(); }); |
| 252 | + | g_lua.bindSingletonFunction("g_resources", "deleteCrashLog", [] { return std::string(); }); |
| 253 | + | |
| 254 | + | g_lua.bindSingletonFunction("g_resources", "resolvePath", &ResourceManager::resolvePath, &g_resources); |
| 255 | + | g_lua.bindSingletonFunction("g_resources", "isLoadedFromMemory", &ResourceManager::isLoadedFromMemory, &g_resources); |
| 256 | + | g_lua.bindSingletonFunction("g_resources", "isLoadedFromArchive", &ResourceManager::isLoadedFromArchive, &g_resources); |
| 257 | + | g_lua.bindSingletonFunction("g_resources", "listUpdateableFiles", [] { return std::list<std::string>(); } ); |
| 258 | + | g_lua.bindSingletonFunction("g_resources", "fileChecksum", &ResourceManager::fileChecksum, &g_resources); |
| 259 | + | g_lua.bindSingletonFunction("g_resources", "filesChecksums", &ResourceManager::filesChecksums, &g_resources); |
| 260 | + | g_lua.bindSingletonFunction("g_resources", "selfChecksum", &ResourceManager::selfChecksum, &g_resources); |
| 261 | + | g_lua.bindSingletonFunction("g_resources", "updateData", &ResourceManager::updateData, &g_resources); |
| 262 | + | g_lua.bindSingletonFunction("g_resources", "updateExecutable", &ResourceManager::updateExecutable, &g_resources); |
| 263 | + | g_lua.bindSingletonFunction("g_resources", "createArchive", &ResourceManager::createArchive, &g_resources); |
| 264 | + | g_lua.bindSingletonFunction("g_resources", "decompressArchive", &ResourceManager::decompressArchive, &g_resources); |
| 265 | + | g_lua.bindSingletonFunction("g_resources", "setLayout", &ResourceManager::setLayout, &g_resources); |
| 266 | + | g_lua.bindSingletonFunction("g_resources", "getLayout", &ResourceManager::getLayout, &g_resources); |
| 267 | + | |
| 268 | + | // Config |
| 269 | + | g_lua.registerClass<Config>(); |
| 270 | + | g_lua.bindClassMemberFunction<Config>("save", &Config::save); |
| 271 | + | g_lua.bindClassMemberFunction<Config>("setValue", &Config::setValue); |
| 272 | + | g_lua.bindClassMemberFunction<Config>("setList", &Config::setList); |
| 273 | + | g_lua.bindClassMemberFunction<Config>("getValue", &Config::getValue); |
| 274 | + | g_lua.bindClassMemberFunction<Config>("getList", &Config::getList); |
| 275 | + | g_lua.bindClassMemberFunction<Config>("exists", &Config::exists); |
| 276 | + | g_lua.bindClassMemberFunction<Config>("remove", &Config::remove); |
| 277 | + | g_lua.bindClassMemberFunction<Config>("setNode", &Config::setNode); |
| 278 | + | g_lua.bindClassMemberFunction<Config>("getNode", &Config::getNode); |
| 279 | + | g_lua.bindClassMemberFunction<Config>("getNodeSize", &Config::getNodeSize); |
| 280 | + | g_lua.bindClassMemberFunction<Config>("mergeNode", &Config::mergeNode); |
| 281 | + | g_lua.bindClassMemberFunction<Config>("getFileName", &Config::getFileName); |
| 282 | + | |
| 283 | + | // Module |
| 284 | + | g_lua.registerClass<Module>(); |
| 285 | + | g_lua.bindClassMemberFunction<Module>("load", &Module::load); |
| 286 | + | g_lua.bindClassMemberFunction<Module>("unload", &Module::unload); |
| 287 | + | g_lua.bindClassMemberFunction<Module>("reload", &Module::reload); |
| 288 | + | g_lua.bindClassMemberFunction<Module>("canReload", &Module::canReload); |
| 289 | + | g_lua.bindClassMemberFunction<Module>("canUnload", &Module::canUnload); |
| 290 | + | g_lua.bindClassMemberFunction<Module>("isLoaded", &Module::isLoaded); |
| 291 | + | g_lua.bindClassMemberFunction<Module>("isReloadble", &Module::isReloadable); |
| 292 | + | g_lua.bindClassMemberFunction<Module>("isSandboxed", &Module::isSandboxed); |
| 293 | + | g_lua.bindClassMemberFunction<Module>("getDescription", &Module::getDescription); |
| 294 | + | g_lua.bindClassMemberFunction<Module>("getName", &Module::getName); |
| 295 | + | g_lua.bindClassMemberFunction<Module>("getAuthor", &Module::getAuthor); |
| 296 | + | g_lua.bindClassMemberFunction<Module>("getWebsite", &Module::getWebsite); |
| 297 | + | g_lua.bindClassMemberFunction<Module>("getVersion", &Module::getVersion); |
| 298 | + | g_lua.bindClassMemberFunction<Module>("getSandbox", &Module::getSandbox); |
| 299 | + | g_lua.bindClassMemberFunction<Module>("isAutoLoad", &Module::isAutoLoad); |
| 300 | + | g_lua.bindClassMemberFunction<Module>("getAutoLoadPriority", &Module::getAutoLoadPriority); |
| 301 | + | |
| 302 | + | // Event |
| 303 | + | g_lua.registerClass<Event>(); |
| 304 | + | g_lua.bindClassMemberFunction<Event>("cancel", &Event::cancel); |
| 305 | + | g_lua.bindClassMemberFunction<Event>("execute", &Event::execute); |
| 306 | + | g_lua.bindClassMemberFunction<Event>("isCanceled", &Event::isCanceled); |
| 307 | + | g_lua.bindClassMemberFunction<Event>("isExecuted", &Event::isExecuted); |
| 308 | + | |
| 309 | + | // ScheduledEvent |
| 310 | + | g_lua.registerClass<ScheduledEvent, Event>(); |
| 311 | + | g_lua.bindClassMemberFunction<ScheduledEvent>("nextCycle", &ScheduledEvent::nextCycle); |
| 312 | + | g_lua.bindClassMemberFunction<ScheduledEvent>("ticks", &ScheduledEvent::ticks); |
| 313 | + | g_lua.bindClassMemberFunction<ScheduledEvent>("remainingTicks", &ScheduledEvent::remainingTicks); |
| 314 | + | g_lua.bindClassMemberFunction<ScheduledEvent>("delay", &ScheduledEvent::delay); |
| 315 | + | g_lua.bindClassMemberFunction<ScheduledEvent>("cyclesExecuted", &ScheduledEvent::cyclesExecuted); |
| 316 | + | g_lua.bindClassMemberFunction<ScheduledEvent>("maxCycles", &ScheduledEvent::maxCycles); |
| 317 | + | |
| 318 | + | #ifdef FW_GRAPHICS |
| 319 | + | // GraphicalApplication |
| 320 | + | g_lua.bindSingletonFunction("g_app", "setMaxFps", &GraphicalApplication::setMaxFps, &g_app); |
| 321 | + | g_lua.bindSingletonFunction("g_app", "getMaxFps", &GraphicalApplication::getMaxFps, &g_app); |
| 322 | + | g_lua.bindSingletonFunction("g_app", "getFps", &GraphicalApplication::getFps, &g_app); |
| 323 | + | g_lua.bindSingletonFunction("g_app", "getGraphicsFps", &GraphicalApplication::getGraphicsFps, &g_app); |
| 324 | + | g_lua.bindSingletonFunction("g_app", "getProcessingFps", &GraphicalApplication::getProcessingFps, &g_app); |
| 325 | + | g_lua.bindSingletonFunction("g_app", "isOnInputEvent", &GraphicalApplication::isOnInputEvent, &g_app); |
| 326 | + | g_lua.bindSingletonFunction("g_app", "doScreenshot", &GraphicalApplication::doScreenshot, &g_app); |
| 327 | + | g_lua.bindSingletonFunction("g_app", "scaleDown", &GraphicalApplication::scaleDown, &g_app); |
| 328 | + | g_lua.bindSingletonFunction("g_app", "scaleUp", &GraphicalApplication::scaleUp, &g_app); |
| 329 | + | g_lua.bindSingletonFunction("g_app", "scale", &GraphicalApplication::scale, &g_app); |
| 330 | + | g_lua.bindSingletonFunction("g_app", "setSmooth", &GraphicalApplication::setSmooth, &g_app); |
| 331 | + | g_lua.bindSingletonFunction("g_app", "doMapScreenshot", &GraphicalApplication::doMapScreenshot, &g_app); |
| 332 | + | |
| 333 | + | // AdaptiveRenderer |
| 334 | + | g_lua.registerSingletonClass("g_adaptiveRenderer"); |
| 335 | + | g_lua.bindSingletonFunction("g_adaptiveRenderer", "getLevel", &AdaptiveRenderer::getLevel, &g_adaptiveRenderer); |
| 336 | + | g_lua.bindSingletonFunction("g_adaptiveRenderer", "setLevel", &AdaptiveRenderer::setForcedLevel, &g_adaptiveRenderer); |
| 337 | + | g_lua.bindSingletonFunction("g_adaptiveRenderer", "getDebugInfo", &AdaptiveRenderer::getDebugInfo, &g_adaptiveRenderer); |
| 338 | + | |
| 339 | + | // PlatformWindow |
| 340 | + | g_lua.registerSingletonClass("g_window"); |
| 341 | + | g_lua.bindSingletonFunction("g_window", "move", &PlatformWindow::move, &g_window); |
| 342 | + | g_lua.bindSingletonFunction("g_window", "resize", &PlatformWindow::resize, &g_window); |
| 343 | + | g_lua.bindSingletonFunction("g_window", "show", &PlatformWindow::show, &g_window); |
| 344 | + | g_lua.bindSingletonFunction("g_window", "hide", &PlatformWindow::hide, &g_window); |
| 345 | + | g_lua.bindSingletonFunction("g_window", "poll", [] {}); // for backward compability |
| 346 | + | g_lua.bindSingletonFunction("g_window", "maximize", &PlatformWindow::maximize, &g_window); |
| 347 | + | g_lua.bindSingletonFunction("g_window", "minimize", &PlatformWindow::minimize, &g_window); |
| 348 | + | g_lua.bindSingletonFunction("g_window", "restoreMouseCursor", &PlatformWindow::restoreMouseCursor, &g_window); |
| 349 | + | g_lua.bindSingletonFunction("g_window", "showMouse", &PlatformWindow::showMouse, &g_window); |
| 350 | + | g_lua.bindSingletonFunction("g_window", "hideMouse", &PlatformWindow::hideMouse, &g_window); |
| 351 | + | g_lua.bindSingletonFunction("g_window", "setTitle", &PlatformWindow::setTitle, &g_window); |
| 352 | + | g_lua.bindSingletonFunction("g_window", "setMouseCursor", &PlatformWindow::setMouseCursor, &g_window); |
| 353 | + | g_lua.bindSingletonFunction("g_window", "setMinimumSize", &PlatformWindow::setMinimumSize, &g_window); |
| 354 | + | g_lua.bindSingletonFunction("g_window", "setFullscreen", &PlatformWindow::setFullscreen, &g_window); |
| 355 | + | g_lua.bindSingletonFunction("g_window", "setVerticalSync", &PlatformWindow::setVerticalSync, &g_window); |
| 356 | + | g_lua.bindSingletonFunction("g_window", "setIcon", &PlatformWindow::setIcon, &g_window); |
| 357 | + | g_lua.bindSingletonFunction("g_window", "setClipboardText", &PlatformWindow::setClipboardText, &g_window); |
| 358 | + | g_lua.bindSingletonFunction("g_window", "getDisplaySize", &PlatformWindow::getDisplaySize, &g_window); |
| 359 | + | g_lua.bindSingletonFunction("g_window", "getClipboardText", &PlatformWindow::getClipboardText, &g_window); |
| 360 | + | g_lua.bindSingletonFunction("g_window", "getPlatformType", &PlatformWindow::getPlatformType, &g_window); |
| 361 | + | g_lua.bindSingletonFunction("g_window", "getDisplayWidth", &PlatformWindow::getDisplayWidth, &g_window); |
| 362 | + | g_lua.bindSingletonFunction("g_window", "getDisplayHeight", &PlatformWindow::getDisplayHeight, &g_window); |
| 363 | + | g_lua.bindSingletonFunction("g_window", "getUnmaximizedSize", &PlatformWindow::getUnmaximizedSize, &g_window); |
| 364 | + | g_lua.bindSingletonFunction("g_window", "getSize", &PlatformWindow::getSize, &g_window); |
| 365 | + | g_lua.bindSingletonFunction("g_window", "getWidth", &PlatformWindow::getWidth, &g_window); |
| 366 | + | g_lua.bindSingletonFunction("g_window", "getHeight", &PlatformWindow::getHeight, &g_window); |
| 367 | + | g_lua.bindSingletonFunction("g_window", "getUnmaximizedPos", &PlatformWindow::getUnmaximizedPos, &g_window); |
| 368 | + | g_lua.bindSingletonFunction("g_window", "getPosition", &PlatformWindow::getPosition, &g_window); |
| 369 | + | g_lua.bindSingletonFunction("g_window", "getX", &PlatformWindow::getX, &g_window); |
| 370 | + | g_lua.bindSingletonFunction("g_window", "getY", &PlatformWindow::getY, &g_window); |
| 371 | + | g_lua.bindSingletonFunction("g_window", "getMousePosition", &PlatformWindow::getMousePosition, &g_window); |
| 372 | + | g_lua.bindSingletonFunction("g_window", "getKeyboardModifiers", &PlatformWindow::getKeyboardModifiers, &g_window); |
| 373 | + | g_lua.bindSingletonFunction("g_window", "isKeyPressed", &PlatformWindow::isKeyPressed, &g_window); |
| 374 | + | g_lua.bindSingletonFunction("g_window", "isMouseButtonPressed", &PlatformWindow::isMouseButtonPressed, &g_window); |
| 375 | + | g_lua.bindSingletonFunction("g_window", "isVisible", &PlatformWindow::isVisible, &g_window); |
| 376 | + | g_lua.bindSingletonFunction("g_window", "isFullscreen", &PlatformWindow::isFullscreen, &g_window); |
| 377 | + | g_lua.bindSingletonFunction("g_window", "isMaximized", &PlatformWindow::isMaximized, &g_window); |
| 378 | + | g_lua.bindSingletonFunction("g_window", "hasFocus", &PlatformWindow::hasFocus, &g_window); |
| 379 | + | g_lua.bindSingletonFunction("g_window", "showTextEditor", &PlatformWindow::showTextEditor, &g_window); |
| 380 | + | g_lua.bindSingletonFunction("g_window", "flash", &PlatformWindow::flash, &g_window); |
| 381 | + | |
| 382 | + | // Input |
| 383 | + | g_lua.registerSingletonClass("g_mouse"); |
| 384 | + | g_lua.bindSingletonFunction("g_mouse", "loadCursors", &Mouse::loadCursors, &g_mouse); |
| 385 | + | g_lua.bindSingletonFunction("g_mouse", "addCursor", &Mouse::addCursor, &g_mouse); |
| 386 | + | g_lua.bindSingletonFunction("g_mouse", "pushCursor", &Mouse::pushCursor, &g_mouse); |
| 387 | + | g_lua.bindSingletonFunction("g_mouse", "popCursor", &Mouse::popCursor, &g_mouse); |
| 388 | + | g_lua.bindSingletonFunction("g_mouse", "isCursorChanged", &Mouse::isCursorChanged, &g_mouse); |
| 389 | + | g_lua.bindSingletonFunction("g_mouse", "isPressed", &Mouse::isPressed, &g_mouse); |
| 390 | + | |
| 391 | + | // Graphics |
| 392 | + | g_lua.registerSingletonClass("g_graphics"); |
| 393 | + | g_lua.bindSingletonFunction("g_graphics", "getVendor", &Graphics::getVendor, &g_graphics); |
| 394 | + | g_lua.bindSingletonFunction("g_graphics", "getRenderer", &Graphics::getRenderer, &g_graphics); |
| 395 | + | g_lua.bindSingletonFunction("g_graphics", "getVersion", &Graphics::getVersion, &g_graphics); |
| 396 | + | g_lua.bindSingletonFunction("g_graphics", "getExtensions", &Graphics::getExtensions, &g_graphics); |
| 397 | + | |
| 398 | + | // Textures |
| 399 | + | g_lua.registerSingletonClass("g_textures"); |
| 400 | + | g_lua.bindSingletonFunction("g_textures", "preload", &TextureManager::preload, &g_textures); |
| 401 | + | g_lua.bindSingletonFunction("g_textures", "clearCache", &TextureManager::clearCache, &g_textures); |
| 402 | + | g_lua.bindSingletonFunction("g_textures", "reload", &TextureManager::reload, &g_textures); |
| 403 | + | |
| 404 | + | // Shaders |
| 405 | + | g_lua.registerSingletonClass("g_shaders"); |
| 406 | + | g_lua.bindSingletonFunction("g_shaders", "createShader", &ShaderManager::createShader, &g_shaders); |
| 407 | + | g_lua.bindSingletonFunction("g_shaders", "createOutfitShader", &ShaderManager::createOutfitShader, &g_shaders); |
| 408 | + | g_lua.bindSingletonFunction("g_shaders", "addTexture", &ShaderManager::addTexture, &g_shaders); |
| 409 | + | |
| 410 | + | // UI |
| 411 | + | g_lua.registerSingletonClass("g_ui"); |
| 412 | + | g_lua.bindSingletonFunction("g_ui", "clearStyles", &UIManager::clearStyles, &g_ui); |
| 413 | + | g_lua.bindSingletonFunction("g_ui", "importStyle", &UIManager::importStyle, &g_ui); |
| 414 | + | g_lua.bindSingletonFunction("g_ui", "importStyleFromString", &UIManager::importStyleFromString, &g_ui); |
| 415 | + | g_lua.bindSingletonFunction("g_ui", "getStyle", &UIManager::getStyle, &g_ui); |
| 416 | + | g_lua.bindSingletonFunction("g_ui", "getStyleClass", &UIManager::getStyleClass, &g_ui); |
| 417 | + | g_lua.bindSingletonFunction("g_ui", "loadUI", &UIManager::loadUI, &g_ui); |
| 418 | + | g_lua.bindSingletonFunction("g_ui", "loadUIFromString", &UIManager::loadUIFromString, &g_ui); |
| 419 | + | g_lua.bindSingletonFunction("g_ui", "displayUI", &UIManager::displayUI, &g_ui); |
| 420 | + | g_lua.bindSingletonFunction("g_ui", "createWidget", &UIManager::createWidget, &g_ui); |
| 421 | + | g_lua.bindSingletonFunction("g_ui", "createWidgetFromOTML", &UIManager::createWidgetFromOTML, &g_ui); |
| 422 | + | g_lua.bindSingletonFunction("g_ui", "getRootWidget", &UIManager::getRootWidget, &g_ui); |
| 423 | + | g_lua.bindSingletonFunction("g_ui", "getDraggingWidget", &UIManager::getDraggingWidget, &g_ui); |
| 424 | + | g_lua.bindSingletonFunction("g_ui", "getPressedWidget", &UIManager::getPressedWidget, &g_ui); |
| 425 | + | g_lua.bindSingletonFunction("g_ui", "setDebugBoxesDrawing", &UIManager::setDebugBoxesDrawing, &g_ui); |
| 426 | + | g_lua.bindSingletonFunction("g_ui", "isDrawingDebugBoxes", &UIManager::isDrawingDebugBoxes, &g_ui); |
| 427 | + | g_lua.bindSingletonFunction("g_ui", "isMouseGrabbed", &UIManager::isMouseGrabbed, &g_ui); |
| 428 | + | g_lua.bindSingletonFunction("g_ui", "isKeyboardGrabbed", &UIManager::isKeyboardGrabbed, &g_ui); |
| 429 | + | |
| 430 | + | // FontManager |
| 431 | + | g_lua.registerSingletonClass("g_fonts"); |
| 432 | + | g_lua.bindSingletonFunction("g_fonts", "clearFonts", &FontManager::clearFonts, &g_fonts); |
| 433 | + | g_lua.bindSingletonFunction("g_fonts", "importFont", &FontManager::importFont, &g_fonts); |
| 434 | + | g_lua.bindSingletonFunction("g_fonts", "fontExists", &FontManager::fontExists, &g_fonts); |
| 435 | + | g_lua.bindSingletonFunction("g_fonts", "setDefaultFont", &FontManager::setDefaultFont, &g_fonts); |
| 436 | + | |
| 437 | + | // Particles, for backward compability |
| 438 | + | g_lua.registerSingletonClass("g_particles"); |
| 439 | + | g_lua.bindSingletonFunction("g_particles", "importParticle", [](const std::string& v) {}); |
| 440 | + | |
| 441 | + | // UIWidget |
| 442 | + | g_lua.registerClass<UIWidget>(); |
| 443 | + | g_lua.bindClassStaticFunction<UIWidget>("create", []{ return UIWidgetPtr(new UIWidget); }); |
| 444 | + | g_lua.bindClassMemberFunction<UIWidget>("addChild", &UIWidget::addChild); |
| 445 | + | g_lua.bindClassMemberFunction<UIWidget>("insertChild", &UIWidget::insertChild); |
| 446 | + | g_lua.bindClassMemberFunction<UIWidget>("removeChild", &UIWidget::removeChild); |
| 447 | + | g_lua.bindClassMemberFunction<UIWidget>("focusChild", &UIWidget::focusChild); |
| 448 | + | g_lua.bindClassMemberFunction<UIWidget>("focusNextChild", &UIWidget::focusNextChild); |
| 449 | + | g_lua.bindClassMemberFunction<UIWidget>("focusPreviousChild", &UIWidget::focusPreviousChild); |
| 450 | + | g_lua.bindClassMemberFunction<UIWidget>("lowerChild", &UIWidget::lowerChild); |
| 451 | + | g_lua.bindClassMemberFunction<UIWidget>("raiseChild", &UIWidget::raiseChild); |
| 452 | + | g_lua.bindClassMemberFunction<UIWidget>("moveChildToIndex", &UIWidget::moveChildToIndex); |
| 453 | + | g_lua.bindClassMemberFunction<UIWidget>("reorderChildren", &UIWidget::reorderChildren); |
| 454 | + | g_lua.bindClassMemberFunction<UIWidget>("lockChild", &UIWidget::lockChild); |
| 455 | + | g_lua.bindClassMemberFunction<UIWidget>("unlockChild", &UIWidget::unlockChild); |
| 456 | + | g_lua.bindClassMemberFunction<UIWidget>("mergeStyle", &UIWidget::mergeStyle); |
| 457 | + | g_lua.bindClassMemberFunction<UIWidget>("applyStyle", &UIWidget::applyStyle); |
| 458 | + | g_lua.bindClassMemberFunction<UIWidget>("addAnchor", &UIWidget::addAnchor); |
| 459 | + | g_lua.bindClassMemberFunction<UIWidget>("removeAnchor", &UIWidget::removeAnchor); |
| 460 | + | g_lua.bindClassMemberFunction<UIWidget>("fill", &UIWidget::fill); |
| 461 | + | g_lua.bindClassMemberFunction<UIWidget>("centerIn", &UIWidget::centerIn); |
| 462 | + | g_lua.bindClassMemberFunction<UIWidget>("breakAnchors", &UIWidget::breakAnchors); |
| 463 | + | g_lua.bindClassMemberFunction<UIWidget>("updateParentLayout", &UIWidget::updateParentLayout); |
| 464 | + | g_lua.bindClassMemberFunction<UIWidget>("updateLayout", &UIWidget::updateLayout); |
| 465 | + | g_lua.bindClassMemberFunction<UIWidget>("lock", &UIWidget::lock); |
| 466 | + | g_lua.bindClassMemberFunction<UIWidget>("unlock", &UIWidget::unlock); |
| 467 | + | g_lua.bindClassMemberFunction<UIWidget>("focus", &UIWidget::focus); |
| 468 | + | g_lua.bindClassMemberFunction<UIWidget>("lower", &UIWidget::lower); |
| 469 | + | g_lua.bindClassMemberFunction<UIWidget>("raise", &UIWidget::raise); |
| 470 | + | g_lua.bindClassMemberFunction<UIWidget>("grabMouse", &UIWidget::grabMouse); |
| 471 | + | g_lua.bindClassMemberFunction<UIWidget>("ungrabMouse", &UIWidget::ungrabMouse); |
| 472 | + | g_lua.bindClassMemberFunction<UIWidget>("grabKeyboard", &UIWidget::grabKeyboard); |
| 473 | + | g_lua.bindClassMemberFunction<UIWidget>("ungrabKeyboard", &UIWidget::ungrabKeyboard); |
| 474 | + | g_lua.bindClassMemberFunction<UIWidget>("bindRectToParent", &UIWidget::bindRectToParent); |
| 475 | + | g_lua.bindClassMemberFunction<UIWidget>("destroy", &UIWidget::destroy); |
| 476 | + | g_lua.bindClassMemberFunction<UIWidget>("destroyChildren", &UIWidget::destroyChildren); |
| 477 | + | g_lua.bindClassMemberFunction<UIWidget>("setId", &UIWidget::setId); |
| 478 | + | g_lua.bindClassMemberFunction<UIWidget>("setParent", &UIWidget::setParent); |
| 479 | + | g_lua.bindClassMemberFunction<UIWidget>("setLayout", &UIWidget::setLayout); |
| 480 | + | g_lua.bindClassMemberFunction<UIWidget>("setRect", &UIWidget::setRect); |
| 481 | + | g_lua.bindClassMemberFunction<UIWidget>("setStyle", &UIWidget::setStyle); |
| 482 | + | g_lua.bindClassMemberFunction<UIWidget>("setStyleFromNode", &UIWidget::setStyleFromNode); |
| 483 | + | g_lua.bindClassMemberFunction<UIWidget>("setEnabled", &UIWidget::setEnabled); |
| 484 | + | g_lua.bindClassMemberFunction<UIWidget>("setVisible", &UIWidget::setVisible); |
| 485 | + | g_lua.bindClassMemberFunction<UIWidget>("setOn", &UIWidget::setOn); |
| 486 | + | g_lua.bindClassMemberFunction<UIWidget>("setChecked", &UIWidget::setChecked); |
| 487 | + | g_lua.bindClassMemberFunction<UIWidget>("setFocusable", &UIWidget::setFocusable); |
| 488 | + | g_lua.bindClassMemberFunction<UIWidget>("setPhantom", &UIWidget::setPhantom); |
| 489 | + | g_lua.bindClassMemberFunction<UIWidget>("setDraggable", &UIWidget::setDraggable); |
| 490 | + | g_lua.bindClassMemberFunction<UIWidget>("setFixedSize", &UIWidget::setFixedSize); |
| 491 | + | g_lua.bindClassMemberFunction<UIWidget>("setClipping", &UIWidget::setClipping); |
| 492 | + | g_lua.bindClassMemberFunction<UIWidget>("setLastFocusReason", &UIWidget::setLastFocusReason); |
| 493 | + | g_lua.bindClassMemberFunction<UIWidget>("setAutoFocusPolicy", &UIWidget::setAutoFocusPolicy); |
| 494 | + | g_lua.bindClassMemberFunction<UIWidget>("setAutoRepeatDelay", &UIWidget::setAutoRepeatDelay); |
| 495 | + | g_lua.bindClassMemberFunction<UIWidget>("setVirtualOffset", &UIWidget::setVirtualOffset); |
| 496 | + | g_lua.bindClassMemberFunction<UIWidget>("isVisible", &UIWidget::isVisible); |
| 497 | + | g_lua.bindClassMemberFunction<UIWidget>("isChildLocked", &UIWidget::isChildLocked); |
| 498 | + | g_lua.bindClassMemberFunction<UIWidget>("hasChild", &UIWidget::hasChild); |
| 499 | + | g_lua.bindClassMemberFunction<UIWidget>("getChildIndex", &UIWidget::getChildIndex); |
| 500 | + | g_lua.bindClassMemberFunction<UIWidget>("getMarginRect", &UIWidget::getMarginRect); |
| 501 | + | g_lua.bindClassMemberFunction<UIWidget>("getPaddingRect", &UIWidget::getPaddingRect); |
| 502 | + | g_lua.bindClassMemberFunction<UIWidget>("getChildrenRect", &UIWidget::getChildrenRect); |
| 503 | + | g_lua.bindClassMemberFunction<UIWidget>("getAnchoredLayout", &UIWidget::getAnchoredLayout); |
| 504 | + | g_lua.bindClassMemberFunction<UIWidget>("getRootParent", &UIWidget::getRootParent); |
| 505 | + | g_lua.bindClassMemberFunction<UIWidget>("getChildAfter", &UIWidget::getChildAfter); |
| 506 | + | g_lua.bindClassMemberFunction<UIWidget>("getChildBefore", &UIWidget::getChildBefore); |
| 507 | + | g_lua.bindClassMemberFunction<UIWidget>("getChildById", &UIWidget::getChildById); |
| 508 | + | g_lua.bindClassMemberFunction<UIWidget>("getChildByPos", &UIWidget::getChildByPos); |
| 509 | + | g_lua.bindClassMemberFunction<UIWidget>("getChildByIndex", &UIWidget::getChildByIndex); |
| 510 | + | g_lua.bindClassMemberFunction<UIWidget>("recursiveGetChildById", &UIWidget::recursiveGetChildById); |
| 511 | + | g_lua.bindClassMemberFunction<UIWidget>("recursiveGetChildByPos", &UIWidget::recursiveGetChildByPos); |
| 512 | + | g_lua.bindClassMemberFunction<UIWidget>("recursiveGetChildren", &UIWidget::recursiveGetChildren); |
| 513 | + | g_lua.bindClassMemberFunction<UIWidget>("recursiveGetChildrenByPos", &UIWidget::recursiveGetChildrenByPos); |
| 514 | + | g_lua.bindClassMemberFunction<UIWidget>("recursiveGetChildrenByMarginPos", &UIWidget::recursiveGetChildrenByMarginPos); |
| 515 | + | g_lua.bindClassMemberFunction<UIWidget>("backwardsGetWidgetById", &UIWidget::backwardsGetWidgetById); |
| 516 | + | g_lua.bindClassMemberFunction<UIWidget>("resize", &UIWidget::resize); |
| 517 | + | g_lua.bindClassMemberFunction<UIWidget>("move", &UIWidget::move); |
| 518 | + | g_lua.bindClassMemberFunction<UIWidget>("hide", &UIWidget::hide); |
| 519 | + | g_lua.bindClassMemberFunction<UIWidget>("show", &UIWidget::show); |
| 520 | + | g_lua.bindClassMemberFunction<UIWidget>("disable", &UIWidget::disable); |
| 521 | + | g_lua.bindClassMemberFunction<UIWidget>("enable", &UIWidget::enable); |
| 522 | + | g_lua.bindClassMemberFunction<UIWidget>("isActive", &UIWidget::isActive); |
| 523 | + | g_lua.bindClassMemberFunction<UIWidget>("isEnabled", &UIWidget::isEnabled); |
| 524 | + | g_lua.bindClassMemberFunction<UIWidget>("isDisabled", &UIWidget::isDisabled); |
| 525 | + | g_lua.bindClassMemberFunction<UIWidget>("isFocused", &UIWidget::isFocused); |
| 526 | + | g_lua.bindClassMemberFunction<UIWidget>("isHovered", &UIWidget::isHovered); |
| 527 | + | g_lua.bindClassMemberFunction<UIWidget>("isPressed", &UIWidget::isPressed); |
| 528 | + | g_lua.bindClassMemberFunction<UIWidget>("isFirst", &UIWidget::isFirst); |
| 529 | + | g_lua.bindClassMemberFunction<UIWidget>("isMiddle", &UIWidget::isMiddle); |
| 530 | + | g_lua.bindClassMemberFunction<UIWidget>("isLast", &UIWidget::isLast); |
| 531 | + | g_lua.bindClassMemberFunction<UIWidget>("isAlternate", &UIWidget::isAlternate); |
| 532 | + | g_lua.bindClassMemberFunction<UIWidget>("isChecked", &UIWidget::isChecked); |
| 533 | + | g_lua.bindClassMemberFunction<UIWidget>("isOn", &UIWidget::isOn); |
| 534 | + | g_lua.bindClassMemberFunction<UIWidget>("isDragging", &UIWidget::isDragging); |
| 535 | + | g_lua.bindClassMemberFunction<UIWidget>("isHidden", &UIWidget::isHidden); |
| 536 | + | g_lua.bindClassMemberFunction<UIWidget>("isExplicitlyEnabled", &UIWidget::isExplicitlyEnabled); |
| 537 | + | g_lua.bindClassMemberFunction<UIWidget>("isExplicitlyVisible", &UIWidget::isExplicitlyVisible); |
| 538 | + | g_lua.bindClassMemberFunction<UIWidget>("isAutoDraw", &UIWidget::isAutoDraw); |
| 539 | + | g_lua.bindClassMemberFunction<UIWidget>("isFocusable", &UIWidget::isFocusable); |
| 540 | + | g_lua.bindClassMemberFunction<UIWidget>("isPhantom", &UIWidget::isPhantom); |
| 541 | + | g_lua.bindClassMemberFunction<UIWidget>("isDraggable", &UIWidget::isDraggable); |
| 542 | + | g_lua.bindClassMemberFunction<UIWidget>("isFixedSize", &UIWidget::isFixedSize); |
| 543 | + | g_lua.bindClassMemberFunction<UIWidget>("isClipping", &UIWidget::isClipping); |
| 544 | + | g_lua.bindClassMemberFunction<UIWidget>("isDestroyed", &UIWidget::isDestroyed); |
| 545 | + | g_lua.bindClassMemberFunction<UIWidget>("hasChildren", &UIWidget::hasChildren); |
| 546 | + | g_lua.bindClassMemberFunction<UIWidget>("containsMarginPoint", &UIWidget::containsMarginPoint); |
| 547 | + | g_lua.bindClassMemberFunction<UIWidget>("containsPaddingPoint", &UIWidget::containsPaddingPoint); |
| 548 | + | g_lua.bindClassMemberFunction<UIWidget>("containsPoint", &UIWidget::containsPoint); |
| 549 | + | g_lua.bindClassMemberFunction<UIWidget>("getId", &UIWidget::getId); |
| 550 | + | g_lua.bindClassMemberFunction<UIWidget>("getSource", &UIWidget::getSource); |
| 551 | + | g_lua.bindClassMemberFunction<UIWidget>("getParent", &UIWidget::getParent); |
| 552 | + | g_lua.bindClassMemberFunction<UIWidget>("getFocusedChild", &UIWidget::getFocusedChild); |
| 553 | + | g_lua.bindClassMemberFunction<UIWidget>("getChildren", &UIWidget::getChildren); |
| 554 | + | g_lua.bindClassMemberFunction<UIWidget>("getFirstChild", &UIWidget::getFirstChild); |
| 555 | + | g_lua.bindClassMemberFunction<UIWidget>("getLastChild", &UIWidget::getLastChild); |
| 556 | + | g_lua.bindClassMemberFunction<UIWidget>("getLayout", &UIWidget::getLayout); |
| 557 | + | g_lua.bindClassMemberFunction<UIWidget>("getStyle", &UIWidget::getStyle); |
| 558 | + | g_lua.bindClassMemberFunction<UIWidget>("getChildCount", &UIWidget::getChildCount); |
| 559 | + | g_lua.bindClassMemberFunction<UIWidget>("getLastFocusReason", &UIWidget::getLastFocusReason); |
| 560 | + | g_lua.bindClassMemberFunction<UIWidget>("getAutoFocusPolicy", &UIWidget::getAutoFocusPolicy); |
| 561 | + | g_lua.bindClassMemberFunction<UIWidget>("getAutoRepeatDelay", &UIWidget::getAutoRepeatDelay); |
| 562 | + | g_lua.bindClassMemberFunction<UIWidget>("getVirtualOffset", &UIWidget::getVirtualOffset); |
| 563 | + | g_lua.bindClassMemberFunction<UIWidget>("getStyleName", &UIWidget::getStyleName); |
| 564 | + | g_lua.bindClassMemberFunction<UIWidget>("getLastClickPosition", &UIWidget::getLastClickPosition); |
| 565 | + | g_lua.bindClassMemberFunction<UIWidget>("setX", &UIWidget::setX); |
| 566 | + | g_lua.bindClassMemberFunction<UIWidget>("setY", &UIWidget::setY); |
| 567 | + | g_lua.bindClassMemberFunction<UIWidget>("setWidth", &UIWidget::setWidth); |
| 568 | + | g_lua.bindClassMemberFunction<UIWidget>("setHeight", &UIWidget::setHeight); |
| 569 | + | g_lua.bindClassMemberFunction<UIWidget>("setSize", &UIWidget::setSize); |
| 570 | + | g_lua.bindClassMemberFunction<UIWidget>("setPosition", &UIWidget::setPosition); |
| 571 | + | g_lua.bindClassMemberFunction<UIWidget>("setColor", &UIWidget::setColor); |
| 572 | + | g_lua.bindClassMemberFunction<UIWidget>("setBackgroundColor", &UIWidget::setBackgroundColor); |
| 573 | + | g_lua.bindClassMemberFunction<UIWidget>("setBackgroundOffsetX", &UIWidget::setBackgroundOffsetX); |
| 574 | + | g_lua.bindClassMemberFunction<UIWidget>("setBackgroundOffsetY", &UIWidget::setBackgroundOffsetY); |
| 575 | + | g_lua.bindClassMemberFunction<UIWidget>("setBackgroundOffset", &UIWidget::setBackgroundOffset); |
| 576 | + | g_lua.bindClassMemberFunction<UIWidget>("setBackgroundWidth", &UIWidget::setBackgroundWidth); |
| 577 | + | g_lua.bindClassMemberFunction<UIWidget>("setBackgroundHeight", &UIWidget::setBackgroundHeight); |
| 578 | + | g_lua.bindClassMemberFunction<UIWidget>("setBackgroundSize", &UIWidget::setBackgroundSize); |
| 579 | + | g_lua.bindClassMemberFunction<UIWidget>("setBackgroundRect", &UIWidget::setBackgroundRect); |
| 580 | + | g_lua.bindClassMemberFunction<UIWidget>("setIcon", &UIWidget::setIcon); |
| 581 | + | g_lua.bindClassMemberFunction<UIWidget>("setIconColor", &UIWidget::setIconColor); |
| 582 | + | g_lua.bindClassMemberFunction<UIWidget>("setIconOffsetX", &UIWidget::setIconOffsetX); |
| 583 | + | g_lua.bindClassMemberFunction<UIWidget>("setIconOffsetY", &UIWidget::setIconOffsetY); |
| 584 | + | g_lua.bindClassMemberFunction<UIWidget>("setIconOffset", &UIWidget::setIconOffset); |
| 585 | + | g_lua.bindClassMemberFunction<UIWidget>("setIconWidth", &UIWidget::setIconWidth); |
| 586 | + | g_lua.bindClassMemberFunction<UIWidget>("setIconHeight", &UIWidget::setIconHeight); |
| 587 | + | g_lua.bindClassMemberFunction<UIWidget>("setIconSize", &UIWidget::setIconSize); |
| 588 | + | g_lua.bindClassMemberFunction<UIWidget>("setIconRect", &UIWidget::setIconRect); |
| 589 | + | g_lua.bindClassMemberFunction<UIWidget>("setIconClip", &UIWidget::setIconClip); |
| 590 | + | g_lua.bindClassMemberFunction<UIWidget>("setIconAlign", &UIWidget::setIconAlign); |
| 591 | + | g_lua.bindClassMemberFunction<UIWidget>("setBorderWidth", &UIWidget::setBorderWidth); |
| 592 | + | g_lua.bindClassMemberFunction<UIWidget>("setBorderWidthTop", &UIWidget::setBorderWidthTop); |
| 593 | + | g_lua.bindClassMemberFunction<UIWidget>("setBorderWidthRight", &UIWidget::setBorderWidthRight); |
| 594 | + | g_lua.bindClassMemberFunction<UIWidget>("setBorderWidthBottom", &UIWidget::setBorderWidthBottom); |
| 595 | + | g_lua.bindClassMemberFunction<UIWidget>("setBorderWidthLeft", &UIWidget::setBorderWidthLeft); |
| 596 | + | g_lua.bindClassMemberFunction<UIWidget>("setBorderColor", &UIWidget::setBorderColor); |
| 597 | + | g_lua.bindClassMemberFunction<UIWidget>("setBorderColorTop", &UIWidget::setBorderColorTop); |
| 598 | + | g_lua.bindClassMemberFunction<UIWidget>("setBorderColorRight", &UIWidget::setBorderColorRight); |
| 599 | + | g_lua.bindClassMemberFunction<UIWidget>("setBorderColorBottom", &UIWidget::setBorderColorBottom); |
| 600 | + | g_lua.bindClassMemberFunction<UIWidget>("setBorderColorLeft", &UIWidget::setBorderColorLeft); |
| 601 | + | g_lua.bindClassMemberFunction<UIWidget>("setMargin", &UIWidget::setMargin); |
| 602 | + | g_lua.bindClassMemberFunction<UIWidget>("setMarginHorizontal", &UIWidget::setMarginHorizontal); |
| 603 | + | g_lua.bindClassMemberFunction<UIWidget>("setMarginVertical", &UIWidget::setMarginVertical); |
| 604 | + | g_lua.bindClassMemberFunction<UIWidget>("setMarginTop", &UIWidget::setMarginTop); |
| 605 | + | g_lua.bindClassMemberFunction<UIWidget>("setMarginRight", &UIWidget::setMarginRight); |
| 606 | + | g_lua.bindClassMemberFunction<UIWidget>("setMarginBottom", &UIWidget::setMarginBottom); |
| 607 | + | g_lua.bindClassMemberFunction<UIWidget>("setMarginLeft", &UIWidget::setMarginLeft); |
| 608 | + | g_lua.bindClassMemberFunction<UIWidget>("setPadding", &UIWidget::setPadding); |
| 609 | + | g_lua.bindClassMemberFunction<UIWidget>("setPaddingHorizontal", &UIWidget::setPaddingHorizontal); |
| 610 | + | g_lua.bindClassMemberFunction<UIWidget>("setPaddingVertical", &UIWidget::setPaddingVertical); |
| 611 | + | g_lua.bindClassMemberFunction<UIWidget>("setPaddingTop", &UIWidget::setPaddingTop); |
| 612 | + | g_lua.bindClassMemberFunction<UIWidget>("setPaddingRight", &UIWidget::setPaddingRight); |
| 613 | + | g_lua.bindClassMemberFunction<UIWidget>("setPaddingBottom", &UIWidget::setPaddingBottom); |
| 614 | + | g_lua.bindClassMemberFunction<UIWidget>("setPaddingLeft", &UIWidget::setPaddingLeft); |
| 615 | + | g_lua.bindClassMemberFunction<UIWidget>("setOpacity", &UIWidget::setOpacity); |
| 616 | + | g_lua.bindClassMemberFunction<UIWidget>("setRotation", &UIWidget::setRotation); |
| 617 | + | g_lua.bindClassMemberFunction<UIWidget>("getX", &UIWidget::getX); |
| 618 | + | g_lua.bindClassMemberFunction<UIWidget>("getY", &UIWidget::getY); |
| 619 | + | g_lua.bindClassMemberFunction<UIWidget>("getPosition", &UIWidget::getPosition); |
| 620 | + | g_lua.bindClassMemberFunction<UIWidget>("getWidth", &UIWidget::getWidth); |
| 621 | + | g_lua.bindClassMemberFunction<UIWidget>("getHeight", &UIWidget::getHeight); |
| 622 | + | g_lua.bindClassMemberFunction<UIWidget>("getSize", &UIWidget::getSize); |
| 623 | + | g_lua.bindClassMemberFunction<UIWidget>("getRect", &UIWidget::getRect); |
| 624 | + | g_lua.bindClassMemberFunction<UIWidget>("getColor", &UIWidget::getColor); |
| 625 | + | g_lua.bindClassMemberFunction<UIWidget>("getBackgroundColor", &UIWidget::getBackgroundColor); |
| 626 | + | g_lua.bindClassMemberFunction<UIWidget>("getBackgroundOffsetX", &UIWidget::getBackgroundOffsetX); |
| 627 | + | g_lua.bindClassMemberFunction<UIWidget>("getBackgroundOffsetY", &UIWidget::getBackgroundOffsetY); |
| 628 | + | g_lua.bindClassMemberFunction<UIWidget>("getBackgroundOffset", &UIWidget::getBackgroundOffset); |
| 629 | + | g_lua.bindClassMemberFunction<UIWidget>("getBackgroundWidth", &UIWidget::getBackgroundWidth); |
| 630 | + | g_lua.bindClassMemberFunction<UIWidget>("getBackgroundHeight", &UIWidget::getBackgroundHeight); |
| 631 | + | g_lua.bindClassMemberFunction<UIWidget>("getBackgroundSize", &UIWidget::getBackgroundSize); |
| 632 | + | g_lua.bindClassMemberFunction<UIWidget>("getBackgroundRect", &UIWidget::getBackgroundRect); |
| 633 | + | g_lua.bindClassMemberFunction<UIWidget>("getIconColor", &UIWidget::getIconColor); |
| 634 | + | g_lua.bindClassMemberFunction<UIWidget>("getIconOffsetX", &UIWidget::getIconOffsetX); |
| 635 | + | g_lua.bindClassMemberFunction<UIWidget>("getIconOffsetY", &UIWidget::getIconOffsetY); |
| 636 | + | g_lua.bindClassMemberFunction<UIWidget>("getIconOffset", &UIWidget::getIconOffset); |
| 637 | + | g_lua.bindClassMemberFunction<UIWidget>("getIconWidth", &UIWidget::getIconWidth); |
| 638 | + | g_lua.bindClassMemberFunction<UIWidget>("getIconHeight", &UIWidget::getIconHeight); |
| 639 | + | g_lua.bindClassMemberFunction<UIWidget>("getIconSize", &UIWidget::getIconSize); |
| 640 | + | g_lua.bindClassMemberFunction<UIWidget>("getIconRect", &UIWidget::getIconRect); |
| 641 | + | g_lua.bindClassMemberFunction<UIWidget>("getIconClip", &UIWidget::getIconClip); |
| 642 | + | g_lua.bindClassMemberFunction<UIWidget>("getIconAlign", &UIWidget::getIconAlign); |
| 643 | + | g_lua.bindClassMemberFunction<UIWidget>("getIconPath", &UIWidget::getIconPath); |
| 644 | + | g_lua.bindClassMemberFunction<UIWidget>("getBorderTopColor", &UIWidget::getBorderTopColor); |
| 645 | + | g_lua.bindClassMemberFunction<UIWidget>("getBorderRightColor", &UIWidget::getBorderRightColor); |
| 646 | + | g_lua.bindClassMemberFunction<UIWidget>("getBorderBottomColor", &UIWidget::getBorderBottomColor); |
| 647 | + | g_lua.bindClassMemberFunction<UIWidget>("getBorderLeftColor", &UIWidget::getBorderLeftColor); |
| 648 | + | g_lua.bindClassMemberFunction<UIWidget>("getBorderTopWidth", &UIWidget::getBorderTopWidth); |
| 649 | + | g_lua.bindClassMemberFunction<UIWidget>("getBorderRightWidth", &UIWidget::getBorderRightWidth); |
| 650 | + | g_lua.bindClassMemberFunction<UIWidget>("getBorderBottomWidth", &UIWidget::getBorderBottomWidth); |
| 651 | + | g_lua.bindClassMemberFunction<UIWidget>("getBorderLeftWidth", &UIWidget::getBorderLeftWidth); |
| 652 | + | g_lua.bindClassMemberFunction<UIWidget>("getMarginTop", &UIWidget::getMarginTop); |
| 653 | + | g_lua.bindClassMemberFunction<UIWidget>("getMarginRight", &UIWidget::getMarginRight); |
| 654 | + | g_lua.bindClassMemberFunction<UIWidget>("getMarginBottom", &UIWidget::getMarginBottom); |
| 655 | + | g_lua.bindClassMemberFunction<UIWidget>("getMarginLeft", &UIWidget::getMarginLeft); |
| 656 | + | g_lua.bindClassMemberFunction<UIWidget>("getPaddingTop", &UIWidget::getPaddingTop); |
| 657 | + | g_lua.bindClassMemberFunction<UIWidget>("getPaddingRight", &UIWidget::getPaddingRight); |
| 658 | + | g_lua.bindClassMemberFunction<UIWidget>("getPaddingBottom", &UIWidget::getPaddingBottom); |
| 659 | + | g_lua.bindClassMemberFunction<UIWidget>("getPaddingLeft", &UIWidget::getPaddingLeft); |
| 660 | + | g_lua.bindClassMemberFunction<UIWidget>("getOpacity", &UIWidget::getOpacity); |
| 661 | + | g_lua.bindClassMemberFunction<UIWidget>("getRotation", &UIWidget::getRotation); |
| 662 | + | g_lua.bindClassMemberFunction<UIWidget>("setQRCode", &UIWidget::setQRCode); |
| 663 | + | g_lua.bindClassMemberFunction<UIWidget>("setImageSource", &UIWidget::setImageSource); |
| 664 | + | g_lua.bindClassMemberFunction<UIWidget>("setImageSourceBase64", &UIWidget::setImageSourceBase64); |
| 665 | + | g_lua.bindClassMemberFunction<UIWidget>("setImageClip", &UIWidget::setImageClip); |
| 666 | + | g_lua.bindClassMemberFunction<UIWidget>("setImageOffsetX", &UIWidget::setImageOffsetX); |
| 667 | + | g_lua.bindClassMemberFunction<UIWidget>("setImageOffsetY", &UIWidget::setImageOffsetY); |
| 668 | + | g_lua.bindClassMemberFunction<UIWidget>("setImageOffset", &UIWidget::setImageOffset); |
| 669 | + | g_lua.bindClassMemberFunction<UIWidget>("setImageWidth", &UIWidget::setImageWidth); |
| 670 | + | g_lua.bindClassMemberFunction<UIWidget>("setImageHeight", &UIWidget::setImageHeight); |
| 671 | + | g_lua.bindClassMemberFunction<UIWidget>("setImageSize", &UIWidget::setImageSize); |
| 672 | + | g_lua.bindClassMemberFunction<UIWidget>("setImageRect", &UIWidget::setImageRect); |
| 673 | + | g_lua.bindClassMemberFunction<UIWidget>("setImageColor", &UIWidget::setImageColor); |
| 674 | + | g_lua.bindClassMemberFunction<UIWidget>("setImageFixedRatio", &UIWidget::setImageFixedRatio); |
| 675 | + | g_lua.bindClassMemberFunction<UIWidget>("setImageRepeated", &UIWidget::setImageRepeated); |
| 676 | + | g_lua.bindClassMemberFunction<UIWidget>("setImageSmooth", &UIWidget::setImageSmooth); |
| 677 | + | g_lua.bindClassMemberFunction<UIWidget>("setImageAutoResize", &UIWidget::setImageAutoResize); |
| 678 | + | g_lua.bindClassMemberFunction<UIWidget>("setImageBorderTop", &UIWidget::setImageBorderTop); |
| 679 | + | g_lua.bindClassMemberFunction<UIWidget>("setImageBorderRight", &UIWidget::setImageBorderRight); |
| 680 | + | g_lua.bindClassMemberFunction<UIWidget>("setImageBorderBottom", &UIWidget::setImageBorderBottom); |
| 681 | + | g_lua.bindClassMemberFunction<UIWidget>("setImageBorderLeft", &UIWidget::setImageBorderLeft); |
| 682 | + | g_lua.bindClassMemberFunction<UIWidget>("setImageBorder", &UIWidget::setImageBorder); |
| 683 | + | g_lua.bindClassMemberFunction<UIWidget>("getImageClip", &UIWidget::getImageClip); |
| 684 | + | g_lua.bindClassMemberFunction<UIWidget>("getImageOffsetX", &UIWidget::getImageOffsetX); |
| 685 | + | g_lua.bindClassMemberFunction<UIWidget>("getImageOffsetY", &UIWidget::getImageOffsetY); |
| 686 | + | g_lua.bindClassMemberFunction<UIWidget>("getImageOffset", &UIWidget::getImageOffset); |
| 687 | + | g_lua.bindClassMemberFunction<UIWidget>("getImageWidth", &UIWidget::getImageWidth); |
| 688 | + | g_lua.bindClassMemberFunction<UIWidget>("getImageHeight", &UIWidget::getImageHeight); |
| 689 | + | g_lua.bindClassMemberFunction<UIWidget>("getImageSize", &UIWidget::getImageSize); |
| 690 | + | g_lua.bindClassMemberFunction<UIWidget>("getImageRect", &UIWidget::getImageRect); |
| 691 | + | g_lua.bindClassMemberFunction<UIWidget>("getImageColor", &UIWidget::getImageColor); |
| 692 | + | g_lua.bindClassMemberFunction<UIWidget>("isImageFixedRatio", &UIWidget::isImageFixedRatio); |
| 693 | + | g_lua.bindClassMemberFunction<UIWidget>("isImageSmooth", &UIWidget::isImageSmooth); |
| 694 | + | g_lua.bindClassMemberFunction<UIWidget>("isImageAutoResize", &UIWidget::isImageAutoResize); |
| 695 | + | g_lua.bindClassMemberFunction<UIWidget>("getImageBorderTop", &UIWidget::getImageBorderTop); |
| 696 | + | g_lua.bindClassMemberFunction<UIWidget>("getImageBorderRight", &UIWidget::getImageBorderRight); |
| 697 | + | g_lua.bindClassMemberFunction<UIWidget>("getImageBorderBottom", &UIWidget::getImageBorderBottom); |
| 698 | + | g_lua.bindClassMemberFunction<UIWidget>("getImageBorderLeft", &UIWidget::getImageBorderLeft); |
| 699 | + | g_lua.bindClassMemberFunction<UIWidget>("getImageTextureWidth", &UIWidget::getImageTextureWidth); |
| 700 | + | g_lua.bindClassMemberFunction<UIWidget>("getImageTextureHeight", &UIWidget::getImageTextureHeight); |
| 701 | + | g_lua.bindClassMemberFunction<UIWidget>("resizeToText", &UIWidget::resizeToText); |
| 702 | + | g_lua.bindClassMemberFunction<UIWidget>("clearText", &UIWidget::clearText); |
| 703 | + | g_lua.bindClassMemberFunction<UIWidget>("setText", &UIWidget::setText); |
| 704 | + | g_lua.bindClassMemberFunction<UIWidget>("setColoredText", &UIWidget::setColoredText); |
| 705 | + | g_lua.bindClassMemberFunction<UIWidget>("setTextAlign", &UIWidget::setTextAlign); |
| 706 | + | g_lua.bindClassMemberFunction<UIWidget>("setTextOffset", &UIWidget::setTextOffset); |
| 707 | + | g_lua.bindClassMemberFunction<UIWidget>("setTextWrap", &UIWidget::setTextWrap); |
| 708 | + | g_lua.bindClassMemberFunction<UIWidget>("setTextAutoResize", &UIWidget::setTextAutoResize); |
| 709 | + | g_lua.bindClassMemberFunction<UIWidget>("setTextVerticalAutoResize", &UIWidget::setTextVerticalAutoResize); |
| 710 | + | g_lua.bindClassMemberFunction<UIWidget>("setTextHorizontalAutoResize", &UIWidget::setTextHorizontalAutoResize); |
| 711 | + | g_lua.bindClassMemberFunction<UIWidget>("setFont", &UIWidget::setFont); |
| 712 | + | g_lua.bindClassMemberFunction<UIWidget>("getText", &UIWidget::getText); |
| 713 | + | g_lua.bindClassMemberFunction<UIWidget>("getDrawText", &UIWidget::getDrawText); |
| 714 | + | g_lua.bindClassMemberFunction<UIWidget>("getTextAlign", &UIWidget::getTextAlign); |
| 715 | + | g_lua.bindClassMemberFunction<UIWidget>("getTextOffset", &UIWidget::getTextOffset); |
| 716 | + | g_lua.bindClassMemberFunction<UIWidget>("getTextWrap", &UIWidget::getTextWrap); |
| 717 | + | g_lua.bindClassMemberFunction<UIWidget>("getFont", &UIWidget::getFont); |
| 718 | + | g_lua.bindClassMemberFunction<UIWidget>("getTextSize", &UIWidget::getTextSize); |
| 719 | + | g_lua.bindClassMemberFunction<UIWidget>("getUseCount", &UIWidget::getUseCount); |
| 720 | + | g_lua.bindClassMemberFunction<UIWidget>("setShadow", &UIWidget::setShadow); |
| 721 | + | g_lua.bindClassMemberFunction<UIWidget>("setCursor", &UIWidget::setCursor); |
| 722 | + | g_lua.bindClassMemberFunction<UIWidget>("setChangeCursorImage", &UIWidget::setChangeCursorImage); |
| 723 | + | |
| 724 | + | // UILayout |
| 725 | + | g_lua.registerClass<UILayout>(); |
| 726 | + | g_lua.bindClassMemberFunction<UILayout>("update", &UILayout::update); |
| 727 | + | g_lua.bindClassMemberFunction<UILayout>("updateLater", &UILayout::updateLater); |
| 728 | + | g_lua.bindClassMemberFunction<UILayout>("applyStyle", &UILayout::applyStyle); |
| 729 | + | g_lua.bindClassMemberFunction<UILayout>("addWidget", &UILayout::addWidget); |
| 730 | + | g_lua.bindClassMemberFunction<UILayout>("removeWidget", &UILayout::removeWidget); |
| 731 | + | g_lua.bindClassMemberFunction<UILayout>("disableUpdates", &UILayout::disableUpdates); |
| 732 | + | g_lua.bindClassMemberFunction<UILayout>("enableUpdates", &UILayout::enableUpdates); |
| 733 | + | g_lua.bindClassMemberFunction<UILayout>("setParent", &UILayout::setParent); |
| 734 | + | g_lua.bindClassMemberFunction<UILayout>("getParentWidget", &UILayout::getParentWidget); |
| 735 | + | g_lua.bindClassMemberFunction<UILayout>("isUpdateDisabled", &UILayout::isUpdateDisabled); |
| 736 | + | g_lua.bindClassMemberFunction<UILayout>("isUpdating", &UILayout::isUpdating); |
| 737 | + | g_lua.bindClassMemberFunction<UILayout>("isUIAnchorLayout", &UILayout::isUIAnchorLayout); |
| 738 | + | g_lua.bindClassMemberFunction<UILayout>("isUIBoxLayout", &UILayout::isUIBoxLayout); |
| 739 | + | g_lua.bindClassMemberFunction<UILayout>("isUIHorizontalLayout", &UILayout::isUIHorizontalLayout); |
| 740 | + | g_lua.bindClassMemberFunction<UILayout>("isUIVerticalLayout", &UILayout::isUIVerticalLayout); |
| 741 | + | g_lua.bindClassMemberFunction<UILayout>("isUIGridLayout", &UILayout::isUIGridLayout); |
| 742 | + | |
| 743 | + | // UIBoxLayout |
| 744 | + | g_lua.registerClass<UIBoxLayout, UILayout>(); |
| 745 | + | g_lua.bindClassMemberFunction<UIBoxLayout>("setSpacing", &UIBoxLayout::setSpacing); |
| 746 | + | g_lua.bindClassMemberFunction<UIBoxLayout>("setFitChildren", &UIBoxLayout::setFitChildren); |
| 747 | + | |
| 748 | + | // UIVerticalLayout |
| 749 | + | g_lua.registerClass<UIVerticalLayout, UIBoxLayout>(); |
| 750 | + | g_lua.bindClassStaticFunction<UIVerticalLayout>("create", [](UIWidgetPtr parent){ return UIVerticalLayoutPtr(new UIVerticalLayout(parent)); } ); |
| 751 | + | g_lua.bindClassMemberFunction<UIVerticalLayout>("setAlignBottom", &UIVerticalLayout::setAlignBottom); |
| 752 | + | g_lua.bindClassMemberFunction<UIVerticalLayout>("isAlignBottom", &UIVerticalLayout::isAlignBottom); |
| 753 | + | |
| 754 | + | // UIHorizontalLayout |
| 755 | + | g_lua.registerClass<UIHorizontalLayout, UIBoxLayout>(); |
| 756 | + | g_lua.bindClassStaticFunction<UIHorizontalLayout>("create", [](UIWidgetPtr parent){ return UIHorizontalLayoutPtr(new UIHorizontalLayout(parent)); } ); |
| 757 | + | g_lua.bindClassMemberFunction<UIHorizontalLayout>("setAlignRight", &UIHorizontalLayout::setAlignRight); |
| 758 | + | |
| 759 | + | // UIGridLayout |
| 760 | + | g_lua.registerClass<UIGridLayout, UILayout>(); |
| 761 | + | g_lua.bindClassStaticFunction<UIGridLayout>("create", [](UIWidgetPtr parent){ return UIGridLayoutPtr(new UIGridLayout(parent)); }); |
| 762 | + | g_lua.bindClassMemberFunction<UIGridLayout>("setCellSize", &UIGridLayout::setCellSize); |
| 763 | + | g_lua.bindClassMemberFunction<UIGridLayout>("setCellWidth", &UIGridLayout::setCellWidth); |
| 764 | + | g_lua.bindClassMemberFunction<UIGridLayout>("setCellHeight", &UIGridLayout::setCellHeight); |
| 765 | + | g_lua.bindClassMemberFunction<UIGridLayout>("setCellSpacing", &UIGridLayout::setCellSpacing); |
| 766 | + | g_lua.bindClassMemberFunction<UIGridLayout>("setFlow", &UIGridLayout::setFlow); |
| 767 | + | g_lua.bindClassMemberFunction<UIGridLayout>("setNumColumns", &UIGridLayout::setNumColumns); |
| 768 | + | g_lua.bindClassMemberFunction<UIGridLayout>("setNumLines", &UIGridLayout::setNumLines); |
| 769 | + | g_lua.bindClassMemberFunction<UIGridLayout>("getNumColumns", &UIGridLayout::getNumColumns); |
| 770 | + | g_lua.bindClassMemberFunction<UIGridLayout>("getNumLines", &UIGridLayout::getNumLines); |
| 771 | + | g_lua.bindClassMemberFunction<UIGridLayout>("getCellSize", &UIGridLayout::getCellSize); |
| 772 | + | g_lua.bindClassMemberFunction<UIGridLayout>("getCellSpacing", &UIGridLayout::getCellSpacing); |
| 773 | + | g_lua.bindClassMemberFunction<UIGridLayout>("isUIGridLayout", &UIGridLayout::isUIGridLayout); |
| 774 | + | |
| 775 | + | // UIAnchorLayout |
| 776 | + | g_lua.registerClass<UIAnchorLayout, UILayout>(); |
| 777 | + | g_lua.bindClassStaticFunction<UIAnchorLayout>("create", [](UIWidgetPtr parent){ return UIAnchorLayoutPtr(new UIAnchorLayout(parent)); } ); |
| 778 | + | g_lua.bindClassMemberFunction<UIAnchorLayout>("removeAnchors", &UIAnchorLayout::removeAnchors); |
| 779 | + | g_lua.bindClassMemberFunction<UIAnchorLayout>("centerIn", &UIAnchorLayout::centerIn); |
| 780 | + | g_lua.bindClassMemberFunction<UIAnchorLayout>("fill", &UIAnchorLayout::fill); |
| 781 | + | |
| 782 | + | // UITextEdit |
| 783 | + | g_lua.registerClass<UITextEdit, UIWidget>(); |
| 784 | + | g_lua.bindClassStaticFunction<UITextEdit>("create", []{ return UITextEditPtr(new UITextEdit); } ); |
| 785 | + | g_lua.bindClassMemberFunction<UITextEdit>("setCursorPos", &UITextEdit::setCursorPos); |
| 786 | + | g_lua.bindClassMemberFunction<UITextEdit>("setSelection", &UITextEdit::setSelection); |
| 787 | + | g_lua.bindClassMemberFunction<UITextEdit>("setCursorVisible", &UITextEdit::setCursorVisible); |
| 788 | + | g_lua.bindClassMemberFunction<UITextEdit>("setTextHidden", &UITextEdit::setTextHidden); |
| 789 | + | g_lua.bindClassMemberFunction<UITextEdit>("setValidCharacters", &UITextEdit::setValidCharacters); |
| 790 | + | g_lua.bindClassMemberFunction<UITextEdit>("setShiftNavigation", &UITextEdit::setShiftNavigation); |
| 791 | + | g_lua.bindClassMemberFunction<UITextEdit>("setMultiline", &UITextEdit::setMultiline); |
| 792 | + | g_lua.bindClassMemberFunction<UITextEdit>("setEditable", &UITextEdit::setEditable); |
| 793 | + | g_lua.bindClassMemberFunction<UITextEdit>("setSelectable", &UITextEdit::setSelectable); |
| 794 | + | g_lua.bindClassMemberFunction<UITextEdit>("setSelectionColor", &UITextEdit::setSelectionColor); |
| 795 | + | g_lua.bindClassMemberFunction<UITextEdit>("setSelectionBackgroundColor", &UITextEdit::setSelectionBackgroundColor); |
| 796 | + | g_lua.bindClassMemberFunction<UITextEdit>("setMaxLength", &UITextEdit::setMaxLength); |
| 797 | + | g_lua.bindClassMemberFunction<UITextEdit>("setTextVirtualOffset", &UITextEdit::setTextVirtualOffset); |
| 798 | + | g_lua.bindClassMemberFunction<UITextEdit>("getTextVirtualOffset", &UITextEdit::getTextVirtualOffset); |
| 799 | + | g_lua.bindClassMemberFunction<UITextEdit>("getTextVirtualSize", &UITextEdit::getTextVirtualSize); |
| 800 | + | g_lua.bindClassMemberFunction<UITextEdit>("getTextTotalSize", &UITextEdit::getTextTotalSize); |
| 801 | + | g_lua.bindClassMemberFunction<UITextEdit>("moveCursorHorizontally", &UITextEdit::moveCursorHorizontally); |
| 802 | + | g_lua.bindClassMemberFunction<UITextEdit>("moveCursorVertically", &UITextEdit::moveCursorVertically); |
| 803 | + | g_lua.bindClassMemberFunction<UITextEdit>("appendText", &UITextEdit::appendText); |
| 804 | + | g_lua.bindClassMemberFunction<UITextEdit>("wrapText", &UITextEdit::wrapText); |
| 805 | + | g_lua.bindClassMemberFunction<UITextEdit>("removeCharacter", &UITextEdit::removeCharacter); |
| 806 | + | g_lua.bindClassMemberFunction<UITextEdit>("blinkCursor", &UITextEdit::blinkCursor); |
| 807 | + | g_lua.bindClassMemberFunction<UITextEdit>("del", &UITextEdit::del); |
| 808 | + | g_lua.bindClassMemberFunction<UITextEdit>("paste", &UITextEdit::paste); |
| 809 | + | g_lua.bindClassMemberFunction<UITextEdit>("copy", &UITextEdit::copy); |
| 810 | + | g_lua.bindClassMemberFunction<UITextEdit>("cut", &UITextEdit::cut); |
| 811 | + | g_lua.bindClassMemberFunction<UITextEdit>("selectAll", &UITextEdit::selectAll); |
| 812 | + | g_lua.bindClassMemberFunction<UITextEdit>("clearSelection", &UITextEdit::clearSelection); |
| 813 | + | g_lua.bindClassMemberFunction<UITextEdit>("getDisplayedText", &UITextEdit::getDisplayedText); |
| 814 | + | g_lua.bindClassMemberFunction<UITextEdit>("getSelection", &UITextEdit::getSelection); |
| 815 | + | g_lua.bindClassMemberFunction<UITextEdit>("getTextPos", &UITextEdit::getTextPos); |
| 816 | + | g_lua.bindClassMemberFunction<UITextEdit>("getCursorPos", &UITextEdit::getCursorPos); |
| 817 | + | g_lua.bindClassMemberFunction<UITextEdit>("getMaxLength", &UITextEdit::getMaxLength); |
| 818 | + | g_lua.bindClassMemberFunction<UITextEdit>("getSelectionStart", &UITextEdit::getSelectionStart); |
| 819 | + | g_lua.bindClassMemberFunction<UITextEdit>("getSelectionEnd", &UITextEdit::getSelectionEnd); |
| 820 | + | g_lua.bindClassMemberFunction<UITextEdit>("getSelectionColor", &UITextEdit::getSelectionColor); |
| 821 | + | g_lua.bindClassMemberFunction<UITextEdit>("getSelectionBackgroundColor", &UITextEdit::getSelectionBackgroundColor); |
| 822 | + | g_lua.bindClassMemberFunction<UITextEdit>("hasSelection", &UITextEdit::hasSelection); |
| 823 | + | g_lua.bindClassMemberFunction<UITextEdit>("isEditable", &UITextEdit::isEditable); |
| 824 | + | g_lua.bindClassMemberFunction<UITextEdit>("isSelectable", &UITextEdit::isSelectable); |
| 825 | + | g_lua.bindClassMemberFunction<UITextEdit>("isCursorVisible", &UITextEdit::isCursorVisible); |
| 826 | + | g_lua.bindClassMemberFunction<UITextEdit>("isChangingCursorImage", &UITextEdit::isChangingCursorImage); |
| 827 | + | g_lua.bindClassMemberFunction<UITextEdit>("isTextHidden", &UITextEdit::isTextHidden); |
| 828 | + | g_lua.bindClassMemberFunction<UITextEdit>("isShiftNavigation", &UITextEdit::isShiftNavigation); |
| 829 | + | g_lua.bindClassMemberFunction<UITextEdit>("isMultiline", &UITextEdit::isMultiline); |
| 830 | + | g_lua.bindClassMemberFunction<UITextEdit>("setPlaceholder", &UITextEdit::setPlaceholder); |
| 831 | + | g_lua.bindClassMemberFunction<UITextEdit>("setPlaceholderColor", &UITextEdit::setPlaceholderColor); |
| 832 | + | g_lua.bindClassMemberFunction<UITextEdit>("setPlaceholderAlign", &UITextEdit::setPlaceholderAlign); |
| 833 | + | g_lua.bindClassMemberFunction<UITextEdit>("setPlaceholderFont", &UITextEdit::setPlaceholderFont); |
| 834 | + | |
| 835 | + | g_lua.registerClass<ShaderProgram>(); |
| 836 | + | g_lua.registerClass<PainterShaderProgram>(); |
| 837 | + | g_lua.bindClassMemberFunction<PainterShaderProgram>("addMultiTexture", &PainterShaderProgram::addMultiTexture); |
| 838 | + | #endif |
| 839 | + | |
| 840 | + | // Server |
| 841 | + | g_lua.registerClass<Server>(); |
| 842 | + | g_lua.bindClassStaticFunction<Server>("create", &Server::create); |
| 843 | + | g_lua.bindClassMemberFunction<Server>("close", &Server::close); |
| 844 | + | g_lua.bindClassMemberFunction<Server>("isOpen", &Server::isOpen); |
| 845 | + | g_lua.bindClassMemberFunction<Server>("acceptNext", &Server::acceptNext); |
| 846 | + | |
| 847 | + | // Connection |
| 848 | + | g_lua.registerClass<Connection>(); |
| 849 | + | g_lua.bindClassMemberFunction<Connection>("getIp", &Connection::getIp); |
| 850 | + | |
| 851 | + | // Protocol |
| 852 | + | g_lua.registerClass<Protocol>(); |
| 853 | + | g_lua.bindClassStaticFunction<Protocol>("create", []{ return ProtocolPtr(new Protocol); }); |
| 854 | + | g_lua.bindClassMemberFunction<Protocol>("connect", &Protocol::connect); |
| 855 | + | g_lua.bindClassMemberFunction<Protocol>("disconnect", &Protocol::disconnect); |
| 856 | + | g_lua.bindClassMemberFunction<Protocol>("isConnected", &Protocol::isConnected); |
| 857 | + | g_lua.bindClassMemberFunction<Protocol>("isConnecting", &Protocol::isConnecting); |
| 858 | + | g_lua.bindClassMemberFunction<Protocol>("getConnection", &Protocol::getConnection); |
| 859 | + | g_lua.bindClassMemberFunction<Protocol>("setConnection", &Protocol::setConnection); |
| 860 | + | g_lua.bindClassMemberFunction<Protocol>("send", &Protocol::send); |
| 861 | + | g_lua.bindClassMemberFunction<Protocol>("recv", &Protocol::recv); |
| 862 | + | g_lua.bindClassMemberFunction<Protocol>("setXteaKey", &Protocol::setXteaKey); |
| 863 | + | g_lua.bindClassMemberFunction<Protocol>("getXteaKey", &Protocol::getXteaKey); |
| 864 | + | g_lua.bindClassMemberFunction<Protocol>("generateXteaKey", &Protocol::generateXteaKey); |
| 865 | + | g_lua.bindClassMemberFunction<Protocol>("enableXteaEncryption", &Protocol::enableXteaEncryption); |
| 866 | + | g_lua.bindClassMemberFunction<Protocol>("enableChecksum", &Protocol::enableChecksum); |
| 867 | + | g_lua.bindClassMemberFunction<Protocol>("enableBigPackets", &Protocol::enableBigPackets); |
| 868 | + | |
| 869 | + | // InputMessage |
| 870 | + | g_lua.registerClass<InputMessage>(); |
| 871 | + | g_lua.bindClassStaticFunction<InputMessage>("create", []{ return InputMessagePtr(new InputMessage); }); |
| 872 | + | g_lua.bindClassMemberFunction<InputMessage>("setBuffer", &InputMessage::setBuffer); |
| 873 | + | g_lua.bindClassMemberFunction<InputMessage>("getBuffer", &InputMessage::getBuffer); |
| 874 | + | g_lua.bindClassMemberFunction<InputMessage>("skipBytes", &InputMessage::skipBytes); |
| 875 | + | g_lua.bindClassMemberFunction<InputMessage>("getU8", &InputMessage::getU8); |
| 876 | + | g_lua.bindClassMemberFunction<InputMessage>("getU16", &InputMessage::getU16); |
| 877 | + | g_lua.bindClassMemberFunction<InputMessage>("getU32", &InputMessage::getU32); |
| 878 | + | g_lua.bindClassMemberFunction<InputMessage>("getU64", &InputMessage::getU64); |
| 879 | + | g_lua.bindClassMemberFunction<InputMessage>("getString", &InputMessage::getString); |
| 880 | + | g_lua.bindClassMemberFunction<InputMessage>("peekU8", &InputMessage::peekU8); |
| 881 | + | g_lua.bindClassMemberFunction<InputMessage>("peekU16", &InputMessage::peekU16); |
| 882 | + | g_lua.bindClassMemberFunction<InputMessage>("peekU32", &InputMessage::peekU32); |
| 883 | + | g_lua.bindClassMemberFunction<InputMessage>("peekU64", &InputMessage::peekU64); |
| 884 | + | g_lua.bindClassMemberFunction<InputMessage>("decryptRsa", &InputMessage::decryptRsa); |
| 885 | + | g_lua.bindClassMemberFunction<InputMessage>("getReadSize", &InputMessage::getReadSize); |
| 886 | + | g_lua.bindClassMemberFunction<InputMessage>("getUnreadSize", &InputMessage::getUnreadSize); |
| 887 | + | g_lua.bindClassMemberFunction<InputMessage>("getMessageSize", &InputMessage::getMessageSize); |
| 888 | + | g_lua.bindClassMemberFunction<InputMessage>("eof", &InputMessage::eof); |
| 889 | + | |
| 890 | + | // OutputMessage |
| 891 | + | g_lua.registerClass<OutputMessage>(); |
| 892 | + | g_lua.bindClassStaticFunction<OutputMessage>("create", []{ return OutputMessagePtr(new OutputMessage); }); |
| 893 | + | g_lua.bindClassMemberFunction<OutputMessage>("setBuffer", &OutputMessage::setBuffer); |
| 894 | + | g_lua.bindClassMemberFunction<OutputMessage>("getBuffer", &OutputMessage::getBuffer); |
| 895 | + | g_lua.bindClassMemberFunction<OutputMessage>("reset", &OutputMessage::reset); |
| 896 | + | g_lua.bindClassMemberFunction<OutputMessage>("addU8", &OutputMessage::addU8); |
| 897 | + | g_lua.bindClassMemberFunction<OutputMessage>("addU16", &OutputMessage::addU16); |
| 898 | + | g_lua.bindClassMemberFunction<OutputMessage>("addU32", &OutputMessage::addU32); |
| 899 | + | g_lua.bindClassMemberFunction<OutputMessage>("addU64", &OutputMessage::addU64); |
| 900 | + | g_lua.bindClassMemberFunction<OutputMessage>("addString", &OutputMessage::addString); |
| 901 | + | g_lua.bindClassMemberFunction<OutputMessage>("addPaddingBytes", &OutputMessage::addPaddingBytes); |
| 902 | + | g_lua.bindClassMemberFunction<OutputMessage>("encryptRsa", &OutputMessage::encryptRsa); |
| 903 | + | g_lua.bindClassMemberFunction<OutputMessage>("getMessageSize", &OutputMessage::getMessageSize); |
| 904 | + | g_lua.bindClassMemberFunction<OutputMessage>("setMessageSize", &OutputMessage::setMessageSize); |
| 905 | + | g_lua.bindClassMemberFunction<OutputMessage>("getWritePos", &OutputMessage::getWritePos); |
| 906 | + | g_lua.bindClassMemberFunction<OutputMessage>("setWritePos", &OutputMessage::setWritePos); |
| 907 | + | |
| 908 | + | g_lua.registerSingletonClass("g_proxy"); |
| 909 | + | g_lua.bindSingletonFunction("g_proxy", "addProxy", &ProxyManager::addProxy, &g_proxy); |
| 910 | + | g_lua.bindSingletonFunction("g_proxy", "removeProxy", &ProxyManager::removeProxy, &g_proxy); |
| 911 | + | g_lua.bindSingletonFunction("g_proxy", "clear", &ProxyManager::clear, &g_proxy); |
| 912 | + | g_lua.bindSingletonFunction("g_proxy", "setMaxActiveProxies", &ProxyManager::setMaxActiveProxies, &g_proxy); |
| 913 | + | g_lua.bindSingletonFunction("g_proxy", "getProxies", &ProxyManager::getProxies, &g_proxy); |
| 914 | + | g_lua.bindSingletonFunction("g_proxy", "getProxiesDebugInfo", &ProxyManager::getProxiesDebugInfo, &g_proxy); |
| 915 | + | g_lua.bindSingletonFunction("g_proxy", "getPing", &ProxyManager::getPing, &g_proxy); |
| 916 | + | |
| 917 | + | g_lua.registerSingletonClass("g_http"); |
| 918 | + | g_lua.bindSingletonFunction("g_http", "get", &Http::get, &g_http); |
| 919 | + | g_lua.bindSingletonFunction("g_http", "post", &Http::post, &g_http); |
| 920 | + | g_lua.bindSingletonFunction("g_http", "download", &Http::download, &g_http); |
| 921 | + | g_lua.bindSingletonFunction("g_http", "ws", &Http::ws, &g_http); |
| 922 | + | g_lua.bindSingletonFunction("g_http", "wsSend", &Http::wsSend, &g_http); |
| 923 | + | g_lua.bindSingletonFunction("g_http", "wsClose", &Http::wsClose, &g_http); |
| 924 | + | g_lua.bindSingletonFunction("g_http", "cancel", &Http::cancel, &g_http); |
| 925 | + | g_lua.bindSingletonFunction("g_http", "setUserAgent", &Http::setUserAgent, &g_http); |
| 926 | + | |
| 927 | + | #ifdef FW_SOUND |
| 928 | + | // SoundManager |
| 929 | + | g_lua.registerSingletonClass("g_sounds"); |
| 930 | + | g_lua.bindSingletonFunction("g_sounds", "preload", &SoundManager::preload, &g_sounds); |
| 931 | + | g_lua.bindSingletonFunction("g_sounds", "play", &SoundManager::play, &g_sounds); |
| 932 | + | g_lua.bindSingletonFunction("g_sounds", "getChannel", &SoundManager::getChannel, &g_sounds); |
| 933 | + | g_lua.bindSingletonFunction("g_sounds", "stopAll", &SoundManager::stopAll, &g_sounds); |
| 934 | + | g_lua.bindSingletonFunction("g_sounds", "enableAudio", &SoundManager::enableAudio, &g_sounds); |
| 935 | + | g_lua.bindSingletonFunction("g_sounds", "disableAudio", &SoundManager::disableAudio, &g_sounds); |
| 936 | + | g_lua.bindSingletonFunction("g_sounds", "setAudioEnabled", &SoundManager::setAudioEnabled, &g_sounds); |
| 937 | + | g_lua.bindSingletonFunction("g_sounds", "isAudioEnabled", &SoundManager::isAudioEnabled, &g_sounds); |
| 938 | + | |
| 939 | + | g_lua.registerClass<SoundSource>(); |
| 940 | + | g_lua.registerClass<CombinedSoundSource, SoundSource>(); |
| 941 | + | g_lua.registerClass<StreamSoundSource, SoundSource>(); |
| 942 | + | |
| 943 | + | g_lua.registerClass<SoundChannel>(); |
| 944 | + | g_lua.bindClassMemberFunction<SoundChannel>("play", &SoundChannel::play); |
| 945 | + | g_lua.bindClassMemberFunction<SoundChannel>("stop", &SoundChannel::stop); |
| 946 | + | g_lua.bindClassMemberFunction<SoundChannel>("enqueue", &SoundChannel::enqueue); |
| 947 | + | g_lua.bindClassMemberFunction<SoundChannel>("enable", &SoundChannel::enable); |
| 948 | + | g_lua.bindClassMemberFunction<SoundChannel>("disable", &SoundChannel::disable); |
| 949 | + | g_lua.bindClassMemberFunction<SoundChannel>("setGain", &SoundChannel::setGain); |
| 950 | + | g_lua.bindClassMemberFunction<SoundChannel>("getGain", &SoundChannel::getGain); |
| 951 | + | g_lua.bindClassMemberFunction<SoundChannel>("setEnabled", &SoundChannel::setEnabled); |
| 952 | + | g_lua.bindClassMemberFunction<SoundChannel>("isEnabled", &SoundChannel::isEnabled); |
| 953 | + | g_lua.bindClassMemberFunction<SoundChannel>("getId", &SoundChannel::getId); |
| 954 | + | #endif |
| 955 | + | } |