diff --git a/bsnes/emulator/emulator.hpp b/bsnes/emulator/emulator.hpp index ad4119dc..b7020590 100644 --- a/bsnes/emulator/emulator.hpp +++ b/bsnes/emulator/emulator.hpp @@ -28,11 +28,11 @@ using namespace nall; #include namespace Emulator { - static const string Name = "bsnes"; - static const string Version = "114.4"; - static const string Author = "byuu"; - static const string License = "GPLv3"; - static const string Website = "https://byuu.org"; + static const string Name = "bsnes"; + static const string Version = "114.5"; + static const string Copyright = "byuu"; + static const string License = "GPLv3"; + static const string Website = "https://byuu.org"; //incremented only when serialization format changes static const string SerializerVersion = "114.2"; diff --git a/bsnes/heuristics/super-famicom.cpp b/bsnes/heuristics/super-famicom.cpp index 0101a246..674196e3 100644 --- a/bsnes/heuristics/super-famicom.cpp +++ b/bsnes/heuristics/super-famicom.cpp @@ -433,13 +433,7 @@ auto SuperFamicom::serial() const -> string { } auto SuperFamicom::romSize() const -> uint { - //subtract appended firmware size, if firmware is present - if((size() & 0x7fff) == 0x100) return size() - 0x100; - if((size() & 0x7fff) == 0xc00) return size() - 0xc00; - if((size() & 0x7fff) == 0x2000) return size() - 0x2000; - if((size() & 0xffff) == 0xd000) return size() - 0xd000; - if((size() & 0x3ffff) == 0x28000) return size() - 0x28000; - return size(); + return size() - firmwareRomSize(); } auto SuperFamicom::programRomSize() const -> uint { @@ -459,8 +453,38 @@ auto SuperFamicom::expansionRomSize() const -> uint { return 0; } +//detect if any firmware is appended to the ROM image, and return its size if so auto SuperFamicom::firmwareRomSize() const -> uint { - return size() - romSize(); + auto cartridgeTypeLo = data[headerAddress + 0x26] & 15; + auto cartridgeTypeHi = data[headerAddress + 0x26] >> 4; + auto cartridgeSubType = data[headerAddress + 0x0f]; + + if(serial() == "042J" || (cartridgeTypeLo == 0x3 && cartridgeTypeHi == 0xe)) { + //Game Boy + if((size() & 0x7fff) == 0x100) return 0x100; + } + + if(cartridgeTypeLo >= 0x3 && cartridgeTypeHi == 0xf && cartridgeSubType == 0x10) { + //Hitachi HG51BS169 + if((size() & 0x7fff) == 0xc00) return 0xc00; + } + + if(cartridgeTypeLo >= 0x3 && cartridgeTypeHi == 0x0) { + //NEC uPD7725 + if((size() & 0x7fff) == 0x2000) return 0x2000; + } + + if(cartridgeTypeLo >= 0x3 && cartridgeTypeHi == 0xf && cartridgeSubType == 0x01) { + //NEC uPD96050 + if((size() & 0xffff) == 0xd000) return 0xd000; + } + + if(cartridgeTypeLo >= 0x3 && cartridgeTypeHi == 0xf && cartridgeSubType == 0x02) { + //ARM6 + if((size() & 0x3ffff) == 0x28000) return 0x28000; + } + + return 0; } auto SuperFamicom::ramSize() const -> uint { diff --git a/bsnes/target-bsnes/bsnes.cpp b/bsnes/target-bsnes/bsnes.cpp index c9a13c24..b7236ab1 100644 --- a/bsnes/target-bsnes/bsnes.cpp +++ b/bsnes/target-bsnes/bsnes.cpp @@ -52,22 +52,6 @@ auto nall::main(Arguments arguments) -> void { emulator = new SuperFamicom::Interface; program.create(); - if(Emulator::Version.find(".") && settings.general.betaWarning && 0) { - MessageDialog dialog; - dialog.setTitle(Emulator::Name); - dialog.setText( - "This is a nightly release. Bugs and regressions are possible!\n" - "If you experience issues, please report them to me.\n" - "If stability is required, please use a stable release.\n" - ); - dialog.setOption("Don't show this message again"); - dialog.information(); - if(dialog.checked()) { - settings.general.betaWarning = false; - settings.save(); - } - } - Application::run(); Instances::presentation.destruct(); Instances::settingsWindow.destruct(); diff --git a/bsnes/target-bsnes/presentation/presentation.cpp b/bsnes/target-bsnes/presentation/presentation.cpp index 89ae5dce..4d61c64e 100644 --- a/bsnes/target-bsnes/presentation/presentation.cpp +++ b/bsnes/target-bsnes/presentation/presentation.cpp @@ -187,7 +187,7 @@ auto Presentation::create() -> void { .setLogo(Resource::SameBoy) .setDescription("Super Game Boy emulator") .setVersion("0.12.1") - .setAuthor("Lior Halphon") + .setCopyright("Lior Halphon") .setLicense("MIT") .setWebsite("https://sameboy.github.io") .setAlignment(*this) @@ -199,7 +199,7 @@ auto Presentation::create() -> void { .setLogo(Resource::Logo) .setDescription("Super Nintendo emulator") .setVersion(Emulator::Version) - .setAuthor("byuu") + .setCopyright("byuu") .setLicense("GPLv3") .setWebsite("https://byuu.org") .setAlignment(*this) diff --git a/bsnes/target-bsnes/program/movies.cpp b/bsnes/target-bsnes/program/movies.cpp index 708039fa..2db6ec82 100644 --- a/bsnes/target-bsnes/program/movies.cpp +++ b/bsnes/target-bsnes/program/movies.cpp @@ -25,7 +25,7 @@ auto Program::moviePlay() -> void { dialog.setTitle("Play Movie"); dialog.setPath(Path::desktop()); dialog.setFilters({string{"Movies (.bsv)|*.bsv"}}); - if(auto location = dialog.openFile()) { + if(auto location = openFile(dialog)) { if(auto fp = file::open(location, file::mode::read)) { bool failed = false; if(fp.read() != 'B') failed = true; @@ -92,7 +92,7 @@ auto Program::movieStop() -> void { dialog.setTitle("Save Movie"); dialog.setPath(Path::desktop()); dialog.setFilters({string{"Movies (.bsv)|*.bsv"}}); - if(auto location = dialog.saveFile()) { + if(auto location = saveFile(dialog)) { if(!location.endsWith(".bsv")) location.append(".bsv"); if(auto fp = file::open(location, file::mode::write)) { fp.write('B'); diff --git a/bsnes/target-bsnes/program/platform.cpp b/bsnes/target-bsnes/program/platform.cpp index ff755a7e..9d2dc96e 100644 --- a/bsnes/target-bsnes/program/platform.cpp +++ b/bsnes/target-bsnes/program/platform.cpp @@ -113,7 +113,7 @@ auto Program::load(uint id, string name, string type, vector options) -> dialog.setTitle("Load SNES ROM"); dialog.setPath(path("Games", settings.path.recent.superFamicom)); dialog.setFilters({string{"SNES ROMs|*.sfc:*.smc:*.zip:*.7z:*.SFC:*.SMC:*.ZIP:*.7Z:*.Sfc:*.Smc:*.Zip"}, string{"All Files|*"}}); - superFamicom.location = dialog.openObject(); + superFamicom.location = openGame(dialog); superFamicom.option = dialog.option(); } if(inode::exists(superFamicom.location)) { @@ -133,7 +133,7 @@ auto Program::load(uint id, string name, string type, vector options) -> dialog.setTitle("Load Game Boy ROM"); dialog.setPath(path("Games", settings.path.recent.gameBoy)); dialog.setFilters({string{"Game Boy ROMs|*.gb:*.gbc:*.zip:*.7z:*.GB:*.GBC:*.ZIP:*.7Z:*.Gb:*.Gbc:*.Zip"}, string{"All Files|*"}}); - gameBoy.location = dialog.openObject(); + gameBoy.location = openGame(dialog); gameBoy.option = dialog.option(); } if(inode::exists(gameBoy.location)) { @@ -153,7 +153,7 @@ auto Program::load(uint id, string name, string type, vector options) -> dialog.setTitle("Load BS Memory ROM"); dialog.setPath(path("Games", settings.path.recent.bsMemory)); dialog.setFilters({string{"BS Memory ROMs|*.bs:*.zip:*.7z:*.BS:*.ZIP:*.7Z:*.Bs:*.Zip"}, string{"All Files|*"}}); - bsMemory.location = dialog.openObject(); + bsMemory.location = openGame(dialog); bsMemory.option = dialog.option(); } if(inode::exists(bsMemory.location)) { @@ -173,7 +173,7 @@ auto Program::load(uint id, string name, string type, vector options) -> dialog.setTitle("Load Sufami Turbo ROM - Slot A"); dialog.setPath(path("Games", settings.path.recent.sufamiTurboA)); dialog.setFilters({string{"Sufami Turbo ROMs|*.st:*.zip:*.7z:*.ST:*.ZIP:*.7Z:*.St:*.Zip"}, string{"All Files|*"}}); - sufamiTurboA.location = dialog.openObject(); + sufamiTurboA.location = openGame(dialog); sufamiTurboA.option = dialog.option(); } if(inode::exists(sufamiTurboA.location)) { @@ -193,7 +193,7 @@ auto Program::load(uint id, string name, string type, vector options) -> dialog.setTitle("Load Sufami Turbo ROM - Slot B"); dialog.setPath(path("Games", settings.path.recent.sufamiTurboB)); dialog.setFilters({string{"Sufami Turbo ROMs|*.st:*.zip:*.7z:*.ST:*.ZIP:*.7Z:*.St:*.Zip"}, string{"All Files|*"}}); - sufamiTurboB.location = dialog.openObject(); + sufamiTurboB.location = openGame(dialog); sufamiTurboB.option = dialog.option(); } if(inode::exists(sufamiTurboB.location)) { diff --git a/bsnes/target-bsnes/program/program.hpp b/bsnes/target-bsnes/program/program.hpp index a449cdf3..7614f21a 100644 --- a/bsnes/target-bsnes/program/program.hpp +++ b/bsnes/target-bsnes/program/program.hpp @@ -114,6 +114,10 @@ struct Program : Lock, Emulator::Platform { auto updateInputDriver(Window parent) -> void; //utility.cpp + auto openGame(BrowserDialog& dialog) -> string; + auto openFile(BrowserDialog& dialog) -> string; + auto saveFile(BrowserDialog& dialog) -> string; + auto selectPath() -> string; auto showMessage(string text) -> void; auto showFrameRate(string text) -> void; auto updateStatus() -> void; diff --git a/bsnes/target-bsnes/program/utility.cpp b/bsnes/target-bsnes/program/utility.cpp index b63e4529..cadaff94 100644 --- a/bsnes/target-bsnes/program/utility.cpp +++ b/bsnes/target-bsnes/program/utility.cpp @@ -1,3 +1,54 @@ +auto Program::openGame(BrowserDialog& dialog) -> string { + if(!settings.general.nativeFileDialogs) { + return dialog.openObject(); + } + + BrowserWindow window; + window.setTitle(dialog.title()); + window.setPath(dialog.path()); + window.setFilters(dialog.filters()); + window.setParent(dialog.alignmentWindow()); + return window.open(); +} + +auto Program::openFile(BrowserDialog& dialog) -> string { + if(!settings.general.nativeFileDialogs) { + return dialog.openFile(); + } + + BrowserWindow window; + window.setTitle(dialog.title()); + window.setPath(dialog.path()); + window.setFilters(dialog.filters()); + window.setParent(dialog.alignmentWindow()); + return window.open(); +} + +auto Program::saveFile(BrowserDialog& dialog) -> string { + if(!settings.general.nativeFileDialogs) { + return dialog.saveFile(); + } + + BrowserWindow window; + window.setTitle(dialog.title()); + window.setPath(dialog.path()); + window.setFilters(dialog.filters()); + window.setParent(dialog.alignmentWindow()); + return window.save(); +} + +auto Program::selectPath() -> string { + if(!settings.general.nativeFileDialogs) { + BrowserDialog dialog; + dialog.setPath(Path::desktop()); + return dialog.selectFolder(); + } + + BrowserWindow window; + window.setPath(Path::desktop()); + return window.directory(); +} + auto Program::showMessage(string text) -> void { statusTime = chrono::millisecond(); statusMessage = text; diff --git a/bsnes/target-bsnes/settings/emulator.cpp b/bsnes/target-bsnes/settings/emulator.cpp index f1630c3d..ce7afda4 100644 --- a/bsnes/target-bsnes/settings/emulator.cpp +++ b/bsnes/target-bsnes/settings/emulator.cpp @@ -20,6 +20,9 @@ auto EmulatorSettings::create() -> void { autoLoadStateOnLoad.setText("Auto-resume on load").setChecked(settings.emulator.autoLoadStateOnLoad).onToggle([&] { settings.emulator.autoLoadStateOnLoad = autoLoadStateOnLoad.checked(); }); + nativeFileDialogs.setText("Use native file dialogs").setChecked(settings.general.nativeFileDialogs).onToggle([&] { + settings.general.nativeFileDialogs = nativeFileDialogs.checked(); + }); optionsSpacer.setColor({192, 192, 192}); fastForwardLabel.setText("Fast Forward").setFont(Font().setBold()); diff --git a/bsnes/target-bsnes/settings/paths.cpp b/bsnes/target-bsnes/settings/paths.cpp index c42a1918..6fb38f43 100644 --- a/bsnes/target-bsnes/settings/paths.cpp +++ b/bsnes/target-bsnes/settings/paths.cpp @@ -8,7 +8,7 @@ auto PathSettings::create() -> void { gamesLabel.setText("Games:"); gamesPath.setEditable(false); gamesAssign.setText("Assign ...").onActivate([&] { - if(auto location = BrowserDialog().selectFolder()) { + if(auto location = program.selectPath()) { settings.path.games = location; refreshPaths(); } @@ -21,7 +21,7 @@ auto PathSettings::create() -> void { patchesLabel.setText("Patches:"); patchesPath.setEditable(false); patchesAssign.setText("Assign ...").onActivate([&] { - if(auto location = BrowserDialog().selectFolder()) { + if(auto location = program.selectPath()) { settings.path.patches = location; refreshPaths(); } @@ -34,7 +34,7 @@ auto PathSettings::create() -> void { savesLabel.setText("Saves:"); savesPath.setEditable(false); savesAssign.setText("Assign ...").onActivate([&] { - if(auto location = BrowserDialog().selectFolder()) { + if(auto location = program.selectPath()) { settings.path.saves = location; refreshPaths(); } @@ -47,7 +47,7 @@ auto PathSettings::create() -> void { cheatsLabel.setText("Cheats:"); cheatsPath.setEditable(false); cheatsAssign.setText("Assign ...").onActivate([&] { - if(auto location = BrowserDialog().selectFolder()) { + if(auto location = program.selectPath()) { settings.path.cheats = location; refreshPaths(); } @@ -60,7 +60,7 @@ auto PathSettings::create() -> void { statesLabel.setText("States:"); statesPath.setEditable(false); statesAssign.setText("Assign ...").onActivate([&] { - if(auto location = BrowserDialog().selectFolder()) { + if(auto location = program.selectPath()) { settings.path.states = location; refreshPaths(); } @@ -73,7 +73,7 @@ auto PathSettings::create() -> void { screenshotsLabel.setText("Screenshots:"); screenshotsPath.setEditable(false); screenshotsAssign.setText("Assign ...").onActivate([&] { - if(auto location = BrowserDialog().selectFolder()) { + if(auto location = program.selectPath()) { settings.path.screenshots = location; refreshPaths(); } diff --git a/bsnes/target-bsnes/settings/settings.cpp b/bsnes/target-bsnes/settings/settings.cpp index 96ab5524..0c17d723 100644 --- a/bsnes/target-bsnes/settings/settings.cpp +++ b/bsnes/target-bsnes/settings/settings.cpp @@ -137,11 +137,11 @@ auto Settings::process(bool load) -> void { bind(natural, "Emulator/Hack/SuperFX/Overclock", emulator.hack.superfx.overclock); bind(boolean, "Emulator/Cheats/Enable", emulator.cheats.enable); - bind(boolean, "General/StatusBar", general.statusBar); - bind(boolean, "General/ScreenSaver", general.screenSaver); - bind(boolean, "General/ToolTips", general.toolTips); - bind(boolean, "General/Crashed", general.crashed); - bind(boolean, "General/BetaWarning", general.betaWarning); + bind(boolean, "General/StatusBar", general.statusBar); + bind(boolean, "General/ScreenSaver", general.screenSaver); + bind(boolean, "General/ToolTips", general.toolTips); + bind(boolean, "General/Crashed", general.crashed); + bind(boolean, "General/NativeFileDialogs", general.nativeFileDialogs); #undef bind } diff --git a/bsnes/target-bsnes/settings/settings.hpp b/bsnes/target-bsnes/settings/settings.hpp index e81fbaa3..c4ad1e26 100644 --- a/bsnes/target-bsnes/settings/settings.hpp +++ b/bsnes/target-bsnes/settings/settings.hpp @@ -145,7 +145,7 @@ struct Settings : Markup::Node { bool screenSaver = false; bool toolTips = true; bool crashed = false; - bool betaWarning = true; + bool nativeFileDialogs = false; } general; }; @@ -303,11 +303,12 @@ struct EmulatorSettings : VerticalLayout { public: Label optionsLabel{this, Size{~0, 0}, 2}; - CheckLabel warnOnUnverifiedGames{this, Size{~0, 0}}; - CheckLabel autoSaveMemory{this, Size{~0, 0}}; - HorizontalLayout autoStateLayout{this, Size{~0, 0}}; + CheckLabel warnOnUnverifiedGames{this, Size{~0, 0}, 2}; + CheckLabel autoSaveMemory{this, Size{~0, 0}, 2}; + HorizontalLayout autoStateLayout{this, Size{~0, 0}, 2}; CheckLabel autoSaveStateOnUnload{&autoStateLayout, Size{0, 0}}; CheckLabel autoLoadStateOnLoad{&autoStateLayout, Size{0, 0}}; + CheckLabel nativeFileDialogs{this, Size{~0, 0}}; Canvas optionsSpacer{this, Size{~0, 1}}; // Label fastForwardLabel{this, Size{~0, 0}, 2}; diff --git a/hiro/cocoa/application.cpp b/hiro/cocoa/application.cpp index 68e15ab9..2afaeb9e 100755 --- a/hiro/cocoa/application.cpp +++ b/hiro/cocoa/application.cpp @@ -37,6 +37,11 @@ NSTimer* applicationTimer = nullptr; namespace hiro { +auto pApplication::exit() -> void { + quit(); + ::exit(EXIT_SUCCESS); +} + auto pApplication::modal() -> bool { return Application::state().modal > 0; } diff --git a/hiro/cocoa/application.hpp b/hiro/cocoa/application.hpp index 990351ed..4a65a881 100755 --- a/hiro/cocoa/application.hpp +++ b/hiro/cocoa/application.hpp @@ -11,6 +11,7 @@ namespace hiro { struct pApplication { + static auto exit() -> void; static auto modal() -> bool; static auto run() -> void; static auto pendingEvents() -> bool; diff --git a/hiro/cocoa/browser-window.cpp b/hiro/cocoa/browser-window.cpp index 4cc407af..54330040 100755 --- a/hiro/cocoa/browser-window.cpp +++ b/hiro/cocoa/browser-window.cpp @@ -26,7 +26,7 @@ auto pBrowserWindow::open(BrowserWindow::State& state) -> string { @autoreleasepool { NSMutableArray* filters = [[NSMutableArray alloc] init]; for(auto& rule : state.filters) { - string pattern = rule.split("(", 1L)(1).trimRight(")", 1L); + string pattern = rule.split("|", 1L)(1).transform(":", ";"); if(pattern) [filters addObject:[NSString stringWithUTF8String:pattern]]; } NSOpenPanel* panel = [NSOpenPanel openPanel]; @@ -51,7 +51,7 @@ auto pBrowserWindow::save(BrowserWindow::State& state) -> string { @autoreleasepool { NSMutableArray* filters = [[NSMutableArray alloc] init]; for(auto& rule : state.filters) { - string pattern = rule.split("(", 1L)(1).trimRight(")", 1L); + string pattern = rule.split("|", 1L)(1).transform(":", ";"); if(pattern) [filters addObject:[NSString stringWithUTF8String:pattern]]; } NSSavePanel* panel = [NSSavePanel savePanel]; diff --git a/hiro/core/application.cpp b/hiro/core/application.cpp index 790d66ff..4d5f2ebc 100755 --- a/hiro/core/application.cpp +++ b/hiro/core/application.cpp @@ -10,8 +10,8 @@ auto Application::doMain() -> void { } auto Application::exit() -> void { - quit(); - ::exit(EXIT_SUCCESS); + state().quit = true; + return pApplication::exit(); } auto Application::font() -> Font { diff --git a/hiro/extension/about-dialog.cpp b/hiro/extension/about-dialog.cpp index dd40a3a0..ca120854 100644 --- a/hiro/extension/about-dialog.cpp +++ b/hiro/extension/about-dialog.cpp @@ -12,8 +12,8 @@ auto AboutDialog::setAlignment(sWindow relativeTo, Alignment alignment) -> type& return *this; } -auto AboutDialog::setAuthor(const string& author) -> type& { - state.author = author; +auto AboutDialog::setCopyright(const string& copyright) -> type& { + state.copyright = copyright; return *this; } @@ -64,7 +64,7 @@ auto AboutDialog::show() -> void { nameLabel.setText(state.name ? state.name : Application::name()); nameLabel.setVisible((bool)state.name && !(bool)state.logo); - Canvas logoCanvas{&layout, Size{~0, 0}}; + Canvas logoCanvas{&layout, Size{~0, 0}, 5_sy}; logoCanvas.setCollapsible(); if(state.logo) { image logo{state.logo}; @@ -95,19 +95,19 @@ auto AboutDialog::show() -> void { versionValue.setText(state.version); if(!state.version) versionLayout.setVisible(false); - HorizontalLayout authorLayout{&layout, Size{~0, 0}, 0}; - authorLayout.setCollapsible(); - Label authorLabel{&authorLayout, Size{~0, 0}, 3_sx}; - authorLabel.setAlignment(1.0); - authorLabel.setFont(Font().setBold()); - authorLabel.setForegroundColor({0, 0, 0}); - authorLabel.setText("Author:"); - Label authorValue{&authorLayout, Size{~0, 0}}; - authorValue.setAlignment(0.0); - authorValue.setFont(Font().setBold()); - authorValue.setForegroundColor({0, 0, 0}); - authorValue.setText(state.author); - if(!state.author) authorLayout.setVisible(false); + HorizontalLayout copyrightLayout{&layout, Size{~0, 0}, 0}; + copyrightLayout.setCollapsible(); + Label copyrightLabel{©rightLayout, Size{~0, 0}, 3_sx}; + copyrightLabel.setAlignment(1.0); + copyrightLabel.setFont(Font().setBold()); + copyrightLabel.setForegroundColor({0, 0, 0}); + copyrightLabel.setText("Copyright:"); + Label copyrightValue{©rightLayout, Size{~0, 0}}; + copyrightValue.setAlignment(0.0); + copyrightValue.setFont(Font().setBold()); + copyrightValue.setForegroundColor({0, 0, 0}); + copyrightValue.setText(state.copyright); + if(!state.copyright) copyrightLayout.setVisible(false); HorizontalLayout licenseLayout{&layout, Size{~0, 0}, 0}; licenseLayout.setCollapsible(); @@ -151,7 +151,7 @@ auto AboutDialog::show() -> void { window.setTitle({"About ", state.name ? state.name : Application::name(), " ..."}); window.setBackgroundColor({255, 255, 240}); - window.setSize({max(360_sx, layout.minimumSize().width()), layout.minimumSize().height()}); + window.setSize({max(320_sx, layout.minimumSize().width()), layout.minimumSize().height()}); window.setResizable(false); window.setAlignment(state.relativeTo, state.alignment); window.setDismissable(); diff --git a/hiro/extension/about-dialog.hpp b/hiro/extension/about-dialog.hpp index 530b6fc7..d9cbb169 100644 --- a/hiro/extension/about-dialog.hpp +++ b/hiro/extension/about-dialog.hpp @@ -5,7 +5,7 @@ struct AboutDialog { auto setAlignment(Alignment = Alignment::Center) -> type&; auto setAlignment(sWindow relativeTo, Alignment = Alignment::Center) -> type&; - auto setAuthor(const string& author = "") -> type&; + auto setCopyright(const string& copyright = "") -> type&; auto setDescription(const string& description = "") -> type&; auto setLicense(const string& license = "") -> type&; auto setLogo(const image& logo = {}) -> type&; @@ -17,7 +17,7 @@ struct AboutDialog { private: struct State { Alignment alignment = Alignment::Center; - string author; + string copyright; string description; string license; image logo; diff --git a/hiro/extension/browser-dialog.cpp b/hiro/extension/browser-dialog.cpp index 6d589f04..294743cd 100755 --- a/hiro/extension/browser-dialog.cpp +++ b/hiro/extension/browser-dialog.cpp @@ -241,12 +241,8 @@ auto BrowserDialogWindow::run() -> BrowserDialog::Response { return (void)window.setModal(false); } if(state.action == "openObject" && isObject(name)) { - if(isMatch(name)) { - response.selected.append({state.path, name}); - return (void)window.setModal(false); - } else if(isFolder(name)) { - return setPath({state.path, name}); - } + response.selected.append({state.path, name}); + return (void)window.setModal(false); } if(state.action == "saveFile") return accept(); setPath(state.path, name); @@ -417,6 +413,18 @@ auto BrowserDialogWindow::setPath(string path, const string& contains) -> void { BrowserDialog::BrowserDialog() { } +auto BrowserDialog::alignment() const -> Alignment { + return state.alignment; +} + +auto BrowserDialog::alignmentWindow() const -> Window { + return state.relativeTo; +} + +auto BrowserDialog::filters() const -> vector { + return state.filters; +} + auto BrowserDialog::openFile() -> string { state.action = "openFile"; if(!state.title) state.title = "Open File"; @@ -449,6 +457,10 @@ auto BrowserDialog::option() -> string { return response.option; } +auto BrowserDialog::path() const -> string { + return state.path; +} + auto BrowserDialog::saveFile() -> string { state.action = "saveFile"; if(!state.title) state.title = "Save File"; @@ -504,6 +516,10 @@ auto BrowserDialog::setTitle(const string& title) -> type& { return *this; } +auto BrowserDialog::title() const -> string { + return state.title; +} + auto BrowserDialog::_run() -> vector { if(!state.path) state.path = Path::user(); response = BrowserDialogWindow(state).run(); diff --git a/hiro/extension/browser-dialog.hpp b/hiro/extension/browser-dialog.hpp index 00343909..5b50770e 100755 --- a/hiro/extension/browser-dialog.hpp +++ b/hiro/extension/browser-dialog.hpp @@ -6,11 +6,15 @@ struct BrowserDialog { using type = BrowserDialog; BrowserDialog(); + auto alignment() const -> Alignment; + auto alignmentWindow() const -> Window; + auto filters() const -> vector; auto openFile() -> string; //one existing file auto openFiles() -> vector; //any existing files auto openFolder() -> string; //one existing folder auto openObject() -> string; //one existing file or folder auto option() -> string; + auto path() const -> string; auto saveFile() -> string; //one file auto selected() -> vector; auto selectFolder() -> string; //one existing folder @@ -21,6 +25,7 @@ struct BrowserDialog { auto setOptions(const vector& options = {}) -> type&; auto setPath(const string& path = "") -> type&; auto setTitle(const string& title = "") -> type&; + auto title() const -> string; private: struct State { diff --git a/hiro/gtk/application.cpp b/hiro/gtk/application.cpp index 98cb2c99..e88295de 100755 --- a/hiro/gtk/application.cpp +++ b/hiro/gtk/application.cpp @@ -15,6 +15,11 @@ auto Log_Filter(const char* logDomain, GLogLevelFlags logLevel, const char* mess print(terminal::color::yellow("hiro: "), logDomain, "::", message, "\n"); } +auto pApplication::exit() -> void { + quit(); + ::exit(EXIT_SUCCESS); +} + auto pApplication::modal() -> bool { return Application::state().modal > 0; } diff --git a/hiro/gtk/application.hpp b/hiro/gtk/application.hpp index 7e7e5ef6..95c0c3ba 100755 --- a/hiro/gtk/application.hpp +++ b/hiro/gtk/application.hpp @@ -3,6 +3,7 @@ namespace hiro { struct pApplication { + static auto exit() -> void; static auto modal() -> bool; static auto run() -> void; static auto pendingEvents() -> bool; diff --git a/hiro/gtk/browser-window.cpp b/hiro/gtk/browser-window.cpp index 55f35b58..05bc3fae 100755 --- a/hiro/gtk/browser-window.cpp +++ b/hiro/gtk/browser-window.cpp @@ -4,9 +4,12 @@ namespace hiro { static auto BrowserWindow_addFilters(GtkWidget* dialog, vector filters) -> void { for(auto& filter : filters) { + auto part = filter.split("|", 1L); + if(part.size() != 2) continue; + GtkFileFilter* gtkFilter = gtk_file_filter_new(); - gtk_file_filter_set_name(gtkFilter, filter); - auto patterns = filter.split("(", 1L)(1).trimRight(")", 1L).split(",").strip(); + gtk_file_filter_set_name(gtkFilter, part[0]); + auto patterns = part[1].split(":"); for(auto& pattern : patterns) gtk_file_filter_add_pattern(gtkFilter, pattern); gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog), gtkFilter); } diff --git a/hiro/gtk/widget/table-view-item.cpp b/hiro/gtk/widget/table-view-item.cpp index 8abbb6e3..175627ab 100755 --- a/hiro/gtk/widget/table-view-item.cpp +++ b/hiro/gtk/widget/table-view-item.cpp @@ -32,6 +32,9 @@ auto pTableViewItem::setBackgroundColor(Color color) -> void { auto pTableViewItem::setFocused() -> void { if(auto parent = _parent()) { + //calling setSelected() and then setFocused() right after sometimes fails to set focus + Application::processEvents(); + auto lock = parent->acquire(); GtkTreePath* path = gtk_tree_path_new_from_string(string{self().offset()}); gtk_tree_view_set_cursor(parent->gtkTreeView, path, nullptr, false); diff --git a/hiro/gtk/widget/widget.cpp b/hiro/gtk/widget/widget.cpp index 652cbbcf..e55ea30a 100755 --- a/hiro/gtk/widget/widget.cpp +++ b/hiro/gtk/widget/widget.cpp @@ -127,6 +127,8 @@ auto pWidget::setGeometry(Geometry geometry) -> void { } } pSizable::setGeometry(geometry); + //this is needed to prevent some repainting issues (specifically with a Label which has a background color set for it) + gtk_widget_queue_draw(gtkWidget); } auto pWidget::setMouseCursor(const MouseCursor& mouseCursor) -> void { diff --git a/hiro/qt/application.cpp b/hiro/qt/application.cpp index f602e0ee..23feb273 100755 --- a/hiro/qt/application.cpp +++ b/hiro/qt/application.cpp @@ -2,6 +2,11 @@ namespace hiro { +auto pApplication::exit() -> void { + quit(); + ::exit(EXIT_SUCCESS); +} + auto pApplication::modal() -> bool { return Application::state().modal > 0; } diff --git a/hiro/qt/application.hpp b/hiro/qt/application.hpp index edd78ec2..02d2be93 100644 --- a/hiro/qt/application.hpp +++ b/hiro/qt/application.hpp @@ -3,6 +3,7 @@ namespace hiro { struct pApplication { + static auto exit() -> void; static auto modal() -> bool; static auto run() -> void; static auto pendingEvents() -> bool; diff --git a/hiro/qt/browser-window.cpp b/hiro/qt/browser-window.cpp index 87fe9eb6..f80828c1 100755 --- a/hiro/qt/browser-window.cpp +++ b/hiro/qt/browser-window.cpp @@ -3,63 +3,48 @@ namespace hiro { auto pBrowserWindow::directory(BrowserWindow::State& state) -> string { - return {}; -/* QString directory = QFileDialog::getExistingDirectory( - state.parent ? state.parent->p.qtWindow : nullptr, - state.title ? state.title : "Select Directory", + state.parent ? state.parent->self()->qtWindow : nullptr, + state.title ? QString::fromUtf8(state.title) : "Select Directory", QString::fromUtf8(state.path), QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks ); string name = directory.toUtf8().constData(); if(name && name.endsWith("/") == false) name.append("/"); return name; -*/ } auto pBrowserWindow::open(BrowserWindow::State& state) -> string { - return {}; -/* - string filters = state.filters.merge(";;"); - - //convert filter list from phoenix to Qt format, example: - //"Text, XML files (*.txt,*.xml)" -> "Text, XML files (*.txt *.xml)" - signed parentheses = 0; - for(auto& n : filters) { - if(n == '(') parentheses++; - if(n == ')') parentheses--; - if(n == ',' && parentheses) n = ' '; + string filters; + for(auto& filter : state.filters) { + auto part = filter.split("|", 1L); + if(part.size() != 2) continue; + filters.append(part[0], " (", part[1].transform(":", " "), ");;"); } + filters.trimRight(";;", 1L); QString filename = QFileDialog::getOpenFileName( - state.parent ? state.parent->p.qtWindow : nullptr, - state.title ? state.title : "Open File", + state.parent ? state.parent->self()->qtWindow : nullptr, + state.title ? QString::fromUtf8(state.title) : "Open File", QString::fromUtf8(state.path), QString::fromUtf8(filters) ); return filename.toUtf8().constData(); -*/ } auto pBrowserWindow::save(BrowserWindow::State& state) -> string { - return {}; -/* - string filters = state.filters.merge(";;"); - - //convert filter list from phoenix to Qt format, example: - //"Text, XML files (*.txt,*.xml)" -> "Text, XML files (*.txt *.xml)" - signed parentheses = 0; - for(auto& n : filters) { - if(n == '(') parentheses++; - if(n == ')') parentheses--; - if(n == ',' && parentheses) n = ' '; + string filters; + for(auto& filter : state.filters) { + auto part = filter.split("|", 1L); + if(part.size() != 2) continue; + filters.append(part[0], " (", part[1].transform(":", " "), ");;"); } + filters.trimRight(";;", 1L); QString filename = QFileDialog::getSaveFileName( - state.parent ? state.parent->p.qtWindow : nullptr, - state.title ? state.title : "Save File", + state.parent ? state.parent->self()->qtWindow : nullptr, + state.title ? QString::fromUtf8(state.title) : "Save File", QString::fromUtf8(state.path), QString::fromUtf8(filters) ); return filename.toUtf8().constData(); -*/ } } diff --git a/hiro/qt/message-window.cpp b/hiro/qt/message-window.cpp index c81243a2..94e1cf55 100755 --- a/hiro/qt/message-window.cpp +++ b/hiro/qt/message-window.cpp @@ -27,35 +27,31 @@ static auto MessageWindow_response(MessageWindow::Buttons buttons, QMessageBox:: } auto pMessageWindow::error(MessageWindow::State& state) -> MessageWindow::Response { - return {}; -// return MessageWindow_response( -// state.buttons, QMessageBox::critical(state.parent ? state.parent->p.qtWindow : nullptr, state.title ? state.title : " ", -// QString::fromUtf8(state.text), MessageWindow_buttons(state.buttons)) -// ); + return MessageWindow_response( + state.buttons, QMessageBox::critical(state.parent ? state.parent->self()->qtWindow : nullptr, state.title ? QString::fromUtf8(state.title) : " ", + QString::fromUtf8(state.text), MessageWindow_buttons(state.buttons)) + ); } auto pMessageWindow::information(MessageWindow::State& state) -> MessageWindow::Response { - return {}; -// return MessageWindow_response( -// state.buttons, QMessageBox::information(state.parent ? state.parent->p.qtWindow : nullptr, state.title ? state.title : " ", -// QString::fromUtf8(state.text), MessageWindow_buttons(state.buttons)) -// ); + return MessageWindow_response( + state.buttons, QMessageBox::information(state.parent ? state.parent->self()->qtWindow : nullptr, state.title ? QString::fromUtf8(state.title) : " ", + QString::fromUtf8(state.text), MessageWindow_buttons(state.buttons)) + ); } auto pMessageWindow::question(MessageWindow::State& state) -> MessageWindow::Response { - return {}; -// return MessageWindow_response( -// state.buttons, QMessageBox::question(state.parent ? state.parent->p.qtWindow : nullptr, state.title ? state.title : " ", -// QString::fromUtf8(state.text), MessageWindow_buttons(state.buttons)) -// ); + return MessageWindow_response( + state.buttons, QMessageBox::question(state.parent ? state.parent->self()->qtWindow : nullptr, state.title ? QString::fromUtf8(state.title) : " ", + QString::fromUtf8(state.text), MessageWindow_buttons(state.buttons)) + ); } auto pMessageWindow::warning(MessageWindow::State& state) -> MessageWindow::Response { - return {}; -// return MessageWindow_response( -// state.buttons, QMessageBox::warning(state.parent ? state.parent->p.qtWindow : nullptr, state.title ? state.title : " ", -// QString::fromUtf8(state.text), MessageWindow_buttons(state.buttons)) -// ); + return MessageWindow_response( + state.buttons, QMessageBox::warning(state.parent ? state.parent->self()->qtWindow : nullptr, state.title ? QString::fromUtf8(state.title) : " ", + QString::fromUtf8(state.text), MessageWindow_buttons(state.buttons)) + ); } } diff --git a/hiro/qt/qt.moc b/hiro/qt/qt.moc index afc4d6c3..9c5dd1ee 100644 --- a/hiro/qt/qt.moc +++ b/hiro/qt/qt.moc @@ -1,48 +1,24 @@ /**************************************************************************** ** Meta object code from reading C++ file 'qt.hpp' ** -** Created by: The Qt Meta Object Compiler version 67 (Qt 5.11.2) +** Created by: The Qt Meta Object Compiler version 63 (Qt 4.8.7) ** ** WARNING! All changes made in this file will be lost! *****************************************************************************/ -#include -#include #if !defined(Q_MOC_OUTPUT_REVISION) #error "The header file 'qt.hpp' doesn't include ." -#elif Q_MOC_OUTPUT_REVISION != 67 -#error "This file was generated using the moc from 5.11.2. It" +#elif Q_MOC_OUTPUT_REVISION != 63 +#error "This file was generated using the moc from 4.8.7. It" #error "cannot be used with the include files from this version of Qt." #error "(The moc has changed too much.)" #endif QT_BEGIN_MOC_NAMESPACE -QT_WARNING_PUSH -QT_WARNING_DISABLE_DEPRECATED -struct qt_meta_stringdata_hiro__QtTimer_t { - QByteArrayData data[3]; - char stringdata0[26]; -}; -#define QT_MOC_LITERAL(idx, ofs, len) \ - Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ - qptrdiff(offsetof(qt_meta_stringdata_hiro__QtTimer_t, stringdata0) + ofs \ - - idx * sizeof(QByteArrayData)) \ - ) -static const qt_meta_stringdata_hiro__QtTimer_t qt_meta_stringdata_hiro__QtTimer = { - { -QT_MOC_LITERAL(0, 0, 13), // "hiro::QtTimer" -QT_MOC_LITERAL(1, 14, 10), // "onActivate" -QT_MOC_LITERAL(2, 25, 0) // "" - - }, - "hiro::QtTimer\0onActivate\0" -}; -#undef QT_MOC_LITERAL - static const uint qt_meta_data_hiro__QtTimer[] = { // content: - 7, // revision + 6, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods @@ -52,20 +28,21 @@ static const uint qt_meta_data_hiro__QtTimer[] = { 0, // flags 0, // signalCount - // slots: name, argc, parameters, tag, flags - 1, 0, 19, 2, 0x0a /* Public */, - - // slots: parameters - QMetaType::Void, + // slots: signature, parameters, type, tag, flags + 14, 27, 27, 27, 0x0a, 0 // eod }; +static const char qt_meta_stringdata_hiro__QtTimer[] = { + "hiro::QtTimer\0onActivate()\0\0" +}; + void hiro::QtTimer::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { if (_c == QMetaObject::InvokeMetaMethod) { + Q_ASSERT(staticMetaObject.cast(_o)); QtTimer *_t = static_cast(_o); - Q_UNUSED(_t) switch (_id) { case 0: _t->onActivate(); break; default: ; @@ -74,22 +51,29 @@ void hiro::QtTimer::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _i Q_UNUSED(_a); } -QT_INIT_METAOBJECT const QMetaObject hiro::QtTimer::staticMetaObject = { - { &QTimer::staticMetaObject, qt_meta_stringdata_hiro__QtTimer.data, - qt_meta_data_hiro__QtTimer, qt_static_metacall, nullptr, nullptr} +const QMetaObjectExtraData hiro::QtTimer::staticMetaObjectExtraData = { + 0, qt_static_metacall }; +const QMetaObject hiro::QtTimer::staticMetaObject = { + { &QTimer::staticMetaObject, qt_meta_stringdata_hiro__QtTimer, + qt_meta_data_hiro__QtTimer, &staticMetaObjectExtraData } +}; + +#ifdef Q_NO_DATA_RELOCATION +const QMetaObject &hiro::QtTimer::getStaticMetaObject() { return staticMetaObject; } +#endif //Q_NO_DATA_RELOCATION const QMetaObject *hiro::QtTimer::metaObject() const { - return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *hiro::QtTimer::qt_metacast(const char *_clname) { - if (!_clname) return nullptr; - if (!strcmp(_clname, qt_meta_stringdata_hiro__QtTimer.stringdata0)) - return static_cast(this); + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_hiro__QtTimer)) + return static_cast(const_cast< QtTimer*>(this)); return QTimer::qt_metacast(_clname); } @@ -102,37 +86,13 @@ int hiro::QtTimer::qt_metacall(QMetaObject::Call _c, int _id, void **_a) if (_id < 1) qt_static_metacall(this, _c, _id, _a); _id -= 1; - } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { - if (_id < 1) - *reinterpret_cast(_a[0]) = -1; - _id -= 1; } return _id; } -struct qt_meta_stringdata_hiro__QtMenuItem_t { - QByteArrayData data[3]; - char stringdata0[29]; -}; -#define QT_MOC_LITERAL(idx, ofs, len) \ - Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ - qptrdiff(offsetof(qt_meta_stringdata_hiro__QtMenuItem_t, stringdata0) + ofs \ - - idx * sizeof(QByteArrayData)) \ - ) -static const qt_meta_stringdata_hiro__QtMenuItem_t qt_meta_stringdata_hiro__QtMenuItem = { - { -QT_MOC_LITERAL(0, 0, 16), // "hiro::QtMenuItem" -QT_MOC_LITERAL(1, 17, 10), // "onActivate" -QT_MOC_LITERAL(2, 28, 0) // "" - - }, - "hiro::QtMenuItem\0onActivate\0" -}; -#undef QT_MOC_LITERAL - static const uint qt_meta_data_hiro__QtMenuItem[] = { // content: - 7, // revision + 6, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods @@ -142,20 +102,21 @@ static const uint qt_meta_data_hiro__QtMenuItem[] = { 0, // flags 0, // signalCount - // slots: name, argc, parameters, tag, flags - 1, 0, 19, 2, 0x0a /* Public */, - - // slots: parameters - QMetaType::Void, + // slots: signature, parameters, type, tag, flags + 17, 30, 30, 30, 0x0a, 0 // eod }; +static const char qt_meta_stringdata_hiro__QtMenuItem[] = { + "hiro::QtMenuItem\0onActivate()\0\0" +}; + void hiro::QtMenuItem::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { if (_c == QMetaObject::InvokeMetaMethod) { + Q_ASSERT(staticMetaObject.cast(_o)); QtMenuItem *_t = static_cast(_o); - Q_UNUSED(_t) switch (_id) { case 0: _t->onActivate(); break; default: ; @@ -164,22 +125,29 @@ void hiro::QtMenuItem::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int Q_UNUSED(_a); } -QT_INIT_METAOBJECT const QMetaObject hiro::QtMenuItem::staticMetaObject = { - { &QAction::staticMetaObject, qt_meta_stringdata_hiro__QtMenuItem.data, - qt_meta_data_hiro__QtMenuItem, qt_static_metacall, nullptr, nullptr} +const QMetaObjectExtraData hiro::QtMenuItem::staticMetaObjectExtraData = { + 0, qt_static_metacall }; +const QMetaObject hiro::QtMenuItem::staticMetaObject = { + { &QAction::staticMetaObject, qt_meta_stringdata_hiro__QtMenuItem, + qt_meta_data_hiro__QtMenuItem, &staticMetaObjectExtraData } +}; + +#ifdef Q_NO_DATA_RELOCATION +const QMetaObject &hiro::QtMenuItem::getStaticMetaObject() { return staticMetaObject; } +#endif //Q_NO_DATA_RELOCATION const QMetaObject *hiro::QtMenuItem::metaObject() const { - return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *hiro::QtMenuItem::qt_metacast(const char *_clname) { - if (!_clname) return nullptr; - if (!strcmp(_clname, qt_meta_stringdata_hiro__QtMenuItem.stringdata0)) - return static_cast(this); + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_hiro__QtMenuItem)) + return static_cast(const_cast< QtMenuItem*>(this)); return QAction::qt_metacast(_clname); } @@ -192,37 +160,13 @@ int hiro::QtMenuItem::qt_metacall(QMetaObject::Call _c, int _id, void **_a) if (_id < 1) qt_static_metacall(this, _c, _id, _a); _id -= 1; - } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { - if (_id < 1) - *reinterpret_cast(_a[0]) = -1; - _id -= 1; } return _id; } -struct qt_meta_stringdata_hiro__QtMenuCheckItem_t { - QByteArrayData data[3]; - char stringdata0[32]; -}; -#define QT_MOC_LITERAL(idx, ofs, len) \ - Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ - qptrdiff(offsetof(qt_meta_stringdata_hiro__QtMenuCheckItem_t, stringdata0) + ofs \ - - idx * sizeof(QByteArrayData)) \ - ) -static const qt_meta_stringdata_hiro__QtMenuCheckItem_t qt_meta_stringdata_hiro__QtMenuCheckItem = { - { -QT_MOC_LITERAL(0, 0, 21), // "hiro::QtMenuCheckItem" -QT_MOC_LITERAL(1, 22, 8), // "onToggle" -QT_MOC_LITERAL(2, 31, 0) // "" - - }, - "hiro::QtMenuCheckItem\0onToggle\0" -}; -#undef QT_MOC_LITERAL - static const uint qt_meta_data_hiro__QtMenuCheckItem[] = { // content: - 7, // revision + 6, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods @@ -232,20 +176,21 @@ static const uint qt_meta_data_hiro__QtMenuCheckItem[] = { 0, // flags 0, // signalCount - // slots: name, argc, parameters, tag, flags - 1, 0, 19, 2, 0x0a /* Public */, - - // slots: parameters - QMetaType::Void, + // slots: signature, parameters, type, tag, flags + 22, 33, 33, 33, 0x0a, 0 // eod }; +static const char qt_meta_stringdata_hiro__QtMenuCheckItem[] = { + "hiro::QtMenuCheckItem\0onToggle()\0\0" +}; + void hiro::QtMenuCheckItem::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { if (_c == QMetaObject::InvokeMetaMethod) { + Q_ASSERT(staticMetaObject.cast(_o)); QtMenuCheckItem *_t = static_cast(_o); - Q_UNUSED(_t) switch (_id) { case 0: _t->onToggle(); break; default: ; @@ -254,22 +199,29 @@ void hiro::QtMenuCheckItem::qt_static_metacall(QObject *_o, QMetaObject::Call _c Q_UNUSED(_a); } -QT_INIT_METAOBJECT const QMetaObject hiro::QtMenuCheckItem::staticMetaObject = { - { &QAction::staticMetaObject, qt_meta_stringdata_hiro__QtMenuCheckItem.data, - qt_meta_data_hiro__QtMenuCheckItem, qt_static_metacall, nullptr, nullptr} +const QMetaObjectExtraData hiro::QtMenuCheckItem::staticMetaObjectExtraData = { + 0, qt_static_metacall }; +const QMetaObject hiro::QtMenuCheckItem::staticMetaObject = { + { &QAction::staticMetaObject, qt_meta_stringdata_hiro__QtMenuCheckItem, + qt_meta_data_hiro__QtMenuCheckItem, &staticMetaObjectExtraData } +}; + +#ifdef Q_NO_DATA_RELOCATION +const QMetaObject &hiro::QtMenuCheckItem::getStaticMetaObject() { return staticMetaObject; } +#endif //Q_NO_DATA_RELOCATION const QMetaObject *hiro::QtMenuCheckItem::metaObject() const { - return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *hiro::QtMenuCheckItem::qt_metacast(const char *_clname) { - if (!_clname) return nullptr; - if (!strcmp(_clname, qt_meta_stringdata_hiro__QtMenuCheckItem.stringdata0)) - return static_cast(this); + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_hiro__QtMenuCheckItem)) + return static_cast(const_cast< QtMenuCheckItem*>(this)); return QAction::qt_metacast(_clname); } @@ -282,37 +234,13 @@ int hiro::QtMenuCheckItem::qt_metacall(QMetaObject::Call _c, int _id, void **_a) if (_id < 1) qt_static_metacall(this, _c, _id, _a); _id -= 1; - } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { - if (_id < 1) - *reinterpret_cast(_a[0]) = -1; - _id -= 1; } return _id; } -struct qt_meta_stringdata_hiro__QtMenuRadioItem_t { - QByteArrayData data[3]; - char stringdata0[34]; -}; -#define QT_MOC_LITERAL(idx, ofs, len) \ - Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ - qptrdiff(offsetof(qt_meta_stringdata_hiro__QtMenuRadioItem_t, stringdata0) + ofs \ - - idx * sizeof(QByteArrayData)) \ - ) -static const qt_meta_stringdata_hiro__QtMenuRadioItem_t qt_meta_stringdata_hiro__QtMenuRadioItem = { - { -QT_MOC_LITERAL(0, 0, 21), // "hiro::QtMenuRadioItem" -QT_MOC_LITERAL(1, 22, 10), // "onActivate" -QT_MOC_LITERAL(2, 33, 0) // "" - - }, - "hiro::QtMenuRadioItem\0onActivate\0" -}; -#undef QT_MOC_LITERAL - static const uint qt_meta_data_hiro__QtMenuRadioItem[] = { // content: - 7, // revision + 6, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods @@ -322,20 +250,21 @@ static const uint qt_meta_data_hiro__QtMenuRadioItem[] = { 0, // flags 0, // signalCount - // slots: name, argc, parameters, tag, flags - 1, 0, 19, 2, 0x0a /* Public */, - - // slots: parameters - QMetaType::Void, + // slots: signature, parameters, type, tag, flags + 22, 35, 35, 35, 0x0a, 0 // eod }; +static const char qt_meta_stringdata_hiro__QtMenuRadioItem[] = { + "hiro::QtMenuRadioItem\0onActivate()\0\0" +}; + void hiro::QtMenuRadioItem::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { if (_c == QMetaObject::InvokeMetaMethod) { + Q_ASSERT(staticMetaObject.cast(_o)); QtMenuRadioItem *_t = static_cast(_o); - Q_UNUSED(_t) switch (_id) { case 0: _t->onActivate(); break; default: ; @@ -344,22 +273,29 @@ void hiro::QtMenuRadioItem::qt_static_metacall(QObject *_o, QMetaObject::Call _c Q_UNUSED(_a); } -QT_INIT_METAOBJECT const QMetaObject hiro::QtMenuRadioItem::staticMetaObject = { - { &QAction::staticMetaObject, qt_meta_stringdata_hiro__QtMenuRadioItem.data, - qt_meta_data_hiro__QtMenuRadioItem, qt_static_metacall, nullptr, nullptr} +const QMetaObjectExtraData hiro::QtMenuRadioItem::staticMetaObjectExtraData = { + 0, qt_static_metacall }; +const QMetaObject hiro::QtMenuRadioItem::staticMetaObject = { + { &QAction::staticMetaObject, qt_meta_stringdata_hiro__QtMenuRadioItem, + qt_meta_data_hiro__QtMenuRadioItem, &staticMetaObjectExtraData } +}; + +#ifdef Q_NO_DATA_RELOCATION +const QMetaObject &hiro::QtMenuRadioItem::getStaticMetaObject() { return staticMetaObject; } +#endif //Q_NO_DATA_RELOCATION const QMetaObject *hiro::QtMenuRadioItem::metaObject() const { - return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *hiro::QtMenuRadioItem::qt_metacast(const char *_clname) { - if (!_clname) return nullptr; - if (!strcmp(_clname, qt_meta_stringdata_hiro__QtMenuRadioItem.stringdata0)) - return static_cast(this); + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_hiro__QtMenuRadioItem)) + return static_cast(const_cast< QtMenuRadioItem*>(this)); return QAction::qt_metacast(_clname); } @@ -372,37 +308,13 @@ int hiro::QtMenuRadioItem::qt_metacall(QMetaObject::Call _c, int _id, void **_a) if (_id < 1) qt_static_metacall(this, _c, _id, _a); _id -= 1; - } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { - if (_id < 1) - *reinterpret_cast(_a[0]) = -1; - _id -= 1; } return _id; } -struct qt_meta_stringdata_hiro__QtButton_t { - QByteArrayData data[3]; - char stringdata0[27]; -}; -#define QT_MOC_LITERAL(idx, ofs, len) \ - Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ - qptrdiff(offsetof(qt_meta_stringdata_hiro__QtButton_t, stringdata0) + ofs \ - - idx * sizeof(QByteArrayData)) \ - ) -static const qt_meta_stringdata_hiro__QtButton_t qt_meta_stringdata_hiro__QtButton = { - { -QT_MOC_LITERAL(0, 0, 14), // "hiro::QtButton" -QT_MOC_LITERAL(1, 15, 10), // "onActivate" -QT_MOC_LITERAL(2, 26, 0) // "" - - }, - "hiro::QtButton\0onActivate\0" -}; -#undef QT_MOC_LITERAL - static const uint qt_meta_data_hiro__QtButton[] = { // content: - 7, // revision + 6, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods @@ -412,20 +324,21 @@ static const uint qt_meta_data_hiro__QtButton[] = { 0, // flags 0, // signalCount - // slots: name, argc, parameters, tag, flags - 1, 0, 19, 2, 0x0a /* Public */, - - // slots: parameters - QMetaType::Void, + // slots: signature, parameters, type, tag, flags + 15, 28, 28, 28, 0x0a, 0 // eod }; +static const char qt_meta_stringdata_hiro__QtButton[] = { + "hiro::QtButton\0onActivate()\0\0" +}; + void hiro::QtButton::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { if (_c == QMetaObject::InvokeMetaMethod) { + Q_ASSERT(staticMetaObject.cast(_o)); QtButton *_t = static_cast(_o); - Q_UNUSED(_t) switch (_id) { case 0: _t->onActivate(); break; default: ; @@ -434,22 +347,29 @@ void hiro::QtButton::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _ Q_UNUSED(_a); } -QT_INIT_METAOBJECT const QMetaObject hiro::QtButton::staticMetaObject = { - { &QToolButton::staticMetaObject, qt_meta_stringdata_hiro__QtButton.data, - qt_meta_data_hiro__QtButton, qt_static_metacall, nullptr, nullptr} +const QMetaObjectExtraData hiro::QtButton::staticMetaObjectExtraData = { + 0, qt_static_metacall }; +const QMetaObject hiro::QtButton::staticMetaObject = { + { &QToolButton::staticMetaObject, qt_meta_stringdata_hiro__QtButton, + qt_meta_data_hiro__QtButton, &staticMetaObjectExtraData } +}; + +#ifdef Q_NO_DATA_RELOCATION +const QMetaObject &hiro::QtButton::getStaticMetaObject() { return staticMetaObject; } +#endif //Q_NO_DATA_RELOCATION const QMetaObject *hiro::QtButton::metaObject() const { - return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *hiro::QtButton::qt_metacast(const char *_clname) { - if (!_clname) return nullptr; - if (!strcmp(_clname, qt_meta_stringdata_hiro__QtButton.stringdata0)) - return static_cast(this); + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_hiro__QtButton)) + return static_cast(const_cast< QtButton*>(this)); return QToolButton::qt_metacast(_clname); } @@ -462,35 +382,13 @@ int hiro::QtButton::qt_metacall(QMetaObject::Call _c, int _id, void **_a) if (_id < 1) qt_static_metacall(this, _c, _id, _a); _id -= 1; - } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { - if (_id < 1) - *reinterpret_cast(_a[0]) = -1; - _id -= 1; } return _id; } -struct qt_meta_stringdata_hiro__QtCanvas_t { - QByteArrayData data[1]; - char stringdata0[15]; -}; -#define QT_MOC_LITERAL(idx, ofs, len) \ - Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ - qptrdiff(offsetof(qt_meta_stringdata_hiro__QtCanvas_t, stringdata0) + ofs \ - - idx * sizeof(QByteArrayData)) \ - ) -static const qt_meta_stringdata_hiro__QtCanvas_t qt_meta_stringdata_hiro__QtCanvas = { - { -QT_MOC_LITERAL(0, 0, 14) // "hiro::QtCanvas" - - }, - "hiro::QtCanvas" -}; -#undef QT_MOC_LITERAL - static const uint qt_meta_data_hiro__QtCanvas[] = { // content: - 7, // revision + 6, // revision 0, // classname 0, 0, // classinfo 0, 0, // methods @@ -503,6 +401,10 @@ static const uint qt_meta_data_hiro__QtCanvas[] = { 0 // eod }; +static const char qt_meta_stringdata_hiro__QtCanvas[] = { + "hiro::QtCanvas\0" +}; + void hiro::QtCanvas::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { Q_UNUSED(_o); @@ -511,55 +413,43 @@ void hiro::QtCanvas::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _ Q_UNUSED(_a); } -QT_INIT_METAOBJECT const QMetaObject hiro::QtCanvas::staticMetaObject = { - { &QWidget::staticMetaObject, qt_meta_stringdata_hiro__QtCanvas.data, - qt_meta_data_hiro__QtCanvas, qt_static_metacall, nullptr, nullptr} +const QMetaObjectExtraData hiro::QtCanvas::staticMetaObjectExtraData = { + 0, qt_static_metacall }; +const QMetaObject hiro::QtCanvas::staticMetaObject = { + { &QWidget::staticMetaObject, qt_meta_stringdata_hiro__QtCanvas, + qt_meta_data_hiro__QtCanvas, &staticMetaObjectExtraData } +}; + +#ifdef Q_NO_DATA_RELOCATION +const QMetaObject &hiro::QtCanvas::getStaticMetaObject() { return staticMetaObject; } +#endif //Q_NO_DATA_RELOCATION const QMetaObject *hiro::QtCanvas::metaObject() const { - return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *hiro::QtCanvas::qt_metacast(const char *_clname) { - if (!_clname) return nullptr; - if (!strcmp(_clname, qt_meta_stringdata_hiro__QtCanvas.stringdata0)) - return static_cast(this); + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_hiro__QtCanvas)) + return static_cast(const_cast< QtCanvas*>(this)); return QWidget::qt_metacast(_clname); } int hiro::QtCanvas::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QWidget::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; return _id; } -struct qt_meta_stringdata_hiro__QtCheckButton_t { - QByteArrayData data[4]; - char stringdata0[38]; -}; -#define QT_MOC_LITERAL(idx, ofs, len) \ - Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ - qptrdiff(offsetof(qt_meta_stringdata_hiro__QtCheckButton_t, stringdata0) + ofs \ - - idx * sizeof(QByteArrayData)) \ - ) -static const qt_meta_stringdata_hiro__QtCheckButton_t qt_meta_stringdata_hiro__QtCheckButton = { - { -QT_MOC_LITERAL(0, 0, 19), // "hiro::QtCheckButton" -QT_MOC_LITERAL(1, 20, 8), // "onToggle" -QT_MOC_LITERAL(2, 29, 0), // "" -QT_MOC_LITERAL(3, 30, 7) // "checked" - - }, - "hiro::QtCheckButton\0onToggle\0\0checked" -}; -#undef QT_MOC_LITERAL - static const uint qt_meta_data_hiro__QtCheckButton[] = { // content: - 7, // revision + 6, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods @@ -569,20 +459,22 @@ static const uint qt_meta_data_hiro__QtCheckButton[] = { 0, // flags 0, // signalCount - // slots: name, argc, parameters, tag, flags - 1, 1, 19, 2, 0x0a /* Public */, - - // slots: parameters - QMetaType::Void, QMetaType::Bool, 3, + // slots: signature, parameters, type, tag, flags + 20, 35, 43, 43, 0x0a, 0 // eod }; +static const char qt_meta_stringdata_hiro__QtCheckButton[] = { + "hiro::QtCheckButton\0onToggle(bool)\0" + "checked\0\0" +}; + void hiro::QtCheckButton::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { if (_c == QMetaObject::InvokeMetaMethod) { + Q_ASSERT(staticMetaObject.cast(_o)); QtCheckButton *_t = static_cast(_o); - Q_UNUSED(_t) switch (_id) { case 0: _t->onToggle((*reinterpret_cast< bool(*)>(_a[1]))); break; default: ; @@ -590,22 +482,29 @@ void hiro::QtCheckButton::qt_static_metacall(QObject *_o, QMetaObject::Call _c, } } -QT_INIT_METAOBJECT const QMetaObject hiro::QtCheckButton::staticMetaObject = { - { &QToolButton::staticMetaObject, qt_meta_stringdata_hiro__QtCheckButton.data, - qt_meta_data_hiro__QtCheckButton, qt_static_metacall, nullptr, nullptr} +const QMetaObjectExtraData hiro::QtCheckButton::staticMetaObjectExtraData = { + 0, qt_static_metacall }; +const QMetaObject hiro::QtCheckButton::staticMetaObject = { + { &QToolButton::staticMetaObject, qt_meta_stringdata_hiro__QtCheckButton, + qt_meta_data_hiro__QtCheckButton, &staticMetaObjectExtraData } +}; + +#ifdef Q_NO_DATA_RELOCATION +const QMetaObject &hiro::QtCheckButton::getStaticMetaObject() { return staticMetaObject; } +#endif //Q_NO_DATA_RELOCATION const QMetaObject *hiro::QtCheckButton::metaObject() const { - return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *hiro::QtCheckButton::qt_metacast(const char *_clname) { - if (!_clname) return nullptr; - if (!strcmp(_clname, qt_meta_stringdata_hiro__QtCheckButton.stringdata0)) - return static_cast(this); + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_hiro__QtCheckButton)) + return static_cast(const_cast< QtCheckButton*>(this)); return QToolButton::qt_metacast(_clname); } @@ -618,37 +517,13 @@ int hiro::QtCheckButton::qt_metacall(QMetaObject::Call _c, int _id, void **_a) if (_id < 1) qt_static_metacall(this, _c, _id, _a); _id -= 1; - } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { - if (_id < 1) - *reinterpret_cast(_a[0]) = -1; - _id -= 1; } return _id; } -struct qt_meta_stringdata_hiro__QtCheckLabel_t { - QByteArrayData data[3]; - char stringdata0[29]; -}; -#define QT_MOC_LITERAL(idx, ofs, len) \ - Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ - qptrdiff(offsetof(qt_meta_stringdata_hiro__QtCheckLabel_t, stringdata0) + ofs \ - - idx * sizeof(QByteArrayData)) \ - ) -static const qt_meta_stringdata_hiro__QtCheckLabel_t qt_meta_stringdata_hiro__QtCheckLabel = { - { -QT_MOC_LITERAL(0, 0, 18), // "hiro::QtCheckLabel" -QT_MOC_LITERAL(1, 19, 8), // "onToggle" -QT_MOC_LITERAL(2, 28, 0) // "" - - }, - "hiro::QtCheckLabel\0onToggle\0" -}; -#undef QT_MOC_LITERAL - static const uint qt_meta_data_hiro__QtCheckLabel[] = { // content: - 7, // revision + 6, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods @@ -658,20 +533,21 @@ static const uint qt_meta_data_hiro__QtCheckLabel[] = { 0, // flags 0, // signalCount - // slots: name, argc, parameters, tag, flags - 1, 0, 19, 2, 0x0a /* Public */, - - // slots: parameters - QMetaType::Void, + // slots: signature, parameters, type, tag, flags + 19, 30, 30, 30, 0x0a, 0 // eod }; +static const char qt_meta_stringdata_hiro__QtCheckLabel[] = { + "hiro::QtCheckLabel\0onToggle()\0\0" +}; + void hiro::QtCheckLabel::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { if (_c == QMetaObject::InvokeMetaMethod) { + Q_ASSERT(staticMetaObject.cast(_o)); QtCheckLabel *_t = static_cast(_o); - Q_UNUSED(_t) switch (_id) { case 0: _t->onToggle(); break; default: ; @@ -680,22 +556,29 @@ void hiro::QtCheckLabel::qt_static_metacall(QObject *_o, QMetaObject::Call _c, i Q_UNUSED(_a); } -QT_INIT_METAOBJECT const QMetaObject hiro::QtCheckLabel::staticMetaObject = { - { &QCheckBox::staticMetaObject, qt_meta_stringdata_hiro__QtCheckLabel.data, - qt_meta_data_hiro__QtCheckLabel, qt_static_metacall, nullptr, nullptr} +const QMetaObjectExtraData hiro::QtCheckLabel::staticMetaObjectExtraData = { + 0, qt_static_metacall }; +const QMetaObject hiro::QtCheckLabel::staticMetaObject = { + { &QCheckBox::staticMetaObject, qt_meta_stringdata_hiro__QtCheckLabel, + qt_meta_data_hiro__QtCheckLabel, &staticMetaObjectExtraData } +}; + +#ifdef Q_NO_DATA_RELOCATION +const QMetaObject &hiro::QtCheckLabel::getStaticMetaObject() { return staticMetaObject; } +#endif //Q_NO_DATA_RELOCATION const QMetaObject *hiro::QtCheckLabel::metaObject() const { - return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *hiro::QtCheckLabel::qt_metacast(const char *_clname) { - if (!_clname) return nullptr; - if (!strcmp(_clname, qt_meta_stringdata_hiro__QtCheckLabel.stringdata0)) - return static_cast(this); + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_hiro__QtCheckLabel)) + return static_cast(const_cast< QtCheckLabel*>(this)); return QCheckBox::qt_metacast(_clname); } @@ -708,38 +591,13 @@ int hiro::QtCheckLabel::qt_metacall(QMetaObject::Call _c, int _id, void **_a) if (_id < 1) qt_static_metacall(this, _c, _id, _a); _id -= 1; - } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { - if (_id < 1) - *reinterpret_cast(_a[0]) = -1; - _id -= 1; } return _id; } -struct qt_meta_stringdata_hiro__QtComboButton_t { - QByteArrayData data[4]; - char stringdata0[37]; -}; -#define QT_MOC_LITERAL(idx, ofs, len) \ - Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ - qptrdiff(offsetof(qt_meta_stringdata_hiro__QtComboButton_t, stringdata0) + ofs \ - - idx * sizeof(QByteArrayData)) \ - ) -static const qt_meta_stringdata_hiro__QtComboButton_t qt_meta_stringdata_hiro__QtComboButton = { - { -QT_MOC_LITERAL(0, 0, 19), // "hiro::QtComboButton" -QT_MOC_LITERAL(1, 20, 8), // "onChange" -QT_MOC_LITERAL(2, 29, 0), // "" -QT_MOC_LITERAL(3, 30, 6) // "offset" - - }, - "hiro::QtComboButton\0onChange\0\0offset" -}; -#undef QT_MOC_LITERAL - static const uint qt_meta_data_hiro__QtComboButton[] = { // content: - 7, // revision + 6, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods @@ -749,20 +607,22 @@ static const uint qt_meta_data_hiro__QtComboButton[] = { 0, // flags 0, // signalCount - // slots: name, argc, parameters, tag, flags - 1, 1, 19, 2, 0x0a /* Public */, - - // slots: parameters - QMetaType::Void, QMetaType::Int, 3, + // slots: signature, parameters, type, tag, flags + 20, 34, 41, 41, 0x0a, 0 // eod }; +static const char qt_meta_stringdata_hiro__QtComboButton[] = { + "hiro::QtComboButton\0onChange(int)\0" + "offset\0\0" +}; + void hiro::QtComboButton::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { if (_c == QMetaObject::InvokeMetaMethod) { + Q_ASSERT(staticMetaObject.cast(_o)); QtComboButton *_t = static_cast(_o); - Q_UNUSED(_t) switch (_id) { case 0: _t->onChange((*reinterpret_cast< int(*)>(_a[1]))); break; default: ; @@ -770,22 +630,29 @@ void hiro::QtComboButton::qt_static_metacall(QObject *_o, QMetaObject::Call _c, } } -QT_INIT_METAOBJECT const QMetaObject hiro::QtComboButton::staticMetaObject = { - { &QComboBox::staticMetaObject, qt_meta_stringdata_hiro__QtComboButton.data, - qt_meta_data_hiro__QtComboButton, qt_static_metacall, nullptr, nullptr} +const QMetaObjectExtraData hiro::QtComboButton::staticMetaObjectExtraData = { + 0, qt_static_metacall }; +const QMetaObject hiro::QtComboButton::staticMetaObject = { + { &QComboBox::staticMetaObject, qt_meta_stringdata_hiro__QtComboButton, + qt_meta_data_hiro__QtComboButton, &staticMetaObjectExtraData } +}; + +#ifdef Q_NO_DATA_RELOCATION +const QMetaObject &hiro::QtComboButton::getStaticMetaObject() { return staticMetaObject; } +#endif //Q_NO_DATA_RELOCATION const QMetaObject *hiro::QtComboButton::metaObject() const { - return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *hiro::QtComboButton::qt_metacast(const char *_clname) { - if (!_clname) return nullptr; - if (!strcmp(_clname, qt_meta_stringdata_hiro__QtComboButton.stringdata0)) - return static_cast(this); + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_hiro__QtComboButton)) + return static_cast(const_cast< QtComboButton*>(this)); return QComboBox::qt_metacast(_clname); } @@ -798,35 +665,13 @@ int hiro::QtComboButton::qt_metacall(QMetaObject::Call _c, int _id, void **_a) if (_id < 1) qt_static_metacall(this, _c, _id, _a); _id -= 1; - } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { - if (_id < 1) - *reinterpret_cast(_a[0]) = -1; - _id -= 1; } return _id; } -struct qt_meta_stringdata_hiro__QtHexEdit_t { - QByteArrayData data[1]; - char stringdata0[16]; -}; -#define QT_MOC_LITERAL(idx, ofs, len) \ - Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ - qptrdiff(offsetof(qt_meta_stringdata_hiro__QtHexEdit_t, stringdata0) + ofs \ - - idx * sizeof(QByteArrayData)) \ - ) -static const qt_meta_stringdata_hiro__QtHexEdit_t qt_meta_stringdata_hiro__QtHexEdit = { - { -QT_MOC_LITERAL(0, 0, 15) // "hiro::QtHexEdit" - - }, - "hiro::QtHexEdit" -}; -#undef QT_MOC_LITERAL - static const uint qt_meta_data_hiro__QtHexEdit[] = { // content: - 7, // revision + 6, // revision 0, // classname 0, 0, // classinfo 0, 0, // methods @@ -839,6 +684,10 @@ static const uint qt_meta_data_hiro__QtHexEdit[] = { 0 // eod }; +static const char qt_meta_stringdata_hiro__QtHexEdit[] = { + "hiro::QtHexEdit\0" +}; + void hiro::QtHexEdit::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { Q_UNUSED(_o); @@ -847,54 +696,43 @@ void hiro::QtHexEdit::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int Q_UNUSED(_a); } -QT_INIT_METAOBJECT const QMetaObject hiro::QtHexEdit::staticMetaObject = { - { &QTextEdit::staticMetaObject, qt_meta_stringdata_hiro__QtHexEdit.data, - qt_meta_data_hiro__QtHexEdit, qt_static_metacall, nullptr, nullptr} +const QMetaObjectExtraData hiro::QtHexEdit::staticMetaObjectExtraData = { + 0, qt_static_metacall }; +const QMetaObject hiro::QtHexEdit::staticMetaObject = { + { &QTextEdit::staticMetaObject, qt_meta_stringdata_hiro__QtHexEdit, + qt_meta_data_hiro__QtHexEdit, &staticMetaObjectExtraData } +}; + +#ifdef Q_NO_DATA_RELOCATION +const QMetaObject &hiro::QtHexEdit::getStaticMetaObject() { return staticMetaObject; } +#endif //Q_NO_DATA_RELOCATION const QMetaObject *hiro::QtHexEdit::metaObject() const { - return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *hiro::QtHexEdit::qt_metacast(const char *_clname) { - if (!_clname) return nullptr; - if (!strcmp(_clname, qt_meta_stringdata_hiro__QtHexEdit.stringdata0)) - return static_cast(this); + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_hiro__QtHexEdit)) + return static_cast(const_cast< QtHexEdit*>(this)); return QTextEdit::qt_metacast(_clname); } int hiro::QtHexEdit::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QTextEdit::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; return _id; } -struct qt_meta_stringdata_hiro__QtHexEditScrollBar_t { - QByteArrayData data[3]; - char stringdata0[35]; -}; -#define QT_MOC_LITERAL(idx, ofs, len) \ - Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ - qptrdiff(offsetof(qt_meta_stringdata_hiro__QtHexEditScrollBar_t, stringdata0) + ofs \ - - idx * sizeof(QByteArrayData)) \ - ) -static const qt_meta_stringdata_hiro__QtHexEditScrollBar_t qt_meta_stringdata_hiro__QtHexEditScrollBar = { - { -QT_MOC_LITERAL(0, 0, 24), // "hiro::QtHexEditScrollBar" -QT_MOC_LITERAL(1, 25, 8), // "onScroll" -QT_MOC_LITERAL(2, 34, 0) // "" - - }, - "hiro::QtHexEditScrollBar\0onScroll\0" -}; -#undef QT_MOC_LITERAL - static const uint qt_meta_data_hiro__QtHexEditScrollBar[] = { // content: - 7, // revision + 6, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods @@ -904,20 +742,22 @@ static const uint qt_meta_data_hiro__QtHexEditScrollBar[] = { 0, // flags 0, // signalCount - // slots: name, argc, parameters, tag, flags - 1, 0, 19, 2, 0x0a /* Public */, - - // slots: parameters - QMetaType::Void, + // slots: signature, parameters, type, tag, flags + 25, 36, 36, 36, 0x0a, 0 // eod }; +static const char qt_meta_stringdata_hiro__QtHexEditScrollBar[] = { + "hiro::QtHexEditScrollBar\0onScroll()\0" + "\0" +}; + void hiro::QtHexEditScrollBar::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { if (_c == QMetaObject::InvokeMetaMethod) { + Q_ASSERT(staticMetaObject.cast(_o)); QtHexEditScrollBar *_t = static_cast(_o); - Q_UNUSED(_t) switch (_id) { case 0: _t->onScroll(); break; default: ; @@ -926,22 +766,29 @@ void hiro::QtHexEditScrollBar::qt_static_metacall(QObject *_o, QMetaObject::Call Q_UNUSED(_a); } -QT_INIT_METAOBJECT const QMetaObject hiro::QtHexEditScrollBar::staticMetaObject = { - { &QScrollBar::staticMetaObject, qt_meta_stringdata_hiro__QtHexEditScrollBar.data, - qt_meta_data_hiro__QtHexEditScrollBar, qt_static_metacall, nullptr, nullptr} +const QMetaObjectExtraData hiro::QtHexEditScrollBar::staticMetaObjectExtraData = { + 0, qt_static_metacall }; +const QMetaObject hiro::QtHexEditScrollBar::staticMetaObject = { + { &QScrollBar::staticMetaObject, qt_meta_stringdata_hiro__QtHexEditScrollBar, + qt_meta_data_hiro__QtHexEditScrollBar, &staticMetaObjectExtraData } +}; + +#ifdef Q_NO_DATA_RELOCATION +const QMetaObject &hiro::QtHexEditScrollBar::getStaticMetaObject() { return staticMetaObject; } +#endif //Q_NO_DATA_RELOCATION const QMetaObject *hiro::QtHexEditScrollBar::metaObject() const { - return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *hiro::QtHexEditScrollBar::qt_metacast(const char *_clname) { - if (!_clname) return nullptr; - if (!strcmp(_clname, qt_meta_stringdata_hiro__QtHexEditScrollBar.stringdata0)) - return static_cast(this); + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_hiro__QtHexEditScrollBar)) + return static_cast(const_cast< QtHexEditScrollBar*>(this)); return QScrollBar::qt_metacast(_clname); } @@ -954,38 +801,13 @@ int hiro::QtHexEditScrollBar::qt_metacall(QMetaObject::Call _c, int _id, void ** if (_id < 1) qt_static_metacall(this, _c, _id, _a); _id -= 1; - } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { - if (_id < 1) - *reinterpret_cast(_a[0]) = -1; - _id -= 1; } return _id; } -struct qt_meta_stringdata_hiro__QtHorizontalScrollBar_t { - QByteArrayData data[3]; - char stringdata0[38]; -}; -#define QT_MOC_LITERAL(idx, ofs, len) \ - Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ - qptrdiff(offsetof(qt_meta_stringdata_hiro__QtHorizontalScrollBar_t, stringdata0) + ofs \ - - idx * sizeof(QByteArrayData)) \ - ) -static const qt_meta_stringdata_hiro__QtHorizontalScrollBar_t qt_meta_stringdata_hiro__QtHorizontalScrollBar = { - { -QT_MOC_LITERAL(0, 0, 27), // "hiro::QtHorizontalScrollBar" -QT_MOC_LITERAL(1, 28, 8), // "onChange" -QT_MOC_LITERAL(2, 37, 0) // "" - - }, - "hiro::QtHorizontalScrollBar\0onChange\0" - "" -}; -#undef QT_MOC_LITERAL - static const uint qt_meta_data_hiro__QtHorizontalScrollBar[] = { // content: - 7, // revision + 6, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods @@ -995,20 +817,22 @@ static const uint qt_meta_data_hiro__QtHorizontalScrollBar[] = { 0, // flags 0, // signalCount - // slots: name, argc, parameters, tag, flags - 1, 0, 19, 2, 0x0a /* Public */, - - // slots: parameters - QMetaType::Void, + // slots: signature, parameters, type, tag, flags + 28, 39, 39, 39, 0x0a, 0 // eod }; +static const char qt_meta_stringdata_hiro__QtHorizontalScrollBar[] = { + "hiro::QtHorizontalScrollBar\0onChange()\0" + "\0" +}; + void hiro::QtHorizontalScrollBar::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { if (_c == QMetaObject::InvokeMetaMethod) { + Q_ASSERT(staticMetaObject.cast(_o)); QtHorizontalScrollBar *_t = static_cast(_o); - Q_UNUSED(_t) switch (_id) { case 0: _t->onChange(); break; default: ; @@ -1017,22 +841,29 @@ void hiro::QtHorizontalScrollBar::qt_static_metacall(QObject *_o, QMetaObject::C Q_UNUSED(_a); } -QT_INIT_METAOBJECT const QMetaObject hiro::QtHorizontalScrollBar::staticMetaObject = { - { &QScrollBar::staticMetaObject, qt_meta_stringdata_hiro__QtHorizontalScrollBar.data, - qt_meta_data_hiro__QtHorizontalScrollBar, qt_static_metacall, nullptr, nullptr} +const QMetaObjectExtraData hiro::QtHorizontalScrollBar::staticMetaObjectExtraData = { + 0, qt_static_metacall }; +const QMetaObject hiro::QtHorizontalScrollBar::staticMetaObject = { + { &QScrollBar::staticMetaObject, qt_meta_stringdata_hiro__QtHorizontalScrollBar, + qt_meta_data_hiro__QtHorizontalScrollBar, &staticMetaObjectExtraData } +}; + +#ifdef Q_NO_DATA_RELOCATION +const QMetaObject &hiro::QtHorizontalScrollBar::getStaticMetaObject() { return staticMetaObject; } +#endif //Q_NO_DATA_RELOCATION const QMetaObject *hiro::QtHorizontalScrollBar::metaObject() const { - return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *hiro::QtHorizontalScrollBar::qt_metacast(const char *_clname) { - if (!_clname) return nullptr; - if (!strcmp(_clname, qt_meta_stringdata_hiro__QtHorizontalScrollBar.stringdata0)) - return static_cast(this); + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_hiro__QtHorizontalScrollBar)) + return static_cast(const_cast< QtHorizontalScrollBar*>(this)); return QScrollBar::qt_metacast(_clname); } @@ -1045,37 +876,13 @@ int hiro::QtHorizontalScrollBar::qt_metacall(QMetaObject::Call _c, int _id, void if (_id < 1) qt_static_metacall(this, _c, _id, _a); _id -= 1; - } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { - if (_id < 1) - *reinterpret_cast(_a[0]) = -1; - _id -= 1; } return _id; } -struct qt_meta_stringdata_hiro__QtHorizontalSlider_t { - QByteArrayData data[3]; - char stringdata0[35]; -}; -#define QT_MOC_LITERAL(idx, ofs, len) \ - Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ - qptrdiff(offsetof(qt_meta_stringdata_hiro__QtHorizontalSlider_t, stringdata0) + ofs \ - - idx * sizeof(QByteArrayData)) \ - ) -static const qt_meta_stringdata_hiro__QtHorizontalSlider_t qt_meta_stringdata_hiro__QtHorizontalSlider = { - { -QT_MOC_LITERAL(0, 0, 24), // "hiro::QtHorizontalSlider" -QT_MOC_LITERAL(1, 25, 8), // "onChange" -QT_MOC_LITERAL(2, 34, 0) // "" - - }, - "hiro::QtHorizontalSlider\0onChange\0" -}; -#undef QT_MOC_LITERAL - static const uint qt_meta_data_hiro__QtHorizontalSlider[] = { // content: - 7, // revision + 6, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods @@ -1085,20 +892,22 @@ static const uint qt_meta_data_hiro__QtHorizontalSlider[] = { 0, // flags 0, // signalCount - // slots: name, argc, parameters, tag, flags - 1, 0, 19, 2, 0x0a /* Public */, - - // slots: parameters - QMetaType::Void, + // slots: signature, parameters, type, tag, flags + 25, 36, 36, 36, 0x0a, 0 // eod }; +static const char qt_meta_stringdata_hiro__QtHorizontalSlider[] = { + "hiro::QtHorizontalSlider\0onChange()\0" + "\0" +}; + void hiro::QtHorizontalSlider::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { if (_c == QMetaObject::InvokeMetaMethod) { + Q_ASSERT(staticMetaObject.cast(_o)); QtHorizontalSlider *_t = static_cast(_o); - Q_UNUSED(_t) switch (_id) { case 0: _t->onChange(); break; default: ; @@ -1107,22 +916,29 @@ void hiro::QtHorizontalSlider::qt_static_metacall(QObject *_o, QMetaObject::Call Q_UNUSED(_a); } -QT_INIT_METAOBJECT const QMetaObject hiro::QtHorizontalSlider::staticMetaObject = { - { &QSlider::staticMetaObject, qt_meta_stringdata_hiro__QtHorizontalSlider.data, - qt_meta_data_hiro__QtHorizontalSlider, qt_static_metacall, nullptr, nullptr} +const QMetaObjectExtraData hiro::QtHorizontalSlider::staticMetaObjectExtraData = { + 0, qt_static_metacall }; +const QMetaObject hiro::QtHorizontalSlider::staticMetaObject = { + { &QSlider::staticMetaObject, qt_meta_stringdata_hiro__QtHorizontalSlider, + qt_meta_data_hiro__QtHorizontalSlider, &staticMetaObjectExtraData } +}; + +#ifdef Q_NO_DATA_RELOCATION +const QMetaObject &hiro::QtHorizontalSlider::getStaticMetaObject() { return staticMetaObject; } +#endif //Q_NO_DATA_RELOCATION const QMetaObject *hiro::QtHorizontalSlider::metaObject() const { - return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *hiro::QtHorizontalSlider::qt_metacast(const char *_clname) { - if (!_clname) return nullptr; - if (!strcmp(_clname, qt_meta_stringdata_hiro__QtHorizontalSlider.stringdata0)) - return static_cast(this); + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_hiro__QtHorizontalSlider)) + return static_cast(const_cast< QtHorizontalSlider*>(this)); return QSlider::qt_metacast(_clname); } @@ -1135,35 +951,13 @@ int hiro::QtHorizontalSlider::qt_metacall(QMetaObject::Call _c, int _id, void ** if (_id < 1) qt_static_metacall(this, _c, _id, _a); _id -= 1; - } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { - if (_id < 1) - *reinterpret_cast(_a[0]) = -1; - _id -= 1; } return _id; } -struct qt_meta_stringdata_hiro__QtLabel_t { - QByteArrayData data[1]; - char stringdata0[14]; -}; -#define QT_MOC_LITERAL(idx, ofs, len) \ - Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ - qptrdiff(offsetof(qt_meta_stringdata_hiro__QtLabel_t, stringdata0) + ofs \ - - idx * sizeof(QByteArrayData)) \ - ) -static const qt_meta_stringdata_hiro__QtLabel_t qt_meta_stringdata_hiro__QtLabel = { - { -QT_MOC_LITERAL(0, 0, 13) // "hiro::QtLabel" - - }, - "hiro::QtLabel" -}; -#undef QT_MOC_LITERAL - static const uint qt_meta_data_hiro__QtLabel[] = { // content: - 7, // revision + 6, // revision 0, // classname 0, 0, // classinfo 0, 0, // methods @@ -1176,6 +970,10 @@ static const uint qt_meta_data_hiro__QtLabel[] = { 0 // eod }; +static const char qt_meta_stringdata_hiro__QtLabel[] = { + "hiro::QtLabel\0" +}; + void hiro::QtLabel::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { Q_UNUSED(_o); @@ -1184,55 +982,43 @@ void hiro::QtLabel::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _i Q_UNUSED(_a); } -QT_INIT_METAOBJECT const QMetaObject hiro::QtLabel::staticMetaObject = { - { &QWidget::staticMetaObject, qt_meta_stringdata_hiro__QtLabel.data, - qt_meta_data_hiro__QtLabel, qt_static_metacall, nullptr, nullptr} +const QMetaObjectExtraData hiro::QtLabel::staticMetaObjectExtraData = { + 0, qt_static_metacall }; +const QMetaObject hiro::QtLabel::staticMetaObject = { + { &QWidget::staticMetaObject, qt_meta_stringdata_hiro__QtLabel, + qt_meta_data_hiro__QtLabel, &staticMetaObjectExtraData } +}; + +#ifdef Q_NO_DATA_RELOCATION +const QMetaObject &hiro::QtLabel::getStaticMetaObject() { return staticMetaObject; } +#endif //Q_NO_DATA_RELOCATION const QMetaObject *hiro::QtLabel::metaObject() const { - return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *hiro::QtLabel::qt_metacast(const char *_clname) { - if (!_clname) return nullptr; - if (!strcmp(_clname, qt_meta_stringdata_hiro__QtLabel.stringdata0)) - return static_cast(this); + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_hiro__QtLabel)) + return static_cast(const_cast< QtLabel*>(this)); return QWidget::qt_metacast(_clname); } int hiro::QtLabel::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QWidget::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; return _id; } -struct qt_meta_stringdata_hiro__QtLineEdit_t { - QByteArrayData data[4]; - char stringdata0[38]; -}; -#define QT_MOC_LITERAL(idx, ofs, len) \ - Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ - qptrdiff(offsetof(qt_meta_stringdata_hiro__QtLineEdit_t, stringdata0) + ofs \ - - idx * sizeof(QByteArrayData)) \ - ) -static const qt_meta_stringdata_hiro__QtLineEdit_t qt_meta_stringdata_hiro__QtLineEdit = { - { -QT_MOC_LITERAL(0, 0, 16), // "hiro::QtLineEdit" -QT_MOC_LITERAL(1, 17, 10), // "onActivate" -QT_MOC_LITERAL(2, 28, 0), // "" -QT_MOC_LITERAL(3, 29, 8) // "onChange" - - }, - "hiro::QtLineEdit\0onActivate\0\0onChange" -}; -#undef QT_MOC_LITERAL - static const uint qt_meta_data_hiro__QtLineEdit[] = { // content: - 7, // revision + 6, // revision 0, // classname 0, 0, // classinfo 2, 14, // methods @@ -1242,22 +1028,23 @@ static const uint qt_meta_data_hiro__QtLineEdit[] = { 0, // flags 0, // signalCount - // slots: name, argc, parameters, tag, flags - 1, 0, 24, 2, 0x0a /* Public */, - 3, 0, 25, 2, 0x0a /* Public */, - - // slots: parameters - QMetaType::Void, - QMetaType::Void, + // slots: signature, parameters, type, tag, flags + 17, 30, 30, 30, 0x0a, + 31, 30, 30, 30, 0x0a, 0 // eod }; +static const char qt_meta_stringdata_hiro__QtLineEdit[] = { + "hiro::QtLineEdit\0onActivate()\0\0" + "onChange()\0" +}; + void hiro::QtLineEdit::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { if (_c == QMetaObject::InvokeMetaMethod) { + Q_ASSERT(staticMetaObject.cast(_o)); QtLineEdit *_t = static_cast(_o); - Q_UNUSED(_t) switch (_id) { case 0: _t->onActivate(); break; case 1: _t->onChange(); break; @@ -1267,22 +1054,29 @@ void hiro::QtLineEdit::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int Q_UNUSED(_a); } -QT_INIT_METAOBJECT const QMetaObject hiro::QtLineEdit::staticMetaObject = { - { &QLineEdit::staticMetaObject, qt_meta_stringdata_hiro__QtLineEdit.data, - qt_meta_data_hiro__QtLineEdit, qt_static_metacall, nullptr, nullptr} +const QMetaObjectExtraData hiro::QtLineEdit::staticMetaObjectExtraData = { + 0, qt_static_metacall }; +const QMetaObject hiro::QtLineEdit::staticMetaObject = { + { &QLineEdit::staticMetaObject, qt_meta_stringdata_hiro__QtLineEdit, + qt_meta_data_hiro__QtLineEdit, &staticMetaObjectExtraData } +}; + +#ifdef Q_NO_DATA_RELOCATION +const QMetaObject &hiro::QtLineEdit::getStaticMetaObject() { return staticMetaObject; } +#endif //Q_NO_DATA_RELOCATION const QMetaObject *hiro::QtLineEdit::metaObject() const { - return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *hiro::QtLineEdit::qt_metacast(const char *_clname) { - if (!_clname) return nullptr; - if (!strcmp(_clname, qt_meta_stringdata_hiro__QtLineEdit.stringdata0)) - return static_cast(this); + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_hiro__QtLineEdit)) + return static_cast(const_cast< QtLineEdit*>(this)); return QLineEdit::qt_metacast(_clname); } @@ -1295,37 +1089,13 @@ int hiro::QtLineEdit::qt_metacall(QMetaObject::Call _c, int _id, void **_a) if (_id < 2) qt_static_metacall(this, _c, _id, _a); _id -= 2; - } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { - if (_id < 2) - *reinterpret_cast(_a[0]) = -1; - _id -= 2; } return _id; } -struct qt_meta_stringdata_hiro__QtRadioLabel_t { - QByteArrayData data[3]; - char stringdata0[31]; -}; -#define QT_MOC_LITERAL(idx, ofs, len) \ - Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ - qptrdiff(offsetof(qt_meta_stringdata_hiro__QtRadioLabel_t, stringdata0) + ofs \ - - idx * sizeof(QByteArrayData)) \ - ) -static const qt_meta_stringdata_hiro__QtRadioLabel_t qt_meta_stringdata_hiro__QtRadioLabel = { - { -QT_MOC_LITERAL(0, 0, 18), // "hiro::QtRadioLabel" -QT_MOC_LITERAL(1, 19, 10), // "onActivate" -QT_MOC_LITERAL(2, 30, 0) // "" - - }, - "hiro::QtRadioLabel\0onActivate\0" -}; -#undef QT_MOC_LITERAL - static const uint qt_meta_data_hiro__QtRadioLabel[] = { // content: - 7, // revision + 6, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods @@ -1335,20 +1105,21 @@ static const uint qt_meta_data_hiro__QtRadioLabel[] = { 0, // flags 0, // signalCount - // slots: name, argc, parameters, tag, flags - 1, 0, 19, 2, 0x0a /* Public */, - - // slots: parameters - QMetaType::Void, + // slots: signature, parameters, type, tag, flags + 19, 32, 32, 32, 0x0a, 0 // eod }; +static const char qt_meta_stringdata_hiro__QtRadioLabel[] = { + "hiro::QtRadioLabel\0onActivate()\0\0" +}; + void hiro::QtRadioLabel::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { if (_c == QMetaObject::InvokeMetaMethod) { + Q_ASSERT(staticMetaObject.cast(_o)); QtRadioLabel *_t = static_cast(_o); - Q_UNUSED(_t) switch (_id) { case 0: _t->onActivate(); break; default: ; @@ -1357,22 +1128,29 @@ void hiro::QtRadioLabel::qt_static_metacall(QObject *_o, QMetaObject::Call _c, i Q_UNUSED(_a); } -QT_INIT_METAOBJECT const QMetaObject hiro::QtRadioLabel::staticMetaObject = { - { &QRadioButton::staticMetaObject, qt_meta_stringdata_hiro__QtRadioLabel.data, - qt_meta_data_hiro__QtRadioLabel, qt_static_metacall, nullptr, nullptr} +const QMetaObjectExtraData hiro::QtRadioLabel::staticMetaObjectExtraData = { + 0, qt_static_metacall }; +const QMetaObject hiro::QtRadioLabel::staticMetaObject = { + { &QRadioButton::staticMetaObject, qt_meta_stringdata_hiro__QtRadioLabel, + qt_meta_data_hiro__QtRadioLabel, &staticMetaObjectExtraData } +}; + +#ifdef Q_NO_DATA_RELOCATION +const QMetaObject &hiro::QtRadioLabel::getStaticMetaObject() { return staticMetaObject; } +#endif //Q_NO_DATA_RELOCATION const QMetaObject *hiro::QtRadioLabel::metaObject() const { - return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *hiro::QtRadioLabel::qt_metacast(const char *_clname) { - if (!_clname) return nullptr; - if (!strcmp(_clname, qt_meta_stringdata_hiro__QtRadioLabel.stringdata0)) - return static_cast(this); + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_hiro__QtRadioLabel)) + return static_cast(const_cast< QtRadioLabel*>(this)); return QRadioButton::qt_metacast(_clname); } @@ -1385,37 +1163,13 @@ int hiro::QtRadioLabel::qt_metacall(QMetaObject::Call _c, int _id, void **_a) if (_id < 1) qt_static_metacall(this, _c, _id, _a); _id -= 1; - } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { - if (_id < 1) - *reinterpret_cast(_a[0]) = -1; - _id -= 1; } return _id; } -struct qt_meta_stringdata_hiro__QtRadioButton_t { - QByteArrayData data[3]; - char stringdata0[32]; -}; -#define QT_MOC_LITERAL(idx, ofs, len) \ - Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ - qptrdiff(offsetof(qt_meta_stringdata_hiro__QtRadioButton_t, stringdata0) + ofs \ - - idx * sizeof(QByteArrayData)) \ - ) -static const qt_meta_stringdata_hiro__QtRadioButton_t qt_meta_stringdata_hiro__QtRadioButton = { - { -QT_MOC_LITERAL(0, 0, 19), // "hiro::QtRadioButton" -QT_MOC_LITERAL(1, 20, 10), // "onActivate" -QT_MOC_LITERAL(2, 31, 0) // "" - - }, - "hiro::QtRadioButton\0onActivate\0" -}; -#undef QT_MOC_LITERAL - static const uint qt_meta_data_hiro__QtRadioButton[] = { // content: - 7, // revision + 6, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods @@ -1425,20 +1179,21 @@ static const uint qt_meta_data_hiro__QtRadioButton[] = { 0, // flags 0, // signalCount - // slots: name, argc, parameters, tag, flags - 1, 0, 19, 2, 0x0a /* Public */, - - // slots: parameters - QMetaType::Void, + // slots: signature, parameters, type, tag, flags + 20, 33, 33, 33, 0x0a, 0 // eod }; +static const char qt_meta_stringdata_hiro__QtRadioButton[] = { + "hiro::QtRadioButton\0onActivate()\0\0" +}; + void hiro::QtRadioButton::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { if (_c == QMetaObject::InvokeMetaMethod) { + Q_ASSERT(staticMetaObject.cast(_o)); QtRadioButton *_t = static_cast(_o); - Q_UNUSED(_t) switch (_id) { case 0: _t->onActivate(); break; default: ; @@ -1447,22 +1202,29 @@ void hiro::QtRadioButton::qt_static_metacall(QObject *_o, QMetaObject::Call _c, Q_UNUSED(_a); } -QT_INIT_METAOBJECT const QMetaObject hiro::QtRadioButton::staticMetaObject = { - { &QToolButton::staticMetaObject, qt_meta_stringdata_hiro__QtRadioButton.data, - qt_meta_data_hiro__QtRadioButton, qt_static_metacall, nullptr, nullptr} +const QMetaObjectExtraData hiro::QtRadioButton::staticMetaObjectExtraData = { + 0, qt_static_metacall }; +const QMetaObject hiro::QtRadioButton::staticMetaObject = { + { &QToolButton::staticMetaObject, qt_meta_stringdata_hiro__QtRadioButton, + qt_meta_data_hiro__QtRadioButton, &staticMetaObjectExtraData } +}; + +#ifdef Q_NO_DATA_RELOCATION +const QMetaObject &hiro::QtRadioButton::getStaticMetaObject() { return staticMetaObject; } +#endif //Q_NO_DATA_RELOCATION const QMetaObject *hiro::QtRadioButton::metaObject() const { - return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *hiro::QtRadioButton::qt_metacast(const char *_clname) { - if (!_clname) return nullptr; - if (!strcmp(_clname, qt_meta_stringdata_hiro__QtRadioButton.stringdata0)) - return static_cast(this); + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_hiro__QtRadioButton)) + return static_cast(const_cast< QtRadioButton*>(this)); return QToolButton::qt_metacast(_clname); } @@ -1475,38 +1237,13 @@ int hiro::QtRadioButton::qt_metacall(QMetaObject::Call _c, int _id, void **_a) if (_id < 1) qt_static_metacall(this, _c, _id, _a); _id -= 1; - } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { - if (_id < 1) - *reinterpret_cast(_a[0]) = -1; - _id -= 1; } return _id; } -struct qt_meta_stringdata_hiro__QtTabFrame_t { - QByteArrayData data[4]; - char stringdata0[37]; -}; -#define QT_MOC_LITERAL(idx, ofs, len) \ - Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ - qptrdiff(offsetof(qt_meta_stringdata_hiro__QtTabFrame_t, stringdata0) + ofs \ - - idx * sizeof(QByteArrayData)) \ - ) -static const qt_meta_stringdata_hiro__QtTabFrame_t qt_meta_stringdata_hiro__QtTabFrame = { - { -QT_MOC_LITERAL(0, 0, 16), // "hiro::QtTabFrame" -QT_MOC_LITERAL(1, 17, 8), // "onChange" -QT_MOC_LITERAL(2, 26, 0), // "" -QT_MOC_LITERAL(3, 27, 9) // "selection" - - }, - "hiro::QtTabFrame\0onChange\0\0selection" -}; -#undef QT_MOC_LITERAL - static const uint qt_meta_data_hiro__QtTabFrame[] = { // content: - 7, // revision + 6, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods @@ -1516,20 +1253,22 @@ static const uint qt_meta_data_hiro__QtTabFrame[] = { 0, // flags 0, // signalCount - // slots: name, argc, parameters, tag, flags - 1, 1, 19, 2, 0x0a /* Public */, - - // slots: parameters - QMetaType::Void, QMetaType::Int, 3, + // slots: signature, parameters, type, tag, flags + 17, 31, 41, 41, 0x0a, 0 // eod }; +static const char qt_meta_stringdata_hiro__QtTabFrame[] = { + "hiro::QtTabFrame\0onChange(int)\0selection\0" + "\0" +}; + void hiro::QtTabFrame::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { if (_c == QMetaObject::InvokeMetaMethod) { + Q_ASSERT(staticMetaObject.cast(_o)); QtTabFrame *_t = static_cast(_o); - Q_UNUSED(_t) switch (_id) { case 0: _t->onChange((*reinterpret_cast< int(*)>(_a[1]))); break; default: ; @@ -1537,22 +1276,29 @@ void hiro::QtTabFrame::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int } } -QT_INIT_METAOBJECT const QMetaObject hiro::QtTabFrame::staticMetaObject = { - { &QTabWidget::staticMetaObject, qt_meta_stringdata_hiro__QtTabFrame.data, - qt_meta_data_hiro__QtTabFrame, qt_static_metacall, nullptr, nullptr} +const QMetaObjectExtraData hiro::QtTabFrame::staticMetaObjectExtraData = { + 0, qt_static_metacall }; +const QMetaObject hiro::QtTabFrame::staticMetaObject = { + { &QTabWidget::staticMetaObject, qt_meta_stringdata_hiro__QtTabFrame, + qt_meta_data_hiro__QtTabFrame, &staticMetaObjectExtraData } +}; + +#ifdef Q_NO_DATA_RELOCATION +const QMetaObject &hiro::QtTabFrame::getStaticMetaObject() { return staticMetaObject; } +#endif //Q_NO_DATA_RELOCATION const QMetaObject *hiro::QtTabFrame::metaObject() const { - return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *hiro::QtTabFrame::qt_metacast(const char *_clname) { - if (!_clname) return nullptr; - if (!strcmp(_clname, qt_meta_stringdata_hiro__QtTabFrame.stringdata0)) - return static_cast(this); + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_hiro__QtTabFrame)) + return static_cast(const_cast< QtTabFrame*>(this)); return QTabWidget::qt_metacast(_clname); } @@ -1565,46 +1311,13 @@ int hiro::QtTabFrame::qt_metacall(QMetaObject::Call _c, int _id, void **_a) if (_id < 1) qt_static_metacall(this, _c, _id, _a); _id -= 1; - } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { - if (_id < 1) - *reinterpret_cast(_a[0]) = -1; - _id -= 1; } return _id; } -struct qt_meta_stringdata_hiro__QtTableView_t { - QByteArrayData data[10]; - char stringdata0[94]; -}; -#define QT_MOC_LITERAL(idx, ofs, len) \ - Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ - qptrdiff(offsetof(qt_meta_stringdata_hiro__QtTableView_t, stringdata0) + ofs \ - - idx * sizeof(QByteArrayData)) \ - ) -static const qt_meta_stringdata_hiro__QtTableView_t qt_meta_stringdata_hiro__QtTableView = { - { -QT_MOC_LITERAL(0, 0, 17), // "hiro::QtTableView" -QT_MOC_LITERAL(1, 18, 10), // "onActivate" -QT_MOC_LITERAL(2, 29, 0), // "" -QT_MOC_LITERAL(3, 30, 16), // "QTreeWidgetItem*" -QT_MOC_LITERAL(4, 47, 4), // "item" -QT_MOC_LITERAL(5, 52, 6), // "column" -QT_MOC_LITERAL(6, 59, 8), // "onChange" -QT_MOC_LITERAL(7, 68, 9), // "onContext" -QT_MOC_LITERAL(8, 78, 6), // "onSort" -QT_MOC_LITERAL(9, 85, 8) // "onToggle" - - }, - "hiro::QtTableView\0onActivate\0\0" - "QTreeWidgetItem*\0item\0column\0onChange\0" - "onContext\0onSort\0onToggle" -}; -#undef QT_MOC_LITERAL - static const uint qt_meta_data_hiro__QtTableView[] = { // content: - 7, // revision + 6, // revision 0, // classname 0, 0, // classinfo 5, 14, // methods @@ -1614,28 +1327,27 @@ static const uint qt_meta_data_hiro__QtTableView[] = { 0, // flags 0, // signalCount - // slots: name, argc, parameters, tag, flags - 1, 2, 39, 2, 0x0a /* Public */, - 6, 0, 44, 2, 0x0a /* Public */, - 7, 0, 45, 2, 0x0a /* Public */, - 8, 1, 46, 2, 0x0a /* Public */, - 9, 2, 49, 2, 0x0a /* Public */, - - // slots: parameters - QMetaType::Void, 0x80000000 | 3, QMetaType::Int, 4, 5, - QMetaType::Void, - QMetaType::Void, - QMetaType::Void, QMetaType::Int, 5, - QMetaType::Void, 0x80000000 | 3, QMetaType::Int, 4, 5, + // slots: signature, parameters, type, tag, flags + 18, 51, 63, 63, 0x0a, + 64, 63, 63, 63, 0x0a, + 75, 63, 63, 63, 0x0a, + 87, 99, 63, 63, 0x0a, + 106, 51, 63, 63, 0x0a, 0 // eod }; +static const char qt_meta_stringdata_hiro__QtTableView[] = { + "hiro::QtTableView\0onActivate(QTreeWidgetItem*,int)\0" + "item,column\0\0onChange()\0onContext()\0" + "onSort(int)\0column\0onToggle(QTreeWidgetItem*,int)\0" +}; + void hiro::QtTableView::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { if (_c == QMetaObject::InvokeMetaMethod) { + Q_ASSERT(staticMetaObject.cast(_o)); QtTableView *_t = static_cast(_o); - Q_UNUSED(_t) switch (_id) { case 0: _t->onActivate((*reinterpret_cast< QTreeWidgetItem*(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break; case 1: _t->onChange(); break; @@ -1647,22 +1359,29 @@ void hiro::QtTableView::qt_static_metacall(QObject *_o, QMetaObject::Call _c, in } } -QT_INIT_METAOBJECT const QMetaObject hiro::QtTableView::staticMetaObject = { - { &QTreeWidget::staticMetaObject, qt_meta_stringdata_hiro__QtTableView.data, - qt_meta_data_hiro__QtTableView, qt_static_metacall, nullptr, nullptr} +const QMetaObjectExtraData hiro::QtTableView::staticMetaObjectExtraData = { + 0, qt_static_metacall }; +const QMetaObject hiro::QtTableView::staticMetaObject = { + { &QTreeWidget::staticMetaObject, qt_meta_stringdata_hiro__QtTableView, + qt_meta_data_hiro__QtTableView, &staticMetaObjectExtraData } +}; + +#ifdef Q_NO_DATA_RELOCATION +const QMetaObject &hiro::QtTableView::getStaticMetaObject() { return staticMetaObject; } +#endif //Q_NO_DATA_RELOCATION const QMetaObject *hiro::QtTableView::metaObject() const { - return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *hiro::QtTableView::qt_metacast(const char *_clname) { - if (!_clname) return nullptr; - if (!strcmp(_clname, qt_meta_stringdata_hiro__QtTableView.stringdata0)) - return static_cast(this); + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_hiro__QtTableView)) + return static_cast(const_cast< QtTableView*>(this)); return QTreeWidget::qt_metacast(_clname); } @@ -1675,37 +1394,13 @@ int hiro::QtTableView::qt_metacall(QMetaObject::Call _c, int _id, void **_a) if (_id < 5) qt_static_metacall(this, _c, _id, _a); _id -= 5; - } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { - if (_id < 5) - *reinterpret_cast(_a[0]) = -1; - _id -= 5; } return _id; } -struct qt_meta_stringdata_hiro__QtTextEdit_t { - QByteArrayData data[3]; - char stringdata0[27]; -}; -#define QT_MOC_LITERAL(idx, ofs, len) \ - Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ - qptrdiff(offsetof(qt_meta_stringdata_hiro__QtTextEdit_t, stringdata0) + ofs \ - - idx * sizeof(QByteArrayData)) \ - ) -static const qt_meta_stringdata_hiro__QtTextEdit_t qt_meta_stringdata_hiro__QtTextEdit = { - { -QT_MOC_LITERAL(0, 0, 16), // "hiro::QtTextEdit" -QT_MOC_LITERAL(1, 17, 8), // "onChange" -QT_MOC_LITERAL(2, 26, 0) // "" - - }, - "hiro::QtTextEdit\0onChange\0" -}; -#undef QT_MOC_LITERAL - static const uint qt_meta_data_hiro__QtTextEdit[] = { // content: - 7, // revision + 6, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods @@ -1715,20 +1410,21 @@ static const uint qt_meta_data_hiro__QtTextEdit[] = { 0, // flags 0, // signalCount - // slots: name, argc, parameters, tag, flags - 1, 0, 19, 2, 0x0a /* Public */, - - // slots: parameters - QMetaType::Void, + // slots: signature, parameters, type, tag, flags + 17, 28, 28, 28, 0x0a, 0 // eod }; +static const char qt_meta_stringdata_hiro__QtTextEdit[] = { + "hiro::QtTextEdit\0onChange()\0\0" +}; + void hiro::QtTextEdit::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { if (_c == QMetaObject::InvokeMetaMethod) { + Q_ASSERT(staticMetaObject.cast(_o)); QtTextEdit *_t = static_cast(_o); - Q_UNUSED(_t) switch (_id) { case 0: _t->onChange(); break; default: ; @@ -1737,22 +1433,29 @@ void hiro::QtTextEdit::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int Q_UNUSED(_a); } -QT_INIT_METAOBJECT const QMetaObject hiro::QtTextEdit::staticMetaObject = { - { &QTextEdit::staticMetaObject, qt_meta_stringdata_hiro__QtTextEdit.data, - qt_meta_data_hiro__QtTextEdit, qt_static_metacall, nullptr, nullptr} +const QMetaObjectExtraData hiro::QtTextEdit::staticMetaObjectExtraData = { + 0, qt_static_metacall }; +const QMetaObject hiro::QtTextEdit::staticMetaObject = { + { &QTextEdit::staticMetaObject, qt_meta_stringdata_hiro__QtTextEdit, + qt_meta_data_hiro__QtTextEdit, &staticMetaObjectExtraData } +}; + +#ifdef Q_NO_DATA_RELOCATION +const QMetaObject &hiro::QtTextEdit::getStaticMetaObject() { return staticMetaObject; } +#endif //Q_NO_DATA_RELOCATION const QMetaObject *hiro::QtTextEdit::metaObject() const { - return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *hiro::QtTextEdit::qt_metacast(const char *_clname) { - if (!_clname) return nullptr; - if (!strcmp(_clname, qt_meta_stringdata_hiro__QtTextEdit.stringdata0)) - return static_cast(this); + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_hiro__QtTextEdit)) + return static_cast(const_cast< QtTextEdit*>(this)); return QTextEdit::qt_metacast(_clname); } @@ -1765,37 +1468,13 @@ int hiro::QtTextEdit::qt_metacall(QMetaObject::Call _c, int _id, void **_a) if (_id < 1) qt_static_metacall(this, _c, _id, _a); _id -= 1; - } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { - if (_id < 1) - *reinterpret_cast(_a[0]) = -1; - _id -= 1; } return _id; } -struct qt_meta_stringdata_hiro__QtVerticalScrollBar_t { - QByteArrayData data[3]; - char stringdata0[36]; -}; -#define QT_MOC_LITERAL(idx, ofs, len) \ - Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ - qptrdiff(offsetof(qt_meta_stringdata_hiro__QtVerticalScrollBar_t, stringdata0) + ofs \ - - idx * sizeof(QByteArrayData)) \ - ) -static const qt_meta_stringdata_hiro__QtVerticalScrollBar_t qt_meta_stringdata_hiro__QtVerticalScrollBar = { - { -QT_MOC_LITERAL(0, 0, 25), // "hiro::QtVerticalScrollBar" -QT_MOC_LITERAL(1, 26, 8), // "onChange" -QT_MOC_LITERAL(2, 35, 0) // "" - - }, - "hiro::QtVerticalScrollBar\0onChange\0" -}; -#undef QT_MOC_LITERAL - static const uint qt_meta_data_hiro__QtVerticalScrollBar[] = { // content: - 7, // revision + 6, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods @@ -1805,20 +1484,22 @@ static const uint qt_meta_data_hiro__QtVerticalScrollBar[] = { 0, // flags 0, // signalCount - // slots: name, argc, parameters, tag, flags - 1, 0, 19, 2, 0x0a /* Public */, - - // slots: parameters - QMetaType::Void, + // slots: signature, parameters, type, tag, flags + 26, 37, 37, 37, 0x0a, 0 // eod }; +static const char qt_meta_stringdata_hiro__QtVerticalScrollBar[] = { + "hiro::QtVerticalScrollBar\0onChange()\0" + "\0" +}; + void hiro::QtVerticalScrollBar::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { if (_c == QMetaObject::InvokeMetaMethod) { + Q_ASSERT(staticMetaObject.cast(_o)); QtVerticalScrollBar *_t = static_cast(_o); - Q_UNUSED(_t) switch (_id) { case 0: _t->onChange(); break; default: ; @@ -1827,22 +1508,29 @@ void hiro::QtVerticalScrollBar::qt_static_metacall(QObject *_o, QMetaObject::Cal Q_UNUSED(_a); } -QT_INIT_METAOBJECT const QMetaObject hiro::QtVerticalScrollBar::staticMetaObject = { - { &QScrollBar::staticMetaObject, qt_meta_stringdata_hiro__QtVerticalScrollBar.data, - qt_meta_data_hiro__QtVerticalScrollBar, qt_static_metacall, nullptr, nullptr} +const QMetaObjectExtraData hiro::QtVerticalScrollBar::staticMetaObjectExtraData = { + 0, qt_static_metacall }; +const QMetaObject hiro::QtVerticalScrollBar::staticMetaObject = { + { &QScrollBar::staticMetaObject, qt_meta_stringdata_hiro__QtVerticalScrollBar, + qt_meta_data_hiro__QtVerticalScrollBar, &staticMetaObjectExtraData } +}; + +#ifdef Q_NO_DATA_RELOCATION +const QMetaObject &hiro::QtVerticalScrollBar::getStaticMetaObject() { return staticMetaObject; } +#endif //Q_NO_DATA_RELOCATION const QMetaObject *hiro::QtVerticalScrollBar::metaObject() const { - return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *hiro::QtVerticalScrollBar::qt_metacast(const char *_clname) { - if (!_clname) return nullptr; - if (!strcmp(_clname, qt_meta_stringdata_hiro__QtVerticalScrollBar.stringdata0)) - return static_cast(this); + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_hiro__QtVerticalScrollBar)) + return static_cast(const_cast< QtVerticalScrollBar*>(this)); return QScrollBar::qt_metacast(_clname); } @@ -1855,37 +1543,13 @@ int hiro::QtVerticalScrollBar::qt_metacall(QMetaObject::Call _c, int _id, void * if (_id < 1) qt_static_metacall(this, _c, _id, _a); _id -= 1; - } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { - if (_id < 1) - *reinterpret_cast(_a[0]) = -1; - _id -= 1; } return _id; } -struct qt_meta_stringdata_hiro__QtVerticalSlider_t { - QByteArrayData data[3]; - char stringdata0[33]; -}; -#define QT_MOC_LITERAL(idx, ofs, len) \ - Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ - qptrdiff(offsetof(qt_meta_stringdata_hiro__QtVerticalSlider_t, stringdata0) + ofs \ - - idx * sizeof(QByteArrayData)) \ - ) -static const qt_meta_stringdata_hiro__QtVerticalSlider_t qt_meta_stringdata_hiro__QtVerticalSlider = { - { -QT_MOC_LITERAL(0, 0, 22), // "hiro::QtVerticalSlider" -QT_MOC_LITERAL(1, 23, 8), // "onChange" -QT_MOC_LITERAL(2, 32, 0) // "" - - }, - "hiro::QtVerticalSlider\0onChange\0" -}; -#undef QT_MOC_LITERAL - static const uint qt_meta_data_hiro__QtVerticalSlider[] = { // content: - 7, // revision + 6, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods @@ -1895,20 +1559,21 @@ static const uint qt_meta_data_hiro__QtVerticalSlider[] = { 0, // flags 0, // signalCount - // slots: name, argc, parameters, tag, flags - 1, 0, 19, 2, 0x0a /* Public */, - - // slots: parameters - QMetaType::Void, + // slots: signature, parameters, type, tag, flags + 23, 34, 34, 34, 0x0a, 0 // eod }; +static const char qt_meta_stringdata_hiro__QtVerticalSlider[] = { + "hiro::QtVerticalSlider\0onChange()\0\0" +}; + void hiro::QtVerticalSlider::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { if (_c == QMetaObject::InvokeMetaMethod) { + Q_ASSERT(staticMetaObject.cast(_o)); QtVerticalSlider *_t = static_cast(_o); - Q_UNUSED(_t) switch (_id) { case 0: _t->onChange(); break; default: ; @@ -1917,22 +1582,29 @@ void hiro::QtVerticalSlider::qt_static_metacall(QObject *_o, QMetaObject::Call _ Q_UNUSED(_a); } -QT_INIT_METAOBJECT const QMetaObject hiro::QtVerticalSlider::staticMetaObject = { - { &QSlider::staticMetaObject, qt_meta_stringdata_hiro__QtVerticalSlider.data, - qt_meta_data_hiro__QtVerticalSlider, qt_static_metacall, nullptr, nullptr} +const QMetaObjectExtraData hiro::QtVerticalSlider::staticMetaObjectExtraData = { + 0, qt_static_metacall }; +const QMetaObject hiro::QtVerticalSlider::staticMetaObject = { + { &QSlider::staticMetaObject, qt_meta_stringdata_hiro__QtVerticalSlider, + qt_meta_data_hiro__QtVerticalSlider, &staticMetaObjectExtraData } +}; + +#ifdef Q_NO_DATA_RELOCATION +const QMetaObject &hiro::QtVerticalSlider::getStaticMetaObject() { return staticMetaObject; } +#endif //Q_NO_DATA_RELOCATION const QMetaObject *hiro::QtVerticalSlider::metaObject() const { - return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *hiro::QtVerticalSlider::qt_metacast(const char *_clname) { - if (!_clname) return nullptr; - if (!strcmp(_clname, qt_meta_stringdata_hiro__QtVerticalSlider.stringdata0)) - return static_cast(this); + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_hiro__QtVerticalSlider)) + return static_cast(const_cast< QtVerticalSlider*>(this)); return QSlider::qt_metacast(_clname); } @@ -1945,35 +1617,13 @@ int hiro::QtVerticalSlider::qt_metacall(QMetaObject::Call _c, int _id, void **_a if (_id < 1) qt_static_metacall(this, _c, _id, _a); _id -= 1; - } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { - if (_id < 1) - *reinterpret_cast(_a[0]) = -1; - _id -= 1; } return _id; } -struct qt_meta_stringdata_hiro__QtViewport_t { - QByteArrayData data[1]; - char stringdata0[17]; -}; -#define QT_MOC_LITERAL(idx, ofs, len) \ - Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ - qptrdiff(offsetof(qt_meta_stringdata_hiro__QtViewport_t, stringdata0) + ofs \ - - idx * sizeof(QByteArrayData)) \ - ) -static const qt_meta_stringdata_hiro__QtViewport_t qt_meta_stringdata_hiro__QtViewport = { - { -QT_MOC_LITERAL(0, 0, 16) // "hiro::QtViewport" - - }, - "hiro::QtViewport" -}; -#undef QT_MOC_LITERAL - static const uint qt_meta_data_hiro__QtViewport[] = { // content: - 7, // revision + 6, // revision 0, // classname 0, 0, // classinfo 0, 0, // methods @@ -1986,6 +1636,10 @@ static const uint qt_meta_data_hiro__QtViewport[] = { 0 // eod }; +static const char qt_meta_stringdata_hiro__QtViewport[] = { + "hiro::QtViewport\0" +}; + void hiro::QtViewport::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { Q_UNUSED(_o); @@ -1994,29 +1648,37 @@ void hiro::QtViewport::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int Q_UNUSED(_a); } -QT_INIT_METAOBJECT const QMetaObject hiro::QtViewport::staticMetaObject = { - { &QWidget::staticMetaObject, qt_meta_stringdata_hiro__QtViewport.data, - qt_meta_data_hiro__QtViewport, qt_static_metacall, nullptr, nullptr} +const QMetaObjectExtraData hiro::QtViewport::staticMetaObjectExtraData = { + 0, qt_static_metacall }; +const QMetaObject hiro::QtViewport::staticMetaObject = { + { &QWidget::staticMetaObject, qt_meta_stringdata_hiro__QtViewport, + qt_meta_data_hiro__QtViewport, &staticMetaObjectExtraData } +}; + +#ifdef Q_NO_DATA_RELOCATION +const QMetaObject &hiro::QtViewport::getStaticMetaObject() { return staticMetaObject; } +#endif //Q_NO_DATA_RELOCATION const QMetaObject *hiro::QtViewport::metaObject() const { - return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *hiro::QtViewport::qt_metacast(const char *_clname) { - if (!_clname) return nullptr; - if (!strcmp(_clname, qt_meta_stringdata_hiro__QtViewport.stringdata0)) - return static_cast(this); + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_hiro__QtViewport)) + return static_cast(const_cast< QtViewport*>(this)); return QWidget::qt_metacast(_clname); } int hiro::QtViewport::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QWidget::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; return _id; } -QT_WARNING_POP QT_END_MOC_NAMESPACE diff --git a/hiro/windows/application.cpp b/hiro/windows/application.cpp index 9f62cbe8..de70a800 100755 --- a/hiro/windows/application.cpp +++ b/hiro/windows/application.cpp @@ -6,6 +6,13 @@ static auto Application_keyboardProc(HWND, UINT, WPARAM, LPARAM) -> bool; static auto Application_processDialogMessage(MSG&) -> void; static auto CALLBACK Window_windowProc(HWND, UINT, WPARAM, LPARAM) -> LRESULT; +auto pApplication::exit() -> void { + quit(); + auto processID = GetCurrentProcessId(); + auto handle = OpenProcess(SYNCHRONIZE | PROCESS_TERMINATE, true, processID); + TerminateProcess(handle, 0); +} + auto pApplication::modal() -> bool { return state().modalCount > 0; } diff --git a/hiro/windows/application.hpp b/hiro/windows/application.hpp index f2d7840c..241d7fe0 100644 --- a/hiro/windows/application.hpp +++ b/hiro/windows/application.hpp @@ -3,6 +3,7 @@ namespace hiro { struct pApplication { + static auto exit() -> void; static auto modal() -> bool; static auto run() -> void; static auto pendingEvents() -> bool; diff --git a/hiro/windows/browser-window.cpp b/hiro/windows/browser-window.cpp index 22e29cf4..7bd261f4 100755 --- a/hiro/windows/browser-window.cpp +++ b/hiro/windows/browser-window.cpp @@ -19,12 +19,9 @@ static auto BrowserWindow_fileDialog(bool save, BrowserWindow::State& state) -> string filters; for(auto& filter : state.filters) { - auto part = filter.split("("); + auto part = filter.split("|", 1L); if(part.size() != 2) continue; - part[1].trimRight(")", 1L); - part[1].replace(" ", ""); - part[1].transform(",", ";"); - filters.append(filter, "\t", part[1], "\t"); + filters.append(filter, "\t", part[1].merge(";"), "\t"); } utf16_t wfilters(filters); diff --git a/hiro/windows/widget/frame.cpp b/hiro/windows/widget/frame.cpp index d47de4ca..59494467 100755 --- a/hiro/windows/widget/frame.cpp +++ b/hiro/windows/widget/frame.cpp @@ -3,7 +3,9 @@ namespace hiro { auto pFrame::construct() -> void { - hwnd = CreateWindow(L"BUTTON", L"", + hwnd = CreateWindowEx( + //WS_EX_TRANSPARENT fixes rendering issues caused by Windows using WS_CLIPCHILDREN + WS_EX_TRANSPARENT, L"BUTTON", L"", WS_CHILD | BS_GROUPBOX, 0, 0, 0, 0, _parentHandle(), nullptr, GetModuleHandle(0), 0); pWidget::construct(); diff --git a/hiro/windows/widget/label.cpp b/hiro/windows/widget/label.cpp index b833217c..987162a0 100755 --- a/hiro/windows/widget/label.cpp +++ b/hiro/windows/widget/label.cpp @@ -94,22 +94,6 @@ auto pLabel::windowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) -> ma return msg == WM_ERASEBKGND; } - if(msg == WM_LBUTTONDOWN || msg == WM_MBUTTONDOWN || msg == WM_RBUTTONDOWN) { - switch(msg) { - case WM_LBUTTONDOWN: self().doMousePress(Mouse::Button::Left); break; - case WM_MBUTTONDOWN: self().doMousePress(Mouse::Button::Middle); break; - case WM_RBUTTONDOWN: self().doMousePress(Mouse::Button::Right); break; - } - } - - if(msg == WM_LBUTTONUP || msg == WM_MBUTTONUP || msg == WM_RBUTTONUP) { - switch(msg) { - case WM_LBUTTONUP: self().doMouseRelease(Mouse::Button::Left); break; - case WM_MBUTTONUP: self().doMouseRelease(Mouse::Button::Middle); break; - case WM_RBUTTONUP: self().doMouseRelease(Mouse::Button::Right); break; - } - } - return pWidget::windowProc(hwnd, msg, wparam, lparam); } diff --git a/hiro/windows/widget/widget.cpp b/hiro/windows/widget/widget.cpp index c83ce185..f5b65c0b 100755 --- a/hiro/windows/widget/widget.cpp +++ b/hiro/windows/widget/widget.cpp @@ -74,6 +74,8 @@ auto pWidget::setGeometry(Geometry geometry) -> void { geometry.setY(geometry.y() - displacement.y()); } SetWindowPos(hwnd, nullptr, geometry.x(), geometry.y(), geometry.width(), geometry.height(), SWP_NOZORDER); + //RedrawWindow fixes painting problems when adjusting Layouts manually + RedrawWindow(hwnd, nullptr, nullptr, RDW_INVALIDATE | RDW_ALLCHILDREN); pSizable::setGeometry(geometry); } diff --git a/hiro/windows/window.cpp b/hiro/windows/window.cpp index e56b19b7..7c6cdf60 100755 --- a/hiro/windows/window.cpp +++ b/hiro/windows/window.cpp @@ -16,10 +16,9 @@ static auto CALLBACK Window_windowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARA return Shared_windowProc(DefWindowProc, hwnd, msg, wparam, lparam); } -//warning: do not add WS_CLIPCHILDREN; this will break painting of Frame ("BUTTON" BS_GROUPBOX) controls -static const uint PopupStyle = WS_POPUP; -static const uint FixedStyle = WS_SYSMENU | WS_CAPTION | WS_MINIMIZEBOX | WS_BORDER; -static const uint ResizableStyle = WS_SYSMENU | WS_CAPTION | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_THICKFRAME; +static const uint PopupStyle = WS_POPUP | WS_CLIPCHILDREN; +static const uint FixedStyle = WS_SYSMENU | WS_CAPTION | WS_MINIMIZEBOX | WS_BORDER | WS_CLIPCHILDREN; +static const uint ResizableStyle = WS_SYSMENU | WS_CAPTION | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_THICKFRAME | WS_CLIPCHILDREN; uint pWindow::minimumStatusHeight = 0; diff --git a/nall/GNUmakefile b/nall/GNUmakefile index 3e1df801..c3473391 100755 --- a/nall/GNUmakefile +++ b/nall/GNUmakefile @@ -108,7 +108,7 @@ ifeq ($(findstring clang++,$(compiler)),clang++) flags += -fno-strict-aliasing -fwrapv -Wno-everything # gcc settings else ifeq ($(findstring g++,$(compiler)),g++) - flags += -fno-strict-aliasing -fwrapv + flags += -fno-strict-aliasing -fwrapv -Wno-trigraphs endif # windows settings diff --git a/nall/chrono.hpp b/nall/chrono.hpp index 5226eb3f..b9c11622 100644 --- a/nall/chrono.hpp +++ b/nall/chrono.hpp @@ -49,6 +49,55 @@ inline auto timestamp() -> uint64_t { return ::time(nullptr); } +//0 = failure condition +inline auto timestamp(const string& datetime) -> uint64_t { + static const uint monthDays[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; + uint64_t timestamp = 0; + if(datetime.match("??????????")) { + return datetime.natural(); + } + if(datetime.match("????*")) { + uint year = datetime.slice(0, 4).natural(); + if(year < 1970 || year > 2199) return 0; + for(uint y = 1970; y < year && y < 2999; y++) { + uint daysInYear = 365; + if(y % 4 == 0 && (y % 100 != 0 || y % 400 == 0)) daysInYear++; + timestamp += daysInYear * 24 * 60 * 60; + } + } + if(datetime.match("????-??*")) { + uint y = datetime.slice(0, 4).natural(); + uint month = datetime.slice(5, 2).natural(); + if(month < 1 || month > 12) return 0; + for(uint m = 1; m < month && m < 12; m++) { + uint daysInMonth = monthDays[m - 1]; + if(m == 2 && y % 4 == 0 && (y % 100 != 0 || y % 400 == 0)) daysInMonth++; + timestamp += daysInMonth * 24 * 60 * 60; + } + } + if(datetime.match("????-??-??*")) { + uint day = datetime.slice(8, 2).natural(); + if(day < 1 || day > 31) return 0; + timestamp += (day - 1) * 24 * 60 * 60; + } + if(datetime.match("????-??-?? ??*")) { + uint hour = datetime.slice(11, 2).natural(); + if(hour > 23) return 0; + timestamp += hour * 60 * 60; + } + if(datetime.match("????-??-?? ??:??*")) { + uint minute = datetime.slice(14, 2).natural(); + if(minute > 59) return 0; + timestamp += minute * 60; + } + if(datetime.match("????-??-?? ??:??:??*")) { + uint second = datetime.slice(17, 2).natural(); + if(second > 59) return 0; + timestamp += second; + } + return timestamp; +} + namespace utc { inline auto timeinfo(uint64_t time = 0) -> chrono::timeinfo { auto stamp = time ? (time_t)time : (time_t)timestamp(); diff --git a/nall/database/sqlite3.hpp b/nall/database/sqlite3.hpp index 772bd139..10ab8729 100644 --- a/nall/database/sqlite3.hpp +++ b/nall/database/sqlite3.hpp @@ -1,9 +1,7 @@ #pragma once -/* SQLite3 C++ RAII wrapper for nall - * - * Note on code below: it is safe (no-op) to call sqlite3_* functions on null sqlite3 objects - */ +//SQLite3 C++ RAII wrapper for nall +//note: it is safe (no-op) to call sqlite3_* functions on null sqlite3 objects #include @@ -34,24 +32,28 @@ struct SQLite3 { return sqlite3_data_count(statement()); } - auto columns() -> unsigned { + auto columns() -> uint { return sqlite3_column_count(statement()); } - auto integer(unsigned column) -> int64_t { + auto boolean(uint column) -> bool { + return sqlite3_column_int64(statement(), column) != 0; + } + + auto integer(uint column) -> int64_t { return sqlite3_column_int64(statement(), column); } - auto natural(unsigned column) -> uint64_t { + auto natural(uint column) -> uint64_t { return sqlite3_column_int64(statement(), column); } - auto real(unsigned column) -> double { + auto real(uint column) -> double { return sqlite3_column_double(statement(), column); } - auto text(unsigned column) -> string { - string result; + auto string(uint column) -> nall::string { + nall::string result; if(auto text = sqlite3_column_text(statement(), column)) { result.resize(sqlite3_column_bytes(statement(), column)); memory::copy(result.get(), text, result.size()); @@ -59,7 +61,7 @@ struct SQLite3 { return result; } - auto data(unsigned column) -> vector { + auto data(uint column) -> vector { vector result; if(auto data = sqlite3_column_blob(statement(), column)) { result.resize(sqlite3_column_bytes(statement(), column)); @@ -68,18 +70,19 @@ struct SQLite3 { return result; } + auto boolean() -> bool { return boolean(_output++); } auto integer() -> int64_t { return integer(_output++); } auto natural() -> uint64_t { return natural(_output++); } auto real() -> double { return real(_output++); } - auto text() -> string { return text(_output++); } + auto string() -> nall::string { return string(_output++); } auto data() -> vector { return data(_output++); } protected: virtual auto statement() -> sqlite3_stmt* { return _statement; } sqlite3_stmt* _statement = nullptr; - signed _response = SQLITE_OK; - unsigned _output = 0; + int _response = SQLITE_OK; + uint _output = 0; }; struct Query : Statement { @@ -102,22 +105,34 @@ struct SQLite3 { return *this; } - auto& bind(unsigned column, nullptr_t) { sqlite3_bind_null(_statement, 1 + column); return *this; } - auto& bind(unsigned column, int32_t value) { sqlite3_bind_int(_statement, 1 + column, value); return *this; } - auto& bind(unsigned column, uint32_t value) { sqlite3_bind_int(_statement, 1 + column, value); return *this; } - auto& bind(unsigned column, int64_t value) { sqlite3_bind_int64(_statement, 1 + column, value); return *this; } - auto& bind(unsigned column, uint64_t value) { sqlite3_bind_int64(_statement, 1 + column, value); return *this; } - auto& bind(unsigned column, double value) { sqlite3_bind_double(_statement, 1 + column, value); return *this; } - auto& bind(unsigned column, const string& value) { sqlite3_bind_text(_statement, 1 + column, value.data(), value.size(), SQLITE_TRANSIENT); return *this; } - auto& bind(unsigned column, const vector& value) { sqlite3_bind_blob(_statement, 1 + column, value.data(), value.size(), SQLITE_TRANSIENT); return *this; } + auto& bind(uint column, nullptr_t) { sqlite3_bind_null(_statement, 1 + column); return *this; } + auto& bind(uint column, bool value) { sqlite3_bind_int(_statement, 1 + column, value); return *this; } + auto& bind(uint column, int32_t value) { sqlite3_bind_int(_statement, 1 + column, value); return *this; } + auto& bind(uint column, uint32_t value) { sqlite3_bind_int(_statement, 1 + column, value); return *this; } + auto& bind(uint column, int64_t value) { sqlite3_bind_int64(_statement, 1 + column, value); return *this; } + auto& bind(uint column, uint64_t value) { sqlite3_bind_int64(_statement, 1 + column, value); return *this; } + auto& bind(uint column, intmax value) { sqlite3_bind_int64(_statement, 1 + column, value); return *this; } + auto& bind(uint column, uintmax value) { sqlite3_bind_int64(_statement, 1 + column, value); return *this; } + auto& bind(uint column, nall::boolean value) { sqlite3_bind_int64(_statement, 1 + column, value); return *this; } + auto& bind(uint column, nall::integer value) { sqlite3_bind_int64(_statement, 1 + column, value); return *this; } + auto& bind(uint column, nall::natural value) { sqlite3_bind_int64(_statement, 1 + column, value); return *this; } + auto& bind(uint column, double value) { sqlite3_bind_double(_statement, 1 + column, value); return *this; } + auto& bind(uint column, const nall::string& value) { sqlite3_bind_text(_statement, 1 + column, value.data(), value.size(), SQLITE_TRANSIENT); return *this; } + auto& bind(uint column, const vector& value) { sqlite3_bind_blob(_statement, 1 + column, value.data(), value.size(), SQLITE_TRANSIENT); return *this; } auto& bind(nullptr_t) { return bind(_input++, nullptr); } + auto& bind(bool value) { return bind(_input++, value); } auto& bind(int32_t value) { return bind(_input++, value); } auto& bind(uint32_t value) { return bind(_input++, value); } auto& bind(int64_t value) { return bind(_input++, value); } auto& bind(uint64_t value) { return bind(_input++, value); } + auto& bind(intmax value) { return bind(_input++, value); } + auto& bind(uintmax value) { return bind(_input++, value); } + auto& bind(nall::boolean value) { return bind(_input++, value); } + auto& bind(nall::integer value) { return bind(_input++, value); } + auto& bind(nall::natural value) { return bind(_input++, value); } auto& bind(double value) { return bind(_input++, value); } - auto& bind(const string& value) { return bind(_input++, value); } + auto& bind(const nall::string& value) { return bind(_input++, value); } auto& bind(const vector& value) { return bind(_input++, value); } auto step() -> bool { @@ -145,7 +160,7 @@ struct SQLite3 { return _statement; } - unsigned _input = 0; + uint _input = 0; bool _stepped = false; }; diff --git a/nall/dsp/resampler/cubic.hpp b/nall/dsp/resampler/cubic.hpp index 7f0bccfd..eaa4aaff 100644 --- a/nall/dsp/resampler/cubic.hpp +++ b/nall/dsp/resampler/cubic.hpp @@ -7,6 +7,9 @@ namespace nall::DSP::Resampler { struct Cubic { + inline auto inputFrequency() const -> double { return _inputFrequency; } + inline auto outputFrequency() const -> double { return _outputFrequency; } + inline auto reset(double inputFrequency, double outputFrequency = 0, uint queueSize = 0) -> void; inline auto setInputFrequency(double inputFrequency) -> void; inline auto pending() const -> bool; @@ -15,41 +18,41 @@ struct Cubic { inline auto serialize(serializer&) -> void; private: - double inputFrequency; - double outputFrequency; + double _inputFrequency; + double _outputFrequency; - double ratio; - double fraction; - double history[4]; - queue samples; + double _ratio; + double _fraction; + double _history[4]; + queue _samples; }; auto Cubic::reset(double inputFrequency, double outputFrequency, uint queueSize) -> void { - this->inputFrequency = inputFrequency; - this->outputFrequency = outputFrequency ? outputFrequency : this->inputFrequency; + _inputFrequency = inputFrequency; + _outputFrequency = outputFrequency ? outputFrequency : _inputFrequency; - ratio = inputFrequency / outputFrequency; - fraction = 0.0; - for(auto& sample : history) sample = 0.0; - samples.resize(queueSize ? queueSize : this->outputFrequency * 0.02); //default to 20ms max queue size + _ratio = _inputFrequency / _outputFrequency; + _fraction = 0.0; + for(auto& sample : _history) sample = 0.0; + _samples.resize(queueSize ? queueSize : _outputFrequency * 0.02); //default to 20ms max queue size } auto Cubic::setInputFrequency(double inputFrequency) -> void { - this->inputFrequency = inputFrequency; - ratio = inputFrequency / outputFrequency; + _inputFrequency = inputFrequency; + _ratio = _inputFrequency / _outputFrequency; } auto Cubic::pending() const -> bool { - return samples.pending(); + return _samples.pending(); } auto Cubic::read() -> double { - return samples.read(); + return _samples.read(); } auto Cubic::write(double sample) -> void { - auto& mu = fraction; - auto& s = history; + auto& mu = _fraction; + auto& s = _history; s[0] = s[1]; s[1] = s[2]; @@ -62,20 +65,20 @@ auto Cubic::write(double sample) -> void { double C = s[2] - s[0]; double D = s[1]; - samples.write(A * mu * mu * mu + B * mu * mu + C * mu + D); - mu += ratio; + _samples.write(A * mu * mu * mu + B * mu * mu + C * mu + D); + mu += _ratio; } mu -= 1.0; } auto Cubic::serialize(serializer& s) -> void { - s.real(inputFrequency); - s.real(outputFrequency); - s.real(ratio); - s.real(fraction); - s.array(history); - samples.serialize(s); + s.real(_inputFrequency); + s.real(_outputFrequency); + s.real(_ratio); + s.real(_fraction); + s.array(_history); + _samples.serialize(s); } } diff --git a/nall/encode/wav.hpp b/nall/encode/wav.hpp new file mode 100644 index 00000000..1b424855 --- /dev/null +++ b/nall/encode/wav.hpp @@ -0,0 +1,52 @@ +#pragma once + +namespace nall::Encode { + +struct WAV { + static auto stereo_16bit(const string& filename, array_view left, array_view right, uint frequency) -> bool { + if(left.size() != right.size()) return false; + static uint channels = 2; + static uint bits = 16; + static uint samples = left.size(); + + file_buffer fp; + if(!fp.open(filename, file::mode::write)) return false; + + fp.write('R'); + fp.write('I'); + fp.write('F'); + fp.write('F'); + fp.writel(4 + (8 + 16) + (8 + samples * 4), 4); + + fp.write('W'); + fp.write('A'); + fp.write('V'); + fp.write('E'); + + fp.write('f'); + fp.write('m'); + fp.write('t'); + fp.write(' '); + fp.writel(16, 4); + fp.writel(1, 2); + fp.writel(channels, 2); + fp.writel(frequency, 4); + fp.writel(frequency * channels * bits, 4); + fp.writel(channels * bits, 2); + fp.writel(bits, 2); + + fp.write('d'); + fp.write('a'); + fp.write('t'); + fp.write('a'); + fp.writel(samples * 4, 4); + for(uint sample : range(samples)) { + fp.writel(left[sample], 2); + fp.writel(right[sample], 2); + } + + return true; + } +}; + +} diff --git a/nall/intrinsics.hpp b/nall/intrinsics.hpp index 0838f424..01fdec40 100755 --- a/nall/intrinsics.hpp +++ b/nall/intrinsics.hpp @@ -38,6 +38,7 @@ namespace nall { #pragma clang diagnostic ignored "-Wtautological-compare" #pragma clang diagnostic ignored "-Wabsolute-value" #pragma clang diagnostic ignored "-Wshift-count-overflow" + #pragma clang diagnostic ignored "-Wtrigraphs" //temporary #pragma clang diagnostic ignored "-Winconsistent-missing-override" @@ -51,6 +52,7 @@ namespace nall { #pragma GCC diagnostic ignored "-Wunknown-pragmas" #pragma GCC diagnostic ignored "-Wpragmas" #pragma GCC diagnostic ignored "-Wswitch-bool" + #pragma GCC diagnostic ignored "-Wtrigraphs" #elif defined(_MSC_VER) #define COMPILER_MICROSOFT constexpr auto compiler() -> Compiler { return Compiler::Microsoft; } diff --git a/nall/string.hpp b/nall/string.hpp index 2ef7b12d..8a837987 100755 --- a/nall/string.hpp +++ b/nall/string.hpp @@ -291,7 +291,7 @@ public: inline auto remove(uint offset, uint length) -> type&; inline auto reverse() -> type&; inline auto size(int length, char fill = ' ') -> type&; - inline auto slice(int offset = 0, int length = -1) -> string; + inline auto slice(int offset = 0, int length = -1) const -> string; }; template<> struct vector : vector_base { diff --git a/nall/string/transform/dml.hpp b/nall/string/transform/dml.hpp index 7fbb1065..d5061355 100755 --- a/nall/string/transform/dml.hpp +++ b/nall/string/transform/dml.hpp @@ -9,16 +9,12 @@ namespace nall { struct DML { - inline auto title() const -> string { return state.title; } - inline auto subtitle() const -> string { return state.subtitle; } - inline auto description() const -> string { return state.description; } - inline auto content() const -> string { return state.output; } + auto content() const -> string { return state.output; } auto& setAllowHTML(bool allowHTML) { settings.allowHTML = allowHTML; return *this; } - auto& setHost(const string& hostname) { settings.host = {hostname, "/"}; return *this; } + auto& setHost(const string& hostname) { settings.host = hostname; return *this; } auto& setPath(const string& pathname) { settings.path = pathname; return *this; } auto& setReader(const function& reader) { settings.reader = reader; return *this; } - auto& setSectioned(bool sectioned) { settings.sectioned = sectioned; return *this; } auto parse(const string& filedata, const string& pathname) -> string; auto parse(const string& filename) -> string; @@ -28,18 +24,13 @@ struct DML { private: struct Settings { bool allowHTML = true; - string host = "localhost/"; + string host = "localhost"; string path; function reader; - bool sectioned = true; } settings; struct State { - string title; - string subtitle; - string description; string output; - uint sections = 0; } state; struct Attribute { @@ -52,6 +43,7 @@ private: auto parseBlock(string& block, const string& pathname, uint depth) -> bool; auto count(const string& text, char value) -> uint; + auto address(string text) -> string; auto escape(const string& text) -> string; auto markup(const string& text) -> string; }; @@ -83,7 +75,6 @@ inline auto DML::parseDocument(const string& filedata, const string& pathname, u auto blocks = filedata.split("\n\n"); for(auto& block : blocks) parseBlock(block, pathname, depth); - if(settings.sectioned && state.sections && depth == 0) state.output.append("\n"); return true; } @@ -98,6 +89,18 @@ inline auto DML::parseBlock(string& block, const string& pathname, uint depth) - parseDocument(document, Location::path(filename), depth + 1); } + //attribute + else if(block.beginsWith("? ")) { + for(auto n : range(lines.size())) { + if(!lines[n].beginsWith("? ")) continue; + auto part = lines[n].trimLeft("? ", 1L).split(":", 1L); + if(part.size() != 2) continue; + auto name = part[0].strip(); + auto value = part[1].strip(); + attributes.append({name, value}); + } + } + //html else if(block.beginsWith("\n") && settings.allowHTML) { for(auto n : range(lines.size())) { @@ -106,52 +109,18 @@ inline auto DML::parseBlock(string& block, const string& pathname, uint depth) - } } - //attribute - else if(block.beginsWith("! ")) { - for(auto& line : lines) { - auto parts = line.trimLeft("! ", 1L).split(":", 1L); - if(parts.size() == 2) attributes.append({parts[0].strip(), parts[1].strip()}); - } - } - - //description - else if(block.beginsWith("? ")) { - while(lines) { - state.description.append(lines.takeLeft().trimLeft("? ", 1L), " "); - } - state.description.strip(); - } - - //section - else if(block.beginsWith("# ")) { - if(settings.sectioned) { - if(state.sections++) state.output.append(""); - state.output.append("
"); - } - auto content = lines.takeLeft().trimLeft("# ", 1L).split("::", 1L).strip(); - auto data = markup(content[0]); - auto name = escape(content(1, data.hash())); - state.subtitle = content[0]; - state.output.append("

