From 15b67922b31e81ffb2ed563bcd1cb0e5e066e6f8 Mon Sep 17 00:00:00 2001 From: Tim Allen Date: Sun, 10 Jun 2018 18:06:02 +1000 Subject: [PATCH] Update to v106r38 release. byuu says: Changelog: - hiro: added Qt5 support - hiro: added GTK3 support (currently runs very poorly) - bsnes: number of recent games and quick state slots can be changed programmatically now - I may expose this as a configuration file setting, but probably not within the GUI - nall: use -Wno-everything when compiling with Clang - sorry, Clang's meaningless warning messages are just endless ... --- higan/emulator/emulator.hpp | 2 +- .../presentation/presentation.cpp | 85 +- .../presentation/presentation.hpp | 22 +- hiro/GNUmakefile | 31 +- hiro/gtk/application.cpp | 6 +- hiro/gtk/keyboard.cpp | 324 ++--- hiro/gtk/settings.cpp | 12 +- hiro/gtk/widget/canvas.cpp | 4 + hiro/gtk/widget/hex-edit.cpp | 24 +- hiro/gtk/widget/horizontal-scroll-bar.cpp | 6 +- hiro/gtk/widget/horizontal-slider.cpp | 4 + hiro/gtk/widget/tab-frame.cpp | 22 +- hiro/gtk/widget/table-view-column.cpp | 4 + hiro/gtk/widget/table-view.cpp | 6 +- hiro/gtk/widget/text-edit.cpp | 2 +- hiro/gtk/widget/vertical-scroll-bar.cpp | 6 +- hiro/gtk/widget/vertical-slider.cpp | 4 + hiro/gtk/widget/viewport.cpp | 7 +- hiro/gtk/widget/widget.cpp | 8 +- hiro/gtk/window.cpp | 61 +- hiro/qt/application.cpp | 17 +- hiro/qt/header.hpp | 9 +- hiro/qt/qt.hpp | 2 +- hiro/qt/qt.moc | 1150 +++++++++++------ hiro/qt/settings.cpp | 12 +- hiro/qt/widget/table-view-column.cpp | 8 + hiro/qt/widget/table-view.cpp | 4 + hiro/qt/window.cpp | 4 + nall/GNUmakefile | 2 +- ruby/video/xshm.cpp | 3 +- 30 files changed, 1132 insertions(+), 719 deletions(-) diff --git a/higan/emulator/emulator.hpp b/higan/emulator/emulator.hpp index c702bc71..ce74ad2d 100644 --- a/higan/emulator/emulator.hpp +++ b/higan/emulator/emulator.hpp @@ -13,7 +13,7 @@ using namespace nall; namespace Emulator { static const string Name = "higan"; - static const string Version = "106.37"; + static const string Version = "106.38"; static const string Author = "byuu"; static const string License = "GPLv3"; static const string Website = "https://byuu.org/"; diff --git a/higan/target-bsnes/presentation/presentation.cpp b/higan/target-bsnes/presentation/presentation.cpp index d4e6787b..7d752e35 100644 --- a/higan/target-bsnes/presentation/presentation.cpp +++ b/higan/target-bsnes/presentation/presentation.cpp @@ -106,26 +106,21 @@ Presentation::Presentation() { toolsMenu.setText("Tools").setVisible(false); saveState.setText("Save State"); - saveState1.setText("Slot 1").onActivate([&] { program->saveState("Quick/Slot 1"); }); - saveState2.setText("Slot 2").onActivate([&] { program->saveState("Quick/Slot 2"); }); - saveState3.setText("Slot 3").onActivate([&] { program->saveState("Quick/Slot 3"); }); - saveState4.setText("Slot 4").onActivate([&] { program->saveState("Quick/Slot 4"); }); - saveState5.setText("Slot 5").onActivate([&] { program->saveState("Quick/Slot 5"); }); - saveState6.setText("Slot 6").onActivate([&] { program->saveState("Quick/Slot 6"); }); - saveState7.setText("Slot 7").onActivate([&] { program->saveState("Quick/Slot 7"); }); - saveState8.setText("Slot 8").onActivate([&] { program->saveState("Quick/Slot 8"); }); - saveState9.setText("Slot 9").onActivate([&] { program->saveState("Quick/Slot 9"); }); + for(uint index : range(QuickStates)) { + saveState.append(MenuItem().setText({"Slot ", 1 + index}).onActivate([=] { + program->saveState({"Quick/Slot ", 1 + index}); + })); + } loadState.setText("Load State"); - loadState1.setText("Slot 1").onActivate([&] { program->loadState("Quick/Slot 1"); }); - loadState2.setText("Slot 2").onActivate([&] { program->loadState("Quick/Slot 2"); }); - loadState3.setText("Slot 3").onActivate([&] { program->loadState("Quick/Slot 3"); }); - loadState4.setText("Slot 4").onActivate([&] { program->loadState("Quick/Slot 4"); }); - loadState5.setText("Slot 5").onActivate([&] { program->loadState("Quick/Slot 5"); }); - loadState6.setText("Slot 6").onActivate([&] { program->loadState("Quick/Slot 6"); }); - loadState7.setText("Slot 7").onActivate([&] { program->loadState("Quick/Slot 7"); }); - loadState8.setText("Slot 8").onActivate([&] { program->loadState("Quick/Slot 8"); }); - loadState9.setText("Slot 9").onActivate([&] { program->loadState("Quick/Slot 9"); }); - loadState0.setText("Recovery Slot").onActivate([&] { program->loadState("Quick/Recovery Slot"); }); + for(uint index : range(QuickStates)) { + loadState.append(MenuItem().setText({"Slot ", 1 + index}).onActivate([=] { + program->loadState({"Quick/Slot ", 1 + index}); + })); + } + loadState.append(MenuSeparator()); + loadState.append(MenuItem().setText("Recovery Slot").onActivate([&] { + program->loadState("Quick/Recovery Slot"); + })); pauseEmulation.setText("Pause Emulation").onToggle([&] { if(pauseEmulation.checked()) audio->clear(); }); @@ -291,7 +286,7 @@ auto Presentation::toggleFullscreenMode() -> void { auto Presentation::updateRecentGames() -> void { loadRecentGame.reset(); - for(auto index : range(5)) { + for(auto index : range(RecentGames)) { MenuItem item; if(auto game = settings[string{"Game/Recent/", 1 + index}].text()) { string displayName; @@ -311,49 +306,25 @@ auto Presentation::updateRecentGames() -> void { } loadRecentGame.append(MenuSeparator()); loadRecentGame.append(MenuItem().setText("Clear List").onActivate([&] { - settings("Game/Recent/1").setValue(""); - settings("Game/Recent/2").setValue(""); - settings("Game/Recent/3").setValue(""); - settings("Game/Recent/4").setValue(""); - settings("Game/Recent/5").setValue(""); + for(auto index : range(RecentGames)) { + settings({"Game/Recent/", 1 + index}).setValue(""); + } updateRecentGames(); })); } auto Presentation::addRecentGame(string location) -> void { - auto game1 = settings["Game/Recent/1"].text(); - auto game2 = settings["Game/Recent/2"].text(); - auto game3 = settings["Game/Recent/3"].text(); - auto game4 = settings["Game/Recent/4"].text(); - auto game5 = settings["Game/Recent/5"].text(); - - if(game1 == location) { - game1 = location; - } else if(game2 == location) { - game2 = game1; - game1 = location; - } else if(game3 == location) { - game3 = game2; - game2 = game1; - game1 = location; - } else if(game4 == location) { - game4 = game3; - game3 = game2; - game2 = game1; - game1 = location; - } else { - game5 = game4; - game4 = game3; - game3 = game2; - game2 = game1; - game1 = location; + for(uint index : range(RecentGames + 1)) { + auto value = settings[{"Game/Recent/", 1 + index}].text(); + if(!value || value == location) { + for(uint n : rrange(index + 1)) { + if(1 + n > RecentGames) continue; + settings({"Game/Recent/", 1 + n}).setValue(settings[{"Game/Recent/", n}].text()); + } + break; + } } - - settings("Game/Recent/1").setValue(game1); - settings("Game/Recent/2").setValue(game2); - settings("Game/Recent/3").setValue(game3); - settings("Game/Recent/4").setValue(game4); - settings("Game/Recent/5").setValue(game5); + settings("Game/Recent/1").setValue(location); updateRecentGames(); } diff --git a/higan/target-bsnes/presentation/presentation.hpp b/higan/target-bsnes/presentation/presentation.hpp index 3cf6ed9f..6ce66494 100644 --- a/higan/target-bsnes/presentation/presentation.hpp +++ b/higan/target-bsnes/presentation/presentation.hpp @@ -9,6 +9,8 @@ struct AboutWindow : Window { }; struct Presentation : Window { + enum : uint { RecentGames = 9, QuickStates = 9 }; + Presentation(); auto drawIcon(uint32_t* output, uint length, uint width, uint height) -> void; auto clearViewport() -> void; @@ -53,27 +55,7 @@ struct Presentation : Window { MenuItem advancedSettings{&settingsMenu}; Menu toolsMenu{&menuBar}; Menu saveState{&toolsMenu}; - MenuItem saveState1{&saveState}; - MenuItem saveState2{&saveState}; - MenuItem saveState3{&saveState}; - MenuItem saveState4{&saveState}; - MenuItem saveState5{&saveState}; - MenuItem saveState6{&saveState}; - MenuItem saveState7{&saveState}; - MenuItem saveState8{&saveState}; - MenuItem saveState9{&saveState}; Menu loadState{&toolsMenu}; - MenuItem loadState1{&loadState}; - MenuItem loadState2{&loadState}; - MenuItem loadState3{&loadState}; - MenuItem loadState4{&loadState}; - MenuItem loadState5{&loadState}; - MenuItem loadState6{&loadState}; - MenuItem loadState7{&loadState}; - MenuItem loadState8{&loadState}; - MenuItem loadState9{&loadState}; - MenuSeparator loadStateSeparator{&loadState}; - MenuItem loadState0{&loadState}; MenuCheckItem pauseEmulation{&toolsMenu}; MenuSeparator toolsSeparator{&toolsMenu}; MenuItem cheatEditor{&toolsMenu}; diff --git a/hiro/GNUmakefile b/hiro/GNUmakefile index 14fa55e2..acdfbfe1 100644 --- a/hiro/GNUmakefile +++ b/hiro/GNUmakefile @@ -13,10 +13,15 @@ ifeq ($(platform),windows) hirolink = -lkernel32 -luser32 -lgdi32 -ladvapi32 -lole32 -lcomctl32 -lcomdlg32 -luxtheme -lmsimg32 -lshlwapi endif - ifeq ($(hiro),gtk) - hiroflags = $(cppflags) $(flags) -DHIRO_GTK $(shell pkg-config --cflags gtk+-2.0 gtksourceview-2.0) + ifeq ($(hiro),gtk2) + hiroflags = $(cppflags) $(flags) -DHIRO_GTK=2 $(shell pkg-config --cflags gtk+-2.0 gtksourceview-2.0) hirolink = $(shell pkg-config --libs gtk+-2.0 gtksourceview-2.0) endif + + ifeq ($(hiro),gtk3) + hiroflags = $(cppflags) $(flags) -DHIRO_GTK=3 $(shell pkg-config --cflags gtk+-3.0 gtksourceview-3.0) + hirolink = $(shell pkg-config --libs gtk+-3.0 gtksourceview-3.0) + endif endif ifeq ($(platform),macos) @@ -32,16 +37,28 @@ endif ifneq ($(filter $(platform),linux bsd),) ifeq ($(hiro),) - hiro := gtk + hiro := gtk2 endif - ifeq ($(hiro),gtk) - hiroflags = $(cppflags) $(flags) -DHIRO_GTK $(shell pkg-config --cflags gtk+-2.0 gtksourceview-2.0) + ifeq ($(hiro),gtk2) + hiroflags = $(cppflags) $(flags) -DHIRO_GTK=2 $(shell pkg-config --cflags gtk+-2.0 gtksourceview-2.0) hirolink = -lX11 $(shell pkg-config --libs gtk+-2.0 gtksourceview-2.0) endif - ifeq ($(hiro),qt) - hiroflags = $(cppflags) $(flags) -DHIRO_QT $(shell pkg-config --cflags QtCore QtGui) + ifeq ($(hiro),gtk3) + hiroflags = $(cppflags) $(flags) -DHIRO_GTK=3 $(shell pkg-config --cflags gtk+-3.0 gtksourceview-3.0) + hirolink = -lX11 $(shell pkg-config --libs gtk+-3.0 gtksourceview-3.0) + endif + + ifeq ($(hiro),qt4) + moc = moc-qt4 + hiroflags = $(cppflags) $(flags) -DHIRO_QT=4 $(shell pkg-config --cflags QtCore QtGui) hirolink = -lX11 $(shell pkg-config --libs QtCore QtGui) endif + + ifeq ($(hiro),qt5) + moc = /usr/local/lib/qt5/bin/moc + hiroflags = -fPIC $(cppflags) $(flags) -DHIRO_QT=5 $(shell pkg-config --cflags Qt5Core Qt5Gui Qt5Widgets) + hirolink = -lX11 $(shell pkg-config --libs Qt5Core Qt5Gui Qt5Widgets) + endif endif diff --git a/hiro/gtk/application.cpp b/hiro/gtk/application.cpp index c28cf2b9..93bd48df 100644 --- a/hiro/gtk/application.cpp +++ b/hiro/gtk/application.cpp @@ -50,7 +50,7 @@ auto pApplication::initialize() -> void { int argc = 1; char* argv[] = {name.get(), nullptr}; #else - //--g-fatal-warnings will force a trap on Gtk-CRITICAL errors + //--g-fatal-warnings will force a trap on Gtk-CRITICAL and Gtk-WARNING messages //this allows gdb to perform a backtrace to find an error's origin point int argc = 2; char* argv[] = {name.get(), new char[19], nullptr}; @@ -75,6 +75,7 @@ auto pApplication::initialize() -> void { g_object_set(gtkSettings, "gtk-im-module", "gtk-im-context-simple", nullptr); #endif + #if HIRO_GTK==2 gtk_rc_parse_string(R"( style "HiroWindow" { @@ -99,6 +100,9 @@ auto pApplication::initialize() -> void { } widget_class "*..." style "HiroTabFrameCloseButton" )"); + #elif HIRO_GTK==3 + //TODO: is there any alternative here with GTK3? + #endif pKeyboard::initialize(); } diff --git a/hiro/gtk/keyboard.cpp b/hiro/gtk/keyboard.cpp index 7a579d43..23ec016d 100644 --- a/hiro/gtk/keyboard.cpp +++ b/hiro/gtk/keyboard.cpp @@ -41,181 +41,181 @@ auto pKeyboard::_pressed(const char* state, uint16_t code) -> bool { auto pKeyboard::_translate(unsigned code) -> signed { switch(code) { - case GDK_Escape: return 0; - case GDK_F1: return 0; - case GDK_F2: return 0; - case GDK_F3: return 0; - case GDK_F4: return 0; - case GDK_F5: return 0; - case GDK_F6: return 0; - case GDK_F7: return 0; - case GDK_F8: return 0; - case GDK_F9: return 0; - case GDK_F10: return 0; - case GDK_F11: return 0; - case GDK_F12: return 0; + case GDK_KEY_Escape: return 0; + case GDK_KEY_F1: return 0; + case GDK_KEY_F2: return 0; + case GDK_KEY_F3: return 0; + case GDK_KEY_F4: return 0; + case GDK_KEY_F5: return 0; + case GDK_KEY_F6: return 0; + case GDK_KEY_F7: return 0; + case GDK_KEY_F8: return 0; + case GDK_KEY_F9: return 0; + case GDK_KEY_F10: return 0; + case GDK_KEY_F11: return 0; + case GDK_KEY_F12: return 0; - case GDK_Print: return 0; - case GDK_Scroll_Lock: return 0; - case GDK_Pause: return 0; + case GDK_KEY_Print: return 0; + case GDK_KEY_Scroll_Lock: return 0; + case GDK_KEY_Pause: return 0; - case GDK_Insert: return 0; - case GDK_Delete: return 0; - case GDK_Home: return 0; - case GDK_End: return 0; - case GDK_Prior: return 0; - case GDK_Next: return 0; + case GDK_KEY_Insert: return 0; + case GDK_KEY_Delete: return 0; + case GDK_KEY_Home: return 0; + case GDK_KEY_End: return 0; + case GDK_KEY_Prior: return 0; + case GDK_KEY_Next: return 0; - case GDK_Up: return 0; - case GDK_Down: return 0; - case GDK_Left: return 0; - case GDK_Right: return 0; + case GDK_KEY_Up: return 0; + case GDK_KEY_Down: return 0; + case GDK_KEY_Left: return 0; + case GDK_KEY_Right: return 0; - case GDK_grave: return '`'; - case GDK_1: return '1'; - case GDK_2: return '2'; - case GDK_3: return '3'; - case GDK_4: return '4'; - case GDK_5: return '5'; - case GDK_6: return '6'; - case GDK_7: return '7'; - case GDK_8: return '8'; - case GDK_9: return '9'; - case GDK_0: return '0'; - case GDK_minus: return '-'; - case GDK_equal: return '='; - case GDK_BackSpace: return '\b'; + case GDK_KEY_grave: return '`'; + case GDK_KEY_1: return '1'; + case GDK_KEY_2: return '2'; + case GDK_KEY_3: return '3'; + case GDK_KEY_4: return '4'; + case GDK_KEY_5: return '5'; + case GDK_KEY_6: return '6'; + case GDK_KEY_7: return '7'; + case GDK_KEY_8: return '8'; + case GDK_KEY_9: return '9'; + case GDK_KEY_0: return '0'; + case GDK_KEY_minus: return '-'; + case GDK_KEY_equal: return '='; + case GDK_KEY_BackSpace: return '\b'; - case GDK_asciitilde: return '~'; - case GDK_exclam: return '!'; - case GDK_at: return '@'; - case GDK_numbersign: return '#'; - case GDK_dollar: return '$'; - case GDK_percent: return '%'; - case GDK_asciicircum: return '^'; - case GDK_ampersand: return '&'; - case GDK_asterisk: return '*'; - case GDK_parenleft: return '('; - case GDK_parenright: return ')'; - case GDK_underscore: return '_'; - case GDK_plus: return '+'; + case GDK_KEY_asciitilde: return '~'; + case GDK_KEY_exclam: return '!'; + case GDK_KEY_at: return '@'; + case GDK_KEY_numbersign: return '#'; + case GDK_KEY_dollar: return '$'; + case GDK_KEY_percent: return '%'; + case GDK_KEY_asciicircum: return '^'; + case GDK_KEY_ampersand: return '&'; + case GDK_KEY_asterisk: return '*'; + case GDK_KEY_parenleft: return '('; + case GDK_KEY_parenright: return ')'; + case GDK_KEY_underscore: return '_'; + case GDK_KEY_plus: return '+'; - case GDK_Tab: return '\t'; - case GDK_Caps_Lock: return 0; - case GDK_Return: return '\n'; - case GDK_Shift_L: return 0; - case GDK_Shift_R: return 0; - case GDK_Control_L: return 0; - case GDK_Control_R: return 0; - case GDK_Alt_L: return 0; - case GDK_Alt_R: return 0; - case GDK_Super_L: return 0; - case GDK_Super_R: return 0; - case GDK_Menu: return 0; - case GDK_space: return ' '; + case GDK_KEY_Tab: return '\t'; + case GDK_KEY_Caps_Lock: return 0; + case GDK_KEY_Return: return '\n'; + case GDK_KEY_Shift_L: return 0; + case GDK_KEY_Shift_R: return 0; + case GDK_KEY_Control_L: return 0; + case GDK_KEY_Control_R: return 0; + case GDK_KEY_Alt_L: return 0; + case GDK_KEY_Alt_R: return 0; + case GDK_KEY_Super_L: return 0; + case GDK_KEY_Super_R: return 0; + case GDK_KEY_Menu: return 0; + case GDK_KEY_space: return ' '; - case GDK_bracketleft: return '['; - case GDK_bracketright: return ']'; - case GDK_backslash: return '\\'; - case GDK_semicolon: return ';'; - case GDK_apostrophe: return '\''; - case GDK_comma: return ','; - case GDK_period: return '.'; - case GDK_slash: return '/'; + case GDK_KEY_bracketleft: return '['; + case GDK_KEY_bracketright: return ']'; + case GDK_KEY_backslash: return '\\'; + case GDK_KEY_semicolon: return ';'; + case GDK_KEY_apostrophe: return '\''; + case GDK_KEY_comma: return ','; + case GDK_KEY_period: return '.'; + case GDK_KEY_slash: return '/'; - case GDK_braceleft: return '{'; - case GDK_braceright: return '}'; - case GDK_bar: return '|'; - case GDK_colon: return ':'; - case GDK_quotedbl: return '\"'; - case GDK_less: return '<'; - case GDK_greater: return '>'; - case GDK_question: return '?'; + case GDK_KEY_braceleft: return '{'; + case GDK_KEY_braceright: return '}'; + case GDK_KEY_bar: return '|'; + case GDK_KEY_colon: return ':'; + case GDK_KEY_quotedbl: return '\"'; + case GDK_KEY_less: return '<'; + case GDK_KEY_greater: return '>'; + case GDK_KEY_question: return '?'; - case GDK_A: return 'A'; - case GDK_B: return 'B'; - case GDK_C: return 'C'; - case GDK_D: return 'D'; - case GDK_E: return 'E'; - case GDK_F: return 'F'; - case GDK_G: return 'G'; - case GDK_H: return 'H'; - case GDK_I: return 'I'; - case GDK_J: return 'J'; - case GDK_K: return 'K'; - case GDK_L: return 'L'; - case GDK_M: return 'M'; - case GDK_N: return 'N'; - case GDK_O: return 'O'; - case GDK_P: return 'P'; - case GDK_Q: return 'Q'; - case GDK_R: return 'R'; - case GDK_S: return 'S'; - case GDK_T: return 'T'; - case GDK_U: return 'U'; - case GDK_V: return 'V'; - case GDK_W: return 'W'; - case GDK_X: return 'X'; - case GDK_Y: return 'Y'; - case GDK_Z: return 'Z'; + case GDK_KEY_A: return 'A'; + case GDK_KEY_B: return 'B'; + case GDK_KEY_C: return 'C'; + case GDK_KEY_D: return 'D'; + case GDK_KEY_E: return 'E'; + case GDK_KEY_F: return 'F'; + case GDK_KEY_G: return 'G'; + case GDK_KEY_H: return 'H'; + case GDK_KEY_I: return 'I'; + case GDK_KEY_J: return 'J'; + case GDK_KEY_K: return 'K'; + case GDK_KEY_L: return 'L'; + case GDK_KEY_M: return 'M'; + case GDK_KEY_N: return 'N'; + case GDK_KEY_O: return 'O'; + case GDK_KEY_P: return 'P'; + case GDK_KEY_Q: return 'Q'; + case GDK_KEY_R: return 'R'; + case GDK_KEY_S: return 'S'; + case GDK_KEY_T: return 'T'; + case GDK_KEY_U: return 'U'; + case GDK_KEY_V: return 'V'; + case GDK_KEY_W: return 'W'; + case GDK_KEY_X: return 'X'; + case GDK_KEY_Y: return 'Y'; + case GDK_KEY_Z: return 'Z'; - case GDK_a: return 'a'; - case GDK_b: return 'b'; - case GDK_c: return 'c'; - case GDK_d: return 'd'; - case GDK_e: return 'e'; - case GDK_f: return 'f'; - case GDK_g: return 'g'; - case GDK_h: return 'h'; - case GDK_i: return 'i'; - case GDK_j: return 'j'; - case GDK_k: return 'k'; - case GDK_l: return 'l'; - case GDK_m: return 'm'; - case GDK_n: return 'n'; - case GDK_o: return 'o'; - case GDK_p: return 'p'; - case GDK_q: return 'q'; - case GDK_r: return 'r'; - case GDK_s: return 's'; - case GDK_t: return 't'; - case GDK_u: return 'u'; - case GDK_v: return 'v'; - case GDK_w: return 'w'; - case GDK_x: return 'x'; - case GDK_y: return 'y'; - case GDK_z: return 'z'; + case GDK_KEY_a: return 'a'; + case GDK_KEY_b: return 'b'; + case GDK_KEY_c: return 'c'; + case GDK_KEY_d: return 'd'; + case GDK_KEY_e: return 'e'; + case GDK_KEY_f: return 'f'; + case GDK_KEY_g: return 'g'; + case GDK_KEY_h: return 'h'; + case GDK_KEY_i: return 'i'; + case GDK_KEY_j: return 'j'; + case GDK_KEY_k: return 'k'; + case GDK_KEY_l: return 'l'; + case GDK_KEY_m: return 'm'; + case GDK_KEY_n: return 'n'; + case GDK_KEY_o: return 'o'; + case GDK_KEY_p: return 'p'; + case GDK_KEY_q: return 'q'; + case GDK_KEY_r: return 'r'; + case GDK_KEY_s: return 's'; + case GDK_KEY_t: return 't'; + case GDK_KEY_u: return 'u'; + case GDK_KEY_v: return 'v'; + case GDK_KEY_w: return 'w'; + case GDK_KEY_x: return 'x'; + case GDK_KEY_y: return 'y'; + case GDK_KEY_z: return 'z'; - case GDK_Num_Lock: return 0; - case GDK_KP_Divide: return '/'; - case GDK_KP_Multiply: return '*'; - case GDK_KP_Subtract: return '-'; - case GDK_KP_Add: return '+'; - case GDK_KP_Enter: return '\n'; - case GDK_KP_Decimal: return '.'; + case GDK_KEY_Num_Lock: return 0; + case GDK_KEY_KP_Divide: return '/'; + case GDK_KEY_KP_Multiply: return '*'; + case GDK_KEY_KP_Subtract: return '-'; + case GDK_KEY_KP_Add: return '+'; + case GDK_KEY_KP_Enter: return '\n'; + case GDK_KEY_KP_Decimal: return '.'; - case GDK_KP_1: return '1'; - case GDK_KP_2: return '2'; - case GDK_KP_3: return '3'; - case GDK_KP_4: return '4'; - case GDK_KP_5: return '5'; - case GDK_KP_6: return '6'; - case GDK_KP_7: return '7'; - case GDK_KP_8: return '8'; - case GDK_KP_9: return '9'; - case GDK_KP_0: return '0'; + case GDK_KEY_KP_1: return '1'; + case GDK_KEY_KP_2: return '2'; + case GDK_KEY_KP_3: return '3'; + case GDK_KEY_KP_4: return '4'; + case GDK_KEY_KP_5: return '5'; + case GDK_KEY_KP_6: return '6'; + case GDK_KEY_KP_7: return '7'; + case GDK_KEY_KP_8: return '8'; + case GDK_KEY_KP_9: return '9'; + case GDK_KEY_KP_0: return '0'; - case GDK_KP_Home: return 0; - case GDK_KP_End: return 0; - case GDK_KP_Page_Up: return 0; - case GDK_KP_Page_Down: return 0; - case GDK_KP_Up: return 0; - case GDK_KP_Down: return 0; - case GDK_KP_Left: return 0; - case GDK_KP_Right: return 0; - case GDK_KP_Begin: return 0; - case GDK_KP_Insert: return 0; - case GDK_KP_Delete: return 0; + case GDK_KEY_KP_Home: return 0; + case GDK_KEY_KP_End: return 0; + case GDK_KEY_KP_Page_Up: return 0; + case GDK_KEY_KP_Page_Down: return 0; + case GDK_KEY_KP_Up: return 0; + case GDK_KEY_KP_Down: return 0; + case GDK_KEY_KP_Left: return 0; + case GDK_KEY_KP_Right: return 0; + case GDK_KEY_KP_Begin: return 0; + case GDK_KEY_KP_Insert: return 0; + case GDK_KEY_KP_Delete: return 0; } return 0; diff --git a/hiro/gtk/settings.cpp b/hiro/gtk/settings.cpp index 400a2f17..7062b2ae 100644 --- a/hiro/gtk/settings.cpp +++ b/hiro/gtk/settings.cpp @@ -2,7 +2,11 @@ namespace hiro { Settings::Settings() { string path = {Path::userData(), "hiro/"}; - auto document = BML::unserialize(file::read({path, "gtk.bml"})); + #if HIRO_GTK==2 + auto document = BML::unserialize(file::read({path, "gtk2.bml"})); + #elif HIRO_GTK==3 + auto document = BML::unserialize(file::read({path, "gtk3.bml"})); + #endif auto get = [&](string_view name) { return document[name]; @@ -32,7 +36,11 @@ Settings::~Settings() { set("Geometry/MenuHeight", geometry.menuHeight); set("Geometry/StatusHeight", geometry.statusHeight); - file::write({path, "gtk.bml"}, BML::serialize(document)); + #if HIRO_GTK==2 + file::write({path, "gtk2.bml"}, BML::serialize(document)); + #elif HIRO_GTK==3 + file::write({path, "gtk3.bml"}, BML::serialize(document)); + #endif } } diff --git a/hiro/gtk/widget/canvas.cpp b/hiro/gtk/widget/canvas.cpp index 684f7e30..954a0755 100644 --- a/hiro/gtk/widget/canvas.cpp +++ b/hiro/gtk/widget/canvas.cpp @@ -132,7 +132,11 @@ auto pCanvas::_onExpose(GdkEventExpose* expose) -> void { height = geometry.height(); } + #if HIRO_GTK==2 gdk_draw_pixbuf(gtk_widget_get_window(gtkWidget), nullptr, surface, sx, sy, dx, dy, width, height, GDK_RGB_DITHER_NONE, 0, 0); + #elif HIRO_GTK==3 + //TODO: use cairo here, but how? no examples show to use sx, sy + #endif } auto pCanvas::_rasterize() -> void { diff --git a/hiro/gtk/widget/hex-edit.cpp b/hiro/gtk/widget/hex-edit.cpp index 49ae7977..09c40e52 100644 --- a/hiro/gtk/widget/hex-edit.cpp +++ b/hiro/gtk/widget/hex-edit.cpp @@ -26,7 +26,11 @@ static auto HexEdit_scroll(GtkRange* range, GtkScrollType scroll, double value, } auto pHexEdit::construct() -> void { + #if HIRO_GTK==2 gtkWidget = gtk_hbox_new(false, 0); + #elif HIRO_GTK==3 + gtkWidget = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); + #endif container = gtk_scrolled_window_new(0, 0); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(container), GTK_POLICY_AUTOMATIC, GTK_POLICY_NEVER); @@ -37,7 +41,11 @@ auto pHexEdit::construct() -> void { gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(subWidget), GTK_WRAP_NONE); gtk_container_add(GTK_CONTAINER(container), subWidget); - scrollBar = gtk_vscrollbar_new((GtkAdjustment*)nullptr); + #if HIRO_GTK==2 + scrollBar = gtk_vscrollbar_new(nullptr); + #elif HIRO_GTK==3 + scrollBar = gtk_scrollbar_new(GTK_ORIENTATION_VERTICAL, nullptr); + #endif gtk_range_set_range(GTK_RANGE(scrollBar), 0, 255); gtk_range_set_increments(GTK_RANGE(scrollBar), 1, 16); gtk_widget_set_sensitive(scrollBar, false); @@ -77,7 +85,7 @@ auto pHexEdit::destruct() -> void { } auto pHexEdit::focused() const -> bool { - return GTK_WIDGET_HAS_FOCUS(subWidget) || GTK_WIDGET_HAS_FOCUS(scrollBar); + return gtk_widget_has_focus(subWidget) || gtk_widget_has_focus(scrollBar); } auto pHexEdit::setAddress(unsigned address) -> void { @@ -166,17 +174,17 @@ auto pHexEdit::keyPress(unsigned scancode, unsigned mask) -> bool { signed cursorY = position / lineWidth; signed cursorX = position % lineWidth; - if(scancode == GDK_Home) { + if(scancode == GDK_KEY_Home) { setCursorPosition(cursorY * lineWidth + 10); return true; } - if(scancode == GDK_End) { + if(scancode == GDK_KEY_End) { setCursorPosition(cursorY * lineWidth + 10 + (state().columns * 3 - 1)); return true; } - if(scancode == GDK_Up) { + if(scancode == GDK_KEY_Up) { if(cursorY != 0) return false; signed newAddress = state().address - state().columns; @@ -187,7 +195,7 @@ auto pHexEdit::keyPress(unsigned scancode, unsigned mask) -> bool { return true; } - if(scancode == GDK_Down) { + if(scancode == GDK_KEY_Down) { if(cursorY >= rows() - 1) return true; if(cursorY != state().rows - 1) return false; @@ -199,7 +207,7 @@ auto pHexEdit::keyPress(unsigned scancode, unsigned mask) -> bool { return true; } - if(scancode == GDK_Page_Up) { + if(scancode == GDK_KEY_Page_Up) { signed newAddress = state().address - state().columns * state().rows; if(newAddress >= 0) { self().setAddress(newAddress); @@ -210,7 +218,7 @@ auto pHexEdit::keyPress(unsigned scancode, unsigned mask) -> bool { return true; } - if(scancode == GDK_Page_Down) { + if(scancode == GDK_KEY_Page_Down) { signed newAddress = state().address + state().columns * state().rows; for(auto n : range(state().rows)) { if(newAddress + state().columns * state().rows - (state().columns - 1) <= state().length) { diff --git a/hiro/gtk/widget/horizontal-scroll-bar.cpp b/hiro/gtk/widget/horizontal-scroll-bar.cpp index 30521b58..0975665b 100644 --- a/hiro/gtk/widget/horizontal-scroll-bar.cpp +++ b/hiro/gtk/widget/horizontal-scroll-bar.cpp @@ -10,7 +10,11 @@ static auto HorizontalScrollBar_change(GtkRange* gtkRange, pHorizontalScrollBar* } auto pHorizontalScrollBar::construct() -> void { - gtkWidget = gtk_hscrollbar_new(0); + #if HIRO_GTK==2 + gtkWidget = gtk_hscrollbar_new(nullptr); + #elif HIRO_GTK==3 + gtkWidget = gtk_scrollbar_new(GTK_ORIENTATION_HORIZONTAL, nullptr); + #endif setLength(state().length); setPosition(state().position); diff --git a/hiro/gtk/widget/horizontal-slider.cpp b/hiro/gtk/widget/horizontal-slider.cpp index 7af58219..74964835 100644 --- a/hiro/gtk/widget/horizontal-slider.cpp +++ b/hiro/gtk/widget/horizontal-slider.cpp @@ -10,7 +10,11 @@ static auto HorizontalSlider_change(GtkRange* gtkRange, pHorizontalSlider* p) -> } auto pHorizontalSlider::construct() -> void { + #if HIRO_GTK==2 gtkWidget = gtk_hscale_new_with_range(0, 100, 1); + #elif HIRO_GTK==3 + gtkWidget = gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL, 0, 100, 1); + #endif gtk_scale_set_draw_value(GTK_SCALE(gtkWidget), false); setLength(state().length); diff --git a/hiro/gtk/widget/tab-frame.cpp b/hiro/gtk/widget/tab-frame.cpp index 5b5e5396..7eebad78 100644 --- a/hiro/gtk/widget/tab-frame.cpp +++ b/hiro/gtk/widget/tab-frame.cpp @@ -65,7 +65,11 @@ auto pTabFrame::append(sTabFrameItem item) -> void { lock(); Tab tab; tab.child = gtk_fixed_new(); + #if HIRO_GTK==2 tab.container = gtk_hbox_new(false, 0); + #elif HIRO_GTK==3 + tab.container = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); + #endif tab.image = gtk_image_new(); tab.title = gtk_label_new(""); gtk_misc_set_alignment(GTK_MISC(tab.title), 0.0, 0.5); @@ -259,10 +263,14 @@ auto pTabFrame::_tabHeight() -> unsigned { signed height = 1; for(auto n : range(self().items())) { - height = max(height, tabs[n].image->allocation.height); - height = max(height, tabs[n].title->allocation.height); + GtkAllocation imageAllocation, titleAllocation, closeAllocation; + gtk_widget_get_allocation(tabs[n].image, &imageAllocation); + gtk_widget_get_allocation(tabs[n].title, &titleAllocation); + gtk_widget_get_allocation(tabs[n].close, &closeAllocation); + height = max(height, imageAllocation.height); + height = max(height, titleAllocation.height); if(!state().items[n]->closable()) continue; - height = max(height, tabs[n].close->allocation.height); + height = max(height, closeAllocation.height); } return height; @@ -272,8 +280,12 @@ auto pTabFrame::_tabWidth() -> unsigned { signed width = 1; for(auto n : range(self().items())) { - width = max(width, tabs[n].image->allocation.width + tabs[n].title->allocation.width + - (state().items[n]->closable() ? tabs[n].close->allocation.width : 0) + GtkAllocation imageAllocation, titleAllocation, closeAllocation; + gtk_widget_get_allocation(tabs[n].image, &imageAllocation); + gtk_widget_get_allocation(tabs[n].title, &titleAllocation); + gtk_widget_get_allocation(tabs[n].close, &closeAllocation); + width = max(width, imageAllocation.width + titleAllocation.width + + (state().items[n]->closable() ? closeAllocation.width : 0) ); } diff --git a/hiro/gtk/widget/table-view-column.cpp b/hiro/gtk/widget/table-view-column.cpp index f9e966b6..a3dd9057 100644 --- a/hiro/gtk/widget/table-view-column.cpp +++ b/hiro/gtk/widget/table-view-column.cpp @@ -7,7 +7,11 @@ auto pTableViewColumn::construct() -> void { auto handle = grandparent.data(); unsigned offset = self().offset(); + #if HIRO_GTK==2 gtkHeader = gtk_hbox_new(false, 0); + #elif HIRO_GTK==3 + gtkHeader = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); + #endif gtkHeaderIcon = gtk_image_new(); gtk_box_pack_start(GTK_BOX(gtkHeader), gtkHeaderIcon, false, false, 0); diff --git a/hiro/gtk/widget/table-view.cpp b/hiro/gtk/widget/table-view.cpp index df8f562a..dd033dc4 100644 --- a/hiro/gtk/widget/table-view.cpp +++ b/hiro/gtk/widget/table-view.cpp @@ -57,7 +57,7 @@ auto pTableView::append(sTableViewItem item) -> void { } auto pTableView::focused() const -> bool { - return GTK_WIDGET_HAS_FOCUS(gtkTreeView); + return gtk_widget_has_focus(GTK_WIDGET(gtkTreeView)); } auto pTableView::remove(sTableViewHeader header) -> void { @@ -82,7 +82,9 @@ auto pTableView::resizeColumns() -> void { signed maximumWidth = self().geometry().width() - 6; if(auto scrollBar = gtk_scrolled_window_get_vscrollbar(gtkScrolledWindow)) { - if(gtk_widget_get_visible(scrollBar)) maximumWidth -= scrollBar->allocation.width; + GtkAllocation allocation; + gtk_widget_get_allocation(scrollBar, &allocation); + if(gtk_widget_get_visible(scrollBar)) maximumWidth -= allocation.width; } signed expandWidth = 0; diff --git a/hiro/gtk/widget/text-edit.cpp b/hiro/gtk/widget/text-edit.cpp index 7e6c4e38..9768dfc9 100644 --- a/hiro/gtk/widget/text-edit.cpp +++ b/hiro/gtk/widget/text-edit.cpp @@ -48,7 +48,7 @@ auto pTextEdit::destruct() -> void { } auto pTextEdit::focused() const -> bool { - return GTK_WIDGET_HAS_FOCUS(subWidget); + return gtk_widget_has_focus(subWidget); } auto pTextEdit::setBackgroundColor(Color color) -> void { diff --git a/hiro/gtk/widget/vertical-scroll-bar.cpp b/hiro/gtk/widget/vertical-scroll-bar.cpp index 45848dfc..bc70dd58 100644 --- a/hiro/gtk/widget/vertical-scroll-bar.cpp +++ b/hiro/gtk/widget/vertical-scroll-bar.cpp @@ -10,7 +10,11 @@ static auto VerticalScrollBar_change(GtkRange* gtkRange, pVerticalScrollBar* p) } auto pVerticalScrollBar::construct() -> void { - gtkWidget = gtk_vscrollbar_new(0); + #if HIRO_GTK==2 + gtkWidget = gtk_vscrollbar_new(nullptr); + #elif HIRO_GTK==3 + gtkWidget = gtk_scrollbar_new(GTK_ORIENTATION_VERTICAL, nullptr); + #endif setLength(state().length); setPosition(state().position); diff --git a/hiro/gtk/widget/vertical-slider.cpp b/hiro/gtk/widget/vertical-slider.cpp index 84130960..984992e4 100644 --- a/hiro/gtk/widget/vertical-slider.cpp +++ b/hiro/gtk/widget/vertical-slider.cpp @@ -10,7 +10,11 @@ static auto VerticalSlider_change(GtkRange* gtkRange, pVerticalSlider* p) -> voi } auto pVerticalSlider::construct() -> void { + #if HIRO_GTK==2 gtkWidget = gtk_vscale_new_with_range(0, 100, 1); + #elif HIRO_GTK==3 + gtkWidget = gtk_scale_new_with_range(GTK_ORIENTATION_VERTICAL, 0, 100, 1); + #endif gtk_scale_set_draw_value(GTK_SCALE(gtkWidget), false); setLength(state().length); diff --git a/hiro/gtk/widget/viewport.cpp b/hiro/gtk/widget/viewport.cpp index 515c4e68..53201811 100644 --- a/hiro/gtk/widget/viewport.cpp +++ b/hiro/gtk/widget/viewport.cpp @@ -10,6 +10,10 @@ GtkSelectionData* data, unsigned type, unsigned timestamp, pViewport* p) -> void p->self().doDrop(paths); } +static auto Viewport_expose(GtkWidget* widget, GdkEventExpose* event) -> signed { + return true; +} + static auto Viewport_mouseLeave(GtkWidget* widget, GdkEventButton* event, pViewport* p) -> signed { p->self().doMouseLeave(); return true; @@ -41,7 +45,7 @@ static auto Viewport_mouseRelease(GtkWidget* widget, GdkEventButton* event, pVie auto pViewport::construct() -> void { gtkWidget = gtk_drawing_area_new(); gtk_widget_add_events(gtkWidget, - GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_POINTER_MOTION_MASK); + GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_EXPOSURE_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_POINTER_MOTION_MASK); GdkColor color; color.pixel = 0; @@ -55,6 +59,7 @@ auto pViewport::construct() -> void { g_signal_connect(G_OBJECT(gtkWidget), "button-press-event", G_CALLBACK(Viewport_mousePress), (gpointer)this); g_signal_connect(G_OBJECT(gtkWidget), "button-release-event", G_CALLBACK(Viewport_mouseRelease), (gpointer)this); g_signal_connect(G_OBJECT(gtkWidget), "drag-data-received", G_CALLBACK(Viewport_dropEvent), (gpointer)this); + g_signal_connect(G_OBJECT(gtkWidget), "expose-event", G_CALLBACK(Viewport_expose), (gpointer)this); g_signal_connect(G_OBJECT(gtkWidget), "leave-notify-event", G_CALLBACK(Viewport_mouseLeave), (gpointer)this); g_signal_connect(G_OBJECT(gtkWidget), "motion-notify-event", G_CALLBACK(Viewport_mouseMove), (gpointer)this); diff --git a/hiro/gtk/widget/widget.cpp b/hiro/gtk/widget/widget.cpp index e4474f71..27c55044 100644 --- a/hiro/gtk/widget/widget.cpp +++ b/hiro/gtk/widget/widget.cpp @@ -20,7 +20,7 @@ auto pWidget::container(mWidget& widget) -> GtkWidget* { auto pWidget::focused() const -> bool { if(!gtkWidget) return false; - return GTK_WIDGET_HAS_FOCUS(gtkWidget); + return gtk_widget_has_focus(gtkWidget); } auto pWidget::setEnabled(bool enabled) -> void { @@ -51,8 +51,10 @@ auto pWidget::setGeometry(Geometry geometry) -> void { auto time = chrono::millisecond(); while(chrono::millisecond() - time < 20) { gtk_main_iteration_do(false); - if(gtkWidget->allocation.width != geometry.width ()) continue; - if(gtkWidget->allocation.height != geometry.height()) continue; + GtkAllocation allocation; + gtk_widget_get_allocation(gtkWidget, &allocation); + if(allocation.width != geometry.width ()) continue; + if(allocation.height != geometry.height()) continue; break; } locked = false; diff --git a/hiro/gtk/window.cpp b/hiro/gtk/window.cpp index 3273fd11..07d39127 100644 --- a/hiro/gtk/window.cpp +++ b/hiro/gtk/window.cpp @@ -12,17 +12,16 @@ static auto Window_close(GtkWidget* widget, GdkEvent* event, pWindow* p) -> sign return true; } -static auto Window_expose(GtkWidget* widget, GdkEvent* event, pWindow* p) -> signed { +//GTK3 draw: called into by GTK2 expose-event +static auto Window_draw(GtkWidget* widget, cairo_t* context, pWindow* p) -> signed { if(auto color = p->state().backgroundColor) { - cairo_t* context = gdk_cairo_create(widget->window); - double red = (double)color.red() / 255.0; double green = (double)color.green() / 255.0; double blue = (double)color.blue() / 255.0; double alpha = (double)color.alpha() / 255.0; if(gdk_screen_is_composited(gdk_screen_get_default()) - && gdk_screen_get_rgba_colormap(gdk_screen_get_default()) + && gdk_screen_get_rgba_visual(gdk_screen_get_default()) ) { cairo_set_source_rgba(context, red, green, blue, alpha); } else { @@ -36,6 +35,15 @@ static auto Window_expose(GtkWidget* widget, GdkEvent* event, pWindow* p) -> sig return false; } +//GTK2 expose-event +static auto Window_expose(GtkWidget* widget, GdkEvent* event, pWindow* p) -> signed { + if(auto color = p->state().backgroundColor) { + cairo_t* context = gdk_cairo_create(gtk_widget_get_window(widget)); + return Window_draw(widget, context, p); + } + return false; +} + static auto Window_configure(GtkWidget* widget, GdkEvent* event, pWindow* p) -> signed { if(!gtk_widget_get_realized(p->widget)) return false; if(!p->pObject::state().visible) return false; @@ -43,7 +51,11 @@ static auto Window_configure(GtkWidget* widget, GdkEvent* event, pWindow* p) -> GdkRectangle border, client; gdk_window_get_frame_extents(gdkWindow, &border); + #if HIRO_GTK==2 gdk_window_get_geometry(gdkWindow, nullptr, nullptr, &client.width, &client.height, nullptr); + #elif HIRO_GTK==3 + gdk_window_get_geometry(gdkWindow, nullptr, nullptr, &client.width, &client.height); + #endif gdk_window_get_origin(gdkWindow, &client.x, &client.y); if(!p->state().fullScreen) { @@ -85,11 +97,19 @@ GtkSelectionData* data, unsigned type, unsigned timestamp, pWindow* p) -> void { p->self().doDrop(paths); } +static auto Window_getPreferredWidth(GtkWidget* widget, int* minimalWidth, int* naturalWidth) -> void { + //TODO: get pWindow; use sizeRequest +} + +static auto Window_getPreferredHeight(GtkWidget* widget, int* minimalHeight, int* naturalHeight) -> void { + //TODO: get pWindow; use sizeRequest +} + static auto Window_keyPress(GtkWidget* widget, GdkEventKey* event, pWindow* p) -> signed { if(auto key = pKeyboard::_translate(event->keyval)) { p->self().doKeyPress(key); } - if(p->state().dismissable && event->keyval == GDK_Escape) { + if(p->state().dismissable && event->keyval == GDK_KEY_Escape) { if(p->state().onClose) { p->self().doClose(); } else { @@ -147,14 +167,18 @@ auto pWindow::construct() -> void { else if(_setIcon("/usr/local/share/pixmaps/")); else if(_setIcon("/usr/share/pixmaps/")); - GdkColormap* colormap = gdk_screen_get_rgba_colormap(gdk_screen_get_default()); - if(!colormap) colormap = gdk_screen_get_rgb_colormap(gdk_screen_get_default()); - if(colormap) gtk_widget_set_colormap(widget, colormap); + auto visual = gdk_screen_get_rgba_visual(gdk_screen_get_default()); + if(!visual) visual = gdk_screen_get_system_visual(gdk_screen_get_default()); + if(visual) gtk_widget_set_visual(widget, visual); gtk_widget_set_app_paintable(widget, true); gtk_widget_add_events(widget, GDK_CONFIGURE); + #if HIRO_GTK==2 menuContainer = gtk_vbox_new(false, 0); + #elif HIRO_GTK==3 + menuContainer = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); + #endif gtk_container_add(GTK_CONTAINER(widget), menuContainer); gtk_widget_show(menuContainer); @@ -167,7 +191,11 @@ auto pWindow::construct() -> void { statusContainer = gtk_event_box_new(); gtkStatus = gtk_statusbar_new(); + #if HIRO_GTK==2 gtk_statusbar_set_has_resize_grip(GTK_STATUSBAR(gtkStatus), true); + #elif HIRO_GTK==3 + gtk_window_set_has_resize_grip(GTK_WINDOW(widget), true); + #endif gtk_container_add(GTK_CONTAINER(statusContainer), gtkStatus); gtk_box_pack_start(GTK_BOX(menuContainer), statusContainer, false, false, 0); gtk_widget_show(statusContainer); @@ -179,13 +207,23 @@ auto pWindow::construct() -> void { setTitle(state().title); g_signal_connect(G_OBJECT(widget), "delete-event", G_CALLBACK(Window_close), (gpointer)this); + #if HIRO_GTK==2 g_signal_connect(G_OBJECT(widget), "expose-event", G_CALLBACK(Window_expose), (gpointer)this); + #elif HIRO_GTK==3 + g_signal_connect(G_OBJECT(widget), "draw", G_CALLBACK(Window_draw), (gpointer)this); + #endif g_signal_connect(G_OBJECT(widget), "configure-event", G_CALLBACK(Window_configure), (gpointer)this); g_signal_connect(G_OBJECT(widget), "drag-data-received", G_CALLBACK(Window_drop), (gpointer)this); g_signal_connect(G_OBJECT(widget), "key-press-event", G_CALLBACK(Window_keyPress), (gpointer)this); g_signal_connect(G_OBJECT(widget), "key-release-event", G_CALLBACK(Window_keyRelease), (gpointer)this); g_signal_connect(G_OBJECT(formContainer), "size-allocate", G_CALLBACK(Window_sizeAllocate), (gpointer)this); + #if HIRO_GTK==2 g_signal_connect(G_OBJECT(formContainer), "size-request", G_CALLBACK(Window_sizeRequest), (gpointer)this); + #elif HIRO_GTK==3 + auto widgetClass = GTK_WIDGET_GET_CLASS(formContainer); + widgetClass->get_preferred_width = Window_getPreferredWidth; + widgetClass->get_preferred_height = Window_getPreferredHeight; + #endif } auto pWindow::destruct() -> void { @@ -316,7 +354,13 @@ auto pWindow::setModal(bool modal) -> void { auto pWindow::setResizable(bool resizable) -> void { gtk_window_set_resizable(GTK_WINDOW(widget), resizable); + #if HIRO_GTK==2 gtk_statusbar_set_has_resize_grip(GTK_STATUSBAR(gtkStatus), resizable); + #elif HIRO_GTK==3 + bool statusBarVisible = false; + if(auto statusBar = state().statusBar) statusBarVisible = statusBar->visible(); + gtk_window_set_has_resize_grip(GTK_WINDOW(widget), resizable && statusBarVisible); + #endif } auto pWindow::setTitle(const string& title) -> void { @@ -428,6 +472,7 @@ auto pWindow::_setStatusText(const string& text) -> void { auto pWindow::_setStatusVisible(bool visible) -> void { gtk_widget_set_visible(gtkStatus, visible); + setResizable(self().resizable()); } auto pWindow::_statusHeight() const -> signed { diff --git a/hiro/qt/application.cpp b/hiro/qt/application.cpp index 1527eef1..7887dab6 100644 --- a/hiro/qt/application.cpp +++ b/hiro/qt/application.cpp @@ -32,21 +32,30 @@ auto pApplication::quit() -> void { //obviously, it is used as sparingly as possible auto pApplication::syncX() -> void { for(auto n : range(8)) { + #if HIRO_QT==4 QApplication::syncX(); + #elif HIRO_QT==5 + QApplication::sync(); + #endif Application::processEvents(); usleep(2000); } } auto pApplication::initialize() -> void { + #if HIRO_QT==5 && defined(PLATFORM_BSD) + setenv("QTCOMPOSE", "/usr/local/lib/X11/locale/", 0); + #endif + display = XOpenDisplay(0); auto name = Application::state.name ? Application::state.name : string{"hiro"}; - int argc = 1; - char* argv[] = {name.get(), nullptr}; - char** argvp = argv; - + //QApplication stores references to argc; + //and will access them after pApplication::initialize() returns + static int argc = 1; + static char* argv[] = {name.get(), nullptr}; + static char** argvp = argv; qtApplication = new QApplication(argc, argvp); pKeyboard::initialize(); diff --git a/hiro/qt/header.hpp b/hiro/qt/header.hpp index 03c4a0c2..8a4ca2dc 100644 --- a/hiro/qt/header.hpp +++ b/hiro/qt/header.hpp @@ -1,5 +1,8 @@ #include #include +#if HIRO_QT==5 +#include +#endif #include #define XK_MISCELLANY #define XK_LATIN1 @@ -12,5 +15,7 @@ //Qt 4.8.0 and earlier improperly define the QLOCATION macro //in C++11, it is detected as a malformed user-defined literal //below is a workaround to fix compilation errors caused by this -#undef QLOCATION -#define QLOCATION "\0" __FILE__ ":" QTOSTRING(__LINE__) +#if HIRO_QT==4 + #undef QLOCATION + #define QLOCATION "\0" __FILE__ ":" QTOSTRING(__LINE__) +#endif diff --git a/hiro/qt/qt.hpp b/hiro/qt/qt.hpp index 15e7c7d3..95526ce6 100644 --- a/hiro/qt/qt.hpp +++ b/hiro/qt/qt.hpp @@ -1,4 +1,4 @@ -//moc-qt4 -i -o qt.moc qt.hpp +//$(moc) -i -o qt.moc qt.hpp /* Qt requires moc in order to bind callbacks, which causes many complications. diff --git a/hiro/qt/qt.moc b/hiro/qt/qt.moc index 4cfb678f..55751916 100644 --- a/hiro/qt/qt.moc +++ b/hiro/qt/qt.moc @@ -1,24 +1,45 @@ /**************************************************************************** ** Meta object code from reading C++ file 'qt.hpp' ** -** Created by: The Qt Meta Object Compiler version 63 (Qt 4.8.6) +** Created by: The Qt Meta Object Compiler version 67 (Qt 5.2.1) ** ** 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 != 63 -#error "This file was generated using the moc from 4.8.6. It" +#elif Q_MOC_OUTPUT_REVISION != 67 +#error "This file was generated using the moc from 5.2.1. 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 +struct qt_meta_stringdata_hiro__QtTimer_t { + QByteArrayData data[3]; + char stringdata[27]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + offsetof(qt_meta_stringdata_hiro__QtTimer_t, stringdata) + ofs \ + - idx * sizeof(QByteArrayData) \ + ) +static const qt_meta_stringdata_hiro__QtTimer_t qt_meta_stringdata_hiro__QtTimer = { + { +QT_MOC_LITERAL(0, 0, 13), +QT_MOC_LITERAL(1, 14, 10), +QT_MOC_LITERAL(2, 25, 0) + }, + "hiro::QtTimer\0onActivate\0\0" +}; +#undef QT_MOC_LITERAL + static const uint qt_meta_data_hiro__QtTimer[] = { // content: - 6, // revision + 7, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods @@ -28,20 +49,18 @@ static const uint qt_meta_data_hiro__QtTimer[] = { 0, // flags 0, // signalCount - // slots: signature, parameters, type, tag, flags - 14, 27, 27, 27, 0x0a, + // slots: name, argc, parameters, tag, flags + 1, 0, 19, 2, 0x0a, + + // slots: parameters + QMetaType::Void, 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); switch (_id) { case 0: _t->onActivate(); break; @@ -51,28 +70,21 @@ void hiro::QtTimer::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _i Q_UNUSED(_a); } -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 } + { &QTimer::staticMetaObject, qt_meta_stringdata_hiro__QtTimer.data, + qt_meta_data_hiro__QtTimer, qt_static_metacall, 0, 0} }; -#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->metaObject : &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; } void *hiro::QtTimer::qt_metacast(const char *_clname) { if (!_clname) return 0; - if (!strcmp(_clname, qt_meta_stringdata_hiro__QtTimer)) + if (!strcmp(_clname, qt_meta_stringdata_hiro__QtTimer.stringdata)) return static_cast(const_cast< QtTimer*>(this)); return QTimer::qt_metacast(_clname); } @@ -86,13 +98,36 @@ 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 stringdata[30]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + offsetof(qt_meta_stringdata_hiro__QtMenuItem_t, stringdata) + ofs \ + - idx * sizeof(QByteArrayData) \ + ) +static const qt_meta_stringdata_hiro__QtMenuItem_t qt_meta_stringdata_hiro__QtMenuItem = { + { +QT_MOC_LITERAL(0, 0, 16), +QT_MOC_LITERAL(1, 17, 10), +QT_MOC_LITERAL(2, 28, 0) + }, + "hiro::QtMenuItem\0onActivate\0\0" +}; +#undef QT_MOC_LITERAL + static const uint qt_meta_data_hiro__QtMenuItem[] = { // content: - 6, // revision + 7, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods @@ -102,20 +137,18 @@ static const uint qt_meta_data_hiro__QtMenuItem[] = { 0, // flags 0, // signalCount - // slots: signature, parameters, type, tag, flags - 17, 30, 30, 30, 0x0a, + // slots: name, argc, parameters, tag, flags + 1, 0, 19, 2, 0x0a, + + // slots: parameters + QMetaType::Void, 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); switch (_id) { case 0: _t->onActivate(); break; @@ -125,28 +158,21 @@ void hiro::QtMenuItem::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int Q_UNUSED(_a); } -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 } + { &QAction::staticMetaObject, qt_meta_stringdata_hiro__QtMenuItem.data, + qt_meta_data_hiro__QtMenuItem, qt_static_metacall, 0, 0} }; -#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->metaObject : &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; } void *hiro::QtMenuItem::qt_metacast(const char *_clname) { if (!_clname) return 0; - if (!strcmp(_clname, qt_meta_stringdata_hiro__QtMenuItem)) + if (!strcmp(_clname, qt_meta_stringdata_hiro__QtMenuItem.stringdata)) return static_cast(const_cast< QtMenuItem*>(this)); return QAction::qt_metacast(_clname); } @@ -160,13 +186,36 @@ 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 stringdata[33]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + offsetof(qt_meta_stringdata_hiro__QtMenuCheckItem_t, stringdata) + ofs \ + - idx * sizeof(QByteArrayData) \ + ) +static const qt_meta_stringdata_hiro__QtMenuCheckItem_t qt_meta_stringdata_hiro__QtMenuCheckItem = { + { +QT_MOC_LITERAL(0, 0, 21), +QT_MOC_LITERAL(1, 22, 8), +QT_MOC_LITERAL(2, 31, 0) + }, + "hiro::QtMenuCheckItem\0onToggle\0\0" +}; +#undef QT_MOC_LITERAL + static const uint qt_meta_data_hiro__QtMenuCheckItem[] = { // content: - 6, // revision + 7, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods @@ -176,20 +225,18 @@ static const uint qt_meta_data_hiro__QtMenuCheckItem[] = { 0, // flags 0, // signalCount - // slots: signature, parameters, type, tag, flags - 22, 33, 33, 33, 0x0a, + // slots: name, argc, parameters, tag, flags + 1, 0, 19, 2, 0x0a, + + // slots: parameters + QMetaType::Void, 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); switch (_id) { case 0: _t->onToggle(); break; @@ -199,28 +246,21 @@ void hiro::QtMenuCheckItem::qt_static_metacall(QObject *_o, QMetaObject::Call _c Q_UNUSED(_a); } -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 } + { &QAction::staticMetaObject, qt_meta_stringdata_hiro__QtMenuCheckItem.data, + qt_meta_data_hiro__QtMenuCheckItem, qt_static_metacall, 0, 0} }; -#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->metaObject : &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; } void *hiro::QtMenuCheckItem::qt_metacast(const char *_clname) { if (!_clname) return 0; - if (!strcmp(_clname, qt_meta_stringdata_hiro__QtMenuCheckItem)) + if (!strcmp(_clname, qt_meta_stringdata_hiro__QtMenuCheckItem.stringdata)) return static_cast(const_cast< QtMenuCheckItem*>(this)); return QAction::qt_metacast(_clname); } @@ -234,13 +274,36 @@ 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 stringdata[35]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + offsetof(qt_meta_stringdata_hiro__QtMenuRadioItem_t, stringdata) + ofs \ + - idx * sizeof(QByteArrayData) \ + ) +static const qt_meta_stringdata_hiro__QtMenuRadioItem_t qt_meta_stringdata_hiro__QtMenuRadioItem = { + { +QT_MOC_LITERAL(0, 0, 21), +QT_MOC_LITERAL(1, 22, 10), +QT_MOC_LITERAL(2, 33, 0) + }, + "hiro::QtMenuRadioItem\0onActivate\0\0" +}; +#undef QT_MOC_LITERAL + static const uint qt_meta_data_hiro__QtMenuRadioItem[] = { // content: - 6, // revision + 7, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods @@ -250,20 +313,18 @@ static const uint qt_meta_data_hiro__QtMenuRadioItem[] = { 0, // flags 0, // signalCount - // slots: signature, parameters, type, tag, flags - 22, 35, 35, 35, 0x0a, + // slots: name, argc, parameters, tag, flags + 1, 0, 19, 2, 0x0a, + + // slots: parameters + QMetaType::Void, 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); switch (_id) { case 0: _t->onActivate(); break; @@ -273,28 +334,21 @@ void hiro::QtMenuRadioItem::qt_static_metacall(QObject *_o, QMetaObject::Call _c Q_UNUSED(_a); } -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 } + { &QAction::staticMetaObject, qt_meta_stringdata_hiro__QtMenuRadioItem.data, + qt_meta_data_hiro__QtMenuRadioItem, qt_static_metacall, 0, 0} }; -#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->metaObject : &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; } void *hiro::QtMenuRadioItem::qt_metacast(const char *_clname) { if (!_clname) return 0; - if (!strcmp(_clname, qt_meta_stringdata_hiro__QtMenuRadioItem)) + if (!strcmp(_clname, qt_meta_stringdata_hiro__QtMenuRadioItem.stringdata)) return static_cast(const_cast< QtMenuRadioItem*>(this)); return QAction::qt_metacast(_clname); } @@ -308,13 +362,36 @@ 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 stringdata[28]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + offsetof(qt_meta_stringdata_hiro__QtButton_t, stringdata) + ofs \ + - idx * sizeof(QByteArrayData) \ + ) +static const qt_meta_stringdata_hiro__QtButton_t qt_meta_stringdata_hiro__QtButton = { + { +QT_MOC_LITERAL(0, 0, 14), +QT_MOC_LITERAL(1, 15, 10), +QT_MOC_LITERAL(2, 26, 0) + }, + "hiro::QtButton\0onActivate\0\0" +}; +#undef QT_MOC_LITERAL + static const uint qt_meta_data_hiro__QtButton[] = { // content: - 6, // revision + 7, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods @@ -324,20 +401,18 @@ static const uint qt_meta_data_hiro__QtButton[] = { 0, // flags 0, // signalCount - // slots: signature, parameters, type, tag, flags - 15, 28, 28, 28, 0x0a, + // slots: name, argc, parameters, tag, flags + 1, 0, 19, 2, 0x0a, + + // slots: parameters + QMetaType::Void, 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); switch (_id) { case 0: _t->onActivate(); break; @@ -347,28 +422,21 @@ void hiro::QtButton::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _ Q_UNUSED(_a); } -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 } + { &QToolButton::staticMetaObject, qt_meta_stringdata_hiro__QtButton.data, + qt_meta_data_hiro__QtButton, qt_static_metacall, 0, 0} }; -#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->metaObject : &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; } void *hiro::QtButton::qt_metacast(const char *_clname) { if (!_clname) return 0; - if (!strcmp(_clname, qt_meta_stringdata_hiro__QtButton)) + if (!strcmp(_clname, qt_meta_stringdata_hiro__QtButton.stringdata)) return static_cast(const_cast< QtButton*>(this)); return QToolButton::qt_metacast(_clname); } @@ -382,13 +450,34 @@ 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 stringdata[16]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + offsetof(qt_meta_stringdata_hiro__QtCanvas_t, stringdata) + 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\0" +}; +#undef QT_MOC_LITERAL + static const uint qt_meta_data_hiro__QtCanvas[] = { // content: - 6, // revision + 7, // revision 0, // classname 0, 0, // classinfo 0, 0, // methods @@ -401,10 +490,6 @@ 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); @@ -413,28 +498,21 @@ void hiro::QtCanvas::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _ Q_UNUSED(_a); } -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 } + { &QWidget::staticMetaObject, qt_meta_stringdata_hiro__QtCanvas.data, + qt_meta_data_hiro__QtCanvas, qt_static_metacall, 0, 0} }; -#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->metaObject : &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; } void *hiro::QtCanvas::qt_metacast(const char *_clname) { if (!_clname) return 0; - if (!strcmp(_clname, qt_meta_stringdata_hiro__QtCanvas)) + if (!strcmp(_clname, qt_meta_stringdata_hiro__QtCanvas.stringdata)) return static_cast(const_cast< QtCanvas*>(this)); return QWidget::qt_metacast(_clname); } @@ -446,10 +524,30 @@ int hiro::QtCanvas::qt_metacall(QMetaObject::Call _c, int _id, void **_a) return _id; return _id; } +struct qt_meta_stringdata_hiro__QtCheckButton_t { + QByteArrayData data[4]; + char stringdata[39]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + offsetof(qt_meta_stringdata_hiro__QtCheckButton_t, stringdata) + ofs \ + - idx * sizeof(QByteArrayData) \ + ) +static const qt_meta_stringdata_hiro__QtCheckButton_t qt_meta_stringdata_hiro__QtCheckButton = { + { +QT_MOC_LITERAL(0, 0, 19), +QT_MOC_LITERAL(1, 20, 8), +QT_MOC_LITERAL(2, 29, 0), +QT_MOC_LITERAL(3, 30, 7) + }, + "hiro::QtCheckButton\0onToggle\0\0checked\0" +}; +#undef QT_MOC_LITERAL + static const uint qt_meta_data_hiro__QtCheckButton[] = { // content: - 6, // revision + 7, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods @@ -459,21 +557,18 @@ static const uint qt_meta_data_hiro__QtCheckButton[] = { 0, // flags 0, // signalCount - // slots: signature, parameters, type, tag, flags - 20, 35, 43, 43, 0x0a, + // slots: name, argc, parameters, tag, flags + 1, 1, 19, 2, 0x0a, + + // slots: parameters + QMetaType::Void, QMetaType::Bool, 3, 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); switch (_id) { case 0: _t->onToggle((*reinterpret_cast< bool(*)>(_a[1]))); break; @@ -482,28 +577,21 @@ void hiro::QtCheckButton::qt_static_metacall(QObject *_o, QMetaObject::Call _c, } } -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 } + { &QToolButton::staticMetaObject, qt_meta_stringdata_hiro__QtCheckButton.data, + qt_meta_data_hiro__QtCheckButton, qt_static_metacall, 0, 0} }; -#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->metaObject : &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; } void *hiro::QtCheckButton::qt_metacast(const char *_clname) { if (!_clname) return 0; - if (!strcmp(_clname, qt_meta_stringdata_hiro__QtCheckButton)) + if (!strcmp(_clname, qt_meta_stringdata_hiro__QtCheckButton.stringdata)) return static_cast(const_cast< QtCheckButton*>(this)); return QToolButton::qt_metacast(_clname); } @@ -517,13 +605,36 @@ 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 stringdata[30]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + offsetof(qt_meta_stringdata_hiro__QtCheckLabel_t, stringdata) + ofs \ + - idx * sizeof(QByteArrayData) \ + ) +static const qt_meta_stringdata_hiro__QtCheckLabel_t qt_meta_stringdata_hiro__QtCheckLabel = { + { +QT_MOC_LITERAL(0, 0, 18), +QT_MOC_LITERAL(1, 19, 8), +QT_MOC_LITERAL(2, 28, 0) + }, + "hiro::QtCheckLabel\0onToggle\0\0" +}; +#undef QT_MOC_LITERAL + static const uint qt_meta_data_hiro__QtCheckLabel[] = { // content: - 6, // revision + 7, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods @@ -533,20 +644,18 @@ static const uint qt_meta_data_hiro__QtCheckLabel[] = { 0, // flags 0, // signalCount - // slots: signature, parameters, type, tag, flags - 19, 30, 30, 30, 0x0a, + // slots: name, argc, parameters, tag, flags + 1, 0, 19, 2, 0x0a, + + // slots: parameters + QMetaType::Void, 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); switch (_id) { case 0: _t->onToggle(); break; @@ -556,28 +665,21 @@ void hiro::QtCheckLabel::qt_static_metacall(QObject *_o, QMetaObject::Call _c, i Q_UNUSED(_a); } -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 } + { &QCheckBox::staticMetaObject, qt_meta_stringdata_hiro__QtCheckLabel.data, + qt_meta_data_hiro__QtCheckLabel, qt_static_metacall, 0, 0} }; -#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->metaObject : &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; } void *hiro::QtCheckLabel::qt_metacast(const char *_clname) { if (!_clname) return 0; - if (!strcmp(_clname, qt_meta_stringdata_hiro__QtCheckLabel)) + if (!strcmp(_clname, qt_meta_stringdata_hiro__QtCheckLabel.stringdata)) return static_cast(const_cast< QtCheckLabel*>(this)); return QCheckBox::qt_metacast(_clname); } @@ -591,13 +693,37 @@ 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 stringdata[38]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + offsetof(qt_meta_stringdata_hiro__QtComboButton_t, stringdata) + ofs \ + - idx * sizeof(QByteArrayData) \ + ) +static const qt_meta_stringdata_hiro__QtComboButton_t qt_meta_stringdata_hiro__QtComboButton = { + { +QT_MOC_LITERAL(0, 0, 19), +QT_MOC_LITERAL(1, 20, 8), +QT_MOC_LITERAL(2, 29, 0), +QT_MOC_LITERAL(3, 30, 6) + }, + "hiro::QtComboButton\0onChange\0\0offset\0" +}; +#undef QT_MOC_LITERAL + static const uint qt_meta_data_hiro__QtComboButton[] = { // content: - 6, // revision + 7, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods @@ -607,21 +733,18 @@ static const uint qt_meta_data_hiro__QtComboButton[] = { 0, // flags 0, // signalCount - // slots: signature, parameters, type, tag, flags - 20, 34, 41, 41, 0x0a, + // slots: name, argc, parameters, tag, flags + 1, 1, 19, 2, 0x0a, + + // slots: parameters + QMetaType::Void, QMetaType::Int, 3, 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); switch (_id) { case 0: _t->onChange((*reinterpret_cast< int(*)>(_a[1]))); break; @@ -630,28 +753,21 @@ void hiro::QtComboButton::qt_static_metacall(QObject *_o, QMetaObject::Call _c, } } -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 } + { &QComboBox::staticMetaObject, qt_meta_stringdata_hiro__QtComboButton.data, + qt_meta_data_hiro__QtComboButton, qt_static_metacall, 0, 0} }; -#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->metaObject : &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; } void *hiro::QtComboButton::qt_metacast(const char *_clname) { if (!_clname) return 0; - if (!strcmp(_clname, qt_meta_stringdata_hiro__QtComboButton)) + if (!strcmp(_clname, qt_meta_stringdata_hiro__QtComboButton.stringdata)) return static_cast(const_cast< QtComboButton*>(this)); return QComboBox::qt_metacast(_clname); } @@ -665,13 +781,34 @@ 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 stringdata[17]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + offsetof(qt_meta_stringdata_hiro__QtHexEdit_t, stringdata) + 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\0" +}; +#undef QT_MOC_LITERAL + static const uint qt_meta_data_hiro__QtHexEdit[] = { // content: - 6, // revision + 7, // revision 0, // classname 0, 0, // classinfo 0, 0, // methods @@ -684,10 +821,6 @@ 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); @@ -696,28 +829,21 @@ void hiro::QtHexEdit::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int Q_UNUSED(_a); } -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 } + { &QTextEdit::staticMetaObject, qt_meta_stringdata_hiro__QtHexEdit.data, + qt_meta_data_hiro__QtHexEdit, qt_static_metacall, 0, 0} }; -#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->metaObject : &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; } void *hiro::QtHexEdit::qt_metacast(const char *_clname) { if (!_clname) return 0; - if (!strcmp(_clname, qt_meta_stringdata_hiro__QtHexEdit)) + if (!strcmp(_clname, qt_meta_stringdata_hiro__QtHexEdit.stringdata)) return static_cast(const_cast< QtHexEdit*>(this)); return QTextEdit::qt_metacast(_clname); } @@ -729,10 +855,29 @@ int hiro::QtHexEdit::qt_metacall(QMetaObject::Call _c, int _id, void **_a) return _id; return _id; } +struct qt_meta_stringdata_hiro__QtHexEditScrollBar_t { + QByteArrayData data[3]; + char stringdata[36]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + offsetof(qt_meta_stringdata_hiro__QtHexEditScrollBar_t, stringdata) + ofs \ + - idx * sizeof(QByteArrayData) \ + ) +static const qt_meta_stringdata_hiro__QtHexEditScrollBar_t qt_meta_stringdata_hiro__QtHexEditScrollBar = { + { +QT_MOC_LITERAL(0, 0, 24), +QT_MOC_LITERAL(1, 25, 8), +QT_MOC_LITERAL(2, 34, 0) + }, + "hiro::QtHexEditScrollBar\0onScroll\0\0" +}; +#undef QT_MOC_LITERAL + static const uint qt_meta_data_hiro__QtHexEditScrollBar[] = { // content: - 6, // revision + 7, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods @@ -742,21 +887,18 @@ static const uint qt_meta_data_hiro__QtHexEditScrollBar[] = { 0, // flags 0, // signalCount - // slots: signature, parameters, type, tag, flags - 25, 36, 36, 36, 0x0a, + // slots: name, argc, parameters, tag, flags + 1, 0, 19, 2, 0x0a, + + // slots: parameters + QMetaType::Void, 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); switch (_id) { case 0: _t->onScroll(); break; @@ -766,28 +908,21 @@ void hiro::QtHexEditScrollBar::qt_static_metacall(QObject *_o, QMetaObject::Call Q_UNUSED(_a); } -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 } + { &QScrollBar::staticMetaObject, qt_meta_stringdata_hiro__QtHexEditScrollBar.data, + qt_meta_data_hiro__QtHexEditScrollBar, qt_static_metacall, 0, 0} }; -#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->metaObject : &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; } void *hiro::QtHexEditScrollBar::qt_metacast(const char *_clname) { if (!_clname) return 0; - if (!strcmp(_clname, qt_meta_stringdata_hiro__QtHexEditScrollBar)) + if (!strcmp(_clname, qt_meta_stringdata_hiro__QtHexEditScrollBar.stringdata)) return static_cast(const_cast< QtHexEditScrollBar*>(this)); return QScrollBar::qt_metacast(_clname); } @@ -801,13 +936,37 @@ 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 stringdata[39]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + offsetof(qt_meta_stringdata_hiro__QtHorizontalScrollBar_t, stringdata) + ofs \ + - idx * sizeof(QByteArrayData) \ + ) +static const qt_meta_stringdata_hiro__QtHorizontalScrollBar_t qt_meta_stringdata_hiro__QtHorizontalScrollBar = { + { +QT_MOC_LITERAL(0, 0, 27), +QT_MOC_LITERAL(1, 28, 8), +QT_MOC_LITERAL(2, 37, 0) + }, + "hiro::QtHorizontalScrollBar\0onChange\0" + "\0" +}; +#undef QT_MOC_LITERAL + static const uint qt_meta_data_hiro__QtHorizontalScrollBar[] = { // content: - 6, // revision + 7, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods @@ -817,21 +976,18 @@ static const uint qt_meta_data_hiro__QtHorizontalScrollBar[] = { 0, // flags 0, // signalCount - // slots: signature, parameters, type, tag, flags - 28, 39, 39, 39, 0x0a, + // slots: name, argc, parameters, tag, flags + 1, 0, 19, 2, 0x0a, + + // slots: parameters + QMetaType::Void, 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); switch (_id) { case 0: _t->onChange(); break; @@ -841,28 +997,21 @@ void hiro::QtHorizontalScrollBar::qt_static_metacall(QObject *_o, QMetaObject::C Q_UNUSED(_a); } -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 } + { &QScrollBar::staticMetaObject, qt_meta_stringdata_hiro__QtHorizontalScrollBar.data, + qt_meta_data_hiro__QtHorizontalScrollBar, qt_static_metacall, 0, 0} }; -#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->metaObject : &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; } void *hiro::QtHorizontalScrollBar::qt_metacast(const char *_clname) { if (!_clname) return 0; - if (!strcmp(_clname, qt_meta_stringdata_hiro__QtHorizontalScrollBar)) + if (!strcmp(_clname, qt_meta_stringdata_hiro__QtHorizontalScrollBar.stringdata)) return static_cast(const_cast< QtHorizontalScrollBar*>(this)); return QScrollBar::qt_metacast(_clname); } @@ -876,13 +1025,36 @@ 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 stringdata[36]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + offsetof(qt_meta_stringdata_hiro__QtHorizontalSlider_t, stringdata) + ofs \ + - idx * sizeof(QByteArrayData) \ + ) +static const qt_meta_stringdata_hiro__QtHorizontalSlider_t qt_meta_stringdata_hiro__QtHorizontalSlider = { + { +QT_MOC_LITERAL(0, 0, 24), +QT_MOC_LITERAL(1, 25, 8), +QT_MOC_LITERAL(2, 34, 0) + }, + "hiro::QtHorizontalSlider\0onChange\0\0" +}; +#undef QT_MOC_LITERAL + static const uint qt_meta_data_hiro__QtHorizontalSlider[] = { // content: - 6, // revision + 7, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods @@ -892,21 +1064,18 @@ static const uint qt_meta_data_hiro__QtHorizontalSlider[] = { 0, // flags 0, // signalCount - // slots: signature, parameters, type, tag, flags - 25, 36, 36, 36, 0x0a, + // slots: name, argc, parameters, tag, flags + 1, 0, 19, 2, 0x0a, + + // slots: parameters + QMetaType::Void, 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); switch (_id) { case 0: _t->onChange(); break; @@ -916,28 +1085,21 @@ void hiro::QtHorizontalSlider::qt_static_metacall(QObject *_o, QMetaObject::Call Q_UNUSED(_a); } -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 } + { &QSlider::staticMetaObject, qt_meta_stringdata_hiro__QtHorizontalSlider.data, + qt_meta_data_hiro__QtHorizontalSlider, qt_static_metacall, 0, 0} }; -#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->metaObject : &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; } void *hiro::QtHorizontalSlider::qt_metacast(const char *_clname) { if (!_clname) return 0; - if (!strcmp(_clname, qt_meta_stringdata_hiro__QtHorizontalSlider)) + if (!strcmp(_clname, qt_meta_stringdata_hiro__QtHorizontalSlider.stringdata)) return static_cast(const_cast< QtHorizontalSlider*>(this)); return QSlider::qt_metacast(_clname); } @@ -951,13 +1113,37 @@ 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__QtLineEdit_t { + QByteArrayData data[4]; + char stringdata[39]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + offsetof(qt_meta_stringdata_hiro__QtLineEdit_t, stringdata) + ofs \ + - idx * sizeof(QByteArrayData) \ + ) +static const qt_meta_stringdata_hiro__QtLineEdit_t qt_meta_stringdata_hiro__QtLineEdit = { + { +QT_MOC_LITERAL(0, 0, 16), +QT_MOC_LITERAL(1, 17, 10), +QT_MOC_LITERAL(2, 28, 0), +QT_MOC_LITERAL(3, 29, 8) + }, + "hiro::QtLineEdit\0onActivate\0\0onChange\0" +}; +#undef QT_MOC_LITERAL + static const uint qt_meta_data_hiro__QtLineEdit[] = { // content: - 6, // revision + 7, // revision 0, // classname 0, 0, // classinfo 2, 14, // methods @@ -967,22 +1153,20 @@ static const uint qt_meta_data_hiro__QtLineEdit[] = { 0, // flags 0, // signalCount - // slots: signature, parameters, type, tag, flags - 17, 30, 30, 30, 0x0a, - 31, 30, 30, 30, 0x0a, + // slots: name, argc, parameters, tag, flags + 1, 0, 24, 2, 0x0a, + 3, 0, 25, 2, 0x0a, + + // slots: parameters + QMetaType::Void, + QMetaType::Void, 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); switch (_id) { case 0: _t->onActivate(); break; @@ -993,28 +1177,21 @@ void hiro::QtLineEdit::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int Q_UNUSED(_a); } -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 } + { &QLineEdit::staticMetaObject, qt_meta_stringdata_hiro__QtLineEdit.data, + qt_meta_data_hiro__QtLineEdit, qt_static_metacall, 0, 0} }; -#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->metaObject : &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; } void *hiro::QtLineEdit::qt_metacast(const char *_clname) { if (!_clname) return 0; - if (!strcmp(_clname, qt_meta_stringdata_hiro__QtLineEdit)) + if (!strcmp(_clname, qt_meta_stringdata_hiro__QtLineEdit.stringdata)) return static_cast(const_cast< QtLineEdit*>(this)); return QLineEdit::qt_metacast(_clname); } @@ -1028,13 +1205,36 @@ 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 stringdata[32]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + offsetof(qt_meta_stringdata_hiro__QtRadioLabel_t, stringdata) + ofs \ + - idx * sizeof(QByteArrayData) \ + ) +static const qt_meta_stringdata_hiro__QtRadioLabel_t qt_meta_stringdata_hiro__QtRadioLabel = { + { +QT_MOC_LITERAL(0, 0, 18), +QT_MOC_LITERAL(1, 19, 10), +QT_MOC_LITERAL(2, 30, 0) + }, + "hiro::QtRadioLabel\0onActivate\0\0" +}; +#undef QT_MOC_LITERAL + static const uint qt_meta_data_hiro__QtRadioLabel[] = { // content: - 6, // revision + 7, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods @@ -1044,20 +1244,18 @@ static const uint qt_meta_data_hiro__QtRadioLabel[] = { 0, // flags 0, // signalCount - // slots: signature, parameters, type, tag, flags - 19, 32, 32, 32, 0x0a, + // slots: name, argc, parameters, tag, flags + 1, 0, 19, 2, 0x0a, + + // slots: parameters + QMetaType::Void, 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); switch (_id) { case 0: _t->onActivate(); break; @@ -1067,28 +1265,21 @@ void hiro::QtRadioLabel::qt_static_metacall(QObject *_o, QMetaObject::Call _c, i Q_UNUSED(_a); } -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 } + { &QRadioButton::staticMetaObject, qt_meta_stringdata_hiro__QtRadioLabel.data, + qt_meta_data_hiro__QtRadioLabel, qt_static_metacall, 0, 0} }; -#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->metaObject : &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; } void *hiro::QtRadioLabel::qt_metacast(const char *_clname) { if (!_clname) return 0; - if (!strcmp(_clname, qt_meta_stringdata_hiro__QtRadioLabel)) + if (!strcmp(_clname, qt_meta_stringdata_hiro__QtRadioLabel.stringdata)) return static_cast(const_cast< QtRadioLabel*>(this)); return QRadioButton::qt_metacast(_clname); } @@ -1102,13 +1293,36 @@ 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 stringdata[33]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + offsetof(qt_meta_stringdata_hiro__QtRadioButton_t, stringdata) + ofs \ + - idx * sizeof(QByteArrayData) \ + ) +static const qt_meta_stringdata_hiro__QtRadioButton_t qt_meta_stringdata_hiro__QtRadioButton = { + { +QT_MOC_LITERAL(0, 0, 19), +QT_MOC_LITERAL(1, 20, 10), +QT_MOC_LITERAL(2, 31, 0) + }, + "hiro::QtRadioButton\0onActivate\0\0" +}; +#undef QT_MOC_LITERAL + static const uint qt_meta_data_hiro__QtRadioButton[] = { // content: - 6, // revision + 7, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods @@ -1118,20 +1332,18 @@ static const uint qt_meta_data_hiro__QtRadioButton[] = { 0, // flags 0, // signalCount - // slots: signature, parameters, type, tag, flags - 20, 33, 33, 33, 0x0a, + // slots: name, argc, parameters, tag, flags + 1, 0, 19, 2, 0x0a, + + // slots: parameters + QMetaType::Void, 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); switch (_id) { case 0: _t->onActivate(); break; @@ -1141,28 +1353,21 @@ void hiro::QtRadioButton::qt_static_metacall(QObject *_o, QMetaObject::Call _c, Q_UNUSED(_a); } -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 } + { &QToolButton::staticMetaObject, qt_meta_stringdata_hiro__QtRadioButton.data, + qt_meta_data_hiro__QtRadioButton, qt_static_metacall, 0, 0} }; -#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->metaObject : &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; } void *hiro::QtRadioButton::qt_metacast(const char *_clname) { if (!_clname) return 0; - if (!strcmp(_clname, qt_meta_stringdata_hiro__QtRadioButton)) + if (!strcmp(_clname, qt_meta_stringdata_hiro__QtRadioButton.stringdata)) return static_cast(const_cast< QtRadioButton*>(this)); return QToolButton::qt_metacast(_clname); } @@ -1176,13 +1381,37 @@ 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 stringdata[38]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + offsetof(qt_meta_stringdata_hiro__QtTabFrame_t, stringdata) + ofs \ + - idx * sizeof(QByteArrayData) \ + ) +static const qt_meta_stringdata_hiro__QtTabFrame_t qt_meta_stringdata_hiro__QtTabFrame = { + { +QT_MOC_LITERAL(0, 0, 16), +QT_MOC_LITERAL(1, 17, 8), +QT_MOC_LITERAL(2, 26, 0), +QT_MOC_LITERAL(3, 27, 9) + }, + "hiro::QtTabFrame\0onChange\0\0selection\0" +}; +#undef QT_MOC_LITERAL + static const uint qt_meta_data_hiro__QtTabFrame[] = { // content: - 6, // revision + 7, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods @@ -1192,21 +1421,18 @@ static const uint qt_meta_data_hiro__QtTabFrame[] = { 0, // flags 0, // signalCount - // slots: signature, parameters, type, tag, flags - 17, 31, 41, 41, 0x0a, + // slots: name, argc, parameters, tag, flags + 1, 1, 19, 2, 0x0a, + + // slots: parameters + QMetaType::Void, QMetaType::Int, 3, 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); switch (_id) { case 0: _t->onChange((*reinterpret_cast< int(*)>(_a[1]))); break; @@ -1215,28 +1441,21 @@ void hiro::QtTabFrame::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int } } -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 } + { &QTabWidget::staticMetaObject, qt_meta_stringdata_hiro__QtTabFrame.data, + qt_meta_data_hiro__QtTabFrame, qt_static_metacall, 0, 0} }; -#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->metaObject : &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; } void *hiro::QtTabFrame::qt_metacast(const char *_clname) { if (!_clname) return 0; - if (!strcmp(_clname, qt_meta_stringdata_hiro__QtTabFrame)) + if (!strcmp(_clname, qt_meta_stringdata_hiro__QtTabFrame.stringdata)) return static_cast(const_cast< QtTabFrame*>(this)); return QTabWidget::qt_metacast(_clname); } @@ -1250,13 +1469,45 @@ 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 stringdata[95]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + offsetof(qt_meta_stringdata_hiro__QtTableView_t, stringdata) + ofs \ + - idx * sizeof(QByteArrayData) \ + ) +static const qt_meta_stringdata_hiro__QtTableView_t qt_meta_stringdata_hiro__QtTableView = { + { +QT_MOC_LITERAL(0, 0, 17), +QT_MOC_LITERAL(1, 18, 10), +QT_MOC_LITERAL(2, 29, 0), +QT_MOC_LITERAL(3, 30, 8), +QT_MOC_LITERAL(4, 39, 9), +QT_MOC_LITERAL(5, 49, 6), +QT_MOC_LITERAL(6, 56, 6), +QT_MOC_LITERAL(7, 63, 8), +QT_MOC_LITERAL(8, 72, 16), +QT_MOC_LITERAL(9, 89, 4) + }, + "hiro::QtTableView\0onActivate\0\0onChange\0" + "onContext\0onSort\0column\0onToggle\0" + "QTreeWidgetItem*\0item\0" +}; +#undef QT_MOC_LITERAL + static const uint qt_meta_data_hiro__QtTableView[] = { // content: - 6, // revision + 7, // revision 0, // classname 0, 0, // classinfo 5, 14, // methods @@ -1266,27 +1517,26 @@ static const uint qt_meta_data_hiro__QtTableView[] = { 0, // flags 0, // signalCount - // slots: signature, parameters, type, tag, flags - 18, 31, 31, 31, 0x0a, - 32, 31, 31, 31, 0x0a, - 43, 31, 31, 31, 0x0a, - 55, 67, 31, 31, 0x0a, - 74, 105, 31, 31, 0x0a, + // slots: name, argc, parameters, tag, flags + 1, 0, 39, 2, 0x0a, + 3, 0, 40, 2, 0x0a, + 4, 0, 41, 2, 0x0a, + 5, 1, 42, 2, 0x0a, + 7, 2, 45, 2, 0x0a, + + // slots: parameters + QMetaType::Void, + QMetaType::Void, + QMetaType::Void, + QMetaType::Void, QMetaType::Int, 6, + QMetaType::Void, 0x80000000 | 8, QMetaType::Int, 9, 6, 0 // eod }; -static const char qt_meta_stringdata_hiro__QtTableView[] = { - "hiro::QtTableView\0onActivate()\0\0" - "onChange()\0onContext()\0onSort(int)\0" - "column\0onToggle(QTreeWidgetItem*,int)\0" - "item,column\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); switch (_id) { case 0: _t->onActivate(); break; @@ -1299,28 +1549,21 @@ void hiro::QtTableView::qt_static_metacall(QObject *_o, QMetaObject::Call _c, in } } -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 } + { &QTreeWidget::staticMetaObject, qt_meta_stringdata_hiro__QtTableView.data, + qt_meta_data_hiro__QtTableView, qt_static_metacall, 0, 0} }; -#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->metaObject : &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; } void *hiro::QtTableView::qt_metacast(const char *_clname) { if (!_clname) return 0; - if (!strcmp(_clname, qt_meta_stringdata_hiro__QtTableView)) + if (!strcmp(_clname, qt_meta_stringdata_hiro__QtTableView.stringdata)) return static_cast(const_cast< QtTableView*>(this)); return QTreeWidget::qt_metacast(_clname); } @@ -1334,13 +1577,36 @@ 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 stringdata[28]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + offsetof(qt_meta_stringdata_hiro__QtTextEdit_t, stringdata) + ofs \ + - idx * sizeof(QByteArrayData) \ + ) +static const qt_meta_stringdata_hiro__QtTextEdit_t qt_meta_stringdata_hiro__QtTextEdit = { + { +QT_MOC_LITERAL(0, 0, 16), +QT_MOC_LITERAL(1, 17, 8), +QT_MOC_LITERAL(2, 26, 0) + }, + "hiro::QtTextEdit\0onChange\0\0" +}; +#undef QT_MOC_LITERAL + static const uint qt_meta_data_hiro__QtTextEdit[] = { // content: - 6, // revision + 7, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods @@ -1350,20 +1616,18 @@ static const uint qt_meta_data_hiro__QtTextEdit[] = { 0, // flags 0, // signalCount - // slots: signature, parameters, type, tag, flags - 17, 28, 28, 28, 0x0a, + // slots: name, argc, parameters, tag, flags + 1, 0, 19, 2, 0x0a, + + // slots: parameters + QMetaType::Void, 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); switch (_id) { case 0: _t->onChange(); break; @@ -1373,28 +1637,21 @@ void hiro::QtTextEdit::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int Q_UNUSED(_a); } -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 } + { &QTextEdit::staticMetaObject, qt_meta_stringdata_hiro__QtTextEdit.data, + qt_meta_data_hiro__QtTextEdit, qt_static_metacall, 0, 0} }; -#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->metaObject : &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; } void *hiro::QtTextEdit::qt_metacast(const char *_clname) { if (!_clname) return 0; - if (!strcmp(_clname, qt_meta_stringdata_hiro__QtTextEdit)) + if (!strcmp(_clname, qt_meta_stringdata_hiro__QtTextEdit.stringdata)) return static_cast(const_cast< QtTextEdit*>(this)); return QTextEdit::qt_metacast(_clname); } @@ -1408,13 +1665,36 @@ 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 stringdata[37]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + offsetof(qt_meta_stringdata_hiro__QtVerticalScrollBar_t, stringdata) + ofs \ + - idx * sizeof(QByteArrayData) \ + ) +static const qt_meta_stringdata_hiro__QtVerticalScrollBar_t qt_meta_stringdata_hiro__QtVerticalScrollBar = { + { +QT_MOC_LITERAL(0, 0, 25), +QT_MOC_LITERAL(1, 26, 8), +QT_MOC_LITERAL(2, 35, 0) + }, + "hiro::QtVerticalScrollBar\0onChange\0\0" +}; +#undef QT_MOC_LITERAL + static const uint qt_meta_data_hiro__QtVerticalScrollBar[] = { // content: - 6, // revision + 7, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods @@ -1424,21 +1704,18 @@ static const uint qt_meta_data_hiro__QtVerticalScrollBar[] = { 0, // flags 0, // signalCount - // slots: signature, parameters, type, tag, flags - 26, 37, 37, 37, 0x0a, + // slots: name, argc, parameters, tag, flags + 1, 0, 19, 2, 0x0a, + + // slots: parameters + QMetaType::Void, 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); switch (_id) { case 0: _t->onChange(); break; @@ -1448,28 +1725,21 @@ void hiro::QtVerticalScrollBar::qt_static_metacall(QObject *_o, QMetaObject::Cal Q_UNUSED(_a); } -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 } + { &QScrollBar::staticMetaObject, qt_meta_stringdata_hiro__QtVerticalScrollBar.data, + qt_meta_data_hiro__QtVerticalScrollBar, qt_static_metacall, 0, 0} }; -#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->metaObject : &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; } void *hiro::QtVerticalScrollBar::qt_metacast(const char *_clname) { if (!_clname) return 0; - if (!strcmp(_clname, qt_meta_stringdata_hiro__QtVerticalScrollBar)) + if (!strcmp(_clname, qt_meta_stringdata_hiro__QtVerticalScrollBar.stringdata)) return static_cast(const_cast< QtVerticalScrollBar*>(this)); return QScrollBar::qt_metacast(_clname); } @@ -1483,13 +1753,36 @@ 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 stringdata[34]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + offsetof(qt_meta_stringdata_hiro__QtVerticalSlider_t, stringdata) + ofs \ + - idx * sizeof(QByteArrayData) \ + ) +static const qt_meta_stringdata_hiro__QtVerticalSlider_t qt_meta_stringdata_hiro__QtVerticalSlider = { + { +QT_MOC_LITERAL(0, 0, 22), +QT_MOC_LITERAL(1, 23, 8), +QT_MOC_LITERAL(2, 32, 0) + }, + "hiro::QtVerticalSlider\0onChange\0\0" +}; +#undef QT_MOC_LITERAL + static const uint qt_meta_data_hiro__QtVerticalSlider[] = { // content: - 6, // revision + 7, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods @@ -1499,20 +1792,18 @@ static const uint qt_meta_data_hiro__QtVerticalSlider[] = { 0, // flags 0, // signalCount - // slots: signature, parameters, type, tag, flags - 23, 34, 34, 34, 0x0a, + // slots: name, argc, parameters, tag, flags + 1, 0, 19, 2, 0x0a, + + // slots: parameters + QMetaType::Void, 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); switch (_id) { case 0: _t->onChange(); break; @@ -1522,28 +1813,21 @@ void hiro::QtVerticalSlider::qt_static_metacall(QObject *_o, QMetaObject::Call _ Q_UNUSED(_a); } -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 } + { &QSlider::staticMetaObject, qt_meta_stringdata_hiro__QtVerticalSlider.data, + qt_meta_data_hiro__QtVerticalSlider, qt_static_metacall, 0, 0} }; -#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->metaObject : &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; } void *hiro::QtVerticalSlider::qt_metacast(const char *_clname) { if (!_clname) return 0; - if (!strcmp(_clname, qt_meta_stringdata_hiro__QtVerticalSlider)) + if (!strcmp(_clname, qt_meta_stringdata_hiro__QtVerticalSlider.stringdata)) return static_cast(const_cast< QtVerticalSlider*>(this)); return QSlider::qt_metacast(_clname); } @@ -1557,13 +1841,34 @@ 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 stringdata[18]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + offsetof(qt_meta_stringdata_hiro__QtViewport_t, stringdata) + 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\0" +}; +#undef QT_MOC_LITERAL + static const uint qt_meta_data_hiro__QtViewport[] = { // content: - 6, // revision + 7, // revision 0, // classname 0, 0, // classinfo 0, 0, // methods @@ -1576,10 +1881,6 @@ 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); @@ -1588,28 +1889,21 @@ void hiro::QtViewport::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int Q_UNUSED(_a); } -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 } + { &QWidget::staticMetaObject, qt_meta_stringdata_hiro__QtViewport.data, + qt_meta_data_hiro__QtViewport, qt_static_metacall, 0, 0} }; -#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->metaObject : &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; } void *hiro::QtViewport::qt_metacast(const char *_clname) { if (!_clname) return 0; - if (!strcmp(_clname, qt_meta_stringdata_hiro__QtViewport)) + if (!strcmp(_clname, qt_meta_stringdata_hiro__QtViewport.stringdata)) return static_cast(const_cast< QtViewport*>(this)); return QWidget::qt_metacast(_clname); } diff --git a/hiro/qt/settings.cpp b/hiro/qt/settings.cpp index 7c16a2c5..e3c27f5a 100644 --- a/hiro/qt/settings.cpp +++ b/hiro/qt/settings.cpp @@ -2,7 +2,11 @@ namespace hiro { Settings::Settings() { string path = {Path::userData(), "hiro/"}; - auto document = BML::unserialize(file::read({path, "qt.bml"})); + #if HIRO_QT==4 + auto document = BML::unserialize(file::read({path, "qt4.bml"})); + #elif HIRO_QT==5 + auto document = BML::unserialize(file::read({path, "qt5.bml"})); + #endif auto get = [&](string_view name) { return document[name]; @@ -32,7 +36,11 @@ Settings::~Settings() { set("Geometry/MenuHeight", geometry.menuHeight); set("Geometry/StatusHeight", geometry.statusHeight); - file::write({path, "qt.bml"}, BML::serialize(document)); + #if HIRO_QT==4 + file::write({path, "qt4.bml"}, BML::serialize(document)); + #elif HIRO_QT==5 + file::write({path, "qt5.bml"}, BML::serialize(document)); + #endif } } diff --git a/hiro/qt/widget/table-view-column.cpp b/hiro/qt/widget/table-view-column.cpp index a05a25ca..58e7c35f 100644 --- a/hiro/qt/widget/table-view-column.cpp +++ b/hiro/qt/widget/table-view-column.cpp @@ -78,10 +78,18 @@ auto pTableViewColumn::_parent() -> maybe { auto pTableViewColumn::_setState() -> void { if(auto header = _parent()) { if(auto parent = header->_parent()) { + #if HIRO_QT==4 parent->qtTableView->header()->setResizeMode(self().offset(), state().resizable ? QHeaderView::Interactive : QHeaderView::Fixed); + #elif HIRO_QT==5 + parent->qtTableView->header()->setSectionResizeMode(self().offset(), state().resizable ? QHeaderView::Interactive : QHeaderView::Fixed); + #endif bool clickable = false; for(auto& column : header->state().columns) clickable |= column->state.sortable; + #if HIRO_QT==4 parent->qtTableView->header()->setClickable(clickable); + #elif HIRO_QT==5 + parent->qtTableView->header()->setSectionsClickable(clickable); + #endif parent->qtTableView->headerItem()->setText(self().offset(), QString::fromUtf8(state().text)); parent->qtTableView->setColumnHidden(self().offset(), !self().visible()); diff --git a/hiro/qt/widget/table-view.cpp b/hiro/qt/widget/table-view.cpp index 36532b32..877866ee 100644 --- a/hiro/qt/widget/table-view.cpp +++ b/hiro/qt/widget/table-view.cpp @@ -8,7 +8,11 @@ auto pTableView::construct() -> void { qtTableView->setContextMenuPolicy(Qt::CustomContextMenu); qtTableView->setRootIsDecorated(false); qtTableView->setHeaderHidden(true); + #if HIRO_QT==4 qtTableView->header()->setMovable(false); + #elif HIRO_QT==5 + qtTableView->header()->setSectionsMovable(false); + #endif qtTableViewDelegate = new QtTableViewDelegate(*this); qtTableView->setItemDelegate(qtTableViewDelegate); diff --git a/hiro/qt/window.cpp b/hiro/qt/window.cpp index 8e253391..541e2b72 100644 --- a/hiro/qt/window.cpp +++ b/hiro/qt/window.cpp @@ -135,7 +135,11 @@ auto pWindow::setFullScreen(bool fullScreen) -> void { auto pWindow::setGeometry(Geometry geometry) -> void { lock(); Application::processEvents(); + #if HIRO_QT==4 QApplication::syncX(); + #elif HIRO_QT==5 + QApplication::sync(); + #endif setResizable(state().resizable); qtWindow->move(geometry.x() - frameMargin().x(), geometry.y() - frameMargin().y()); diff --git a/nall/GNUmakefile b/nall/GNUmakefile index db9ffc9d..dd69a74f 100644 --- a/nall/GNUmakefile +++ b/nall/GNUmakefile @@ -86,7 +86,7 @@ endif # clang settings ifeq ($(findstring clang++,$(compiler)),clang++) - flags += -fno-strict-aliasing -fwrapv + flags += -fno-strict-aliasing -fwrapv -Wno-everything # gcc settings else ifeq ($(findstring g++,$(compiler)),g++) flags += -fno-strict-aliasing -fwrapv diff --git a/ruby/video/xshm.cpp b/ruby/video/xshm.cpp index 1d076262..66a05427 100644 --- a/ruby/video/xshm.cpp +++ b/ruby/video/xshm.cpp @@ -107,8 +107,9 @@ private: return false; } - XSetWindowAttributes setAttributes = {0}; + XSetWindowAttributes setAttributes = {}; setAttributes.border_pixel = 0; + setAttributes.event_mask = ExposureMask; _window = XCreateWindow(_display, (Window)_context, 0, 0, 256, 256, 0, getAttributes.depth, InputOutput, getAttributes.visual,