diff --git a/emulator/emulator.hpp b/emulator/emulator.hpp index ea2c7a61..5a36ffb5 100644 --- a/emulator/emulator.hpp +++ b/emulator/emulator.hpp @@ -3,7 +3,7 @@ namespace Emulator { static const char Name[] = "higan"; - static const char Version[] = "094.19"; + static const char Version[] = "094.20"; static const char Author[] = "byuu"; static const char License[] = "GPLv3"; static const char Website[] = "http://byuu.org/"; diff --git a/hiro/components.hpp b/hiro/components.hpp new file mode 100644 index 00000000..4f15c104 --- /dev/null +++ b/hiro/components.hpp @@ -0,0 +1,81 @@ +/* hiro components + * + * By commenting out lines below, individual components of hiro can be disabled.) + * This can be useful to avoid dependencies (eg GTK+ relies on GtkSourceView for SourceEdit.) + * It's also very useful for porting hiro to new targets; or performing major core changes. + * + * Note that the core classes (Application, Window, Sizable, etc) have circular dependencies. + * Disabling only certain core pieces will result in compilation errors. + * As such, this file is really only meant for disabling individual widgets or menu items. + */ + +#define Hiro_Application + +#define Hiro_Color +#define Hiro_Position +#define Hiro_Size +#define Hiro_Geometry + +#define Hiro_Font +#define Hiro_Desktop +#define Hiro_Monitor +#define Hiro_Keyboard +#define Hiro_Mouse +#define Hiro_BrowserWindow +#define Hiro_MessageWindow + +#define Hiro_Object +#define Hiro_Hotkey +#define Hiro_Timer + +#define Hiro_Window +#define Hiro_StatusBar +#define Hiro_MenuBar +#define Hiro_PopupMenu + +#define Hiro_Action +#define Hiro_Menu +#define Hiro_MenuSeparator +#define Hiro_MenuItem +#define Hiro_MenuCheckItem +#define Hiro_MenuRadioItem + +#define Hiro_Sizable +#define Hiro_Layout +#define Hiro_Widget +#define Hiro_Button +#define Hiro_Canvas +#define Hiro_CheckButton +#define Hiro_CheckLabel +#define Hiro_ComboButton +#define Hiro_Console +#define Hiro_Frame +#define Hiro_HexEdit +#define Hiro_HorizontalScroller +#define Hiro_HorizontalSlider +#define Hiro_IconView +#define Hiro_Label +#define Hiro_LineEdit +#define Hiro_ListView +#define Hiro_ProgressBar +#define Hiro_RadioButton +#define Hiro_RadioLabel +#define Hiro_SourceView +#define Hiro_TabFrame +#define Hiro_TextEdit +#define Hiro_TreeView +#define Hiro_VerticalScroller +#define Hiro_VerticalSlider +#define Hiro_Viewport + +#define Hiro_FixedLayout +#define Hiro_HorizontalLayout +#define Hiro_VerticalLayout + +#if defined(Hiro_Button) && defined(Hiro_Canvas) && defined(Hiro_Label) + #define Hiro_MessageDialog +#endif + +#if defined(Hiro_Button) && defined(Hiro_ComboButton) && defined(Hiro_LineEdit) && defined(Hiro_ListView) && defined(Hiro_MessageDialog) + #define Hiro_BrowserDialog +#endif diff --git a/hiro/core/action/action.cpp b/hiro/core/action/action.cpp index c4199296..1251a42c 100644 --- a/hiro/core/action/action.cpp +++ b/hiro/core/action/action.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Action) + auto mAction::allocate() -> pObject* { return new pAction(*this); } @@ -7,6 +9,10 @@ auto mAction::allocate() -> pObject* { auto mAction::remove() -> type& { if(auto menu = parentMenu()) menu->remove(*this); if(auto menuBar = parentMenuBar()) menuBar->remove((mMenu&)*this); + #if defined(Hiro_PopupMenu) if(auto popupMenu = parentPopupMenu()) popupMenu->remove(*this); + #endif return *this; } + +#endif diff --git a/hiro/core/action/menu-check-item.cpp b/hiro/core/action/menu-check-item.cpp index 4b2d6392..d0535cc5 100644 --- a/hiro/core/action/menu-check-item.cpp +++ b/hiro/core/action/menu-check-item.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_MenuCheckItem) + auto mMenuCheckItem::allocate() -> pObject* { return new pMenuCheckItem(*this); } @@ -31,3 +33,5 @@ auto mMenuCheckItem::setText(const string& text) -> type& { auto mMenuCheckItem::text() const -> string { return state.text; } + +#endif diff --git a/hiro/core/action/menu-item.cpp b/hiro/core/action/menu-item.cpp index 25a8ad8f..50dd2d91 100644 --- a/hiro/core/action/menu-item.cpp +++ b/hiro/core/action/menu-item.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_MenuItem) + auto mMenuItem::allocate() -> pObject* { return new pMenuItem(*this); } @@ -32,3 +34,5 @@ auto mMenuItem::setText(const string& text) -> type& { auto mMenuItem::text() const -> string { return state.text; } + +#endif diff --git a/hiro/core/action/menu-radio-item.cpp b/hiro/core/action/menu-radio-item.cpp index c4d940b8..e09eebad 100644 --- a/hiro/core/action/menu-radio-item.cpp +++ b/hiro/core/action/menu-radio-item.cpp @@ -1,10 +1,12 @@ +#if defined(Hiro_MenuRadioItem) + auto mMenuRadioItem::allocate() -> pObject* { return new pMenuRadioItem(*this); } // -auto mMenuRadioItem::group(const vector>& group) -> void { +auto mMenuRadioItem::group(const vector& group) -> void { for(auto& weak : group) { if(auto item = weak.acquire()) item->state.group = group; } @@ -49,3 +51,5 @@ auto mMenuRadioItem::setText(const string& text) -> type& { auto mMenuRadioItem::text() const -> string { return state.text; } + +#endif diff --git a/hiro/core/action/menu-separator.cpp b/hiro/core/action/menu-separator.cpp index 98246b1b..39939806 100644 --- a/hiro/core/action/menu-separator.cpp +++ b/hiro/core/action/menu-separator.cpp @@ -1,3 +1,7 @@ +#if defined(Hiro_MenuSeparator) + auto mMenuSeparator::allocate() -> pObject* { return new pMenuSeparator(*this); } + +#endif diff --git a/hiro/core/action/menu.cpp b/hiro/core/action/menu.cpp index 4cfeec33..ca17b392 100644 --- a/hiro/core/action/menu.cpp +++ b/hiro/core/action/menu.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Menu) + auto mMenu::allocate() -> pObject* { return new pMenu(*this); } @@ -58,3 +60,5 @@ auto mMenu::setText(const string& text) -> type& { auto mMenu::text() const -> string { return state.text; } + +#endif diff --git a/hiro/core/application.cpp b/hiro/core/application.cpp index d6597aad..71eac1af 100644 --- a/hiro/core/application.cpp +++ b/hiro/core/application.cpp @@ -1,3 +1,7 @@ +#if defined(Hiro_Application) + +Application::State Application::state; + auto Application::doMain() -> void { if(state.onMain) return state.onMain(); } @@ -95,3 +99,5 @@ auto Application::initialize() -> void { return pApplication::initialize(); } } + +#endif diff --git a/hiro/core/browser-window.cpp b/hiro/core/browser-window.cpp index 7d24a1c5..584edffe 100644 --- a/hiro/core/browser-window.cpp +++ b/hiro/core/browser-window.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_BrowserWindow) + auto BrowserWindow::directory() -> string { return pBrowserWindow::directory(state); } @@ -29,3 +31,5 @@ auto BrowserWindow::setTitle(const string& title) -> type& { state.title = title; return *this; } + +#endif diff --git a/hiro/core/color.cpp b/hiro/core/color.cpp index dd43696c..81287896 100644 --- a/hiro/core/color.cpp +++ b/hiro/core/color.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Color) + Color::Color() { setColor(0, 0, 0, 0); } @@ -81,3 +83,5 @@ auto Color::setRed(signed red) -> type& { auto Color::value() const -> uint32_t { return (state.alpha << 24) + (state.red << 16) + (state.green << 8) + (state.blue << 0); } + +#endif diff --git a/hiro/core/core.cpp b/hiro/core/core.cpp index 79011b6b..9344fb4b 100644 --- a/hiro/core/core.cpp +++ b/hiro/core/core.cpp @@ -15,11 +15,6 @@ #include "core.hpp" using namespace nall; -namespace hiro { - Application::State Application::state; - Keyboard::State Keyboard::state; -} - #if defined(HIRO_WINDOWS) #include "../windows/platform.cpp" #elif defined(HIRO_QT) diff --git a/hiro/core/core.hpp b/hiro/core/core.hpp index 8a19e249..8985af74 100644 --- a/hiro/core/core.hpp +++ b/hiro/core/core.hpp @@ -83,6 +83,7 @@ enum class Edge : unsigned { Top, Bottom, Left, Right }; enum class Orientation : unsigned { Horizontal, Vertical }; +#if defined(Hiro_Application) struct Application { Application() = delete; @@ -134,7 +135,9 @@ struct Application { static State state; static auto initialize() -> void; }; +#endif +#if defined(Hiro_Color) struct Color { using type = Color; @@ -168,7 +171,9 @@ struct Color { signed blue; } state; }; +#endif +#if defined(Hiro_Position) struct Position { using type = Position; @@ -191,7 +196,9 @@ struct Position { signed y; } state; }; +#endif +#if defined(Hiro_Size) struct Size { using type = Size; @@ -217,7 +224,9 @@ struct Size { signed height; } state; }; +#endif +#if defined(Hiro_Geometry) struct Geometry { using type = Geometry; @@ -256,7 +265,9 @@ struct Geometry { signed height; } state; }; +#endif +#if defined(Hiro_Font) struct Font { Font() = delete; @@ -265,14 +276,18 @@ struct Font { static auto monospace(unsigned size = 0, const string& style = "") -> string; static auto size(const string& font, const string& text = " ") -> Size; }; +#endif +#if defined(Hiro_Desktop) struct Desktop { Desktop() = delete; static auto size() -> Size; static auto workspace() -> Geometry; }; +#endif +#if defined(Hiro_Monitor) struct Monitor { Monitor() = delete; @@ -280,7 +295,9 @@ struct Monitor { static auto geometry(unsigned monitor) -> Geometry; static auto primary() -> unsigned; }; +#endif +#if defined(Hiro_Keyboard) struct Keyboard { Keyboard() = delete; @@ -300,7 +317,9 @@ struct Keyboard { }; static State state; }; +#endif +#if defined(Hiro_Mouse) struct Mouse { enum class Button : unsigned { Left, Middle, Right }; @@ -310,7 +329,9 @@ struct Mouse { static auto pressed(Button) -> bool; static auto released(Button) -> bool; }; +#endif +#if defined(Hiro_BrowserWindow) struct BrowserWindow { using type = BrowserWindow; @@ -330,7 +351,9 @@ struct BrowserWindow { string title; } state; }; +#endif +#if defined(Hiro_MessageWindow) struct MessageWindow { enum class Buttons : unsigned { Ok, OkCancel, YesNo, YesNoCancel }; enum class Response : unsigned { Ok, Cancel, Yes, No }; @@ -355,6 +378,7 @@ struct MessageWindow { string title; } state; }; +#endif #define Declare(Name) \ using type = m##Name; \ @@ -372,6 +396,7 @@ struct MessageWindow { } \ virtual auto allocate() -> pObject*; \ +#if defined(Hiro_Object) struct mObject { Declare(Object) @@ -426,7 +451,9 @@ struct mObject { virtual auto construct() -> void; virtual auto destruct() -> void; }; +#endif +#if defined(Hiro_Hotkey) struct mHotkey : mObject { Declare(Hotkey) @@ -450,7 +477,9 @@ struct mHotkey : mObject { string sequence; } state; }; +#endif +#if defined(Hiro_Timer) struct mTimer : mObject { Declare(Timer) @@ -465,7 +494,9 @@ struct mTimer : mObject { function onActivate; } state; }; +#endif +#if defined(Hiro_Window) struct mWindow : mObject { Declare(Window) using mObject::remove; @@ -538,7 +569,9 @@ struct mWindow : mObject { auto destruct() -> void; }; +#endif +#if defined(Hiro_StatusBar) struct mStatusBar : mObject { Declare(StatusBar) @@ -551,7 +584,9 @@ struct mStatusBar : mObject { string text; } state; }; +#endif +#if defined(Hiro_MenuBar) struct mMenuBar : mObject { Declare(MenuBar) @@ -569,7 +604,9 @@ struct mMenuBar : mObject { auto destruct() -> void override; }; +#endif +#if defined(Hiro_PopupMenu) struct mPopupMenu : mObject { Declare(PopupMenu) using mObject::remove; @@ -588,7 +625,9 @@ struct mPopupMenu : mObject { auto destruct() -> void override; }; +#endif +#if defined(Hiro_Action) struct mAction : mObject { Declare(Action) @@ -598,7 +637,9 @@ struct mAction : mObject { struct State { } state; }; +#endif +#if defined(Hiro_Menu) struct mMenu : mAction { Declare(Menu) using mObject::remove; @@ -622,7 +663,9 @@ struct mMenu : mAction { auto destruct() -> void override; }; +#endif +#if defined(Hiro_MenuSeparator) struct mMenuSeparator : mAction { Declare(MenuSeparator) @@ -630,7 +673,9 @@ struct mMenuSeparator : mAction { struct State { } state; }; +#endif +#if defined(Hiro_MenuItem) struct mMenuItem : mAction { Declare(MenuItem) @@ -648,7 +693,9 @@ struct mMenuItem : mAction { string text; } state; }; +#endif +#if defined(Hiro_MenuCheckItem) struct mMenuCheckItem : mAction { Declare(MenuCheckItem) @@ -666,7 +713,9 @@ struct mMenuCheckItem : mAction { string text; } state; }; +#endif +#if defined(Hiro_MenuRadioItem) struct mMenuRadioItem : mAction { Declare(MenuRadioItem) @@ -687,7 +736,9 @@ struct mMenuRadioItem : mAction { string text; } state; }; +#endif +#if defined(Hiro_Sizable) struct mSizable : mObject { Declare(Sizable) @@ -700,7 +751,9 @@ struct mSizable : mObject { Geometry geometry; } state; }; +#endif +#if defined(Hiro_Layout) struct mLayout : mSizable { Declare(Layout) @@ -719,7 +772,9 @@ struct mLayout : mSizable { auto destruct() -> void override; }; +#endif +#if defined(Hiro_Widget) struct mWidget : mSizable { Declare(Widget) @@ -732,7 +787,9 @@ struct mWidget : mSizable { function onSize; } state; }; +#endif +#if defined(Hiro_Button) struct mButton : mWidget { Declare(Button) @@ -756,7 +813,9 @@ struct mButton : mWidget { string text; } state; }; +#endif +#if defined(Hiro_Canvas) struct mCanvas : mWidget { Declare(Canvas) @@ -800,7 +859,9 @@ struct mCanvas : mWidget { Size size; } state; }; +#endif +#if defined(Hiro_CheckButton) struct mCheckButton : mWidget { Declare(CheckButton) @@ -827,7 +888,9 @@ struct mCheckButton : mWidget { string text; } state; }; +#endif +#if defined(Hiro_CheckLabel) struct mCheckLabel : mWidget { Declare(CheckLabel) @@ -845,7 +908,9 @@ struct mCheckLabel : mWidget { string text; } state; }; +#endif +#if defined(Hiro_ComboButton) struct mComboButton : mWidget { Declare(ComboButton) using mObject::remove; @@ -868,7 +933,9 @@ struct mComboButton : mWidget { auto destruct() -> void override; }; +#endif +#if defined(Hiro_ComboButton) struct mComboButtonItem : mObject { Declare(ComboButtonItem) @@ -886,7 +953,9 @@ struct mComboButtonItem : mObject { string text; } state; }; +#endif +#if defined(Hiro_Console) struct mConsole : mWidget { Declare(Console) @@ -909,7 +978,9 @@ struct mConsole : mWidget { string prompt; } state; }; +#endif +#if defined(Hiro_Frame) struct mFrame : mWidget { Declare(Frame) using mObject::remove; @@ -929,7 +1000,9 @@ struct mFrame : mWidget { auto destruct() -> void override; }; +#endif +#if defined(Hiro_HexEdit) struct mHexEdit : mWidget { Declare(HexEdit) @@ -963,7 +1036,9 @@ struct mHexEdit : mWidget { unsigned rows = 16; } state; }; +#endif +#if defined(Hiro_HorizontalScroller) struct mHorizontalScroller : mWidget { Declare(HorizontalScroller) @@ -981,7 +1056,9 @@ struct mHorizontalScroller : mWidget { unsigned position = 0; } state; }; +#endif +#if defined(Hiro_HorizontalSlider) struct mHorizontalSlider : mWidget { Declare(HorizontalSlider) @@ -999,7 +1076,9 @@ struct mHorizontalSlider : mWidget { unsigned position = 0; } state; }; +#endif +#if defined(Hiro_IconView) struct mIconView : mWidget { Declare(IconView) using mObject::remove; @@ -1044,7 +1123,9 @@ struct mIconView : mWidget { auto destruct() -> void override; }; +#endif +#if defined(Hiro_IconView) struct mIconViewItem : mObject { Declare(IconViewItem) @@ -1063,7 +1144,9 @@ struct mIconViewItem : mObject { string text; } state; }; +#endif +#if defined(Hiro_Label) struct mLabel : mWidget { Declare(Label) @@ -1081,7 +1164,9 @@ struct mLabel : mWidget { double verticalAlignment = 0.5; } state; }; +#endif +#if defined(Hiro_LineEdit) struct mLineEdit : mWidget { Declare(LineEdit) @@ -1108,7 +1193,9 @@ struct mLineEdit : mWidget { string text; } state; }; +#endif +#if defined(Hiro_ListView) struct mListView : mWidget { Declare(ListView) using mObject::remove; @@ -1174,7 +1261,9 @@ struct mListView : mWidget { auto destruct() -> void override; }; +#endif +#if defined(Hiro_ListView) struct mListViewColumn : mObject { Declare(ListViewColumn) @@ -1220,7 +1309,9 @@ struct mListViewColumn : mObject { signed width = 0; } state; }; +#endif +#if defined(Hiro_ListView) struct mListViewItem : mObject { Declare(ListViewItem) @@ -1244,7 +1335,9 @@ struct mListViewItem : mObject { lstring text; } state; }; +#endif +#if defined(Hiro_ProgressBar) struct mProgressBar : mWidget { Declare(ProgressBar) @@ -1256,7 +1349,9 @@ struct mProgressBar : mWidget { unsigned position = 0; } state; }; +#endif +#if defined(Hiro_RadioButton) struct mRadioButton : mWidget { Declare(RadioButton) @@ -1286,7 +1381,9 @@ struct mRadioButton : mWidget { string text; } state; }; +#endif +#if defined(Hiro_RadioLabel) struct mRadioLabel : mWidget { Declare(RadioLabel) @@ -1307,7 +1404,9 @@ struct mRadioLabel : mWidget { string text; } state; }; +#endif +#if defined(Hiro_SourceEdit) struct mSourceEdit : mWidget { Declare(SourceEdit) @@ -1330,7 +1429,9 @@ struct mSourceEdit : mWidget { string text; } state; }; +#endif +#if defined(Hiro_TabFrame) struct mTabFrame : mWidget { Declare(TabFrame) using mObject::remove; @@ -1364,7 +1465,9 @@ struct mTabFrame : mWidget { auto destruct() -> void override; }; +#endif +#if defined(Hiro_TabFrame) struct mTabFrameItem : mObject { Declare(TabFrameItem) @@ -1396,7 +1499,9 @@ struct mTabFrameItem : mObject { auto destruct() -> void override; }; +#endif +#if defined(Hiro_TextEdit) struct mTextEdit : mWidget { Declare(TextEdit) @@ -1429,7 +1534,9 @@ struct mTextEdit : mWidget { bool wordWrap = true; } state; }; +#endif +#if defined(Hiro_TreeView) struct mTreeView : mWidget { Declare(TreeView) using mObject::remove; @@ -1472,7 +1579,9 @@ struct mTreeView : mWidget { auto destruct() -> void override; }; +#endif +#if defined(Hiro_TreeView) struct mTreeViewItem : mObject { Declare(TreeViewItem) @@ -1502,7 +1611,9 @@ struct mTreeViewItem : mObject { auto destruct() -> void override; }; +#endif +#if defined(Hiro_VerticalScroller) struct mVerticalScroller : mWidget { Declare(VerticalScroller) @@ -1520,7 +1631,9 @@ struct mVerticalScroller : mWidget { unsigned position = 0; } state; }; +#endif +#if defined(Hiro_VerticalSlider) struct mVerticalSlider : mWidget { Declare(VerticalSlider) @@ -1538,7 +1651,9 @@ struct mVerticalSlider : mWidget { unsigned position = 0; } state; }; +#endif +#if defined(Hiro_Viewport) struct mViewport : mWidget { Declare(Viewport) @@ -1566,6 +1681,7 @@ struct mViewport : mWidget { function onMouseRelease; } state; }; +#endif #undef Declare diff --git a/hiro/core/desktop.cpp b/hiro/core/desktop.cpp index f8981629..9e330600 100644 --- a/hiro/core/desktop.cpp +++ b/hiro/core/desktop.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Desktop) + auto Desktop::size() -> Size { return pDesktop::size(); } @@ -5,3 +7,5 @@ auto Desktop::size() -> Size { auto Desktop::workspace() -> Geometry { return pDesktop::workspace(); } + +#endif diff --git a/hiro/core/font.cpp b/hiro/core/font.cpp index 0ca2deaf..d4274653 100644 --- a/hiro/core/font.cpp +++ b/hiro/core/font.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Font) + auto Font::serif(unsigned size, const string& style) -> string { return pFont::serif(size, style); } @@ -13,3 +15,5 @@ auto Font::monospace(unsigned size, const string& style) -> string { auto Font::size(const string& font, const string& text) -> Size { return pFont::size(font, text); } + +#endif diff --git a/hiro/core/geometry.cpp b/hiro/core/geometry.cpp index 21cd32f5..6a2d320d 100644 --- a/hiro/core/geometry.cpp +++ b/hiro/core/geometry.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Geometry) + Geometry::Geometry() { setGeometry(0, 0, 0, 0); } @@ -110,3 +112,5 @@ auto Geometry::x() const -> signed { auto Geometry::y() const -> signed { return state.y; } + +#endif diff --git a/hiro/core/hotkey.cpp b/hiro/core/hotkey.cpp index 432fa659..80c8b2c3 100644 --- a/hiro/core/hotkey.cpp +++ b/hiro/core/hotkey.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Hotkey) + auto mHotkey::allocate() -> pObject* { return new pHotkey(*this); } @@ -51,3 +53,5 @@ auto mHotkey::setSequence(const string& sequence) -> type& { } return *this; } + +#endif diff --git a/hiro/core/keyboard.cpp b/hiro/core/keyboard.cpp index 4ab5d1ff..ea595fcb 100644 --- a/hiro/core/keyboard.cpp +++ b/hiro/core/keyboard.cpp @@ -1,3 +1,7 @@ +#if defined(Hiro_Keyboard) + +Keyboard::State Keyboard::state; + const vector Keyboard::keys = { //physical keyboard buttons "Escape", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12", @@ -72,3 +76,5 @@ auto Keyboard::remove(sHotkey hotkey) -> void { state.hotkeys.remove(*offset); } } + +#endif diff --git a/hiro/core/layout.cpp b/hiro/core/layout.cpp index 73a66996..6dc57baf 100644 --- a/hiro/core/layout.cpp +++ b/hiro/core/layout.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Layout) + auto mLayout::allocate() -> pObject* { return new pLayout(*this); } @@ -17,7 +19,9 @@ auto mLayout::append(shared_pointer sizable) -> type& { } auto mLayout::remove() -> type& { + #if defined(Hiro_TabFrame) if(auto tabFrameItem = parentTabFrameItem()) tabFrameItem->remove(tabFrameItem->layout()); + #endif if(auto layout = parentLayout()) layout->remove(layout->sizable(offset())); if(auto window = parentWindow()) window->remove(window->layout()); setParent(); @@ -56,3 +60,5 @@ auto mLayout::sizable(unsigned position) const -> shared_pointer { auto mLayout::sizables() const -> unsigned { return state.sizables.size(); } + +#endif diff --git a/hiro/core/menu-bar.cpp b/hiro/core/menu-bar.cpp index c8559ddc..48121714 100644 --- a/hiro/core/menu-bar.cpp +++ b/hiro/core/menu-bar.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_MenuBar) + auto mMenuBar::allocate() -> pObject* { return new pMenuBar(*this); } @@ -45,3 +47,5 @@ auto mMenuBar::reset() -> type& { while(state.menus) remove(state.menus.last()); return *this; } + +#endif diff --git a/hiro/core/message-window.cpp b/hiro/core/message-window.cpp index 287e336d..1b238a35 100644 --- a/hiro/core/message-window.cpp +++ b/hiro/core/message-window.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_MessageWindow) + MessageWindow::MessageWindow(const string& text) { state.text = text; } @@ -36,3 +38,5 @@ auto MessageWindow::warning(MessageWindow::Buttons buttons) -> Response { state.buttons = buttons; return pMessageWindow::warning(state); } + +#endif diff --git a/hiro/core/monitor.cpp b/hiro/core/monitor.cpp index 6ca1984a..e4f07694 100644 --- a/hiro/core/monitor.cpp +++ b/hiro/core/monitor.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Monitor) + auto Monitor::count() -> unsigned { return pMonitor::count(); } @@ -9,3 +11,5 @@ auto Monitor::geometry(unsigned monitor) -> Geometry { auto Monitor::primary() -> unsigned { return pMonitor::primary(); } + +#endif diff --git a/hiro/core/mouse.cpp b/hiro/core/mouse.cpp index 49fe1574..7042d9d5 100644 --- a/hiro/core/mouse.cpp +++ b/hiro/core/mouse.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Mouse) + auto Mouse::position() -> Position { return pMouse::position(); } @@ -9,3 +11,5 @@ auto Mouse::pressed(Mouse::Button button) -> bool { auto Mouse::released(Mouse::Button button) -> bool { return !pressed(button); } + +#endif diff --git a/hiro/core/object.cpp b/hiro/core/object.cpp index 3b97fe28..bfae31f3 100644 --- a/hiro/core/object.cpp +++ b/hiro/core/object.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Object) + mObject::mObject() { Application::initialize(); } @@ -30,7 +32,9 @@ auto mObject::destruct() -> void { //otherwise, the pObject is not allocated until it is attached to a non-abstract parent auto mObject::abstract() const -> bool { if(dynamic_cast(this)) return false; + #if defined(Hiro_PopupMenu) if(dynamic_cast(this)) return false; + #endif if(auto object = parent()) return object->abstract(); return true; } @@ -65,6 +69,7 @@ auto mObject::parent() const -> mObject* { return state.parent; } +#if defined(Hiro_ComboButton) auto mObject::parentComboButton(bool recursive) const -> mComboButton* { if(auto comboButton = dynamic_cast(parent())) return comboButton; if(recursive) { @@ -72,7 +77,9 @@ auto mObject::parentComboButton(bool recursive) const -> mComboButton* { } return nullptr; } +#endif +#if defined(Hiro_Frame) auto mObject::parentFrame(bool recursive) const -> mFrame* { if(auto frame = dynamic_cast(parent())) return frame; if(recursive) { @@ -80,7 +87,9 @@ auto mObject::parentFrame(bool recursive) const -> mFrame* { } return nullptr; } +#endif +#if defined(Hiro_IconView) auto mObject::parentIconView(bool recursive) const -> mIconView* { if(auto iconView = dynamic_cast(parent())) return iconView; if(recursive) { @@ -88,7 +97,9 @@ auto mObject::parentIconView(bool recursive) const -> mIconView* { } return nullptr; } +#endif +#if defined(Hiro_Layout) auto mObject::parentLayout(bool recursive) const -> mLayout* { if(auto layout = dynamic_cast(parent())) return layout; if(recursive) { @@ -96,7 +107,9 @@ auto mObject::parentLayout(bool recursive) const -> mLayout* { } return nullptr; } +#endif +#if defined(Hiro_ListView) auto mObject::parentListView(bool recursive) const -> mListView* { if(auto listView = dynamic_cast(parent())) return listView; if(recursive) { @@ -104,7 +117,9 @@ auto mObject::parentListView(bool recursive) const -> mListView* { } return nullptr; } +#endif +#if defined(Hiro_Menu) auto mObject::parentMenu(bool recursive) const -> mMenu* { if(auto menu = dynamic_cast(parent())) return menu; if(recursive) { @@ -112,7 +127,9 @@ auto mObject::parentMenu(bool recursive) const -> mMenu* { } return nullptr; } +#endif +#if defined(Hiro_MenuBar) auto mObject::parentMenuBar(bool recursive) const -> mMenuBar* { if(auto menuBar = dynamic_cast(parent())) return menuBar; if(recursive) { @@ -120,7 +137,9 @@ auto mObject::parentMenuBar(bool recursive) const -> mMenuBar* { } return nullptr; } +#endif +#if defined(Hiro_PopupMenu) auto mObject::parentPopupMenu(bool recursive) const -> mPopupMenu* { if(auto popupMenu = dynamic_cast(parent())) return popupMenu; if(recursive) { @@ -128,7 +147,9 @@ auto mObject::parentPopupMenu(bool recursive) const -> mPopupMenu* { } return nullptr; } +#endif +#if defined(Hiro_Sizable) auto mObject::parentSizable(bool recursive) const -> mSizable* { if(auto sizable = dynamic_cast(parent())) return sizable; if(recursive) { @@ -136,7 +157,9 @@ auto mObject::parentSizable(bool recursive) const -> mSizable* { } return nullptr; } +#endif +#if defined(Hiro_TabFrame) auto mObject::parentTabFrame(bool recursive) const -> mTabFrame* { if(auto tabFrame = dynamic_cast(parent())) return tabFrame; if(recursive) { @@ -144,7 +167,9 @@ auto mObject::parentTabFrame(bool recursive) const -> mTabFrame* { } return nullptr; } +#endif +#if defined(Hiro_TabFrame) auto mObject::parentTabFrameItem(bool recursive) const -> mTabFrameItem* { if(auto tabFrameItem = dynamic_cast(parent())) return tabFrameItem; if(recursive) { @@ -152,7 +177,9 @@ auto mObject::parentTabFrameItem(bool recursive) const -> mTabFrameItem* { } return nullptr; } +#endif +#if defined(Hiro_TreeView) auto mObject::parentTreeView(bool recursive) const -> mTreeView* { if(auto treeView = dynamic_cast(parent())) return treeView; if(recursive) { @@ -160,7 +187,9 @@ auto mObject::parentTreeView(bool recursive) const -> mTreeView* { } return nullptr; } +#endif +#if defined(Hiro_TreeView) auto mObject::parentTreeViewItem(bool recursive) const -> mTreeViewItem* { if(auto treeViewItem = dynamic_cast(parent())) return treeViewItem; if(recursive) { @@ -168,7 +197,9 @@ auto mObject::parentTreeViewItem(bool recursive) const -> mTreeViewItem* { } return nullptr; } +#endif +#if defined(Hiro_Widget) auto mObject::parentWidget(bool recursive) const -> mWidget* { if(auto widget = dynamic_cast(parent())) return widget; if(recursive) { @@ -176,7 +207,9 @@ auto mObject::parentWidget(bool recursive) const -> mWidget* { } return nullptr; } +#endif +#if defined(Hiro_Window) auto mObject::parentWindow(bool recursive) const -> mWindow* { if(auto window = dynamic_cast(parent())) return window; if(recursive) { @@ -184,6 +217,7 @@ auto mObject::parentWindow(bool recursive) const -> mWindow* { } return nullptr; } +#endif auto mObject::remove() -> type& { signal(remove); @@ -231,3 +265,5 @@ auto mObject::visible(bool recursive) const -> bool { if(auto object = parent()) return object->visible(true); return true; } + +#endif diff --git a/hiro/core/popup-menu.cpp b/hiro/core/popup-menu.cpp index 6e74fd7f..0499b8df 100644 --- a/hiro/core/popup-menu.cpp +++ b/hiro/core/popup-menu.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_PopupMenu) + auto mPopupMenu::allocate() -> pObject* { return new pPopupMenu(*this); } @@ -45,3 +47,5 @@ auto mPopupMenu::setVisible(bool visible) -> type& { signal(setVisible, visible); return *this; } + +#endif diff --git a/hiro/core/position.cpp b/hiro/core/position.cpp index f878fc01..8d5dc744 100644 --- a/hiro/core/position.cpp +++ b/hiro/core/position.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Position) + Position::Position() { setPosition(0, 0); } @@ -41,3 +43,5 @@ auto Position::x() const -> signed { auto Position::y() const -> signed { return state.y; } + +#endif diff --git a/hiro/core/sizable.cpp b/hiro/core/sizable.cpp index 210226fd..b0a66c43 100644 --- a/hiro/core/sizable.cpp +++ b/hiro/core/sizable.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Sizable) + auto mSizable::allocate() -> pObject* { return new pSizable(*this); } @@ -15,3 +17,5 @@ auto mSizable::setGeometry(Geometry geometry) -> type& { signal(setGeometry, geometry); return *this; } + +#endif diff --git a/hiro/core/size.cpp b/hiro/core/size.cpp index 950189b4..bbf79efc 100644 --- a/hiro/core/size.cpp +++ b/hiro/core/size.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Size) + Size::Size() { setSize(0, 0); } @@ -41,3 +43,5 @@ auto Size::setWidth(signed width) -> type& { auto Size::width() const -> signed { return state.width; } + +#endif diff --git a/hiro/core/status-bar.cpp b/hiro/core/status-bar.cpp index 2f5cf46b..5f8e7974 100644 --- a/hiro/core/status-bar.cpp +++ b/hiro/core/status-bar.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_StatusBar) + auto mStatusBar::allocate() -> pObject* { return new pStatusBar(*this); } @@ -18,3 +20,5 @@ auto mStatusBar::setText(const string& text) -> type& { auto mStatusBar::text() const -> string { return state.text; } + +#endif diff --git a/hiro/core/timer.cpp b/hiro/core/timer.cpp index e8488c5e..1278cfb1 100644 --- a/hiro/core/timer.cpp +++ b/hiro/core/timer.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Timer) + auto mTimer::allocate() -> pObject* { return new pTimer(*this); } @@ -22,3 +24,5 @@ auto mTimer::setInterval(unsigned interval) -> type& { signal(setInterval, interval); return *this; } + +#endif diff --git a/hiro/core/widget/button.cpp b/hiro/core/widget/button.cpp index 6382bf0f..5240de13 100644 --- a/hiro/core/widget/button.cpp +++ b/hiro/core/widget/button.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Button) + auto mButton::allocate() -> pObject* { return new pButton(*this); } @@ -52,3 +54,5 @@ auto mButton::setText(const string& text) -> type& { auto mButton::text() const -> string { return state.text; } + +#endif diff --git a/hiro/core/widget/canvas.cpp b/hiro/core/widget/canvas.cpp index 4499e0e1..ef5e279d 100644 --- a/hiro/core/widget/canvas.cpp +++ b/hiro/core/widget/canvas.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Canvas) + auto mCanvas::allocate() -> pObject* { return new pCanvas(*this); } @@ -123,3 +125,5 @@ auto mCanvas::update() -> type& { signal(update); return *this; } + +#endif diff --git a/hiro/core/widget/check-button.cpp b/hiro/core/widget/check-button.cpp index 16411d80..65759c6d 100644 --- a/hiro/core/widget/check-button.cpp +++ b/hiro/core/widget/check-button.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_CheckButton) + auto mCheckButton::allocate() -> pObject* { return new pCheckButton(*this); } @@ -62,3 +64,5 @@ auto mCheckButton::setText(const string& text) -> type& { auto mCheckButton::text() const -> string { return state.text; } + +#endif diff --git a/hiro/core/widget/check-label.cpp b/hiro/core/widget/check-label.cpp index 7f072545..3ff75c44 100644 --- a/hiro/core/widget/check-label.cpp +++ b/hiro/core/widget/check-label.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_CheckLabel) + auto mCheckLabel::allocate() -> pObject* { return new pCheckLabel(*this); } @@ -32,3 +34,5 @@ auto mCheckLabel::setText(const string& text) -> type& { auto mCheckLabel::text() const -> string { return state.text; } + +#endif diff --git a/hiro/core/widget/combo-button-item.cpp b/hiro/core/widget/combo-button-item.cpp index e2b7422b..fdccca62 100644 --- a/hiro/core/widget/combo-button-item.cpp +++ b/hiro/core/widget/combo-button-item.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_ComboButton) + auto mComboButtonItem::allocate() -> pObject* { return new pComboButtonItem(*this); } @@ -41,3 +43,5 @@ auto mComboButtonItem::setText(const string& text) -> type& { auto mComboButtonItem::text() const -> string { return state.text; } + +#endif diff --git a/hiro/core/widget/combo-button.cpp b/hiro/core/widget/combo-button.cpp index daf3f68a..8cff5e23 100644 --- a/hiro/core/widget/combo-button.cpp +++ b/hiro/core/widget/combo-button.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_ComboButton) + auto mComboButton::allocate() -> pObject* { return new pComboButton(*this); } @@ -59,3 +61,5 @@ auto mComboButton::selected() const -> sComboButtonItem { if(state.selected >= 0) return state.items[state.selected]; return {}; } + +#endif diff --git a/hiro/core/widget/console.cpp b/hiro/core/widget/console.cpp index 2db0408c..5678f0b6 100644 --- a/hiro/core/widget/console.cpp +++ b/hiro/core/widget/console.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Console) + auto mConsole::allocate() -> pObject* { return new pConsole(*this); } @@ -52,3 +54,5 @@ auto mConsole::setPrompt(const string& prompt) -> type& { signal(setPrompt, prompt); return *this; } + +#endif diff --git a/hiro/core/widget/frame.cpp b/hiro/core/widget/frame.cpp index b6abe85c..eed50a3b 100644 --- a/hiro/core/widget/frame.cpp +++ b/hiro/core/widget/frame.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Frame) + auto mFrame::allocate() -> pObject* { return new pFrame(*this); } @@ -40,3 +42,5 @@ auto mFrame::setText(const string& text) -> type& { auto mFrame::text() const -> string { return state.text; } + +#endif diff --git a/hiro/core/widget/hex-edit.cpp b/hiro/core/widget/hex-edit.cpp index 3a9d5a10..2267a4bd 100644 --- a/hiro/core/widget/hex-edit.cpp +++ b/hiro/core/widget/hex-edit.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_HexEdit) + auto mHexEdit::allocate() -> pObject* { return new pHexEdit(*this); } @@ -87,3 +89,5 @@ auto mHexEdit::update() -> type& { signal(update); return *this; } + +#endif diff --git a/hiro/core/widget/horizontal-scroller.cpp b/hiro/core/widget/horizontal-scroller.cpp index 6af6856e..a730d5fa 100644 --- a/hiro/core/widget/horizontal-scroller.cpp +++ b/hiro/core/widget/horizontal-scroller.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_HorizontalScroller) + auto mHorizontalScroller::allocate() -> pObject* { return new pHorizontalScroller(*this); } @@ -32,3 +34,5 @@ auto mHorizontalScroller::setPosition(unsigned position) -> type& { signal(setPosition, position); return *this; } + +#endif diff --git a/hiro/core/widget/horizontal-slider.cpp b/hiro/core/widget/horizontal-slider.cpp index f9a9c04d..d569dd4d 100644 --- a/hiro/core/widget/horizontal-slider.cpp +++ b/hiro/core/widget/horizontal-slider.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_HorizontalSlider) + auto mHorizontalSlider::allocate() -> pObject* { return new pHorizontalSlider(*this); } @@ -32,3 +34,5 @@ auto mHorizontalSlider::setPosition(unsigned position) -> type& { signal(setPosition, position); return *this; } + +#endif diff --git a/hiro/core/widget/icon-view-item.cpp b/hiro/core/widget/icon-view-item.cpp index db6dac33..bff5694e 100644 --- a/hiro/core/widget/icon-view-item.cpp +++ b/hiro/core/widget/icon-view-item.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_IconView) + auto mIconViewItem::allocate() -> pObject* { return new pIconViewItem(*this); } @@ -38,3 +40,5 @@ auto mIconViewItem::setText(const string& text) -> type& { auto mIconViewItem::text() const -> string { return state.text; } + +#endif diff --git a/hiro/core/widget/icon-view.cpp b/hiro/core/widget/icon-view.cpp index 283e1cc9..502757a2 100644 --- a/hiro/core/widget/icon-view.cpp +++ b/hiro/core/widget/icon-view.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_IconView) + auto mIconView::allocate() -> pObject* { return new pIconView(*this); } @@ -146,3 +148,5 @@ auto mIconView::setSelected(const vector& selections) -> type& { signal(setItemSelected, selections); return *this; } + +#endif diff --git a/hiro/core/widget/label.cpp b/hiro/core/widget/label.cpp index d0e2df91..31e1f7ed 100644 --- a/hiro/core/widget/label.cpp +++ b/hiro/core/widget/label.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Label) + auto mLabel::allocate() -> pObject* { return new pLabel(*this); } @@ -35,3 +37,5 @@ auto mLabel::text() const -> string { auto mLabel::verticalAlignment() const -> double { return state.verticalAlignment; } + +#endif diff --git a/hiro/core/widget/line-edit.cpp b/hiro/core/widget/line-edit.cpp index 96672fe5..82bc4358 100644 --- a/hiro/core/widget/line-edit.cpp +++ b/hiro/core/widget/line-edit.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_LineEdit) + auto mLineEdit::allocate() -> pObject* { return new pLineEdit(*this); } @@ -61,3 +63,5 @@ auto mLineEdit::setText(const string& text) -> type& { auto mLineEdit::text() const -> string { return state.text; } + +#endif diff --git a/hiro/core/widget/list-view-column.cpp b/hiro/core/widget/list-view-column.cpp index cb180748..8b8731c7 100644 --- a/hiro/core/widget/list-view-column.cpp +++ b/hiro/core/widget/list-view-column.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_ListView) + auto mListViewColumn::allocate() -> pObject* { return new pListViewColumn(*this); } @@ -133,3 +135,5 @@ auto mListViewColumn::verticalAlignment() const -> double { auto mListViewColumn::width() const -> signed { return state.width; } + +#endif diff --git a/hiro/core/widget/list-view-item.cpp b/hiro/core/widget/list-view-item.cpp index bdc5ad88..22796174 100644 --- a/hiro/core/widget/list-view-item.cpp +++ b/hiro/core/widget/list-view-item.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_ListView) + auto mListViewItem::allocate() -> pObject* { return new pListViewItem(*this); } @@ -63,3 +65,5 @@ auto mListViewItem::setText(unsigned column, const string& text) -> type& { auto mListViewItem::text(unsigned column) const -> string { return state.text(column, ""); } + +#endif diff --git a/hiro/core/widget/list-view.cpp b/hiro/core/widget/list-view.cpp index 7c9e915d..8473c1bd 100644 --- a/hiro/core/widget/list-view.cpp +++ b/hiro/core/widget/list-view.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_ListView) + auto mListView::allocate() -> pObject* { return new pListView(*this); } @@ -226,3 +228,5 @@ auto mListView::setSelected(bool selected) -> type& { signal(setSelected, selected); return *this; } + +#endif diff --git a/hiro/core/widget/progress-bar.cpp b/hiro/core/widget/progress-bar.cpp index 726cfaec..d55b203a 100644 --- a/hiro/core/widget/progress-bar.cpp +++ b/hiro/core/widget/progress-bar.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_ProgressBar) + auto mProgressBar::allocate() -> pObject* { return new pProgressBar(*this); } @@ -13,3 +15,5 @@ auto mProgressBar::setPosition(unsigned position) -> type& { signal(setPosition, position); return *this; } + +#endif diff --git a/hiro/core/widget/radio-button.cpp b/hiro/core/widget/radio-button.cpp index cf64cfd8..95dcf421 100644 --- a/hiro/core/widget/radio-button.cpp +++ b/hiro/core/widget/radio-button.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_RadioButton) + auto mRadioButton::allocate() -> pObject* { return new pRadioButton(*this); } @@ -79,3 +81,5 @@ auto mRadioButton::setText(const string& text) -> type& { auto mRadioButton::text() const -> string { return state.text; } + +#endif diff --git a/hiro/core/widget/radio-label.cpp b/hiro/core/widget/radio-label.cpp index 9142643f..3de2b91a 100644 --- a/hiro/core/widget/radio-label.cpp +++ b/hiro/core/widget/radio-label.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_RadioLabel) + auto mRadioLabel::allocate() -> pObject* { return new pRadioLabel(*this); } @@ -49,3 +51,5 @@ auto mRadioLabel::setText(const string& text) -> type& { auto mRadioLabel::text() const -> string { return state.text; } + +#endif diff --git a/hiro/core/widget/source-edit.cpp b/hiro/core/widget/source-edit.cpp index d9dd0f8e..2406d8f9 100644 --- a/hiro/core/widget/source-edit.cpp +++ b/hiro/core/widget/source-edit.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_SourceEdit) + auto mSourceEdit::allocate() -> pObject* { return new pSourceEdit(*this); } @@ -50,3 +52,5 @@ auto mSourceEdit::setText(const string& text) -> type& { auto mSourceEdit::text() const -> string { return signal(text); } + +#endif diff --git a/hiro/core/widget/tab-frame-item.cpp b/hiro/core/widget/tab-frame-item.cpp index 0eae926a..2a885cd7 100644 --- a/hiro/core/widget/tab-frame-item.cpp +++ b/hiro/core/widget/tab-frame-item.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_TabFrame) + auto mTabFrameItem::allocate() -> pObject* { return new pTabFrameItem(*this); } @@ -93,3 +95,5 @@ auto mTabFrameItem::setText(const string& text) -> type& { auto mTabFrameItem::text() const -> string { return state.text; } + +#endif diff --git a/hiro/core/widget/tab-frame.cpp b/hiro/core/widget/tab-frame.cpp index c50ff819..65b5af12 100644 --- a/hiro/core/widget/tab-frame.cpp +++ b/hiro/core/widget/tab-frame.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_TabFrame) + auto mTabFrame::allocate() -> pObject* { return new pTabFrame(*this); } @@ -88,3 +90,5 @@ auto mTabFrame::setParent(mObject* parent, signed offset) -> type& { for(auto& item : state.items) item->setParent(this, item->offset()); return *this; } + +#endif diff --git a/hiro/core/widget/text-edit.cpp b/hiro/core/widget/text-edit.cpp index ae0982b4..7db7f016 100644 --- a/hiro/core/widget/text-edit.cpp +++ b/hiro/core/widget/text-edit.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_TextEdit) + auto mTextEdit::allocate() -> pObject* { return new pTextEdit(*this); } @@ -81,3 +83,5 @@ auto mTextEdit::text() const -> string { auto mTextEdit::wordWrap() const -> bool { return state.wordWrap; } + +#endif diff --git a/hiro/core/widget/tree-view-item.cpp b/hiro/core/widget/tree-view-item.cpp index 40995fdf..e75e783a 100644 --- a/hiro/core/widget/tree-view-item.cpp +++ b/hiro/core/widget/tree-view-item.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_TreeView) + auto mTreeViewItem::allocate() -> pObject* { return new pTreeViewItem(*this); } @@ -96,3 +98,5 @@ auto mTreeViewItem::setText(const string& text) -> type& { auto mTreeViewItem::text() const -> string { return state.text; } + +#endif diff --git a/hiro/core/widget/tree-view.cpp b/hiro/core/widget/tree-view.cpp index 217638e2..1c2738c8 100644 --- a/hiro/core/widget/tree-view.cpp +++ b/hiro/core/widget/tree-view.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_TreeView) + auto mTreeView::allocate() -> pObject* { return new pTreeView(*this); } @@ -126,3 +128,5 @@ auto mTreeView::setForegroundColor(Color color) -> type& { signal(setForegroundColor, color); return *this; } + +#endif diff --git a/hiro/core/widget/vertical-scroller.cpp b/hiro/core/widget/vertical-scroller.cpp index fb7f41ad..7792d10b 100644 --- a/hiro/core/widget/vertical-scroller.cpp +++ b/hiro/core/widget/vertical-scroller.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_VerticalScroller) + auto mVerticalScroller::allocate() -> pObject* { return new pVerticalScroller(*this); } @@ -32,3 +34,5 @@ auto mVerticalScroller::setPosition(unsigned position) -> type& { signal(setPosition, position); return *this; } + +#endif diff --git a/hiro/core/widget/vertical-slider.cpp b/hiro/core/widget/vertical-slider.cpp index e9f51a8c..982cb1b5 100644 --- a/hiro/core/widget/vertical-slider.cpp +++ b/hiro/core/widget/vertical-slider.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_VerticalSlider) + auto mVerticalSlider::allocate() -> pObject* { return new pVerticalSlider(*this); } @@ -32,3 +34,5 @@ auto mVerticalSlider::setPosition(unsigned position) -> type& { signal(setPosition, position); return *this; } + +#endif diff --git a/hiro/core/widget/viewport.cpp b/hiro/core/widget/viewport.cpp index b60ec9d9..7962697a 100644 --- a/hiro/core/widget/viewport.cpp +++ b/hiro/core/widget/viewport.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Viewport) + auto mViewport::allocate() -> pObject* { return new pViewport(*this); } @@ -62,3 +64,5 @@ auto mViewport::setDroppable(bool droppable) -> type& { signal(setDroppable, droppable); return *this; } + +#endif diff --git a/hiro/core/widget/widget.cpp b/hiro/core/widget/widget.cpp index 599fdac4..901956ac 100644 --- a/hiro/core/widget/widget.cpp +++ b/hiro/core/widget/widget.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Widget) + auto mWidget::allocate() -> pObject* { return new pWidget(*this); } @@ -18,3 +20,5 @@ auto mWidget::remove() -> type& { setParent(); return *this; } + +#endif diff --git a/hiro/core/window.cpp b/hiro/core/window.cpp index 389f0c6f..e020c0fb 100644 --- a/hiro/core/window.cpp +++ b/hiro/core/window.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Window) + auto mWindow::allocate() -> pObject* { return new pWindow(*this); } @@ -280,3 +282,5 @@ auto mWindow::statusBar() const -> shared_pointer { auto mWindow::title() const -> string { return state.title; } + +#endif diff --git a/hiro/extension/browser-dialog.cpp b/hiro/extension/browser-dialog.cpp index 232cb2b6..1cc98bac 100644 --- a/hiro/extension/browser-dialog.cpp +++ b/hiro/extension/browser-dialog.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_BrowserDialog) + struct BrowserDialogWindow { BrowserDialogWindow(BrowserDialog::State& state) : state(state) {} auto accept() -> void; @@ -229,3 +231,5 @@ auto BrowserDialog::_run() -> lstring { if(!state.path) state.path = userpath(); return BrowserDialogWindow(state).run(); } + +#endif diff --git a/hiro/extension/browser-dialog.hpp b/hiro/extension/browser-dialog.hpp index 510ab697..0f86b128 100644 --- a/hiro/extension/browser-dialog.hpp +++ b/hiro/extension/browser-dialog.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_BrowserDialog) + struct BrowserDialogWindow; struct BrowserDialog { @@ -27,3 +29,5 @@ private: friend class BrowserDialogWindow; }; + +#endif diff --git a/hiro/extension/fixed-layout.cpp b/hiro/extension/fixed-layout.cpp index bb976269..0b11f0b4 100644 --- a/hiro/extension/fixed-layout.cpp +++ b/hiro/extension/fixed-layout.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_FixedLayout) + auto mFixedLayout::append(shared_pointer sizable, Geometry geometry) -> type& { properties.append({geometry}); mLayout::append(sizable); @@ -49,3 +51,5 @@ auto mFixedLayout::setVisible(bool visible) -> type& { } return *this; } + +#endif diff --git a/hiro/extension/fixed-layout.hpp b/hiro/extension/fixed-layout.hpp index 37f50ada..9b9a6da1 100644 --- a/hiro/extension/fixed-layout.hpp +++ b/hiro/extension/fixed-layout.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_FixedLayout) + struct mFixedLayout : mLayout { using type = mFixedLayout; using mLayout::append; @@ -16,3 +18,5 @@ struct mFixedLayout : mLayout { }; nall::vector properties; }; + +#endif diff --git a/hiro/extension/horizontal-layout.cpp b/hiro/extension/horizontal-layout.cpp index 4d50d4c5..4848a017 100644 --- a/hiro/extension/horizontal-layout.cpp +++ b/hiro/extension/horizontal-layout.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_HorizontalLayout) + auto mHorizontalLayout::append(shared_pointer sizable, Size size, signed spacing) -> type& { properties.append({size.width(), size.height(), spacing < 0 ? settings.spacing : spacing}); mLayout::append(sizable); @@ -123,3 +125,5 @@ auto mHorizontalLayout::setVisible(bool visible) -> type& { } return *this; } + +#endif diff --git a/hiro/extension/horizontal-layout.hpp b/hiro/extension/horizontal-layout.hpp index 9a941dc2..5269f755 100644 --- a/hiro/extension/horizontal-layout.hpp +++ b/hiro/extension/horizontal-layout.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_HorizontalLayout) + struct mHorizontalLayout : mLayout { using type = mHorizontalLayout; using mLayout::append; @@ -28,3 +30,5 @@ struct mHorizontalLayout : mLayout { }; nall::vector properties; }; + +#endif diff --git a/hiro/extension/message-dialog.cpp b/hiro/extension/message-dialog.cpp index 2745e37a..e936bd82 100644 --- a/hiro/extension/message-dialog.cpp +++ b/hiro/extension/message-dialog.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_MessageDialog) + MessageDialog::MessageDialog(const string& text) { state.text = text; } @@ -75,3 +77,5 @@ auto MessageDialog::_run() -> signed { return state.response; } + +#endif diff --git a/hiro/extension/message-dialog.hpp b/hiro/extension/message-dialog.hpp index 0f3627c2..b1b9006e 100644 --- a/hiro/extension/message-dialog.hpp +++ b/hiro/extension/message-dialog.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_MessageDialog) + struct MessageDialog { using type = MessageDialog; @@ -22,3 +24,5 @@ private: auto _run() -> signed; }; + +#endif diff --git a/hiro/extension/shared.hpp b/hiro/extension/shared.hpp index 73d065f4..ef817996 100644 --- a/hiro/extension/shared.hpp +++ b/hiro/extension/shared.hpp @@ -45,10 +45,13 @@ auto doSize() const -> void { return self().doSize(); } \ auto onSize(const function& function = {}) -> type& { return self().onSize(function), *this; } \ +#if defined(Hiro_Object) struct Object : sObject { DeclareObject(Object) }; +#endif +#if defined(Hiro_Hotkey) struct Hotkey : sHotkey { DeclareObject(Hotkey) @@ -61,7 +64,9 @@ struct Hotkey : sHotkey { auto setParent(sObject object) -> type& { return self().setParent(object), *this; } auto setSequence(const string& sequence = "") -> type& { return self().setSequence(sequence), *this; } }; +#endif +#if defined(Hiro_Timer) struct Timer : sTimer { DeclareObject(Timer) @@ -70,7 +75,9 @@ struct Timer : sTimer { auto onActivate(const function& function = {}) -> type& { return self().onActivate(function), *this; } auto setInterval(unsigned interval = 0) -> type& { return self().setInterval(interval), *this; } }; +#endif +#if defined(Hiro_Window) struct Window : sWindow { DeclareObject(Window) @@ -120,14 +127,18 @@ struct Window : sWindow { auto statusBar() const -> sStatusBar { return self().statusBar(); } auto title() const -> string { return self().title(); } }; +#endif +#if defined(Hiro_StatusBar) struct StatusBar : sStatusBar { DeclareObject(StatusBar) auto setText(const string& text = "") -> type& { return self().setText(text), *this; } auto text() const -> string { return self().text(); } }; +#endif +#if defined(Hiro_MenuBar) struct MenuBar : sMenuBar { DeclareObject(MenuBar) @@ -137,7 +148,9 @@ struct MenuBar : sMenuBar { auto remove(sMenu menu) -> type& { return self().remove(menu), *this; } auto reset() -> type& { return self().reset(), *this; } }; +#endif +#if defined(Hiro_PopupMenu) struct PopupMenu : sPopupMenu { DeclareObject(PopupMenu) @@ -147,11 +160,15 @@ struct PopupMenu : sPopupMenu { auto remove(sAction action) -> type& { return self().remove(action), *this; } auto reset() -> type& { return self().reset(), *this; } }; +#endif +#if defined(Hiro_Action) struct Action : sAction { DeclareAction(Action) }; +#endif +#if defined(Hiro_Menu) struct Menu : sMenu { DeclareAction(Menu) @@ -165,11 +182,15 @@ struct Menu : sMenu { auto setText(const string& text = "") -> type& { return self().setText(text), *this; } auto text() const -> string { return self().text(); } }; +#endif +#if defined(Hiro_MenuSeparator) struct MenuSeparator : sMenuSeparator { DeclareAction(MenuSeparator) }; +#endif +#if defined(Hiro_MenuItem) struct MenuItem : sMenuItem { DeclareAction(MenuItem) @@ -180,7 +201,9 @@ struct MenuItem : sMenuItem { auto setText(const string& text = "") -> type& { return self().setText(text), *this; } auto text() const -> string { return self().text(); } }; +#endif +#if defined(Hiro_MenuCheckItem) struct MenuCheckItem : sMenuCheckItem { DeclareAction(MenuCheckItem) @@ -191,7 +214,9 @@ struct MenuCheckItem : sMenuCheckItem { auto setText(const string& text = "") -> type& { return self().setText(text), *this; } auto text() const -> string { return self().text(); } }; +#endif +#if defined(Hiro_MenuRadioItem) struct MenuRadioItem : sMenuRadioItem { DeclareAction(MenuRadioItem) @@ -202,21 +227,33 @@ struct MenuRadioItem : sMenuRadioItem { auto setText(const string& text = "") -> type& { return self().setText(text), *this; } auto text() const -> string { return self().text(); } - static auto group(const vector& group) -> void { return mMenuRadioItem::group(group); } + static auto group(const vector& group) -> void { + vector items; + for(auto& item : group) items.append(item); + return mMenuRadioItem::group(items); + } }; +#endif +#if defined(Hiro_Sizable) struct Sizable : sSizable { DeclareSizable(Sizable) }; +#endif +#if defined(Hiro_Layout) struct Layout : sLayout { DeclareLayout(Layout) }; +#endif +#if defined(Hiro_Widget) struct Widget : sWidget { DeclareWidget(Widget) }; +#endif +#if defined(Hiro_Button) struct Button : sButton { DeclareWidget(Button) @@ -231,7 +268,9 @@ struct Button : sButton { auto setText(const string& text = "") -> type& { return self().setText(text), *this; } auto text() const -> string { return self().text(); } }; +#endif +#if defined(Hiro_Canvas) struct Canvas : sCanvas { DeclareWidget(Canvas) @@ -260,7 +299,9 @@ struct Canvas : sCanvas { auto size() const -> Size { return self().size(); } auto update() -> type& { return self().update(), *this; } }; +#endif +#if defined(Hiro_CheckButton) struct CheckButton : sCheckButton { DeclareWidget(CheckButton) @@ -277,7 +318,9 @@ struct CheckButton : sCheckButton { auto setText(const string& text = "") -> type& { return self().setText(text), *this; } auto text() const -> string { return self().text(); } }; +#endif +#if defined(Hiro_CheckLabel) struct CheckLabel : sCheckLabel { DeclareWidget(CheckLabel) @@ -288,7 +331,9 @@ struct CheckLabel : sCheckLabel { auto setText(const string& text = "") -> type& { return self().setText(text), *this; } auto text() const -> string { return self().text(); } }; +#endif +#if defined(Hiro_ComboButton) struct ComboButton : sComboButton { DeclareWidget(ComboButton) @@ -301,7 +346,9 @@ struct ComboButton : sComboButton { auto reset() -> type& { return self().reset(), *this; } auto selected() const -> sComboButtonItem { return self().selected(); } }; +#endif +#if defined(Hiro_ComboButton) struct ComboButtonItem : sComboButtonItem { DeclareObject(ComboButtonItem) @@ -312,7 +359,9 @@ struct ComboButtonItem : sComboButtonItem { auto setText(const string& text = "") -> type& { return self().setText(text), *this; } auto text() const -> string { return self().text(); } }; +#endif +#if defined(Hiro_Console) struct Console : sConsole { DeclareWidget(Console) @@ -327,7 +376,9 @@ struct Console : sConsole { auto setForegroundColor(Color color = {}) -> type& { return self().setForegroundColor(color), *this; } auto setPrompt(const string& prompt = "") -> type& { return self().setPrompt(prompt), *this; } }; +#endif +#if defined(Hiro_Frame) struct Frame : sFrame { DeclareWidget(Frame) @@ -338,7 +389,9 @@ struct Frame : sFrame { auto setText(const string& text = "") -> type& { return self().setText(text), *this; } auto text() const -> string { return self().text(); } }; +#endif +#if defined(Hiro_HexEdit) struct HexEdit : sHexEdit { DeclareWidget(HexEdit) @@ -360,7 +413,9 @@ struct HexEdit : sHexEdit { auto setRows(unsigned rows = 16) -> type& { return self().setRows(rows), *this; } auto update() -> type& { return self().update(), *this; } }; +#endif +#if defined(Hiro_HorizontalScroller) struct HorizontalScroller : sHorizontalScroller { DeclareWidget(HorizontalScroller) @@ -371,7 +426,9 @@ struct HorizontalScroller : sHorizontalScroller { auto setLength(unsigned length = 101) -> type& { return self().setLength(length), *this; } auto setPosition(unsigned position = 0) -> type& { return self().setPosition(position), *this; } }; +#endif +#if defined(Hiro_HorizontalSlider) struct HorizontalSlider : sHorizontalSlider { DeclareWidget(HorizontalSlider) @@ -382,7 +439,9 @@ struct HorizontalSlider : sHorizontalSlider { auto setLength(unsigned length = 101) -> type& { return self().setLength(length), *this; } auto setPosition(unsigned position = 0) -> type& { return self().setPosition(position), *this; } }; +#endif +#if defined(Hiro_IconView) struct IconView : sIconView { DeclareWidget(IconView) @@ -411,7 +470,9 @@ struct IconView : sIconView { auto setOrientation(Orientation orientation = Orientation::Horizontal) -> type& { return self().setOrientation(orientation), *this; } auto setSelected(const vector& selections) -> type& { return self().setSelected(selections), *this; } }; +#endif +#if defined(Hiro_IconView) struct IconViewItem : sIconViewItem { DeclareObject(IconViewItem) @@ -422,7 +483,9 @@ struct IconViewItem : sIconViewItem { auto setText(const string& text = "") -> type& { return self().setText(text), *this; } auto text() const -> string { return self().text(); } }; +#endif +#if defined(Hiro_Label) struct Label : sLabel { DeclareWidget(Label) @@ -433,7 +496,9 @@ struct Label : sLabel { auto text() const -> string { return self().text(); } auto verticalAlignment() const -> double { return self().verticalAlignment(); } }; +#endif +#if defined(Hiro_LineEdit) struct LineEdit : sLineEdit { DeclareWidget(LineEdit) @@ -450,7 +515,9 @@ struct LineEdit : sLineEdit { auto setText(const string& text = "") -> type& { return self().setText(text), *this; } auto text() const -> string { return self().text(); } }; +#endif +#if defined(Hiro_ListView) struct ListView : sListView { DeclareWidget(ListView) @@ -494,7 +561,9 @@ struct ListView : sListView { auto setMultiSelect(bool multiSelect = true) -> type& { return self().setMultiSelect(multiSelect), *this; } auto setSelected(bool selected = true) -> type& { return self().setSelected(selected), *this; } }; +#endif +#if defined(Hiro_ListView) struct ListViewColumn : sListViewColumn { DeclareObject(ListViewColumn) @@ -521,7 +590,9 @@ struct ListViewColumn : sListViewColumn { auto verticalAlignment() const -> double { return self().verticalAlignment(); } auto width() const -> signed { return self().width(); } }; +#endif +#if defined(Hiro_ListView) struct ListViewItem : sListViewItem { DeclareObject(ListViewItem) @@ -535,14 +606,18 @@ struct ListViewItem : sListViewItem { auto setText(unsigned column, const string& text = "") -> type& { return self().setText(column, text), *this; } auto text(unsigned column = 0) const -> string { return self().text(column); } }; +#endif +#if defined(Hiro_ProgressBar) struct ProgressBar : sProgressBar { DeclareWidget(ProgressBar) auto position() const -> unsigned { return self().position(); } auto setPosition(unsigned position = 0) -> type& { return self().setPosition(position), *this; } }; +#endif +#if defined(Hiro_RadioButton) struct RadioButton : sRadioButton { DeclareWidget(RadioButton) @@ -559,9 +634,15 @@ struct RadioButton : sRadioButton { auto setText(const string& text = "") -> type& { return self().setText(text), *this; } auto text() const -> string { return self().text(); } - static auto group(const vector& group) -> void { return mRadioButton::group(group); } + static auto group(const vector& group) -> void { + vector items; + for(auto& item : group) items.append(item); + return mRadioButton::group(items); + } }; +#endif +#if defined(Hiro_RadioLabel) struct RadioLabel : sRadioLabel { DeclareWidget(RadioLabel) @@ -572,9 +653,15 @@ struct RadioLabel : sRadioLabel { auto setText(const string& text = "") -> type& { return self().setText(text), *this; } auto text() const -> string { return self().text(); } - static auto group(const vector& group) -> void { return mRadioLabel::group(group); } + static auto group(const vector& group) -> void { + vector items; + for(auto& item : items) items.append(item); + return mRadioLabel::group(items); + } }; +#endif +#if defined(Hiro_SourceEdit) struct SourceEdit : sSourceEdit { DeclareWidget(SourceEdit) @@ -588,7 +675,9 @@ struct SourceEdit : sSourceEdit { auto setText(const string& text = "") -> type& { return self().setText(text), *this; } auto text() const -> string { return self().text(); } }; +#endif +#if defined(Hiro_TabFrame) struct TabFrame : sTabFrame { DeclareWidget(TabFrame) @@ -607,7 +696,9 @@ struct TabFrame : sTabFrame { auto selected() const -> sTabFrameItem { return self().selected(); } auto setEdge(Edge edge = Edge::Top) -> type& { return self().setEdge(edge), *this; } }; +#endif +#if defined(Hiro_TabFrame) struct TabFrameItem : sTabFrameItem { DeclareObject(TabFrameItem) @@ -626,7 +717,9 @@ struct TabFrameItem : sTabFrameItem { auto setText(const string& text = "") -> type& { return self().setText(text), *this; } auto text() const -> string { return self().text(); } }; +#endif +#if defined(Hiro_TextEdit) struct TextEdit : sTextEdit { DeclareWidget(TextEdit) @@ -647,7 +740,9 @@ struct TextEdit : sTextEdit { auto text() const -> string { return self().text(); } auto wordWrap() const -> bool { return self().wordWrap(); } }; +#endif +#if defined(Hiro_TreeView) struct TreeView : sTreeView { DeclareWidget(TreeView) @@ -674,7 +769,9 @@ struct TreeView : sTreeView { auto setCheckable(bool checkable = true) -> type& { return self().setCheckable(checkable), *this; } auto setForegroundColor(Color color = {}) -> type& { return self().setForegroundColor(color), *this; } }; +#endif +#if defined(Hiro_TreeView) struct TreeViewItem : sTreeViewItem { DeclareObject(TreeViewItem) @@ -692,7 +789,9 @@ struct TreeViewItem : sTreeViewItem { auto setText(const string& text = "") -> type& { return self().setText(text), *this; } auto text() const -> string { return self().text(); } }; +#endif +#if defined(Hiro_VerticalScroller) struct VerticalScroller : sVerticalScroller { DeclareWidget(VerticalScroller) @@ -703,7 +802,9 @@ struct VerticalScroller : sVerticalScroller { auto setLength(unsigned length = 101) -> type& { return self().setLength(length), *this; } auto setPosition(unsigned position = 0) -> type& { return self().setPosition(position), *this; } }; +#endif +#if defined(Hiro_VerticalSlider) struct VerticalSlider : sVerticalSlider { DeclareWidget(VerticalSlider) @@ -714,7 +815,9 @@ struct VerticalSlider : sVerticalSlider { auto setLength(unsigned length = 101) -> type& { return self().setLength(length), *this; } auto setPosition(unsigned position = 0) -> type& { return self().setPosition(position), *this; } }; +#endif +#if defined(Hiro_Viewport) struct Viewport : sViewport { DeclareWidget(Viewport) @@ -732,17 +835,19 @@ struct Viewport : sViewport { auto onMouseRelease(const function& function = {}) -> type& { return self().onMouseRelease(function), *this; } auto setDroppable(bool droppable = true) -> type& { return self().setDroppable(droppable), *this; } }; +#endif +#if defined(Hiro_FixedLayout) using sFixedLayout = shared_pointer; -using sHorizontalLayout = shared_pointer; -using sVerticalLayout = shared_pointer; - struct FixedLayout : sFixedLayout { DeclareLayout(FixedLayout) auto append(sSizable sizable, Geometry geometry) -> type& { return self().append(sizable, geometry), *this; } }; +#endif +#if defined(Hiro_HorizontalLayout) +using sHorizontalLayout = shared_pointer; struct HorizontalLayout : sHorizontalLayout { DeclareLayout(HorizontalLayout) @@ -751,7 +856,10 @@ struct HorizontalLayout : sHorizontalLayout { auto setMargin(signed margin = 0) -> type& { return self().setMargin(margin), *this; } auto setSpacing(signed spacing = 5) -> type& { return self().setSpacing(spacing), *this; } }; +#endif +#if defined(Hiro_VerticalLayout) +using sVerticalLayout = shared_pointer; struct VerticalLayout : sVerticalLayout { DeclareLayout(VerticalLayout) @@ -760,6 +868,7 @@ struct VerticalLayout : sVerticalLayout { auto setMargin(signed margin = 0) -> type& { return self().setMargin(margin), *this; } auto setSpacing(signed spacing = 5) -> type& { return self().setSpacing(spacing), *this; } }; +#endif #undef Declare #undef DeclareObject diff --git a/hiro/extension/vertical-layout.cpp b/hiro/extension/vertical-layout.cpp index 1c2c86d1..fafef2da 100644 --- a/hiro/extension/vertical-layout.cpp +++ b/hiro/extension/vertical-layout.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_VerticalLayout) + auto mVerticalLayout::append(shared_pointer sizable, Size size, signed spacing) -> type& { properties.append({size.width(), size.height(), spacing < 0 ? settings.spacing : spacing}); mLayout::append(sizable); @@ -125,3 +127,5 @@ auto mVerticalLayout::setVisible(bool visible) -> type& { } return *this; } + +#endif diff --git a/hiro/extension/vertical-layout.hpp b/hiro/extension/vertical-layout.hpp index e3ec666c..bd45d599 100644 --- a/hiro/extension/vertical-layout.hpp +++ b/hiro/extension/vertical-layout.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_VerticalLayout) + struct mVerticalLayout : mLayout { using type = mVerticalLayout; using mLayout::append; @@ -28,3 +30,5 @@ struct mVerticalLayout : mLayout { }; nall::vector properties; }; + +#endif diff --git a/hiro/gtk/action/action.cpp b/hiro/gtk/action/action.cpp index f28a97a7..9b0cd10a 100644 --- a/hiro/gtk/action/action.cpp +++ b/hiro/gtk/action/action.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Action) + namespace hiro { auto pAction::construct() -> void { @@ -29,3 +31,5 @@ auto pAction::_mnemonic(string text) -> string { } } + +#endif diff --git a/hiro/gtk/action/action.hpp b/hiro/gtk/action/action.hpp index 2a28d5a3..2117d49a 100644 --- a/hiro/gtk/action/action.hpp +++ b/hiro/gtk/action/action.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Action) + namespace hiro { struct pAction : pObject { @@ -13,3 +15,5 @@ struct pAction : pObject { }; } + +#endif diff --git a/hiro/gtk/action/menu-check-item.cpp b/hiro/gtk/action/menu-check-item.cpp index e262cf8d..3061dc3a 100644 --- a/hiro/gtk/action/menu-check-item.cpp +++ b/hiro/gtk/action/menu-check-item.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_MenuCheckItem) + namespace hiro { static auto MenuCheckItem_toggle(GtkCheckMenuItem* gtkCheckMenuItem, pMenuCheckItem* p) -> void { @@ -32,3 +34,5 @@ auto pMenuCheckItem::setText(const string& text) -> void { } } + +#endif diff --git a/hiro/gtk/action/menu-check-item.hpp b/hiro/gtk/action/menu-check-item.hpp index b342de84..3a288f8c 100644 --- a/hiro/gtk/action/menu-check-item.hpp +++ b/hiro/gtk/action/menu-check-item.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_MenuCheckItem) + namespace hiro { struct pMenuCheckItem : pAction { @@ -9,3 +11,5 @@ struct pMenuCheckItem : pAction { }; } + +#endif diff --git a/hiro/gtk/action/menu-item.cpp b/hiro/gtk/action/menu-item.cpp index 39d1dba4..383775e9 100644 --- a/hiro/gtk/action/menu-item.cpp +++ b/hiro/gtk/action/menu-item.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_MenuItem) + namespace hiro { static auto MenuItem_activate(GtkMenuItem*, pMenuItem* p) -> void { @@ -28,3 +30,5 @@ auto pMenuItem::setText(const string& text) -> void { } } + +#endif diff --git a/hiro/gtk/action/menu-item.hpp b/hiro/gtk/action/menu-item.hpp index bf2e13db..8d980c34 100644 --- a/hiro/gtk/action/menu-item.hpp +++ b/hiro/gtk/action/menu-item.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_MenuItem) + namespace hiro { struct pMenuItem : pAction { @@ -8,3 +10,5 @@ struct pMenuItem : pAction { }; } + +#endif diff --git a/hiro/gtk/action/menu-radio-item.cpp b/hiro/gtk/action/menu-radio-item.cpp index a3f05076..89c0bf97 100644 --- a/hiro/gtk/action/menu-radio-item.cpp +++ b/hiro/gtk/action/menu-radio-item.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_MenuRadioItem) + namespace hiro { static auto MenuRadioItem_activate(GtkCheckMenuItem* gtkCheckMenuItem, pMenuRadioItem* p) -> void { @@ -73,3 +75,5 @@ auto pMenuRadioItem::_parent() -> pMenuRadioItem& { } } + +#endif diff --git a/hiro/gtk/action/menu-radio-item.hpp b/hiro/gtk/action/menu-radio-item.hpp index f129c1a6..0eedab59 100644 --- a/hiro/gtk/action/menu-radio-item.hpp +++ b/hiro/gtk/action/menu-radio-item.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_MenuRadioItem) + namespace hiro { struct pMenuRadioItem : pAction { @@ -12,3 +14,5 @@ struct pMenuRadioItem : pAction { }; } + +#endif diff --git a/hiro/gtk/action/menu-separator.cpp b/hiro/gtk/action/menu-separator.cpp index 1344e93c..d6386411 100644 --- a/hiro/gtk/action/menu-separator.cpp +++ b/hiro/gtk/action/menu-separator.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_MenuSeparator) + namespace hiro { auto pMenuSeparator::construct() -> void { @@ -9,3 +11,5 @@ auto pMenuSeparator::destruct() -> void { } } + +#endif diff --git a/hiro/gtk/action/menu-separator.hpp b/hiro/gtk/action/menu-separator.hpp index 5bf18a62..a94dbf6f 100644 --- a/hiro/gtk/action/menu-separator.hpp +++ b/hiro/gtk/action/menu-separator.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_MenuSeparator) + namespace hiro { struct pMenuSeparator : pAction { @@ -5,3 +7,5 @@ struct pMenuSeparator : pAction { }; } + +#endif diff --git a/hiro/gtk/action/menu.cpp b/hiro/gtk/action/menu.cpp index 527a84ff..574ac7ea 100644 --- a/hiro/gtk/action/menu.cpp +++ b/hiro/gtk/action/menu.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Menu) + namespace hiro { auto pMenu::construct() -> void { @@ -18,7 +20,7 @@ auto pMenu::append(sAction action) -> void { if(action->self()) { gtk_menu_shell_append(GTK_MENU_SHELL(gtkMenu), action->self()->widget); action->self()->setFont(action->font(true)); - action->self()->setVisible(action->visible(true)); + action->self()->setVisible(action->visible()); //hidden parent will hide child; no need to inherit visibility } } @@ -46,3 +48,5 @@ auto pMenu::setText(const string& text) -> void { } } + +#endif diff --git a/hiro/gtk/action/menu.hpp b/hiro/gtk/action/menu.hpp index c0e199a7..a198cf09 100644 --- a/hiro/gtk/action/menu.hpp +++ b/hiro/gtk/action/menu.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Menu) + namespace hiro { struct pMenu : pAction { @@ -13,3 +15,5 @@ struct pMenu : pAction { }; } + +#endif diff --git a/hiro/gtk/application.cpp b/hiro/gtk/application.cpp index 63ad90a4..ec92c4ed 100644 --- a/hiro/gtk/application.cpp +++ b/hiro/gtk/application.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Application) + namespace hiro { #if defined(PLATFORM_XORG) @@ -106,3 +108,5 @@ void pApplication::initialize() { } } + +#endif diff --git a/hiro/gtk/application.hpp b/hiro/gtk/application.hpp index 269937ce..a8f8ea24 100644 --- a/hiro/gtk/application.hpp +++ b/hiro/gtk/application.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Application) + namespace hiro { struct pApplication { @@ -14,3 +16,5 @@ struct pApplication { }; } + +#endif diff --git a/hiro/gtk/browser-window.cpp b/hiro/gtk/browser-window.cpp index 1ca5ef80..9fed6d08 100644 --- a/hiro/gtk/browser-window.cpp +++ b/hiro/gtk/browser-window.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_BrowserWindow) + namespace hiro { static void BrowserWindow_addFilters(GtkWidget* dialog, lstring filters) { @@ -86,3 +88,5 @@ auto pBrowserWindow::save(BrowserWindow::State& state) -> string { } } + +#endif diff --git a/hiro/gtk/browser-window.hpp b/hiro/gtk/browser-window.hpp index 964acea4..80e561b1 100644 --- a/hiro/gtk/browser-window.hpp +++ b/hiro/gtk/browser-window.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_BrowserWindow) + namespace hiro { struct pBrowserWindow { @@ -7,3 +9,5 @@ struct pBrowserWindow { }; } + +#endif diff --git a/hiro/gtk/desktop.cpp b/hiro/gtk/desktop.cpp index 4cd551f4..11f1af65 100644 --- a/hiro/gtk/desktop.cpp +++ b/hiro/gtk/desktop.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Desktop) + namespace hiro { Size pDesktop::size() { @@ -46,3 +48,5 @@ Geometry pDesktop::workspace() { } } + +#endif diff --git a/hiro/gtk/desktop.hpp b/hiro/gtk/desktop.hpp index d063450a..74efc343 100644 --- a/hiro/gtk/desktop.hpp +++ b/hiro/gtk/desktop.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Desktop) + namespace hiro { struct pDesktop { @@ -6,3 +8,5 @@ struct pDesktop { }; } + +#endif diff --git a/hiro/gtk/font.cpp b/hiro/gtk/font.cpp index fcd6c23f..b41c2bc0 100644 --- a/hiro/gtk/font.cpp +++ b/hiro/gtk/font.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Font) + namespace hiro { string pFont::serif(unsigned size, string style) { @@ -75,3 +77,5 @@ void pFont::setFont(GtkWidget* widget, gpointer font) { } } + +#endif diff --git a/hiro/gtk/font.hpp b/hiro/gtk/font.hpp index 8dbd17e9..711176f2 100644 --- a/hiro/gtk/font.hpp +++ b/hiro/gtk/font.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Font) + namespace hiro { struct pFont { @@ -14,3 +16,5 @@ struct pFont { }; } + +#endif diff --git a/hiro/gtk/header.hpp b/hiro/gtk/header.hpp index 0820f9ad..1af33fb1 100644 --- a/hiro/gtk/header.hpp +++ b/hiro/gtk/header.hpp @@ -14,28 +14,32 @@ #include #include #include + #include #include #include #include #include + #if defined(Hiro_SourceEdit) #include #include #include - #include + #endif #include #include #endif #if defined(PLATFORM_XORG) #include + #include + #include #include #include #include #include + #if defined(Hiro_SourceEdit) #include #include #include - #include - #include + #endif #include #endif diff --git a/hiro/gtk/hotkey.cpp b/hiro/gtk/hotkey.cpp index 73879ddb..608ba7bb 100644 --- a/hiro/gtk/hotkey.cpp +++ b/hiro/gtk/hotkey.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Hotkey) + namespace hiro { auto pHotkey::construct() -> void { @@ -7,3 +9,5 @@ auto pHotkey::destruct() -> void { } } + +#endif diff --git a/hiro/gtk/hotkey.hpp b/hiro/gtk/hotkey.hpp index 4f476cdc..b1caa7bc 100644 --- a/hiro/gtk/hotkey.hpp +++ b/hiro/gtk/hotkey.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Hotkey) + namespace hiro { struct pHotkey : pObject { @@ -5,3 +7,5 @@ struct pHotkey : pObject { }; } + +#endif diff --git a/hiro/gtk/keyboard.cpp b/hiro/gtk/keyboard.cpp index 34895a1a..5d20e179 100644 --- a/hiro/gtk/keyboard.cpp +++ b/hiro/gtk/keyboard.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Keyboard) + namespace hiro { auto pKeyboard::poll() -> vector { @@ -245,3 +247,5 @@ auto pKeyboard::initialize() -> void { } } + +#endif diff --git a/hiro/gtk/keyboard.hpp b/hiro/gtk/keyboard.hpp index 9257ca92..c7555f6f 100644 --- a/hiro/gtk/keyboard.hpp +++ b/hiro/gtk/keyboard.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Mouse) + namespace hiro { struct pKeyboard { @@ -11,3 +13,5 @@ struct pKeyboard { }; } + +#endif diff --git a/hiro/gtk/layout.cpp b/hiro/gtk/layout.cpp index 607b0cf2..30f423b5 100644 --- a/hiro/gtk/layout.cpp +++ b/hiro/gtk/layout.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Layout) + namespace hiro { auto pLayout::construct() -> void { @@ -27,3 +29,5 @@ auto pLayout::setVisible(bool visible) -> void { } } + +#endif diff --git a/hiro/gtk/layout.hpp b/hiro/gtk/layout.hpp index f77bfc84..3895710c 100644 --- a/hiro/gtk/layout.hpp +++ b/hiro/gtk/layout.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Layout) + namespace hiro { struct pLayout : pSizable { @@ -9,3 +11,5 @@ struct pLayout : pSizable { }; } + +#endif diff --git a/hiro/gtk/menu-bar.cpp b/hiro/gtk/menu-bar.cpp index 94127d2d..ce7b765c 100644 --- a/hiro/gtk/menu-bar.cpp +++ b/hiro/gtk/menu-bar.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_MenuBar) + namespace hiro { auto pMenuBar::construct() -> void { @@ -43,3 +45,5 @@ auto pMenuBar::_parent() -> pWindow* { } } + +#endif diff --git a/hiro/gtk/menu-bar.hpp b/hiro/gtk/menu-bar.hpp index 7c1897cf..1bafd7dd 100644 --- a/hiro/gtk/menu-bar.hpp +++ b/hiro/gtk/menu-bar.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_MenuBar) + namespace hiro { struct pMenuBar : pObject { @@ -13,3 +15,5 @@ struct pMenuBar : pObject { }; } + +#endif diff --git a/hiro/gtk/message-window.cpp b/hiro/gtk/message-window.cpp index 88e3874c..4391297a 100644 --- a/hiro/gtk/message-window.cpp +++ b/hiro/gtk/message-window.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_MessageWindow) + namespace hiro { static auto Message(MessageWindow::State& state, GtkMessageType messageStyle) -> MessageWindow::Response { @@ -58,3 +60,5 @@ auto pMessageWindow::warning(MessageWindow::State& state) -> MessageWindow::Resp } } + +#endif diff --git a/hiro/gtk/message-window.hpp b/hiro/gtk/message-window.hpp index 4daadc3d..b8b26af5 100644 --- a/hiro/gtk/message-window.hpp +++ b/hiro/gtk/message-window.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_MessageWindow) + namespace hiro { struct pMessageWindow { @@ -8,3 +10,5 @@ struct pMessageWindow { }; } + +#endif diff --git a/hiro/gtk/monitor.cpp b/hiro/gtk/monitor.cpp index 649c0823..b542cfa1 100644 --- a/hiro/gtk/monitor.cpp +++ b/hiro/gtk/monitor.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Monitor) + namespace hiro { unsigned pMonitor::count() { @@ -15,3 +17,5 @@ unsigned pMonitor::primary() { } } + +#endif diff --git a/hiro/gtk/monitor.hpp b/hiro/gtk/monitor.hpp index c616d6a8..e922bcfe 100644 --- a/hiro/gtk/monitor.hpp +++ b/hiro/gtk/monitor.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Monitor) + namespace hiro { struct pMonitor { @@ -7,3 +9,5 @@ struct pMonitor { }; } + +#endif diff --git a/hiro/gtk/mouse.cpp b/hiro/gtk/mouse.cpp index ae9ab4e9..ca3c288a 100644 --- a/hiro/gtk/mouse.cpp +++ b/hiro/gtk/mouse.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Mouse) + namespace hiro { auto pMouse::position() -> Position { @@ -41,3 +43,5 @@ auto pMouse::pressed(Mouse::Button button) -> bool { } } + +#endif diff --git a/hiro/gtk/mouse.hpp b/hiro/gtk/mouse.hpp index 805671fa..72a56058 100644 --- a/hiro/gtk/mouse.hpp +++ b/hiro/gtk/mouse.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Mouse) + namespace hiro { struct pMouse { @@ -6,3 +8,5 @@ struct pMouse { }; } + +#endif diff --git a/hiro/gtk/object.cpp b/hiro/gtk/object.cpp index 0eb9c64a..fae97d8c 100644 --- a/hiro/gtk/object.cpp +++ b/hiro/gtk/object.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Object) + namespace hiro { auto pObject::construct() -> void { @@ -29,3 +31,5 @@ auto pObject::setVisible(bool visible) -> void { } } + +#endif diff --git a/hiro/gtk/object.hpp b/hiro/gtk/object.hpp index 45cfe490..84469aa5 100644 --- a/hiro/gtk/object.hpp +++ b/hiro/gtk/object.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Object) + namespace hiro { struct pObject { @@ -25,3 +27,5 @@ struct pObject { }; } + +#endif diff --git a/hiro/gtk/popup-menu.cpp b/hiro/gtk/popup-menu.cpp index 752d0877..2f0f9d91 100644 --- a/hiro/gtk/popup-menu.cpp +++ b/hiro/gtk/popup-menu.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_PopupMenu) + namespace hiro { auto pPopupMenu::construct() -> void { @@ -30,3 +32,5 @@ auto pPopupMenu::setVisible(bool visible) -> void { } } + +#endif diff --git a/hiro/gtk/popup-menu.hpp b/hiro/gtk/popup-menu.hpp index 03548cfb..631ac17b 100644 --- a/hiro/gtk/popup-menu.hpp +++ b/hiro/gtk/popup-menu.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_PopupMenu) + namespace hiro { struct pPopupMenu : pObject { @@ -12,3 +14,5 @@ struct pPopupMenu : pObject { }; } + +#endif diff --git a/hiro/gtk/settings.cpp b/hiro/gtk/settings.cpp index c1754dae..77cbf767 100644 --- a/hiro/gtk/settings.cpp +++ b/hiro/gtk/settings.cpp @@ -1,12 +1,12 @@ namespace hiro { void Settings::load() { - string path = {userpath(), ".config/phoenix/"}; + string path = {configpath(), "hiro/"}; Configuration::Document::load({path, "gtk.bml"}); } void Settings::save() { - string path = {userpath(), ".config/phoenix/"}; + string path = {configpath(), "hiro/"}; directory::create(path, 0755); Configuration::Document::save({path, "gtk.bml"}); } diff --git a/hiro/gtk/sizable.cpp b/hiro/gtk/sizable.cpp index c882be2b..4e793ab3 100644 --- a/hiro/gtk/sizable.cpp +++ b/hiro/gtk/sizable.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Sizable) + namespace hiro { auto pSizable::construct() -> void { @@ -14,3 +16,5 @@ auto pSizable::setGeometry(Geometry geometry) -> void { } } + +#endif diff --git a/hiro/gtk/sizable.hpp b/hiro/gtk/sizable.hpp index 12dfc9f0..5270283f 100644 --- a/hiro/gtk/sizable.hpp +++ b/hiro/gtk/sizable.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Sizable) + namespace hiro { struct pSizable : pObject { @@ -8,3 +10,5 @@ struct pSizable : pObject { }; } + +#endif diff --git a/hiro/gtk/status-bar.cpp b/hiro/gtk/status-bar.cpp index 02ffafbf..a58eae53 100644 --- a/hiro/gtk/status-bar.cpp +++ b/hiro/gtk/status-bar.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_StatusBar) + namespace hiro { auto pStatusBar::construct() -> void { @@ -36,3 +38,5 @@ auto pStatusBar::_parent() -> pWindow* { } } + +#endif diff --git a/hiro/gtk/status-bar.hpp b/hiro/gtk/status-bar.hpp index 7f178dc5..61655437 100644 --- a/hiro/gtk/status-bar.hpp +++ b/hiro/gtk/status-bar.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_StatusBar) + namespace hiro { struct pStatusBar : pObject { @@ -12,3 +14,5 @@ struct pStatusBar : pObject { }; } + +#endif diff --git a/hiro/gtk/timer.cpp b/hiro/gtk/timer.cpp index 49dee689..eb413ada 100644 --- a/hiro/gtk/timer.cpp +++ b/hiro/gtk/timer.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Timer) + namespace hiro { static auto Timer_trigger(pTimer* p) -> signed { @@ -29,3 +31,5 @@ auto pTimer::setInterval(unsigned interval) -> void { } } + +#endif diff --git a/hiro/gtk/timer.hpp b/hiro/gtk/timer.hpp index d09565e0..a5baf34f 100644 --- a/hiro/gtk/timer.hpp +++ b/hiro/gtk/timer.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Timer) + namespace hiro { struct pTimer : pObject { @@ -8,3 +10,5 @@ struct pTimer : pObject { }; } + +#endif diff --git a/hiro/gtk/utility.cpp b/hiro/gtk/utility.cpp index 1fbdbd36..24c76ab7 100644 --- a/hiro/gtk/utility.cpp +++ b/hiro/gtk/utility.cpp @@ -1,5 +1,6 @@ namespace hiro { +#if defined(Hiro_Color) static auto CreateColor(const Color& color) -> GdkColor { GdkColor gdkColor; gdkColor.pixel = (color.red() << 16) | (color.green() << 8) | (color.blue() << 0); @@ -8,6 +9,7 @@ static auto CreateColor(const Color& color) -> GdkColor { gdkColor.blue = (color.blue() << 8) | (color.blue() << 0); return gdkColor; } +#endif static auto CreatePixbuf(const nall::image& image, bool scale = false) -> GdkPixbuf* { nall::image gdkImage = image; diff --git a/hiro/gtk/widget/button.cpp b/hiro/gtk/widget/button.cpp index 7c1e5872..f5d9512b 100644 --- a/hiro/gtk/widget/button.cpp +++ b/hiro/gtk/widget/button.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Button) + namespace hiro { static auto Button_activate(GtkButton* gtkButton, pButton* p) -> void { p->_doActivate(); } @@ -66,3 +68,5 @@ auto pButton::_doActivate() -> void { } } + +#endif diff --git a/hiro/gtk/widget/button.hpp b/hiro/gtk/widget/button.hpp index 9cabea5d..76108e67 100644 --- a/hiro/gtk/widget/button.hpp +++ b/hiro/gtk/widget/button.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Button) + namespace hiro { struct pButton : pWidget { @@ -15,3 +17,5 @@ struct pButton : pWidget { }; } + +#endif diff --git a/hiro/gtk/widget/canvas.cpp b/hiro/gtk/widget/canvas.cpp index e40c3baf..2992dd7c 100644 --- a/hiro/gtk/widget/canvas.cpp +++ b/hiro/gtk/widget/canvas.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Canvas) + namespace hiro { static auto Canvas_drop(GtkWidget* widget, GdkDragContext* context, signed x, signed y, @@ -210,3 +212,5 @@ auto pCanvas::_release() -> void { } } + +#endif diff --git a/hiro/gtk/widget/canvas.hpp b/hiro/gtk/widget/canvas.hpp index 99e9b03d..5a2a79b3 100644 --- a/hiro/gtk/widget/canvas.hpp +++ b/hiro/gtk/widget/canvas.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Canvas) + namespace hiro { struct pCanvas : pWidget { @@ -26,3 +28,5 @@ struct pCanvas : pWidget { }; } + +#endif diff --git a/hiro/gtk/widget/check-button.cpp b/hiro/gtk/widget/check-button.cpp index 41c7a51f..ac1e75d3 100644 --- a/hiro/gtk/widget/check-button.cpp +++ b/hiro/gtk/widget/check-button.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_CheckButton) + namespace hiro { static auto CheckButton_toggle(GtkToggleButton* toggleButton, pCheckButton* p) -> void { @@ -71,3 +73,5 @@ auto pCheckButton::setText(const string& text) -> void { } } + +#endif diff --git a/hiro/gtk/widget/check-button.hpp b/hiro/gtk/widget/check-button.hpp index 3b31d917..886f4e56 100644 --- a/hiro/gtk/widget/check-button.hpp +++ b/hiro/gtk/widget/check-button.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_CheckButton) + namespace hiro { struct pCheckButton : pWidget { @@ -12,3 +14,5 @@ struct pCheckButton : pWidget { }; } + +#endif diff --git a/hiro/gtk/widget/check-label.cpp b/hiro/gtk/widget/check-label.cpp index c9dbd0a7..5139cfa7 100644 --- a/hiro/gtk/widget/check-label.cpp +++ b/hiro/gtk/widget/check-label.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_CheckLabel) + namespace hiro { static auto CheckLabel_toggle(GtkToggleButton* toggleButton, pCheckLabel* p) -> void { @@ -37,3 +39,5 @@ auto pCheckLabel::setText(const string& text) -> void { } } + +#endif diff --git a/hiro/gtk/widget/check-label.hpp b/hiro/gtk/widget/check-label.hpp index c84195f1..30375739 100644 --- a/hiro/gtk/widget/check-label.hpp +++ b/hiro/gtk/widget/check-label.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_CheckLabel) + namespace hiro { struct pCheckLabel : pWidget { @@ -9,3 +11,5 @@ struct pCheckLabel : pWidget { }; } + +#endif diff --git a/hiro/gtk/widget/combo-button-item.cpp b/hiro/gtk/widget/combo-button-item.cpp index 2f6e79bc..ff716ac3 100644 --- a/hiro/gtk/widget/combo-button-item.cpp +++ b/hiro/gtk/widget/combo-button-item.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_ComboButton) + namespace hiro { auto pComboButtonItem::construct() -> void { @@ -40,3 +42,5 @@ auto pComboButtonItem::_parent() -> pComboButton* { } } + +#endif diff --git a/hiro/gtk/widget/combo-button-item.hpp b/hiro/gtk/widget/combo-button-item.hpp index d823b746..3afd541f 100644 --- a/hiro/gtk/widget/combo-button-item.hpp +++ b/hiro/gtk/widget/combo-button-item.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_ComboButton) + namespace hiro { struct pComboButtonItem : pObject { @@ -13,3 +15,5 @@ struct pComboButtonItem : pObject { }; } + +#endif diff --git a/hiro/gtk/widget/combo-button.cpp b/hiro/gtk/widget/combo-button.cpp index 9b2ea147..4062a940 100644 --- a/hiro/gtk/widget/combo-button.cpp +++ b/hiro/gtk/widget/combo-button.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_ComboButton) + namespace hiro { static auto ComboButton_change(GtkComboBox* comboBox, pComboButton* p) -> void { p->_updateSelected(); } @@ -89,3 +91,5 @@ auto pComboButton::_updateSelected() -> void { } } + +#endif diff --git a/hiro/gtk/widget/combo-button.hpp b/hiro/gtk/widget/combo-button.hpp index ff66df28..ae36b7f4 100644 --- a/hiro/gtk/widget/combo-button.hpp +++ b/hiro/gtk/widget/combo-button.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_ComboButton) + namespace hiro { struct pComboButton : pWidget { @@ -19,3 +21,5 @@ struct pComboButton : pWidget { }; } + +#endif diff --git a/hiro/gtk/widget/console.cpp b/hiro/gtk/widget/console.cpp index a72cd629..2a687bf0 100644 --- a/hiro/gtk/widget/console.cpp +++ b/hiro/gtk/widget/console.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Console) + namespace hiro { static auto Console_keyPress(GtkWidget*, GdkEventKey* event, pConsole* p) -> signed { @@ -183,3 +185,5 @@ auto pConsole::_seekToMark() -> void { } } + +#endif diff --git a/hiro/gtk/widget/console.hpp b/hiro/gtk/widget/console.hpp index 0d32a476..5d27957c 100644 --- a/hiro/gtk/widget/console.hpp +++ b/hiro/gtk/widget/console.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Console) + namespace hiro { struct pConsole : pWidget { @@ -21,3 +23,5 @@ struct pConsole : pWidget { }; } + +#endif diff --git a/hiro/gtk/widget/frame.cpp b/hiro/gtk/widget/frame.cpp index 30a1b180..2d8c603c 100644 --- a/hiro/gtk/widget/frame.cpp +++ b/hiro/gtk/widget/frame.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Frame) + namespace hiro { auto pFrame::construct() -> void { @@ -64,3 +66,5 @@ auto pFrame::_layout() -> pLayout* { } } + +#endif diff --git a/hiro/gtk/widget/frame.hpp b/hiro/gtk/widget/frame.hpp index 5d09750e..bdc09626 100644 --- a/hiro/gtk/widget/frame.hpp +++ b/hiro/gtk/widget/frame.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Frame) + namespace hiro { struct pFrame : pWidget { @@ -18,3 +20,5 @@ struct pFrame : pWidget { }; } + +#endif diff --git a/hiro/gtk/widget/hex-edit.cpp b/hiro/gtk/widget/hex-edit.cpp index 03805517..49e1d75e 100644 --- a/hiro/gtk/widget/hex-edit.cpp +++ b/hiro/gtk/widget/hex-edit.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_HexEdit) + namespace hiro { static auto HexEdit_keyPress(GtkWidget* widget, GdkEventKey* event, pHexEdit* p) -> signed { @@ -307,3 +309,5 @@ auto pHexEdit::updateScroll() -> void { } } + +#endif diff --git a/hiro/gtk/widget/hex-edit.hpp b/hiro/gtk/widget/hex-edit.hpp index 685d7d28..8273ce93 100644 --- a/hiro/gtk/widget/hex-edit.hpp +++ b/hiro/gtk/widget/hex-edit.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_HexEdit) + namespace hiro { struct pHexEdit : pWidget { @@ -29,3 +31,5 @@ struct pHexEdit : pWidget { }; } + +#endif diff --git a/hiro/gtk/widget/horizontal-scroller.cpp b/hiro/gtk/widget/horizontal-scroller.cpp index d8dc7ede..fff85179 100644 --- a/hiro/gtk/widget/horizontal-scroller.cpp +++ b/hiro/gtk/widget/horizontal-scroller.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_HorizontalScroller) + namespace hiro { static auto HorizontalScroller_change(GtkRange* gtkRange, pHorizontalScroller* p) -> void { @@ -39,3 +41,5 @@ auto pHorizontalScroller::setPosition(unsigned position) -> void { } } + +#endif diff --git a/hiro/gtk/widget/horizontal-scroller.hpp b/hiro/gtk/widget/horizontal-scroller.hpp index a522f0bb..368bef93 100644 --- a/hiro/gtk/widget/horizontal-scroller.hpp +++ b/hiro/gtk/widget/horizontal-scroller.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_HorizontalScroller) + namespace hiro { struct pHorizontalScroller : pWidget { @@ -9,3 +11,5 @@ struct pHorizontalScroller : pWidget { }; } + +#endif diff --git a/hiro/gtk/widget/horizontal-slider.cpp b/hiro/gtk/widget/horizontal-slider.cpp index dbd2c379..7af58219 100644 --- a/hiro/gtk/widget/horizontal-slider.cpp +++ b/hiro/gtk/widget/horizontal-slider.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_HorizontalSlider) + namespace hiro { static auto HorizontalSlider_change(GtkRange* gtkRange, pHorizontalSlider* p) -> void { @@ -38,3 +40,5 @@ auto pHorizontalSlider::setPosition(unsigned position) -> void { } } + +#endif diff --git a/hiro/gtk/widget/horizontal-slider.hpp b/hiro/gtk/widget/horizontal-slider.hpp index c24fc004..a05ba416 100644 --- a/hiro/gtk/widget/horizontal-slider.hpp +++ b/hiro/gtk/widget/horizontal-slider.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_HorizontalSlider) + namespace hiro { struct pHorizontalSlider : pWidget { @@ -9,3 +11,5 @@ struct pHorizontalSlider : pWidget { }; } + +#endif diff --git a/hiro/gtk/widget/icon-view-item.cpp b/hiro/gtk/widget/icon-view-item.cpp index fa985855..48081e86 100644 --- a/hiro/gtk/widget/icon-view-item.cpp +++ b/hiro/gtk/widget/icon-view-item.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_IconView) + namespace hiro { auto pIconViewItem::construct() -> void { @@ -30,3 +32,5 @@ auto pIconViewItem::_parent() -> pIconView* { } } + +#endif diff --git a/hiro/gtk/widget/icon-view-item.hpp b/hiro/gtk/widget/icon-view-item.hpp index 4e8fad46..e4060110 100644 --- a/hiro/gtk/widget/icon-view-item.hpp +++ b/hiro/gtk/widget/icon-view-item.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_IconView) + namespace hiro { struct pIconViewItem : pObject { @@ -11,3 +13,5 @@ struct pIconViewItem : pObject { }; } + +#endif diff --git a/hiro/gtk/widget/icon-view.cpp b/hiro/gtk/widget/icon-view.cpp index 73f242eb..f200d440 100644 --- a/hiro/gtk/widget/icon-view.cpp +++ b/hiro/gtk/widget/icon-view.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_IconView) + namespace hiro { static auto IconView_activate(GtkIconView* iconView, GtkTreePath* path, pIconView* p) -> void { @@ -222,3 +224,5 @@ auto pIconView::_updateSelected() -> void { } } + +#endif diff --git a/hiro/gtk/widget/icon-view.hpp b/hiro/gtk/widget/icon-view.hpp index 41447b6b..0be21b83 100644 --- a/hiro/gtk/widget/icon-view.hpp +++ b/hiro/gtk/widget/icon-view.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_IconView) + namespace hiro { struct pIconView : pWidget { @@ -27,3 +29,5 @@ struct pIconView : pWidget { }; } + +#endif diff --git a/hiro/gtk/widget/label.cpp b/hiro/gtk/widget/label.cpp index 69766178..195acf87 100644 --- a/hiro/gtk/widget/label.cpp +++ b/hiro/gtk/widget/label.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Label) + namespace hiro { auto pLabel::construct() -> void { @@ -39,3 +41,5 @@ auto pLabel::_setAlignment() -> void { } } + +#endif diff --git a/hiro/gtk/widget/label.hpp b/hiro/gtk/widget/label.hpp index 6a79bb14..0b570477 100644 --- a/hiro/gtk/widget/label.hpp +++ b/hiro/gtk/widget/label.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Label) + namespace hiro { struct pLabel : pWidget { @@ -12,3 +14,5 @@ struct pLabel : pWidget { }; } + +#endif diff --git a/hiro/gtk/widget/line-edit.cpp b/hiro/gtk/widget/line-edit.cpp index 0fb689b5..169c9661 100644 --- a/hiro/gtk/widget/line-edit.cpp +++ b/hiro/gtk/widget/line-edit.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_LineEdit) + namespace hiro { static auto LineEdit_activate(GtkEntry*, pLineEdit* p) -> void { @@ -53,3 +55,5 @@ auto pLineEdit::setText(const string& text) -> void { } } + +#endif diff --git a/hiro/gtk/widget/line-edit.hpp b/hiro/gtk/widget/line-edit.hpp index 243278d6..591fe141 100644 --- a/hiro/gtk/widget/line-edit.hpp +++ b/hiro/gtk/widget/line-edit.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_LineEdit) + namespace hiro { struct pLineEdit : pWidget { @@ -11,3 +13,5 @@ struct pLineEdit : pWidget { }; } + +#endif diff --git a/hiro/gtk/widget/list-view-column.cpp b/hiro/gtk/widget/list-view-column.cpp index ffe9ae24..9a718e21 100644 --- a/hiro/gtk/widget/list-view-column.cpp +++ b/hiro/gtk/widget/list-view-column.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_ListView) + namespace hiro { auto pListViewColumn::construct() -> void { @@ -131,3 +133,5 @@ auto pListViewColumn::_setAlignment() -> void { } } + +#endif diff --git a/hiro/gtk/widget/list-view-column.hpp b/hiro/gtk/widget/list-view-column.hpp index 42394ad1..70f2be29 100644 --- a/hiro/gtk/widget/list-view-column.hpp +++ b/hiro/gtk/widget/list-view-column.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_ListView) + namespace hiro { struct pListViewColumn : pObject { @@ -30,3 +32,5 @@ struct pListViewColumn : pObject { }; } + +#endif diff --git a/hiro/gtk/widget/list-view-item.cpp b/hiro/gtk/widget/list-view-item.cpp index 3e7617dd..ebf24425 100644 --- a/hiro/gtk/widget/list-view-item.cpp +++ b/hiro/gtk/widget/list-view-item.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_ListView) + namespace hiro { auto pListViewItem::construct() -> void { @@ -57,3 +59,5 @@ auto pListViewItem::_parent() -> pListView* { } } + +#endif diff --git a/hiro/gtk/widget/list-view-item.hpp b/hiro/gtk/widget/list-view-item.hpp index fd584e3b..881db09e 100644 --- a/hiro/gtk/widget/list-view-item.hpp +++ b/hiro/gtk/widget/list-view-item.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_ListView) + namespace hiro { struct pListViewItem : pObject { @@ -15,3 +17,5 @@ struct pListViewItem : pObject { }; } + +#endif diff --git a/hiro/gtk/widget/list-view.cpp b/hiro/gtk/widget/list-view.cpp index b0e9b8c8..96d9f0d9 100644 --- a/hiro/gtk/widget/list-view.cpp +++ b/hiro/gtk/widget/list-view.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_ListView) + namespace hiro { static auto ListView_activate(GtkTreeView*, GtkTreePath*, GtkTreeViewColumn*, pListView* p) -> void { return p->_doActivate(); } @@ -372,3 +374,5 @@ auto pListView::_updateSelected() -> void { } } + +#endif diff --git a/hiro/gtk/widget/list-view.hpp b/hiro/gtk/widget/list-view.hpp index 576cde40..7f2f7436 100644 --- a/hiro/gtk/widget/list-view.hpp +++ b/hiro/gtk/widget/list-view.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_ListView) + namespace hiro { struct pListView : pWidget { @@ -43,3 +45,5 @@ struct pListView : pWidget { }; } + +#endif diff --git a/hiro/gtk/widget/progress-bar.cpp b/hiro/gtk/widget/progress-bar.cpp index 8e888d88..b291423f 100644 --- a/hiro/gtk/widget/progress-bar.cpp +++ b/hiro/gtk/widget/progress-bar.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_ProgressBar) + namespace hiro { auto pProgressBar::construct() -> void { @@ -22,3 +24,5 @@ auto pProgressBar::setPosition(unsigned position) -> void { } } + +#endif diff --git a/hiro/gtk/widget/progress-bar.hpp b/hiro/gtk/widget/progress-bar.hpp index 14e677c1..a6c23d29 100644 --- a/hiro/gtk/widget/progress-bar.hpp +++ b/hiro/gtk/widget/progress-bar.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_ProgressBar) + namespace hiro { struct pProgressBar : pWidget { @@ -8,3 +10,5 @@ struct pProgressBar : pWidget { }; } + +#endif diff --git a/hiro/gtk/widget/radio-button.cpp b/hiro/gtk/widget/radio-button.cpp index 97b5dd85..5298a6ef 100644 --- a/hiro/gtk/widget/radio-button.cpp +++ b/hiro/gtk/widget/radio-button.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_RadioButton) + namespace hiro { static auto RadioButton_activate(GtkToggleButton*, pRadioButton* p) -> void { @@ -99,3 +101,5 @@ auto pRadioButton::_parent() -> pRadioButton& { } } + +#endif diff --git a/hiro/gtk/widget/radio-button.hpp b/hiro/gtk/widget/radio-button.hpp index f74ac141..2d966883 100644 --- a/hiro/gtk/widget/radio-button.hpp +++ b/hiro/gtk/widget/radio-button.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_RadioButton) + namespace hiro { struct pRadioButton : pWidget { @@ -15,3 +17,5 @@ struct pRadioButton : pWidget { }; } + +#endif diff --git a/hiro/gtk/widget/radio-label.cpp b/hiro/gtk/widget/radio-label.cpp index b3ec8c61..222e05de 100644 --- a/hiro/gtk/widget/radio-label.cpp +++ b/hiro/gtk/widget/radio-label.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_RadioLabel) + namespace hiro { static auto RadioLabel_activate(GtkToggleButton*, pRadioLabel* p) -> void { @@ -69,3 +71,5 @@ auto pRadioLabel::_parent() -> pRadioLabel& { } } + +#endif diff --git a/hiro/gtk/widget/radio-label.hpp b/hiro/gtk/widget/radio-label.hpp index 758980ba..7fb8f1cb 100644 --- a/hiro/gtk/widget/radio-label.hpp +++ b/hiro/gtk/widget/radio-label.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_RadioLabel) + namespace hiro { struct pRadioLabel : pWidget { @@ -12,3 +14,5 @@ struct pRadioLabel : pWidget { }; } + +#endif diff --git a/hiro/gtk/widget/source-edit.cpp b/hiro/gtk/widget/source-edit.cpp index aacb9264..186c2e12 100644 --- a/hiro/gtk/widget/source-edit.cpp +++ b/hiro/gtk/widget/source-edit.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_SourceEdit) + namespace hiro { static auto SourceEdit_change(GtkTextBuffer*, pSourceEdit* p) -> void { @@ -124,3 +126,5 @@ auto pSourceEdit::text() const -> string { } } + +#endif diff --git a/hiro/gtk/widget/source-edit.hpp b/hiro/gtk/widget/source-edit.hpp index 7c9c07e5..2caf3cd1 100644 --- a/hiro/gtk/widget/source-edit.hpp +++ b/hiro/gtk/widget/source-edit.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_SourceEdit) + namespace hiro { struct pSourceEdit : pWidget { @@ -23,3 +25,5 @@ struct pSourceEdit : pWidget { }; } + +#endif diff --git a/hiro/gtk/widget/tab-frame-item.cpp b/hiro/gtk/widget/tab-frame-item.cpp index b202e4bb..e2c5dade 100644 --- a/hiro/gtk/widget/tab-frame-item.cpp +++ b/hiro/gtk/widget/tab-frame-item.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_TabFrame) + namespace hiro { auto pTabFrameItem::construct() -> void { @@ -44,3 +46,5 @@ auto pTabFrameItem::_parent() -> pTabFrame* { } } + +#endif diff --git a/hiro/gtk/widget/tab-frame-item.hpp b/hiro/gtk/widget/tab-frame-item.hpp index 2f3ddd30..c9d54bbc 100644 --- a/hiro/gtk/widget/tab-frame-item.hpp +++ b/hiro/gtk/widget/tab-frame-item.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_TabFrame) + namespace hiro { struct pTabFrameItem : pObject { @@ -13,3 +15,5 @@ struct pTabFrameItem : pObject { }; } + +#endif diff --git a/hiro/gtk/widget/tab-frame.cpp b/hiro/gtk/widget/tab-frame.cpp index 757c771c..ffb19e53 100644 --- a/hiro/gtk/widget/tab-frame.cpp +++ b/hiro/gtk/widget/tab-frame.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_TabFrame) + namespace hiro { static auto TabFrame_change(GtkNotebook* notebook, GtkWidget* page, unsigned position, pTabFrame* p) -> void { @@ -274,3 +276,5 @@ auto pTabFrame::_tabWidth() -> unsigned { } } + +#endif diff --git a/hiro/gtk/widget/tab-frame.hpp b/hiro/gtk/widget/tab-frame.hpp index 4319fc94..f6392033 100644 --- a/hiro/gtk/widget/tab-frame.hpp +++ b/hiro/gtk/widget/tab-frame.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_TabFrame) + namespace hiro { struct pTabFrame : pWidget { @@ -37,3 +39,5 @@ struct pTabFrame : pWidget { }; } + +#endif diff --git a/hiro/gtk/widget/text-edit.cpp b/hiro/gtk/widget/text-edit.cpp index 758b782b..46c0fd11 100644 --- a/hiro/gtk/widget/text-edit.cpp +++ b/hiro/gtk/widget/text-edit.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_TextEdit) + namespace hiro { static auto TextEdit_change(GtkTextBuffer* textBuffer, pTextEdit* p) -> void { @@ -98,3 +100,5 @@ auto pTextEdit::text() const -> string { } } + +#endif diff --git a/hiro/gtk/widget/text-edit.hpp b/hiro/gtk/widget/text-edit.hpp index 5d04e346..92a22dc6 100644 --- a/hiro/gtk/widget/text-edit.hpp +++ b/hiro/gtk/widget/text-edit.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_TextEdit) + namespace hiro { struct pTextEdit : pWidget { @@ -17,3 +19,5 @@ struct pTextEdit : pWidget { }; } + +#endif diff --git a/hiro/gtk/widget/tree-view-item.cpp b/hiro/gtk/widget/tree-view-item.cpp index 3648e9db..f66912a4 100644 --- a/hiro/gtk/widget/tree-view-item.cpp +++ b/hiro/gtk/widget/tree-view-item.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_TreeView) + namespace hiro { auto pTreeViewItem::construct() -> void { @@ -80,3 +82,5 @@ auto pTreeViewItem::_parentWidget() -> pTreeView* { } } + +#endif diff --git a/hiro/gtk/widget/tree-view-item.hpp b/hiro/gtk/widget/tree-view-item.hpp index 224d1197..a6a08b64 100644 --- a/hiro/gtk/widget/tree-view-item.hpp +++ b/hiro/gtk/widget/tree-view-item.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_TreeView) + namespace hiro { struct pTreeViewItem : pObject { @@ -18,3 +20,5 @@ struct pTreeViewItem : pObject { }; } + +#endif diff --git a/hiro/gtk/widget/tree-view.cpp b/hiro/gtk/widget/tree-view.cpp index fc895a40..f1cc2f0b 100644 --- a/hiro/gtk/widget/tree-view.cpp +++ b/hiro/gtk/widget/tree-view.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_TreeView) + namespace hiro { static auto TreeView_activate(GtkTreeView*, GtkTreePath* gtkPath, GtkTreeViewColumn*, pTreeView* p) -> void { p->_activatePath(gtkPath); } @@ -160,3 +162,5 @@ auto pTreeView::_updateSelected() -> void { } } + +#endif diff --git a/hiro/gtk/widget/tree-view.hpp b/hiro/gtk/widget/tree-view.hpp index e3abe189..e73e66d9 100644 --- a/hiro/gtk/widget/tree-view.hpp +++ b/hiro/gtk/widget/tree-view.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_TreeView) + namespace hiro { struct pTreeView : pWidget { @@ -30,3 +32,5 @@ struct pTreeView : pWidget { }; } + +#endif diff --git a/hiro/gtk/widget/vertical-scroller.cpp b/hiro/gtk/widget/vertical-scroller.cpp index 0bd8ef86..becb1138 100644 --- a/hiro/gtk/widget/vertical-scroller.cpp +++ b/hiro/gtk/widget/vertical-scroller.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_VerticalScroller) + namespace hiro { static auto VerticalScroller_change(GtkRange* gtkRange, pVerticalScroller* p) -> void { @@ -39,3 +41,5 @@ auto pVerticalScroller::setPosition(unsigned position) -> void { } } + +#endif diff --git a/hiro/gtk/widget/vertical-scroller.hpp b/hiro/gtk/widget/vertical-scroller.hpp index e4333c90..5de257e4 100644 --- a/hiro/gtk/widget/vertical-scroller.hpp +++ b/hiro/gtk/widget/vertical-scroller.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_VerticalScroller) + namespace hiro { struct pVerticalScroller : pWidget { @@ -9,3 +11,5 @@ struct pVerticalScroller : pWidget { }; } + +#endif diff --git a/hiro/gtk/widget/vertical-slider.cpp b/hiro/gtk/widget/vertical-slider.cpp index 25fed744..84130960 100644 --- a/hiro/gtk/widget/vertical-slider.cpp +++ b/hiro/gtk/widget/vertical-slider.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_VerticalSlider) + namespace hiro { static auto VerticalSlider_change(GtkRange* gtkRange, pVerticalSlider* p) -> void { @@ -38,3 +40,5 @@ auto pVerticalSlider::setPosition(unsigned position) -> void { } } + +#endif diff --git a/hiro/gtk/widget/vertical-slider.hpp b/hiro/gtk/widget/vertical-slider.hpp index 58995857..d970aaa7 100644 --- a/hiro/gtk/widget/vertical-slider.hpp +++ b/hiro/gtk/widget/vertical-slider.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_VerticalSlider) + namespace hiro { struct pVerticalSlider : pWidget { @@ -9,3 +11,5 @@ struct pVerticalSlider : pWidget { }; } + +#endif diff --git a/hiro/gtk/widget/viewport.cpp b/hiro/gtk/widget/viewport.cpp index 7a8d393a..9f4d28ee 100644 --- a/hiro/gtk/widget/viewport.cpp +++ b/hiro/gtk/widget/viewport.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Viewport) + namespace hiro { static auto Viewport_dropEvent(GtkWidget* widget, GdkDragContext* context, signed x, signed y, @@ -82,3 +84,5 @@ auto pViewport::setDroppable(bool droppable) -> void { } } + +#endif diff --git a/hiro/gtk/widget/viewport.hpp b/hiro/gtk/widget/viewport.hpp index 137d0b01..ed0b17f7 100644 --- a/hiro/gtk/widget/viewport.hpp +++ b/hiro/gtk/widget/viewport.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Viewport) + namespace hiro { struct pViewport : pWidget { @@ -8,3 +10,5 @@ struct pViewport : pWidget { }; } + +#endif diff --git a/hiro/gtk/widget/widget.cpp b/hiro/gtk/widget/widget.cpp index 6c03f128..3729f5d2 100644 --- a/hiro/gtk/widget/widget.cpp +++ b/hiro/gtk/widget/widget.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Widget) + namespace hiro { auto pWidget::construct() -> void { @@ -49,3 +51,5 @@ auto pWidget::setVisible(bool visible) -> void { } } + +#endif diff --git a/hiro/gtk/widget/widget.hpp b/hiro/gtk/widget/widget.hpp index 244361eb..453f045d 100644 --- a/hiro/gtk/widget/widget.hpp +++ b/hiro/gtk/widget/widget.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Widget) + namespace hiro { struct pWidget : pSizable { @@ -16,3 +18,5 @@ struct pWidget : pSizable { }; } + +#endif diff --git a/hiro/gtk/window.cpp b/hiro/gtk/window.cpp index e82ad5f1..3109f3ec 100644 --- a/hiro/gtk/window.cpp +++ b/hiro/gtk/window.cpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Window) + namespace hiro { static auto Window_close(GtkWidget* widget, GdkEvent* event, pWindow* p) -> signed { @@ -406,3 +408,5 @@ auto pWindow::_statusHeight() const -> signed { } } + +#endif diff --git a/hiro/gtk/window.hpp b/hiro/gtk/window.hpp index 7f88ba8f..55543275 100644 --- a/hiro/gtk/window.hpp +++ b/hiro/gtk/window.hpp @@ -1,3 +1,5 @@ +#if defined(Hiro_Window) + namespace hiro { struct pWindow : pObject { @@ -44,3 +46,5 @@ struct pWindow : pObject { }; } + +#endif diff --git a/hiro/hiro.cpp b/hiro/hiro.cpp index ab89294f..9c4a1418 100644 --- a/hiro/hiro.cpp +++ b/hiro/hiro.cpp @@ -1,6 +1,7 @@ #ifndef HIRO_CPP #define HIRO_CPP +#include "components.hpp" #include "core/core.cpp" #include "extension/extension.cpp" diff --git a/hiro/hiro.hpp b/hiro/hiro.hpp index 8adb9a69..5acf48a4 100644 --- a/hiro/hiro.hpp +++ b/hiro/hiro.hpp @@ -10,6 +10,7 @@ #ifndef HIRO_HPP #define HIRO_HPP +#include "components.hpp" #include "core/core.hpp" #include "extension/extension.hpp" diff --git a/nall/atoi.hpp b/nall/atoi.hpp index 6c2babae..86f05f32 100644 --- a/nall/atoi.hpp +++ b/nall/atoi.hpp @@ -81,19 +81,6 @@ constexpr inline uintmax_t hex(const char* s) { ); } -constexpr inline intmax_t numeral(const char* s) { - return ( - *s == '0' && *(s + 1) == 'X' ? hex_(s + 2) : - *s == '0' && *(s + 1) == 'x' ? hex_(s + 2) : - *s == '0' && *(s + 1) == 'B' ? binary_(s + 2) : - *s == '0' && *(s + 1) == 'b' ? binary_(s + 2) : - *s == '0' ? octal_(s + 1) : - *s == '+' ? +decimal_(s + 1) : - *s == '-' ? -decimal_(s + 1) : - decimal_(s) - ); -} - inline double real(const char* s) { return atof(s); } diff --git a/nall/string.hpp b/nall/string.hpp index 12f4162f..0a8f53ad 100644 --- a/nall/string.hpp +++ b/nall/string.hpp @@ -28,6 +28,7 @@ #define NALL_STRING_INTERNAL_HPP #include #include +#include #include #include #include diff --git a/nall/string/atoi.hpp b/nall/string/atoi.hpp new file mode 100644 index 00000000..9af86f16 --- /dev/null +++ b/nall/string/atoi.hpp @@ -0,0 +1,21 @@ +#ifdef NALL_STRING_INTERNAL_HPP + +namespace nall { + +auto string::integer() const -> intmax_t { + if(beginsWith("0b") || beginsWith("0B")) return nall::binary(data()); + if(beginsWith("0o") || beginsWith("0O")) return nall::octal(data()); + if(beginsWith("0x") || beginsWith("0X")) return nall::hex(data()); + return nall::integer(data()); +} + +auto string::decimal() const -> uintmax_t { + if(beginsWith("0b") || beginsWith("0B")) return nall::binary(data()); + if(beginsWith("0o") || beginsWith("0O")) return nall::octal(data()); + if(beginsWith("0x") || beginsWith("0X")) return nall::hex(data()); + return nall::decimal(data()); +} + +} + +#endif diff --git a/nall/string/base.hpp b/nall/string/base.hpp index 98337f06..f531699e 100644 --- a/nall/string/base.hpp +++ b/nall/string/base.hpp @@ -219,11 +219,9 @@ public: auto begin() const -> const char* { return &data()[0]; } auto end() const -> const char* { return &data()[size()]; } - //nall/atoi.hpp - inline auto integer() const -> intmax_t { return nall::integer(*this); } - inline auto decimal() const -> uintmax_t { return nall::decimal(*this); } - inline auto hex() const -> uintmax_t { return nall::hex(*this); } - inline auto numeral() const -> intmax_t { return nall::numeral(*this); } + //atoi.hpp + inline auto integer() const -> intmax_t; + inline auto decimal() const -> uintmax_t; //core.hpp inline auto operator[](signed) const -> const char&; diff --git a/nall/string/markup/find.hpp b/nall/string/markup/find.hpp index d4b95931..e0080cb1 100644 --- a/nall/string/markup/find.hpp +++ b/nall/string/markup/find.hpp @@ -41,10 +41,10 @@ auto ManagedNode::_evaluate(string query) const -> bool { switch(comparator) { case Comparator::EQ: if(data.match(side(1)) == true) continue; break; case Comparator::NE: if(data.match(side(1)) == false) continue; break; - case Comparator::LT: if(numeral(data) < numeral(side(1))) continue; break; - case Comparator::LE: if(numeral(data) <= numeral(side(1))) continue; break; - case Comparator::GT: if(numeral(data) > numeral(side(1))) continue; break; - case Comparator::GE: if(numeral(data) >= numeral(side(1))) continue; break; + case Comparator::LT: if(data.decimal() < side(1).decimal()) continue; break; + case Comparator::LE: if(data.decimal() <= side(1).decimal()) continue; break; + case Comparator::GT: if(data.decimal() > side(1).decimal()) continue; break; + case Comparator::GE: if(data.decimal() >= side(1).decimal()) continue; break; } return false; @@ -65,10 +65,10 @@ auto ManagedNode::_find(const string& query) const -> vector { name = p(0); if(p(1).find("-")) { p = p(1).split<1>("-"); - lo = p(0).empty() ? 0u : numeral(p(0)); - hi = p(1).empty() ? ~0u : numeral(p(1)); + lo = p(0).empty() ? 0u : p(0).decimal(); + hi = p(1).empty() ? ~0u : p(1).decimal(); } else { - lo = hi = numeral(p(1)); + lo = hi = p(1).decimal(); } } diff --git a/nall/string/markup/node.hpp b/nall/string/markup/node.hpp index 208205ad..67824b70 100644 --- a/nall/string/markup/node.hpp +++ b/nall/string/markup/node.hpp @@ -47,8 +47,8 @@ struct Node { auto text() const -> string { return value().strip(); } auto boolean() const -> bool { return text() == "true"; } - auto integer() const -> intmax_t { return text().numeral(); } - auto decimal() const -> uintmax_t { return text().numeral(); } + auto integer() const -> intmax_t { return text().integer(); } + auto decimal() const -> uintmax_t { return text().decimal(); } auto setName(const string& name = "") -> void { shared->_name = name; } auto setValue(const string& value = "") -> void { shared->_value = value; } diff --git a/target-tomoko/input/input.cpp b/target-tomoko/input/input.cpp index c1fcdc38..1382164f 100644 --- a/target-tomoko/input/input.cpp +++ b/target-tomoko/input/input.cpp @@ -5,7 +5,7 @@ InputManager* inputManager = nullptr; auto InputMapping::bind() -> void { auto token = assignment.split("/"); if(token.size() < 3) return unbind(); - uint64_t id = token[0].hex(); + uint64_t id = hex(token[0]); unsigned group = token[1].decimal(); unsigned input = token[2].decimal(); string qualifier = token(3, "None"); diff --git a/target-tomoko/presentation/presentation.cpp b/target-tomoko/presentation/presentation.cpp index 4cb7bb50..56bc03d4 100644 --- a/target-tomoko/presentation/presentation.cpp +++ b/target-tomoko/presentation/presentation.cpp @@ -103,9 +103,10 @@ Presentation::Presentation() { } auto Presentation::updateEmulator() -> void { - inputPort1.reset(); - inputPort2.reset(); if(!emulator) return; + resetSystem.setVisible(emulator->information.resettable); + inputPort1.setVisible(false).reset(); + inputPort2.setVisible(false).reset(); for(auto n : range(emulator->port)) { if(n >= 2) break; @@ -113,7 +114,7 @@ auto Presentation::updateEmulator() -> void { auto& menu = (n == 0 ? inputPort1 : inputPort2); menu.setText(port.name); - vector items; + vector items; for(auto& device : port.device) { MenuRadioItem item{&menu}; item.setText(device.name).onActivate([=] { @@ -122,7 +123,10 @@ auto Presentation::updateEmulator() -> void { items.append(item); } MenuRadioItem::group(items); + if(items.size() > 1) menu.setVisible(); } + + systemMenuSeparatorPorts.setVisible(inputPort1.visible() || inputPort2.visible()); } auto Presentation::resizeViewport() -> void { @@ -157,8 +161,8 @@ auto Presentation::resizeViewport() -> void { width *= 1 + multiplier; height *= multiplier; - signed x = (desktop.width() - width) / 2; - signed y = (desktop.height() - height) / 2; + signed x = (desktop.width() - width) / 2; + signed y = (desktop.height() - height) / 2; if(x < 0) x = 0; if(y < 0) y = 0; diff --git a/target-tomoko/program/media.cpp b/target-tomoko/program/media.cpp index 904de5a2..de65f08b 100644 --- a/target-tomoko/program/media.cpp +++ b/target-tomoko/program/media.cpp @@ -21,8 +21,9 @@ auto Program::loadMedia(Emulator::Interface& _emulator, Emulator::Interface::Med folderPaths.append(location); emulator = &_emulator; - updateVideoPalette(); emulator->load(media.id); + updateVideoPalette(); + dsp.setFrequency(emulator->audioFrequency()); emulator->power(); presentation->resizeViewport();