", data); - for(auto& line : lines) { - if(!line.beginsWith("# ")) continue; - state.output.append("", line.trimLeft("# ", 1L), ""); - } - state.output.append("

\n"); - } - //header - else if(auto depth = count(block, '=')) { + else if(auto depth = count(block, '#')) { auto content = slice(lines.takeLeft(), depth + 1).split("::", 1L).strip(); auto data = markup(content[0]); auto name = escape(content(1, data.hash())); - if(depth <= 4) { - state.output.append("", data); + if(depth <= 5) { + state.output.append("", data); for(auto& line : lines) { - if(count(line, '=') != depth) continue; + if(count(line, '#') != depth) continue; state.output.append("", slice(line, depth + 1), ""); } - state.output.append("\n"); + state.output.append("\n"); } } @@ -239,6 +208,29 @@ inline auto DML::count(const string& text, char value) -> uint { return 0; } +// . => domain +// ./* => domain/* +// ../subdomain => subdomain.domain +// ../subdomain/* => subdomain.domain/* +inline auto DML::address(string s) -> string { + if(s.beginsWith("../")) { + s.trimLeft("../", 1L); + if(auto p = s.find("/")) { + return {"//", s.slice(0, *p), ".", settings.host, s.slice(*p)}; + } else { + return {"//", s, ".", settings.host}; + } + } + if(s.beginsWith("./")) { + s.trimLeft(".", 1L); + return {"//", settings.host, s}; + } + if(s == ".") { + return {"//", settings.host}; + } + return s; +} + inline auto DML::escape(const string& text) -> string { string output; for(auto c : text) { @@ -281,8 +273,8 @@ inline auto DML::markup(const string& s) -> string { if(link && !image && a == ']' && b == ']') { auto list = slice(s, link(), n - link()).split("::", 1L); - string uri = list.last(); - string name = list.size() == 2 ? list.first() : list.last().split("//", 1L).last(); + string uri = address(list.last()); + string name = list.size() == 2 ? list.first() : uri.split("//", 1L).last(); t.append("", escape(name), ""); @@ -294,8 +286,8 @@ inline auto DML::markup(const string& s) -> string { if(image && !link && a == '}' && b == '}') { auto side = slice(s, image(), n - image()).split("}{", 1L); auto list = side(0).split("::", 1L); - string uri = list.last(); - string name = list.size() == 2 ? list.first() : list.last().split("//", 1L).last(); + string uri = address(list.last()); + string name = list.size() == 2 ? list.first() : uri.split("//", 1L).last(); list = side(1).split("; "); boolean link, title, caption; string width, height; @@ -322,7 +314,6 @@ inline auto DML::markup(const string& s) -> string { if(link) t.append(""); t.append("\"","); diff --git a/nall/string/utility.hpp b/nall/string/utility.hpp index 5c3ac4b6..4f11fd54 100755 --- a/nall/string/utility.hpp +++ b/nall/string/utility.hpp @@ -95,7 +95,7 @@ auto slice(string_view self, int offset, int length) -> string { return result; } -auto string::slice(int offset, int length) -> string { +auto string::slice(int offset, int length) const -> string { return nall::slice(*this, offset, length); } diff --git a/ruby/GNUmakefile b/ruby/GNUmakefile index 1450daf5..f27418b2 100755 --- a/ruby/GNUmakefile +++ b/ruby/GNUmakefile @@ -1,7 +1,7 @@ ifeq ($(ruby),) ifeq ($(platform),windows) ruby += video.wgl video.direct3d video.directdraw video.gdi - ruby += audio.wasapi audio.xaudio2 audio.directsound audio.waveout #audio.asio + ruby += audio.asio audio.wasapi audio.xaudio2 audio.directsound audio.waveout ruby += input.windows else ifeq ($(platform),macos) ruby += video.cgl @@ -13,7 +13,7 @@ ifeq ($(ruby),) ruby += input.sdl input.xlib input.udev else ifeq ($(platform),bsd) ruby += video.glx video.glx2 video.xvideo video.xshm - ruby += audio.oss #audio.pulseaudio + ruby += audio.oss audio.openal #audio.pulseaudio ruby += input.sdl input.xlib endif endif @@ -65,7 +65,8 @@ endif ifeq ($(platform),bsd) ruby.options += -lX11 -lXext -lXrandr - ruby.options += $(if $(findstring audio.openal,$(ruby)),-lopenal) + ruby.options += $(if $(findstring audio.openal,$(ruby)),-lopenal -fuse-ld=bfd) + # -fuse-ld=bfd: see FreeBSD bug 219089 endif ruby.objects := $(object.path)/ruby.o diff --git a/ruby/audio/alsa.cpp b/ruby/audio/alsa.cpp index 276a7787..b5c84753 100755 --- a/ruby/audio/alsa.cpp +++ b/ruby/audio/alsa.cpp @@ -17,6 +17,7 @@ struct AudioALSA : AudioDriver { auto ready() -> bool override { return _ready; } auto hasBlocking() -> bool override { return true; } + auto hasDynamic() -> bool override { return true; } auto hasDevices() -> vector override { vector devices; @@ -55,20 +56,27 @@ struct AudioALSA : AudioDriver { auto setLatency(uint latency) -> bool override { return initialize(); } auto level() -> double override { - snd_pcm_sframes_t available = snd_pcm_avail_update(_interface); - if(available < 0) return 0.5; + snd_pcm_sframes_t available; + for(uint timeout : range(256)) { + available = snd_pcm_avail_update(_interface); + if(available >= 0) break; + snd_pcm_recover(_interface, available, 1); + } return (double)(_bufferSize - available) / _bufferSize; } auto output(const double samples[]) -> void override { _buffer[_offset] = (uint16_t)sclamp<16>(samples[0] * 32767.0) << 0; _buffer[_offset] |= (uint16_t)sclamp<16>(samples[1] * 32767.0) << 16; - _offset++; + if(++_offset < _periodSize) return; snd_pcm_sframes_t available; do { available = snd_pcm_avail_update(_interface); - if(available < 0) snd_pcm_recover(_interface, available, 1); + if(available < 0) { + snd_pcm_recover(_interface, available, 1); + continue; + } if(available < _offset) { if(!self.blocking) { _offset = 0; diff --git a/ruby/audio/asio.cpp b/ruby/audio/asio.cpp index ed635ec6..e389d726 100644 --- a/ruby/audio/asio.cpp +++ b/ruby/audio/asio.cpp @@ -52,6 +52,11 @@ struct AudioASIO : AudioDriver { } latencies.append(latency); } + //it is possible that no latencies in the hard-coded list above will match; so ensure driver-declared latencies are available + if(!latencies.find(self.activeDevice.minimumBufferSize)) latencies.append(self.activeDevice.minimumBufferSize); + if(!latencies.find(self.activeDevice.maximumBufferSize)) latencies.append(self.activeDevice.maximumBufferSize); + if(!latencies.find(self.activeDevice.preferredBufferSize)) latencies.append(self.activeDevice.preferredBufferSize); + latencies.sort(); return latencies; } @@ -75,6 +80,15 @@ struct AudioASIO : AudioDriver { auto output(const double samples[]) -> void override { if(!ready()) return; + //defer call to IASIO::start(), because the drivers themselves will sometimes crash internally. + //if software initializes AudioASIO but does not play music at startup, this can prevent a crash loop. + if(!_started) { + _started = true; + if(_asio->start() != ASE_OK) { + _ready = false; + return; + } + } if(self.blocking) { while(_queue.count >= self.latency); } @@ -151,13 +165,14 @@ private: } _ready = true; + _started = false; clear(); - if(_asio->start() != ASE_OK) return _ready = false; return true; } auto terminate() -> void { _ready = false; + _started = false; self.activeDevice = {}; if(_asio) { _asio->stop(); @@ -244,6 +259,7 @@ private: } bool _ready = false; + bool _started = false; struct Queue { double samples[65536][8]; diff --git a/ruby/audio/audio.cpp b/ruby/audio/audio.cpp index 5364c0b9..a6bf15bf 100644 --- a/ruby/audio/audio.cpp +++ b/ruby/audio/audio.cpp @@ -242,10 +242,10 @@ auto Audio::hasDrivers() -> vector { } auto Audio::optimalDriver() -> string { - #if defined(AUDIO_ASIO) - return "ASIO"; - #elif defined(AUDIO_WASAPI) + #if defined(AUDIO_WASAPI) return "WASAPI"; + #elif defined(AUDIO_ASIO) + return "ASIO"; #elif defined(AUDIO_XAUDIO2) return "XAudio 2.1"; #elif defined(AUDIO_DIRECTSOUND) diff --git a/ruby/audio/pulseaudio.cpp b/ruby/audio/pulseaudio.cpp index 01665fef..05b15075 100755 --- a/ruby/audio/pulseaudio.cpp +++ b/ruby/audio/pulseaudio.cpp @@ -15,6 +15,7 @@ struct AudioPulseAudio : AudioDriver { auto ready() -> bool override { return _ready; } auto hasBlocking() -> bool override { return true; } + auto hasDynamic() -> bool override { return true; } auto hasFrequencies() -> vector override { return {44100, 48000, 96000}; @@ -28,6 +29,12 @@ struct AudioPulseAudio : AudioDriver { auto setFrequency(uint frequency) -> bool override { return initialize(); } auto setLatency(uint latency) -> bool override { return initialize(); } + auto level() -> double override { + pa_mainloop_iterate(_mainLoop, 0, nullptr); + auto length = pa_stream_writable_size(_stream); + return (double)(_bufferSize - length) / _bufferSize; + } + auto output(const double samples[]) -> void override { pa_stream_begin_write(_stream, (void**)&_buffer, &_period); _buffer[_offset] = (uint16_t)sclamp<16>(samples[0] * 32767.0) << 0; @@ -35,13 +42,8 @@ struct AudioPulseAudio : AudioDriver { if((++_offset + 1) * pa_frame_size(&_specification) <= _period) return; while(true) { - if(_first) { - _first = false; - pa_mainloop_iterate(_mainLoop, 0, nullptr); - } else { - pa_mainloop_iterate(_mainLoop, 1, nullptr); - } - uint length = pa_stream_writable_size(_stream); + pa_mainloop_iterate(_mainLoop, 0, nullptr); + auto length = pa_stream_writable_size(_stream); if(length >= _offset * pa_frame_size(&_specification)) break; if(!self.blocking) { _offset = 0; @@ -91,9 +93,10 @@ private: if(!PA_STREAM_IS_GOOD(streamState)) return false; } while(streamState != PA_STREAM_READY); - _period = 960; + pa_buffer_attr* attributes = pa_stream_get_buffer_attr(_stream); + _period = attributes->minreq; + _bufferSize = attributes->tlength; _offset = 0; - _first = true; return _ready = true; } @@ -127,11 +130,11 @@ private: uint32_t* _buffer = nullptr; size_t _period = 0; + size_t _bufferSize = 0; uint _offset = 0; pa_mainloop* _mainLoop = nullptr; pa_context* _context = nullptr; pa_stream* _stream = nullptr; pa_sample_spec _specification; - bool _first = true; }; diff --git a/ruby/input/joypad/iokit.cpp b/ruby/input/joypad/iokit.cpp index 679ffcea..2b9d516a 100644 --- a/ruby/input/joypad/iokit.cpp +++ b/ruby/input/joypad/iokit.cpp @@ -14,7 +14,6 @@ struct InputJoypadIOKit { for(uint n : range(CFArrayGetCount(elements))) { IOHIDElementRef element = (IOHIDElementRef)CFArrayGetValueAtIndex(elements, n); IOHIDElementType type = IOHIDElementGetType(element); - uint32_t page = IOHIDElementGetUsagePage(element); uint32_t usage = IOHIDElementGetUsage(element); switch(type) { case kIOHIDElementTypeInput_Button: @@ -22,7 +21,6 @@ struct InputJoypadIOKit { break; case kIOHIDElementTypeInput_Axis: case kIOHIDElementTypeInput_Misc: - if(page != kHIDPage_GenericDesktop && page != kHIDPage_Simulation) break; if(usage == kHIDUsage_Sim_Accelerator || usage == kHIDUsage_Sim_Brake || usage == kHIDUsage_Sim_Rudder || usage == kHIDUsage_Sim_Throttle || usage == kHIDUsage_GD_X || usage == kHIDUsage_GD_Y || usage == kHIDUsage_GD_Z diff --git a/ruby/video/cgl.cpp b/ruby/video/cgl.cpp index d17001e2..9f446272 100755 --- a/ruby/video/cgl.cpp +++ b/ruby/video/cgl.cpp @@ -66,6 +66,10 @@ struct VideoCGL : VideoDriver, OpenGL { return true; } + auto focused() -> bool override { + return true; + } + auto clear() -> void override { @autoreleasepool { [view lockFocus]; diff --git a/ruby/video/direct3d.cpp b/ruby/video/direct3d.cpp index 2549506d..2bbcad0d 100755 --- a/ruby/video/direct3d.cpp +++ b/ruby/video/direct3d.cpp @@ -34,6 +34,12 @@ struct VideoDirect3D : VideoDriver { auto setBlocking(bool blocking) -> bool override { return true; } auto setShader(string shader) -> bool override { return updateFilter(); } + auto focused() -> bool override { + if(self.fullScreen && self.exclusive) return true; + auto focused = GetFocus(); + return _context == focused || IsChild(_context, focused); + } + auto clear() -> void override { if(_lost && !recover()) return; diff --git a/ruby/video/directdraw.cpp b/ruby/video/directdraw.cpp index 1902a56e..06d55ec1 100755 --- a/ruby/video/directdraw.cpp +++ b/ruby/video/directdraw.cpp @@ -40,6 +40,12 @@ struct VideoDirectDraw : VideoDriver { return true; } + auto focused() -> bool override { + if(self.fullScreen && self.exclusive) return true; + auto focused = GetFocus(); + return _context == focused || IsChild(_context, focused); + } + auto clear() -> void override { DDBLTFX fx{}; fx.dwSize = sizeof(DDBLTFX); diff --git a/ruby/video/gdi.cpp b/ruby/video/gdi.cpp index 52297248..db6ad30e 100755 --- a/ruby/video/gdi.cpp +++ b/ruby/video/gdi.cpp @@ -24,6 +24,12 @@ struct VideoGDI : VideoDriver { auto setMonitor(string monitor) -> bool override { return initialize(); } auto setContext(uintptr context) -> bool override { return initialize(); } + auto focused() -> bool override { + if(self.fullScreen && self.exclusive) return true; + auto focused = GetFocus(); + return _context == focused || IsChild(_context, focused); + } + auto size(uint& width, uint& height) -> void override { RECT rectangle; GetClientRect(_context, &rectangle); diff --git a/ruby/video/glx.cpp b/ruby/video/glx.cpp index 1810ee6a..a9c95380 100755 --- a/ruby/video/glx.cpp +++ b/ruby/video/glx.cpp @@ -74,6 +74,10 @@ struct VideoGLX : VideoDriver, OpenGL { return true; } + auto focused() -> bool override { + return true; + } + auto clear() -> void override { OpenGL::clear(); if(_doubleBuffer) glXSwapBuffers(_display, _glXWindow); diff --git a/ruby/video/glx2.cpp b/ruby/video/glx2.cpp index 5f2fb5f6..3e0fef45 100644 --- a/ruby/video/glx2.cpp +++ b/ruby/video/glx2.cpp @@ -83,6 +83,10 @@ struct VideoGLX2 : VideoDriver { return true; } + auto focused() -> bool override { + return true; + } + auto clear() -> void override { memory::fill(_glBuffer, _glWidth * _glHeight); glClearColor(0.0, 0.0, 0.0, 1.0); diff --git a/ruby/video/video.cpp b/ruby/video/video.cpp index 97db4d37..e2edaefb 100644 --- a/ruby/video/video.cpp +++ b/ruby/video/video.cpp @@ -94,6 +94,10 @@ auto Video::setShader(string shader) -> bool { // +auto Video::focused() -> bool { + return instance->focused(); +} + auto Video::clear() -> void { return instance->clear(); } diff --git a/ruby/video/video.hpp b/ruby/video/video.hpp index b107a3f8..71f4c84d 100644 --- a/ruby/video/video.hpp +++ b/ruby/video/video.hpp @@ -28,6 +28,7 @@ struct VideoDriver { virtual auto setFormat(string format) -> bool { return true; } virtual auto setShader(string shader) -> bool { return true; } + virtual auto focused() -> bool { return true; } virtual auto clear() -> void {} virtual auto size(uint& width, uint& height) -> void {} virtual auto acquire(uint32_t*& data, uint& pitch, uint width, uint height) -> bool { return false; } @@ -108,6 +109,7 @@ struct Video { auto setFormat(string format) -> bool; auto setShader(string shader) -> bool; + auto focused() -> bool; auto clear() -> void; struct Size { uint width = 0; diff --git a/ruby/video/wgl.cpp b/ruby/video/wgl.cpp index e1ed8627..43feea3f 100755 --- a/ruby/video/wgl.cpp +++ b/ruby/video/wgl.cpp @@ -53,6 +53,12 @@ struct VideoWGL : VideoDriver, OpenGL { return true; } + auto focused() -> bool override { + if(self.fullScreen && self.exclusive) return true; + auto focused = GetFocus(); + return _context == focused || IsChild(_context, focused); + } + auto clear() -> void override { OpenGL::clear(); SwapBuffers(_display); diff --git a/ruby/video/xshm.cpp b/ruby/video/xshm.cpp index 413f9134..6f84b430 100755 --- a/ruby/video/xshm.cpp +++ b/ruby/video/xshm.cpp @@ -31,6 +31,10 @@ struct VideoXShm : VideoDriver { auto setContext(uintptr context) -> bool override { return initialize(); } auto setShader(string shader) -> bool override { return true; } + auto focused() -> bool override { + return true; + } + auto clear() -> void override { auto dp = _inputBuffer; uint length = _inputWidth * _inputHeight; diff --git a/ruby/video/xvideo.cpp b/ruby/video/xvideo.cpp index 981ae227..7e90446a 100755 --- a/ruby/video/xvideo.cpp +++ b/ruby/video/xvideo.cpp @@ -57,6 +57,10 @@ struct VideoXVideo : VideoDriver { return initialize(); } + auto focused() -> bool override { + return true; + } + auto clear() -> void override { memory::fill(_buffer, _bufferWidth * _bufferHeight); //clear twice in case video is double buffered ...