├── .clang-format ├── .gitignore ├── .vscode └── c_cpp_properties.json ├── AmigaOS.MUI.cpp.wrapper.code-workspace ├── LICENSE ├── Makefile ├── README.md ├── components └── src │ └── Components │ ├── Buttons │ ├── BasicButton.cpp │ └── BasicButton.hpp │ ├── Core │ ├── Root.cpp │ └── Root.hpp │ ├── MCC │ ├── ActionCycle.cpp │ ├── ActionCycle.hpp │ ├── ActionText.cpp │ ├── ActionText.hpp │ └── Core │ │ ├── ActionRoot.cpp │ │ ├── ActionRoot.hpp │ │ └── Dispatcher │ │ ├── OnActiveEntryDispatcher.hpp │ │ ├── OnClickDispatcher.hpp │ │ ├── OnDoubleClickEntryDispatcher.hpp │ │ └── OnTimerDispatcher.hpp │ └── Tabs │ ├── TabsContainer.cpp │ └── TabsContainer.hpp ├── docs └── assets │ ├── advanced.example.png │ └── basic.example.png ├── examples ├── Makefile ├── advanced │ ├── App.cpp │ ├── App.hpp │ ├── Components │ │ ├── AppWindow.cpp │ │ ├── AppWindow.hpp │ │ ├── Application.cpp │ │ ├── Application.hpp │ │ ├── Core │ │ │ ├── Root.cpp │ │ │ └── Root.hpp │ │ └── Tabs │ │ │ ├── Content.cpp │ │ │ ├── Content.hpp │ │ │ ├── CustomClassesTab.cpp │ │ │ ├── CustomClassesTab.hpp │ │ │ ├── HardwareList.cpp │ │ │ ├── HardwareList.hpp │ │ │ ├── ListAndImageTab.cpp │ │ │ ├── ListAndImageTab.hpp │ │ │ ├── TabsContainerRegister.cpp │ │ │ ├── TabsContainerRegister.hpp │ │ │ ├── TabsContainerTitles.cpp │ │ │ └── TabsContainerTitles.hpp │ ├── Main.cpp │ ├── Main.hpp │ └── img │ │ └── close.160x160.png ├── basic │ ├── Main.cpp │ └── Main.hpp ├── makefile.generic.gcc.mk └── template │ ├── App.hpp │ ├── Components │ ├── AppWindow.hpp │ ├── Core │ │ ├── Root.cpp │ │ └── Root.hpp │ └── InfoWindow.hpp │ ├── Main.cpp │ └── Main.hpp ├── tests └── Makefile └── wrappers ├── Makefile ├── makefile.generic.gcc.mk └── src ├── Core ├── StringStorage.cpp └── StringStorage.hpp ├── MUI ├── Application.cpp ├── Application.hpp ├── Area.cpp ├── Area.hpp ├── Balance.cpp ├── Balance.hpp ├── Coloradjust.cpp ├── Coloradjust.hpp ├── Colorfield.cpp ├── Colorfield.hpp ├── Context │ ├── ApplicationContext.cpp │ └── ApplicationContext.hpp ├── Core │ ├── BuilderRoot.cpp │ ├── BuilderRoot.hpp │ ├── CustomClassManager.cpp │ ├── CustomClassManager.hpp │ ├── CustomClassScope.cpp │ ├── CustomClassScope.hpp │ ├── MakeObject.cpp │ ├── MakeObject.hpp │ ├── MuiMasterBaseScope.cpp │ ├── MuiMasterBaseScope.hpp │ ├── NullObject.cpp │ ├── NullObject.hpp │ ├── Object.cpp │ ├── Object.hpp │ ├── ObjectScope.cpp │ ├── ObjectScope.hpp │ ├── RGBColor.cpp │ ├── RGBColor.hpp │ ├── Root.cpp │ └── Root.hpp ├── Cycle.cpp ├── Cycle.hpp ├── Dtpic.cpp ├── Dtpic.hpp ├── Family.cpp ├── Family.hpp ├── Floattext.cpp ├── Floattext.hpp ├── Fontpanel.cpp ├── Fontpanel.hpp ├── Gadget.cpp ├── Gadget.hpp ├── Gauge.cpp ├── Gauge.hpp ├── Group.cpp ├── Group.hpp ├── Image.cpp ├── Image.hpp ├── List.cpp ├── List.hpp ├── Listview.cpp ├── Listview.hpp ├── MCC │ ├── Busy.cpp │ ├── Busy.hpp │ ├── NList.cpp │ ├── NList.hpp │ ├── NListview.cpp │ ├── NListview.hpp │ ├── TextEditor.cpp │ ├── TextEditor.hpp │ └── ValueTypes │ │ ├── NList │ │ ├── Active.hpp │ │ ├── DragType.hpp │ │ ├── Exchange.hpp │ │ ├── First.hpp │ │ ├── HorizFirst.hpp │ │ ├── Insert.hpp │ │ ├── Jump.hpp │ │ ├── Move.hpp │ │ ├── MultiSelect.hpp │ │ ├── Redraw.hpp │ │ ├── Remove.hpp │ │ ├── Select.hpp │ │ └── TypeSelect.hpp │ │ ├── NListview │ │ ├── HSB.hpp │ │ └── VSB.hpp │ │ └── TextEditor │ │ ├── InsertText.hpp │ │ ├── MarkText.hpp │ │ ├── SetBlock.hpp │ │ ├── TabSize.hpp │ │ └── WrapMode.hpp ├── Menu.cpp ├── Menu.hpp ├── Menuitem.cpp ├── Menuitem.hpp ├── Menustrip.cpp ├── Menustrip.hpp ├── Notifier │ ├── Core │ │ ├── DestNotifierRoot.cpp │ │ ├── DestNotifierRoot.hpp │ │ ├── NotifierObject.cpp │ │ ├── NotifierObject.hpp │ │ ├── NotifyDestType.cpp │ │ ├── NotifyDestType.hpp │ │ ├── SourceNotifier.cpp │ │ └── SourceNotifier.hpp │ ├── Dest │ │ ├── DestApplicationNotifier.cpp │ │ ├── DestApplicationNotifier.hpp │ │ ├── DestAreaNotifier.cpp │ │ ├── DestAreaNotifier.hpp │ │ ├── DestCycleNotifier.cpp │ │ ├── DestCycleNotifier.hpp │ │ ├── DestFamilyNotifier.cpp │ │ ├── DestFamilyNotifier.hpp │ │ ├── DestGadgetNotifier.cpp │ │ ├── DestGadgetNotifier.hpp │ │ ├── DestGroupNotifier.cpp │ │ ├── DestGroupNotifier.hpp │ │ ├── DestListNotifier.cpp │ │ ├── DestListNotifier.hpp │ │ ├── DestMenuitemNotifier.cpp │ │ ├── DestMenuitemNotifier.hpp │ │ ├── DestNotifyNotifier.cpp │ │ ├── DestNotifyNotifier.hpp │ │ ├── DestPendisplayNotifier.cpp │ │ ├── DestPendisplayNotifier.hpp │ │ ├── DestPropNotifier.cpp │ │ ├── DestPropNotifier.hpp │ │ ├── DestRegisterNotifier.cpp │ │ ├── DestRegisterNotifier.hpp │ │ ├── DestStringNotifier.cpp │ │ ├── DestStringNotifier.hpp │ │ ├── DestWindowNotifier.cpp │ │ └── DestWindowNotifier.hpp │ ├── Notifier.cpp │ ├── Notifier.hpp │ └── Source │ │ ├── AreaNotifier.hpp │ │ ├── CycleNotifier.hpp │ │ ├── FamilyNotifier.hpp │ │ ├── GadgetNotifier.hpp │ │ ├── GroupNotifier.hpp │ │ ├── ListNotifier.hpp │ │ ├── MenuitemNotifier.hpp │ │ ├── NotifyNotifier.hpp │ │ ├── PendisplayNotifier.hpp │ │ ├── PropNotifier.hpp │ │ ├── StringNotifier.hpp │ │ └── WindowNotifier.hpp ├── Notify.cpp ├── Notify.hpp ├── Numeric.cpp ├── Numeric.hpp ├── Panel.cpp ├── Panel.hpp ├── Pendisplay.cpp ├── Pendisplay.hpp ├── Popasl.cpp ├── Popasl.hpp ├── Poppen.cpp ├── Poppen.hpp ├── Popstring.cpp ├── Popstring.hpp ├── Prop.cpp ├── Prop.hpp ├── Radio.cpp ├── Radio.hpp ├── Rectangle.cpp ├── Rectangle.hpp ├── Register.cpp ├── Register.hpp ├── Scale.cpp ├── Scale.hpp ├── Scrollbar.cpp ├── Scrollbar.hpp ├── Scrollgroup.cpp ├── Scrollgroup.hpp ├── Slider.cpp ├── Slider.hpp ├── String.cpp ├── String.hpp ├── Text.cpp ├── Text.hpp ├── Title.cpp ├── Title.hpp ├── ValueTypes │ ├── Area │ │ ├── Font.hpp │ │ ├── Frame.hpp │ │ ├── InputMode.hpp │ │ └── PointerType.hpp │ ├── Cycle │ │ └── Active.hpp │ ├── Fontpanel │ │ └── ShowCollection.hpp │ ├── Group │ │ ├── ActivePage.hpp │ │ ├── HorizCenter.hpp │ │ └── VertCenter.hpp │ ├── ImageOrBackground.hpp │ ├── List │ │ ├── Active.hpp │ │ ├── DragType.hpp │ │ ├── HScrollerVisibility.hpp │ │ ├── Jump.hpp │ │ ├── MultiSelect.hpp │ │ ├── NextSelected.hpp │ │ └── ScrollerPos.hpp │ ├── Listview │ │ ├── DragType.hpp │ │ ├── MultiSelect.hpp │ │ └── ScrollerPos.hpp │ ├── Menuitem │ │ └── Shortcut.hpp │ ├── Notify │ │ └── Trigger.hpp │ ├── Prop │ │ └── UseWinBorder.hpp │ ├── Scrollbar │ │ └── Type.hpp │ ├── String │ │ └── Format.hpp │ ├── Text │ │ └── Shorten.hpp │ └── Title │ │ ├── OnLastClose.hpp │ │ └── Position.hpp ├── Virtgroup.cpp ├── Virtgroup.hpp ├── Window.cpp └── Window.hpp └── SDI ├── SDI_compiler.h └── SDI_hook.h /.clang-format: -------------------------------------------------------------------------------- 1 | # Common settings Clang 10 2 | BasedOnStyle: WebKit 3 | TabWidth: 4 4 | IndentWidth: 4 5 | ColumnLimit: 140 6 | --- 7 | Language: Cpp 8 | AlignAfterOpenBracket: true 9 | AccessModifierOffset: -2 10 | IndentCaseLabels: true 11 | PointerAlignment: Right 12 | BreakBeforeBraces: Custom 13 | BraceWrapping: { 14 | AfterCaseLabel: 'true' 15 | AfterClass: 'true' 16 | AfterControlStatement: 'true' 17 | AfterEnum : 'true' 18 | AfterFunction : 'true' 19 | AfterNamespace : 'true' 20 | AfterStruct : 'true' 21 | AfterUnion : 'true' 22 | BeforeCatch : 'true' 23 | BeforeElse : 'true' 24 | IndentBraces : 'false' 25 | AfterExternBlock : 'true' 26 | SplitEmptyFunction : 'true' 27 | SplitEmptyRecord : 'true' 28 | SplitEmptyNamespace : 'true' 29 | } 30 | BreakConstructorInitializersBeforeComma: true 31 | ConstructorInitializerIndentWidth: 2 32 | AllowShortFunctionsOnASingleLine: Empty 33 | NamespaceIndentation: All 34 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Compiled Object files 5 | *.slo 6 | *.lo 7 | *.o 8 | *.obj 9 | 10 | # Precompiled Headers 11 | *.gch 12 | *.pch 13 | 14 | # Compiled Dynamic libraries 15 | *.so 16 | *.dylib 17 | *.dll 18 | 19 | # Fortran module files 20 | *.mod 21 | *.smod 22 | 23 | # Compiled Static libraries 24 | *.lai 25 | *.la 26 | *.a 27 | *.lib 28 | 29 | # Executables 30 | *.exe 31 | *.out 32 | *.app 33 | *.bin 34 | 35 | # folders 36 | examples/out/* 37 | out/* -------------------------------------------------------------------------------- /.vscode/c_cpp_properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "amiga", 5 | "includePath": [ 6 | "../AmigaOS.cpp.wrapper/wrappers/src/", 7 | "${workspaceFolder}/wrappers/src/**", 8 | "${workspaceFolder}/examples/advanced/**", 9 | "${workspaceFolder}/components/src/**", 10 | "/opt/amiga/m68k-amigaos/ndk-include/", 11 | "/opt/amiga/m68k-amigaos/include/" 12 | ], 13 | "defines": [], 14 | "compilerPath": "/opt/amiga/bin/m68k-amigaos-g++", 15 | "cStandard": "c17", 16 | "cppStandard": "c++17", 17 | "intelliSenseMode": "${default}", 18 | "compilerArgs": [ 19 | "-lamiga", 20 | "-noixemul" 21 | ], 22 | "configurationProvider": "ms-vscode.makefile-tools" 23 | } 24 | ], 25 | "version": 4 26 | } -------------------------------------------------------------------------------- /AmigaOS.MUI.cpp.wrapper.code-workspace: -------------------------------------------------------------------------------- 1 | { 2 | "folders": [ 3 | { 4 | "path": "." 5 | } 6 | ], 7 | "settings": {} 8 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022-2024 TDolphin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # MakeFile for "AmigaOS MUI C++ wrapper" project 3 | # 4 | # (c) 2022-2024 TDolphin 5 | # 6 | 7 | SUB_PROJECTS = wrappers tests examples 8 | 9 | all: 10 | @echo "# Available actions:" 11 | @echo "make aos_m68k - AmigaOS m68k build (cross compilation on linux)" 12 | @echo "make mos_ppc - MorphOS PowerPC build" 13 | @echo "make clean - remove all obj files and lib file" 14 | 15 | aos_m68k: sub_projects_aos_m68k 16 | 17 | mos_ppc: sub_projects_mos_ppc 18 | 19 | sub_projects_aos_m68k: 20 | @echo "------------------------------------------------" 21 | @date 22 | @for dir in $(SUB_PROJECTS); do \ 23 | $(MAKE) amigaos_m68k -C $$dir; \ 24 | done 25 | @date 26 | @echo "------------------------------------------------" 27 | 28 | sub_projects_mos_ppc: 29 | @echo "------------------------------------------------" 30 | @date 31 | @for dir in $(SUB_PROJECTS); do \ 32 | $(MAKE) morphos_ppc -C $$dir; \ 33 | done 34 | @date 35 | @echo "------------------------------------------------" 36 | 37 | clean_examples: 38 | $(MAKE) clean -C examples 39 | 40 | clean: 41 | @for dir in $(SUB_PROJECTS); do \ 42 | $(MAKE) clean -C $$dir; \ 43 | done 44 | 45 | rebuild_aos_m68k: clean aos_m68k 46 | 47 | rebuild_mos_ppc: clean mos_ppc 48 | -------------------------------------------------------------------------------- /components/src/Components/Buttons/BasicButton.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // Components 5 | // 6 | // (c) 2022-2024 TDolphin 7 | // 8 | 9 | #include "BasicButton.hpp" 10 | 11 | #include "Components/MCC/ActionText.hpp" 12 | 13 | namespace Components 14 | { 15 | BasicButton::BasicButton(const std::string &label, const std::string &shortHelp, const long weight) 16 | : mComponent(MCC::ActionTextBuilder() 17 | .tagFont(MUI::Font::Button) 18 | .tagInputMode(MUI::InputMode::RelVerify) 19 | .tagBackground(MUI::ImageOrBackground::ButtonBack) 20 | .tagFrame(MUI::Frame::Button) 21 | .tagContents(label) 22 | .tagWeight(weight) 23 | .tagShortHelp(shortHelp) 24 | .object(*this)) 25 | { 26 | } 27 | 28 | void BasicButton::setLabel(const std::string &label) 29 | { 30 | mComponent.setContents(label); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /components/src/Components/Buttons/BasicButton.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // Components 5 | // 6 | // (c) 2022-2024 TDolphin 7 | // 8 | 9 | #pragma once 10 | 11 | #include "Components/Core/Root.hpp" 12 | #include "Components/MCC/Core/Dispatcher/OnClickDispatcher.hpp" 13 | #include "MUI/Text.hpp" 14 | 15 | namespace Components 16 | { 17 | class BasicButton : public Root, public MCC::OnClickDispatcher 18 | { 19 | MUI::Text mComponent; 20 | 21 | public: 22 | BasicButton(const std::string &label, const std::string &shortHelp, const long weight = -1); 23 | 24 | void setLabel(const std::string &label); 25 | 26 | MUI::Text &muiRoot() const 27 | { 28 | return (MUI::Text &)mComponent; 29 | } 30 | }; 31 | } 32 | -------------------------------------------------------------------------------- /components/src/Components/Core/Root.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // Components 5 | // 6 | // (c) 2022-2024 TDolphin 7 | // 8 | 9 | #include "Root.hpp" 10 | 11 | #include 12 | 13 | namespace Components 14 | { 15 | void AbstractRoot::MuiAlert(const std::string &message) const 16 | { 17 | auto appObject = MUI::Notify(muiObject()).getApplicationObject(); 18 | #ifdef MUIV_Requester_Image_Error 19 | auto flags = MUIV_Requester_Image_Error; 20 | #else 21 | auto flags = 0; 22 | #endif 23 | MUI_Request(appObject, nullptr, flags, nullptr, (char *)"_Ok", (char *)message.c_str(), TAG_END); 24 | } 25 | 26 | void AbstractRoot::MuiWarning(const std::string &message) const 27 | { 28 | auto appObject = MUI::Notify(muiObject()).getApplicationObject(); 29 | #ifdef MUIV_Requester_Image_Warning 30 | auto flags = MUIV_Requester_Image_Warning; 31 | #else 32 | auto flags = 0; 33 | #endif 34 | MUI_Request(appObject, nullptr, flags, nullptr, (char *)"_Ok", (char *)message.c_str(), TAG_END); 35 | } 36 | 37 | void AbstractRoot::MuiInfo(const std::string &message, const std::string &gadgets) const 38 | { 39 | auto appObject = MUI::Notify(muiObject()).getApplicationObject(); 40 | MUI_Request(appObject, nullptr, 0, nullptr, (char *)gadgets.c_str(), (char *)message.c_str(), TAG_END); 41 | } 42 | 43 | long AbstractRoot::MuiRequest(const std::string &title, const std::string &message, const std::string &gadgets) const 44 | { 45 | auto appObject = MUI::Notify(muiObject()).getApplicationObject(); 46 | return MUI_Request(appObject, nullptr, 0, (char *)title.c_str(), (char *)gadgets.c_str(), (char *)message.c_str(), TAG_END); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /components/src/Components/Core/Root.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // Components 5 | // 6 | // (c) 2022-2024 TDolphin 7 | // 8 | 9 | #pragma once 10 | 11 | #include "MUI/Notify.hpp" 12 | 13 | namespace Components 14 | { 15 | class AbstractRoot 16 | { 17 | public: 18 | virtual Object *muiObject() const = 0; 19 | 20 | // requesters 21 | void MuiAlert(const std::string &message) const; 22 | void MuiWarning(const std::string &message) const; 23 | void MuiInfo(const std::string &message, const std::string &gadgets) const; 24 | long MuiRequest(const std::string &title, const std::string &message, const std::string &gadgets) const; 25 | }; 26 | 27 | /// @brief Root class for all components (including Application, Windows). 28 | template class NotifyRoot : public AbstractRoot 29 | { 30 | public: 31 | Object *muiObject() const 32 | { 33 | return muiRoot().muiObject(); 34 | } 35 | 36 | operator T &() const 37 | { 38 | return (T &)muiRoot(); 39 | } 40 | 41 | virtual T &muiRoot() const = 0; 42 | }; 43 | 44 | /// @brief Root class for all components builded on at least MUI::Area (base class with MUIA_Disabled attribute) 45 | template class Root : public NotifyRoot 46 | { 47 | public: 48 | void Enable() 49 | { 50 | this->muiRoot().Enable(); 51 | } 52 | 53 | void Disable() 54 | { 55 | this->muiRoot().Disable(); 56 | } 57 | }; 58 | } 59 | -------------------------------------------------------------------------------- /components/src/Components/MCC/ActionCycle.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // Components 5 | // 6 | // (c) 2022-2024 TDolphin 7 | // 8 | 9 | #pragma once 10 | 11 | #include "Core/ActionRoot.hpp" 12 | #include "MUI/Cycle.hpp" 13 | 14 | namespace Components::MCC 15 | { 16 | class ActionCycleDispatcher : public ActionDispatcherRoot 17 | { 18 | public: 19 | /// @brief called when cycle active (MUIA_Cycle_Active, MUIV_EveryTime) 20 | virtual unsigned long OnCycle() = 0; 21 | }; 22 | 23 | class ActionCycleBuilder : public MUI::CycleBuilderTemplate> 24 | { 25 | public: 26 | ActionCycleBuilder(); 27 | 28 | ActionRoot object(ActionCycleDispatcher &dispatcher); 29 | }; 30 | } 31 | -------------------------------------------------------------------------------- /components/src/Components/MCC/ActionText.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // Components 5 | // 6 | // (c) 2022-2024 TDolphin 7 | // 8 | 9 | #include "ActionText.hpp" 10 | 11 | #ifdef TRACE_CUSTOM_COMPONENTS 12 | #include 13 | #endif 14 | 15 | #include 16 | #include 17 | #include 18 | 19 | #include "MUI/Notifier/Notifier.hpp" 20 | 21 | #include "SDI/SDI_compiler.h" 22 | #include "SDI/SDI_hook.h" 23 | 24 | DISPATCHER(ActionTextDispatcherFunc) 25 | { 26 | // Be careful with std::cout, when here is some "debug" info !!! 27 | // It causes that MUI interface hangs during "drag&drop"! 28 | // std::cout << __PRETTY_FUNCTION__ << std::hex << "MethodID: 0x" << msg->MethodID << std::endl; 29 | 30 | auto dispatchMethodResult = Components::MCC::dispatchMethod(msg->MethodID, cl, obj, msg); 31 | if (dispatchMethodResult.dispatchResult) 32 | return dispatchMethodResult.methodResult; 33 | 34 | return DoSuperMethodA(cl, obj, msg); 35 | } 36 | 37 | namespace Components::MCC 38 | { 39 | ActionTextBuilder::ActionTextBuilder() 40 | : MUI::TextBuilderTemplate>("ActionText") 41 | { 42 | } 43 | 44 | ActionRoot ActionTextBuilder::object(OnClickDispatcher &dispatcher) 45 | { 46 | #ifdef TRACE_CUSTOM_COMPONENTS 47 | std::cout << __PRETTY_FUNCTION__ << std::endl; 48 | #endif 49 | PushTag(MUIA_ActionDispatcher, (void *)&dispatcher); 50 | 51 | auto object = MUI::TextBuilderTemplate>::object(sizeof(CustomObjectData), 52 | ENTRY(ActionTextDispatcherFunc)); 53 | 54 | // object (un)pressed -> call dispatcher method 55 | MUI::Notifier::from(object).onPressed(false).notifySelf().method(MUIM_ActionOnClick); 56 | 57 | return object; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /components/src/Components/MCC/ActionText.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // Components 5 | // 6 | // (c) 2022-2024 TDolphin 7 | // 8 | 9 | #pragma once 10 | 11 | #include "Core/Dispatcher/OnClickDispatcher.hpp" 12 | #include "MUI/Text.hpp" 13 | 14 | namespace Components::MCC 15 | { 16 | class ActionTextBuilder : public MUI::TextBuilderTemplate> 17 | { 18 | public: 19 | ActionTextBuilder(); 20 | 21 | ActionRoot object(OnClickDispatcher &dispatcher); 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /components/src/Components/MCC/Core/Dispatcher/OnActiveEntryDispatcher.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // Components 5 | // 6 | // (c) 2022-2024 TDolphin 7 | // 8 | 9 | #pragma once 10 | 11 | #include "../ActionRoot.hpp" 12 | 13 | namespace Components::MCC 14 | { 15 | class OnActiveEntryDispatcher : virtual public ActionDispatcherRoot 16 | { 17 | public: 18 | /// @brief called when entry activated in list 19 | virtual unsigned long OnActiveEntry() = 0; 20 | }; 21 | } 22 | -------------------------------------------------------------------------------- /components/src/Components/MCC/Core/Dispatcher/OnClickDispatcher.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // Components 5 | // 6 | // (c) 2022-2024 TDolphin 7 | // 8 | 9 | #pragma once 10 | 11 | #include "../ActionRoot.hpp" 12 | 13 | namespace Components::MCC 14 | { 15 | class OnClickDispatcher : virtual public ActionDispatcherRoot 16 | { 17 | public: 18 | /// @brief called when area clicked (MUIA_Pressed, FALSE) 19 | virtual unsigned long OnClick() = 0; 20 | }; 21 | } 22 | -------------------------------------------------------------------------------- /components/src/Components/MCC/Core/Dispatcher/OnDoubleClickEntryDispatcher.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // Components 5 | // 6 | // (c) 2022-2024 TDolphin 7 | // 8 | 9 | #pragma once 10 | 11 | #include "../ActionRoot.hpp" 12 | 13 | namespace Components::MCC 14 | { 15 | class OnDoubleClickEntryDispatcher : virtual public ActionDispatcherRoot 16 | { 17 | public: 18 | /// @brief called when entry double clicked in list 19 | virtual unsigned long OnDoubleClickEntry() = 0; 20 | }; 21 | } 22 | -------------------------------------------------------------------------------- /components/src/Components/MCC/Core/Dispatcher/OnTimerDispatcher.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // Components 5 | // 6 | // (c) 2022-2024 TDolphin 7 | // 8 | 9 | #pragma once 10 | 11 | #include "../ActionRoot.hpp" 12 | 13 | namespace Components::MCC 14 | { 15 | class OnTimerDispatcher : virtual public ActionDispatcherRoot 16 | { 17 | public: 18 | /// @brief called when timer 19 | virtual unsigned long OnTimer() = 0; 20 | }; 21 | } 22 | -------------------------------------------------------------------------------- /components/src/Components/Tabs/TabsContainer.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // Components 5 | // 6 | // (c) 2022-2024 TDolphin 7 | // 8 | 9 | #include "TabsContainer.hpp" 10 | 11 | #include "MUI/Text.hpp" 12 | 13 | namespace Components 14 | { 15 | TabsContainer::TabsContainer(const std::vector> &tabs) 16 | #ifdef MUIC_Title 17 | : mTabsTitle(MUI::TitleBuilder().object()) 18 | , mComponent(MUI::GroupBuilder() 19 | .tagCycleChain() 20 | .tagChild(mTabsTitle) 21 | #ifdef __MORPHOS__ 22 | .tagPageMode() 23 | .tagBackground(MUI::ImageOrBackground::RegisterBack) 24 | .tagFrame(MUI::Frame::Register) 25 | #endif 26 | .object()) 27 | #else 28 | : mPageTitles(tabs.size()) 29 | , mpPageTitlesArray(new const char *[tabs.size()]) 30 | , mComponent(MUI::RegisterBuilder() 31 | .tagTitles([&]() { 32 | unsigned int index = 0; 33 | for (auto &tab : tabs) 34 | { 35 | mPageTitles.push_back(tab.first); 36 | mpPageTitlesArray[index++] = (char *)mPageTitles.back().c_str(); 37 | } 38 | mpPageTitlesArray[index++] = (char *)nullptr; 39 | return mpPageTitlesArray; 40 | }()) 41 | .object()) 42 | #endif 43 | { 44 | #ifdef MUIC_Title 45 | for (auto &tab : tabs) 46 | mTabsTitle.AddTail(MUI::TextBuilder().tagContents(tab.first).object()); 47 | for (auto &tab : tabs) 48 | { 49 | #ifdef MUIM_Group_AddTail 50 | mComponent.AddTail(tab.second); 51 | #else 52 | mComponent.AddMember(tab.second); 53 | #endif 54 | } 55 | #else 56 | for (auto &tab : tabs) 57 | { 58 | #ifdef MUIM_Group_AddTail 59 | mComponent.AddTail(tab.second); 60 | #else 61 | mComponent.AddMember(tab.second); 62 | #endif 63 | } 64 | #endif 65 | } 66 | 67 | TabsContainer::~TabsContainer() 68 | { 69 | #ifndef MUIC_Title 70 | delete[] mpPageTitlesArray; 71 | #endif 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /components/src/Components/Tabs/TabsContainer.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // Components 5 | // 6 | // (c) 2022-2024 TDolphin 7 | // 8 | 9 | #pragma once 10 | 11 | #include "Components/Core/Root.hpp" 12 | #include "MUI/Register.hpp" 13 | #include "MUI/Title.hpp" 14 | 15 | #include 16 | #include 17 | 18 | namespace Components 19 | { 20 | /// @brief Tabs/Pages with usage of MUI::Register 21 | class TabsContainer : public Root 22 | { 23 | #ifdef MUIC_Title 24 | MUI::Title mTabsTitle; 25 | MUI::Group mComponent; 26 | #else 27 | std::vector mPageTitles; 28 | const char **mpPageTitlesArray; 29 | MUI::Register mComponent; 30 | #endif 31 | 32 | public: 33 | TabsContainer(const std::vector> &tabs); 34 | ~TabsContainer(); 35 | 36 | MUI::Register &muiRoot() const 37 | { 38 | return (MUI::Register &)mComponent; 39 | } 40 | }; 41 | } 42 | -------------------------------------------------------------------------------- /docs/assets/advanced.example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tdolphin-org/AmigaOS.MUI.cpp.wrapper/c6a991d9d9c0345680caf885e0ff410f76cde5b3/docs/assets/advanced.example.png -------------------------------------------------------------------------------- /docs/assets/basic.example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tdolphin-org/AmigaOS.MUI.cpp.wrapper/c6a991d9d9c0345680caf885e0ff410f76cde5b3/docs/assets/basic.example.png -------------------------------------------------------------------------------- /examples/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # MakeFile for AmigaOS MUI C++ wrapper 3 | # 4 | # Examples 5 | # 6 | # (c) 2022-2024 TDolphin 7 | # 8 | 9 | all: 10 | @echo "# Available actions:" 11 | @echo "make amigaos_m68k - AmigaOS m68k build (cross compilation on linux)" 12 | @echo "make morphos_ppc - MorphOS PowerPC build" 13 | @echo "make clean - remove all obj files" 14 | 15 | amigaos_m68k: 16 | @echo "# Build for AmigaOS m68k" 17 | $(MAKE) -f makefile.generic.gcc.mk APP_EXAMPLE=basic.example.bin PROJECT=basic MODULES= \ 18 | AOSCPP_PATH=../../AmigaOS.cpp.wrapper \ 19 | SUB_BUILD_PATH=amigaos/m68k CPPC=m68k-amigaos-g++ AR=m68k-amigaos-ar STRIP=m68k-amigaos-strip OBJDUMP=m68k-amigaos-objdump all 20 | $(MAKE) -f makefile.generic.gcc.mk APP_EXAMPLE=advanced.example.bin PROJECT=advanced MODULES=Components,Components/Core,Components/Tabs \ 21 | AOSCPP_PATH=../../AmigaOS.cpp.wrapper \ 22 | SUB_BUILD_PATH=amigaos/m68k CPPC=m68k-amigaos-g++ AR=m68k-amigaos-ar STRIP=m68k-amigaos-strip OBJDUMP=m68k-amigaos-objdump all 23 | cp advanced/img/* out/amigaos/m68k 24 | 25 | morphos_ppc: 26 | @echo "# Build for MorphOS PowerPC" 27 | $(MAKE) -f makefile.generic.gcc.mk APP_EXAMPLE=basic.example.bin PROJECT=basic MODULES= \ 28 | AOSCPP_PATH=../../AmigaOS.cpp.wrapper \ 29 | SUB_BUILD_PATH=morphos/ppc CPPC=g++ AR=ar STRIP=strip MORE_CPP_FLAGS=-noixemul OBJDUMP=objdump all 30 | $(MAKE) -f makefile.generic.gcc.mk APP_EXAMPLE=advanced.example.bin PROJECT=advanced MODULES=Components,Components/Core,Components/Tabs \ 31 | AOSCPP_PATH=../../AmigaOS.cpp.wrapper \ 32 | SUB_BUILD_PATH=morphos/ppc CPPC=g++ AR=ar STRIP=strip MORE_CPP_FLAGS=-noixemul OBJDUMP=objdump all 33 | cp advanced/img/* out/morphos/ppc 34 | 35 | clean: 36 | rm -f -R obj/* 37 | -------------------------------------------------------------------------------- /examples/advanced/App.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // Advanced Example 5 | // 6 | // (c) 2022-2024 TDolphin 7 | // 8 | 9 | #include "App.hpp" 10 | 11 | #include "MUI/Context/ApplicationContext.hpp" 12 | 13 | #include 14 | #include 15 | #include 16 | 17 | using namespace std; 18 | 19 | AppCore::AppCore() { } 20 | 21 | void AppCore::Run() 22 | { 23 | // application scope 24 | // do MUI_DisposeObject(..) on destructor 25 | MUI::ApplicationScope application(mApplication); 26 | 27 | mApplication.RegisterEvents(); 28 | 29 | // list of application windows 30 | for (auto window : mApplication.muiRoot().getWindowList()) 31 | std::cout << "muiObjectPtr = " << window.muiObject() << " id=" << window.getID().toString() << std::endl; 32 | 33 | auto appWindow = MUI::ApplicationContext::instance().getAppWindow(); 34 | // open window on constructor, close on destructor 35 | MUI::WindowScope window(appWindow); 36 | 37 | // appWindow.setScreenTitle(); 38 | 39 | // main application loop 40 | ULONG signals = 0; 41 | while (DoMethod(mApplication.muiObject(), MUIM_Application_NewInput, &signals) != MUIV_Application_ReturnID_Quit) 42 | { 43 | if (signals) 44 | { 45 | signals = Wait(signals | SIGBREAKF_CTRL_C); 46 | if (signals & SIGBREAKF_CTRL_C) 47 | break; 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /examples/advanced/App.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // Advanced Example 5 | // 6 | // (c) 2022-2024 TDolphin 7 | // 8 | 9 | #pragma once 10 | 11 | #include "Components/Application.hpp" 12 | #include "Core/Singleton.hpp" 13 | #include "MUI/Core/MuiMasterBaseScope.hpp" 14 | 15 | class AppCore 16 | { 17 | friend class td::Singleton; 18 | 19 | // open MUI library, close on destructor 20 | MuiMasterBaseScope muiBase; 21 | 22 | Components::Application mApplication; 23 | 24 | AppCore(); 25 | 26 | public: 27 | void Run(); 28 | }; 29 | 30 | /// @brief main Application (singleton) object 31 | typedef class td::Singleton App; 32 | -------------------------------------------------------------------------------- /examples/advanced/Components/AppWindow.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // Advanced Example 5 | // 6 | // (c) 2022-2024 TDolphin 7 | // 8 | 9 | #pragma once 10 | 11 | #include "Core/Root.hpp" 12 | #include "MUI/Text.hpp" 13 | #include "MUI/Window.hpp" 14 | #include "Tabs/Content.hpp" 15 | 16 | namespace Components 17 | { 18 | class AppWindow : public Root 19 | { 20 | MUI::Area mCloseButton; 21 | Content mContent; 22 | MUI::Text mInfoText; 23 | MUI::Window mComponent; 24 | 25 | public: 26 | AppWindow(); 27 | 28 | void RegisterEvents(); 29 | 30 | operator MUI::Window &() const 31 | { 32 | return (MUI::Window &)mComponent; 33 | } 34 | 35 | MUI::Window &muiRoot() 36 | { 37 | return mComponent; 38 | } 39 | 40 | protected: 41 | const MUI::Notify &muiNotify() const 42 | { 43 | return mComponent; 44 | } 45 | }; 46 | } 47 | -------------------------------------------------------------------------------- /examples/advanced/Components/Application.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // Advanced Example 5 | // 6 | // (c) 2022-2024 TDolphin 7 | // 8 | 9 | #include "Application.hpp" 10 | 11 | #include "MUI/Notifier/Notifier.hpp" 12 | 13 | namespace Components 14 | { 15 | Application::Application() 16 | : mComponent(MUI::ApplicationBuilder() 17 | .tagAuthor("rz") 18 | .tagBase("advanced.example.bin") 19 | .tagCopyright("(c) 2022-2024 TDolphin") 20 | .tagDescription("Advanced Example of usage MUI C++ wrapper") 21 | .tagTitle("Advanced Example") 22 | .tagVersion("$VER: 1.0") 23 | .tagWindow(mAppWindow) 24 | .object()) 25 | { 26 | } 27 | 28 | void Application::RegisterEvents() 29 | { 30 | MUI::Notifier::from(mAppWindow.muiRoot()).onCloseRequest(true).notifyObject(mComponent).returnIDQuit(); 31 | 32 | mAppWindow.RegisterEvents(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /examples/advanced/Components/Application.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // Advanced Example 5 | // 6 | // (c) 2022-2024 TDolphin 7 | // 8 | 9 | #pragma once 10 | 11 | #include "AppWindow.hpp" 12 | #include "Components/Core/Root.hpp" 13 | #include "MUI/Application.hpp" 14 | 15 | namespace Components 16 | { 17 | class Application : public Root 18 | { 19 | AppWindow mAppWindow; 20 | MUI::Application mComponent; 21 | 22 | public: 23 | Application(); 24 | 25 | void RegisterEvents(); 26 | 27 | operator MUI::Application &() 28 | { 29 | return mComponent; 30 | } 31 | 32 | MUI::Application &muiRoot() const 33 | { 34 | return (MUI::Application &)mComponent; 35 | } 36 | 37 | protected: 38 | const MUI::Notify &muiNotify() const 39 | { 40 | return mComponent; 41 | } 42 | }; 43 | } 44 | -------------------------------------------------------------------------------- /examples/advanced/Components/Core/Root.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // Advanced Example 5 | // 6 | // (c) 2022-2024 TDolphin 7 | // 8 | 9 | #include "Root.hpp" 10 | 11 | #include 12 | 13 | namespace Components 14 | { 15 | void Root::MuiAlert(const std::string &message) const 16 | { 17 | auto appObject = muiNotify().getApplicationObject(); 18 | #ifdef MUIV_Requester_Image_Error 19 | auto flags = MUIV_Requester_Image_Error; 20 | #else 21 | auto flags = 0; 22 | #endif 23 | MUI_Request(appObject, nullptr, flags, nullptr, (char *)"_Ok", (char *)message.c_str(), TAG_END); 24 | } 25 | 26 | void Root::MuiWarning(const std::string &message) const 27 | { 28 | auto appObject = muiNotify().getApplicationObject(); 29 | #ifdef MUIV_Requester_Image_Warning 30 | auto flags = MUIV_Requester_Image_Warning; 31 | #else 32 | auto flags = 0; 33 | #endif 34 | MUI_Request(appObject, nullptr, flags, nullptr, (char *)"_Ok", (char *)message.c_str(), TAG_END); 35 | } 36 | 37 | void Root::MuiInfo(const std::string &message, const std::string &gadgets) const 38 | { 39 | auto appObject = muiNotify().getApplicationObject(); 40 | MUI_Request(appObject, nullptr, 0, nullptr, (char *)gadgets.c_str(), (char *)message.c_str(), TAG_END); 41 | } 42 | 43 | long Root::MuiRequest(const std::string &title, const std::string &message, const std::string &gadgets) const 44 | { 45 | auto appObject = muiNotify().getApplicationObject(); 46 | return MUI_Request(appObject, nullptr, 0, (char *)title.c_str(), (char *)gadgets.c_str(), (char *)message.c_str(), TAG_END); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /examples/advanced/Components/Core/Root.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // Advanced Example 5 | // 6 | // (c) 2022-2024 TDolphin 7 | // 8 | 9 | #pragma once 10 | 11 | #include "MUI/Notify.hpp" 12 | 13 | namespace Components 14 | { 15 | class Root 16 | { 17 | public: 18 | Object *muiObject() const 19 | { 20 | return muiNotify().muiObject(); 21 | } 22 | 23 | operator const MUI::Notify &() const 24 | { 25 | return muiNotify(); 26 | } 27 | 28 | void MuiAlert(const std::string &message) const; 29 | void MuiWarning(const std::string &message) const; 30 | void MuiInfo(const std::string &message, const std::string &gadgets) const; 31 | long MuiRequest(const std::string &title, const std::string &message, const std::string &gadgets) const; 32 | 33 | protected: 34 | virtual const MUI::Notify &muiNotify() const = 0; 35 | }; 36 | } 37 | -------------------------------------------------------------------------------- /examples/advanced/Components/Tabs/Content.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // Advanced Example 5 | // 6 | // (c) 2022-2024 TDolphin 7 | // 8 | 9 | #pragma once 10 | 11 | #include "CustomClassesTab.hpp" 12 | #include "ListAndImageTab.hpp" 13 | #include "TabsContainerRegister.hpp" // version using MUI::Register for tabs/pages 14 | #include "TabsContainerTitles.hpp" // version using MUI::Titles for tabs/pages 15 | 16 | namespace Components 17 | { 18 | class Content : public Root 19 | { 20 | MUI::Group mRegisterInfoGroup; 21 | ListAndImageTab mListAndImageTab; 22 | TabsContainerRegister mLeftTabsRegister; 23 | 24 | MUI::Group mTitleInfoGroup; 25 | CustomClassesTab mCustomClassesTab; 26 | TabsContainerTitles mRightTabsTitles; 27 | 28 | MUI::Group mComponent; 29 | 30 | public: 31 | Content(); 32 | 33 | protected: 34 | const MUI::Notify &muiNotify() const 35 | { 36 | return mComponent; 37 | } 38 | }; 39 | } 40 | -------------------------------------------------------------------------------- /examples/advanced/Components/Tabs/CustomClassesTab.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // Advanced Example 5 | // 6 | // (c) 2022-2024 TDolphin 7 | // 8 | 9 | #include "CustomClassesTab.hpp" 10 | 11 | const char *items[] = { "AmigaOS", "MorphOS", "AROS", nullptr }; 12 | const char *itemsWrapped[] = { "AmigaOS 3.1", "MorphOS 3.18", "AROS 2k23", nullptr }; 13 | const char *itemLong = "AmigaOS MUI C++ wrapper .. Advanced Example .. (c) 2022-2024 TDolphin"; 14 | 15 | namespace Components 16 | { 17 | CustomClassesTab::CustomClassesTab() 18 | : mItemsNList(MUI::MCC::NListBuilder() 19 | .tagObjectID("NLST") 20 | .tagDefaultObjectOnClick(true) 21 | .tagFormat("WEIGHT=200 BAR, MINPIXWIDTH=4 COLWIDTH=4 BAR, MINPIXWIDTH=4 COLWIDTH=4 BAR") 22 | .tagMultiSelect(MUI::MCC::NList_MultiSelect::None) 23 | .tagSourceArray(items) 24 | .tagAutoVisible(true) 25 | .tagEntryValueDependent(true) 26 | .tagTitle(true) 27 | .tagTitleSeparator(true) 28 | .tagFont(MUI::Font::Fixed) 29 | .tagConstructHookString() 30 | .tagDestructHookString() 31 | .tagFrame(MUI::Frame::ReadList) 32 | .object()) 33 | , mItemsNListview(MUI::MCC::NListviewBuilder() 34 | .tagHoriz_ScrollBar(MUI::MCC::NListview_HSB::Always) 35 | .tagVert_ScrollBar(MUI::MCC::NListview_VSB::Always) 36 | .tagNList(mItemsNList) 37 | .object()) 38 | , mComponent(MUI::GroupBuilder().tagChild(mItemsNListview).object()) 39 | { 40 | mItemsNList.InsertWrapBottom((const void **)itemsWrapped, MUI::MCC::NList_WrapCol::WrapColumn0, MUI::MCC::NList_Align::Left); 41 | mItemsNList.InsertSingleWrapBottom(itemLong, MUI::MCC::NList_WrapCol::WrapColumn0, MUI::MCC::NList_Align::Left); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /examples/advanced/Components/Tabs/CustomClassesTab.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // Advanced Example 5 | // 6 | // (c) 2022-2024 TDolphin 7 | // 8 | 9 | #pragma once 10 | 11 | #include "Components/Core/Root.hpp" 12 | #include "MUI/Group.hpp" 13 | #include "MUI/MCC/NListview.hpp" 14 | 15 | namespace Components 16 | { 17 | class CustomClassesTab : public Root 18 | { 19 | MUI::MCC::NList mItemsNList; 20 | MUI::MCC::NListview mItemsNListview; 21 | 22 | MUI::Group mComponent; 23 | 24 | public: 25 | CustomClassesTab(); 26 | 27 | operator MUI::Group &() 28 | { 29 | return mComponent; 30 | } 31 | 32 | protected: 33 | const MUI::Notify &muiNotify() const 34 | { 35 | return mComponent; 36 | } 37 | }; 38 | } 39 | -------------------------------------------------------------------------------- /examples/advanced/Components/Tabs/HardwareList.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // Advanced Example 5 | // 6 | // (c) 2022-2024 TDolphin 7 | // 8 | 9 | #include "HardwareList.hpp" 10 | 11 | #include "MUI/Notifier/Notifier.hpp" 12 | 13 | const char *hardwareItems[] = { "Amiga 1000", "Amiga 500", "Amiga 2000", "Amiga 3000", "Amiga 600", "Amiga 1200", "Amiga 4000", nullptr }; 14 | 15 | namespace Components 16 | { 17 | HardwareList::HardwareList() 18 | : mComponent(MUI::ListBuilder().tagFrame(MUI::Frame::ReadList).tagSourceArray(hardwareItems).tagWeight(50).object()) 19 | { 20 | mComponent.InsertSingleBottom("Walker"); 21 | 22 | #ifdef MUIA_List_DoubleClick 23 | MUI::Notifier::from(mComponent).onDoubleClick(true).notifySelf().setActive(0); 24 | #endif 25 | MUI::Notifier::from(mComponent).onSelected(true).notifySelf().setActive(0); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /examples/advanced/Components/Tabs/HardwareList.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // Advanced Example 5 | // 6 | // (c) 2022-2024 TDolphin 7 | // 8 | 9 | #pragma once 10 | 11 | #include "Components/Core/Root.hpp" 12 | #include "MUI/List.hpp" 13 | 14 | namespace Components 15 | { 16 | class HardwareList : public Root 17 | { 18 | MUI::List mComponent; 19 | 20 | public: 21 | HardwareList(); 22 | 23 | protected: 24 | const MUI::Notify &muiNotify() const 25 | { 26 | return mComponent; 27 | } 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /examples/advanced/Components/Tabs/ListAndImageTab.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // Advanced Example 5 | // 6 | // (c) 2022-2024 TDolphin 7 | // 8 | 9 | #include "ListAndImageTab.hpp" 10 | 11 | #include "MUI/Core/MakeObject.hpp" 12 | 13 | namespace Components 14 | { 15 | ListAndImageTab::ListAndImageTab() 16 | : mExampleImage(MUI::ImageBuilder() 17 | .tagFrame(MUI::Frame::Button) 18 | .tagFixWidth(160) 19 | .tagFixHeight(160) 20 | .tagSpecPicture("PROGDIR:close.160x160.png") 21 | .tagFreeHoriz(true) 22 | .tagFreeVert(true) 23 | .object()) 24 | , mComponent(MUI::GroupBuilder() 25 | .horizontal() 26 | .tagChild(mHardwareList) 27 | .tagChild(MUI::GroupBuilder() 28 | .vertical() 29 | .tagChild(MUI::MakeObject::HVSpace()) 30 | .tagChild(mExampleImage) 31 | .tagChild(MUI::MakeObject::HVSpace()) 32 | .object()) 33 | .object()) 34 | { 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /examples/advanced/Components/Tabs/ListAndImageTab.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // Advanced Example 5 | // 6 | // (c) 2022-2024 TDolphin 7 | // 8 | 9 | #pragma once 10 | 11 | #include "Components/Core/Root.hpp" 12 | #include "HardwareList.hpp" 13 | #include "MUI/Group.hpp" 14 | #include "MUI/Image.hpp" 15 | 16 | namespace Components 17 | { 18 | class ListAndImageTab : public Root 19 | { 20 | MUI::Image mExampleImage; 21 | HardwareList mHardwareList; 22 | 23 | MUI::Group mComponent; 24 | 25 | public: 26 | ListAndImageTab(); 27 | 28 | operator MUI::Group &() 29 | { 30 | return mComponent; 31 | } 32 | 33 | protected: 34 | const MUI::Notify &muiNotify() const 35 | { 36 | return mComponent; 37 | } 38 | }; 39 | } 40 | -------------------------------------------------------------------------------- /examples/advanced/Components/Tabs/TabsContainerRegister.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // Advanced Example 5 | // 6 | // (c) 2022-2024 TDolphin 7 | // 8 | 9 | #include "TabsContainerRegister.hpp" 10 | 11 | namespace Components 12 | { 13 | TabsContainerRegister::TabsContainerRegister(const std::vector> &tabs) 14 | : mPageTitles(tabs.size()) 15 | , mpPageTitlesArray(new const char *[tabs.size()]) 16 | , mComponent(MUI::RegisterBuilder() 17 | .tagTitles([&]() { 18 | unsigned int index = 0; 19 | for (auto &tab : tabs) 20 | { 21 | mPageTitles.push_back(tab.first); 22 | mpPageTitlesArray[index++] = (char *)mPageTitles.back().c_str(); 23 | } 24 | mpPageTitlesArray[index++] = (char *)nullptr; 25 | return mpPageTitlesArray; 26 | }()) 27 | .object()) 28 | { 29 | for (auto &tab : tabs) 30 | { 31 | #ifdef MUIM_Group_AddTail 32 | mComponent.AddTail(tab.second); 33 | #else 34 | mComponent.AddMember(tab.second); 35 | #endif 36 | } 37 | } 38 | 39 | TabsContainerRegister::~TabsContainerRegister() 40 | { 41 | delete[] mpPageTitlesArray; 42 | } 43 | } -------------------------------------------------------------------------------- /examples/advanced/Components/Tabs/TabsContainerRegister.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // Advanced Example 5 | // 6 | // (c) 2022-2024 TDolphin 7 | // 8 | 9 | #pragma once 10 | 11 | #include "Components/Core/Root.hpp" 12 | 13 | #include "MUI/Register.hpp" 14 | 15 | #include 16 | #include 17 | 18 | namespace Components 19 | { 20 | /// @brief Tabs/Pages with usage of MUI::Register 21 | class TabsContainerRegister : public Root 22 | { 23 | std::vector mPageTitles; 24 | const char **mpPageTitlesArray; 25 | MUI::Register mComponent; 26 | 27 | public: 28 | TabsContainerRegister(const std::vector> &tabs); 29 | ~TabsContainerRegister(); 30 | 31 | const MUI::Notify &muiNotify() const 32 | { 33 | return mComponent; 34 | } 35 | }; 36 | } 37 | -------------------------------------------------------------------------------- /examples/advanced/Components/Tabs/TabsContainerTitles.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // Advanced Example 5 | // 6 | // (c) 2022-2024 TDolphin 7 | // 8 | 9 | #include "TabsContainerTitles.hpp" 10 | 11 | #include "MUI/Text.hpp" 12 | 13 | namespace Components 14 | { 15 | TabsContainerTitles::TabsContainerTitles(const std::vector> &tabs) 16 | #ifdef MUIC_Title 17 | : mTabsTitle(MUI::TitleBuilder().tagClosable(true).tagNewable(true).object()) 18 | #else 19 | : mTitleNotSupportedText(MUI::TextBuilder().tagContents("MUI::Title not supported (compiled) by this MUI version").object()) 20 | #endif 21 | , mComponent(MUI::GroupBuilder() 22 | .tagCycleChain() 23 | #ifdef MUIC_Title 24 | .tagChild(mTabsTitle) 25 | #else 26 | .tagChild(mTitleNotSupportedText) 27 | #endif 28 | #ifdef __MORPHOS__ 29 | .tagPageMode() 30 | .tagBackground(MUI::ImageOrBackground::RegisterBack) 31 | .tagFrame(MUI::Frame::Register) 32 | #endif 33 | .object()) 34 | { 35 | #ifdef MUIC_Title 36 | for (auto &tab : tabs) 37 | mTabsTitle.AddTail(MUI::TextBuilder().tagContents(tab.first).object()); 38 | #endif 39 | for (auto &tab : tabs) 40 | { 41 | #ifdef MUIM_Group_AddTail 42 | mComponent.AddTail(tab.second); 43 | #else 44 | mComponent.AddMember(tab.second); 45 | #endif 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /examples/advanced/Components/Tabs/TabsContainerTitles.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // Advanced Example 5 | // 6 | // (c) 2022-2024 TDolphin 7 | // 8 | 9 | #pragma once 10 | 11 | #include "Components/Core/Root.hpp" 12 | 13 | #include "MUI/Group.hpp" 14 | #include "MUI/Title.hpp" 15 | #include "MUI/Text.hpp" 16 | 17 | #include 18 | #include 19 | 20 | namespace Components 21 | { 22 | /// @brief Tabs/Pages with usage of MUI::Titles 23 | class TabsContainerTitles : public Root 24 | { 25 | #ifdef MUIC_Title 26 | MUI::Title mTabsTitle; 27 | #else 28 | MUI::Text mTitleNotSupportedText; 29 | #endif 30 | MUI::Group mComponent; 31 | 32 | public: 33 | TabsContainerTitles(const std::vector> &tabs); 34 | 35 | const MUI::Notify &muiNotify() const 36 | { 37 | return mComponent; 38 | } 39 | }; 40 | } 41 | -------------------------------------------------------------------------------- /examples/advanced/Main.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // Advanced Example 5 | // 6 | // (c) 2022-2024 TDolphin 7 | // 8 | 9 | #include "Main.hpp" 10 | 11 | #include "App.hpp" 12 | 13 | #include 14 | 15 | using namespace std; 16 | 17 | int main(int argc, char **argv) 18 | { 19 | cout << "advanced MUI application example, showing usage of 'AmigaOS MUI C++ wrapper'" << endl; 20 | 21 | try 22 | { 23 | App::instance().Run(); 24 | } 25 | catch (const runtime_error &e) 26 | { 27 | cerr << "Runtime exception: " << e.what() << endl; 28 | return -1; 29 | } 30 | catch (const exception &e) 31 | { 32 | cerr << "Exception: " << e.what() << endl; 33 | return RETURN_FAIL; 34 | } 35 | catch (...) 36 | { 37 | cerr << "Unknown exception (...)" << endl; 38 | return RETURN_FAIL; 39 | } 40 | 41 | std::cout << "Application finished!" << std::endl; 42 | 43 | return RETURN_OK; 44 | } 45 | -------------------------------------------------------------------------------- /examples/advanced/Main.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // Advanced Example 5 | // 6 | // (c) 2022-2024 TDolphin 7 | // 8 | 9 | #pragma once 10 | -------------------------------------------------------------------------------- /examples/advanced/img/close.160x160.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tdolphin-org/AmigaOS.MUI.cpp.wrapper/c6a991d9d9c0345680caf885e0ff410f76cde5b3/examples/advanced/img/close.160x160.png -------------------------------------------------------------------------------- /examples/basic/Main.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // Basic Example 5 | // 6 | // (c) 2022-2024 TDolphin 7 | // 8 | 9 | #pragma once 10 | -------------------------------------------------------------------------------- /examples/makefile.generic.gcc.mk: -------------------------------------------------------------------------------- 1 | # 2 | # AmigaOS MUI C++ wrapper 3 | # 4 | # Examples 5 | # 6 | # (c) 2022-2024 TDolphin 7 | # 8 | # generic makefile for gcc 9 | # 10 | # for MorphOS (host) (ppc) 11 | # 12 | # requires: MUI dev (MorphOS SDK) 13 | # 14 | # for Linux (host) x86_64 (64-bit) 15 | # 16 | # cross compilation setup from -> https://github.com/bebbo/amiga-gcc 17 | # 18 | # requires: MUI3.8 or MUI5 dev 19 | # 20 | 21 | # replace , => space 22 | MORE_CPP_FLAGS_X = $(shell echo $(MORE_CPP_FLAGS) | tr ',' ' ') 23 | MORE_LFLAGS_X = $(shell echo $(MORE_LFLAGS) | tr ',' ' ') 24 | 25 | CPP_FLAGS = $(DEBUG_FLAGS) $(MORE_CPP_FLAGS_X) -I${AOSCPP_PATH}/wrappers/src -I$(PROJECT) -I../wrappers/src -O1 26 | LFLAGS = -L../wrappers/lib/$(SUB_BUILD_PATH) -lMUIcpp $(MORE_LFLAGS_X) -lstdc++ -noixemul -Os 27 | 28 | dir_guard = mkdir -p $(@D) 29 | 30 | BINPATH = out/$(SUB_BUILD_PATH) 31 | 32 | SRC_DIRS = $(shell echo $(MODULES) | tr ',' ' ') 33 | SRCS = $(wildcard $(PROJECT)/*.cpp) $(foreach sdir,$(SRC_DIRS),$(wildcard $(PROJECT)/$(sdir)/*.cpp)) 34 | OBJS = $(patsubst %.cpp,obj/$(SUB_BUILD_PATH)/%.o,$(SRCS)) 35 | 36 | all: $(BINPATH)/$(APP_EXAMPLE) 37 | 38 | $(BINPATH)/$(APP_EXAMPLE): $(OBJS) 39 | $(dir_guard) 40 | @echo "## Linking example ..." 41 | $(CPPC) $^ $(LFLAGS) -o $@_nonstripped 42 | @echo "## Stripping ..." 43 | $(STRIP) --remove-section=.comment $@_nonstripped -o $@ 44 | $(OBJDUMP) --syms --reloc --disassemble-all $@_nonstripped > $@_disassembled 45 | @echo "## Finished." 46 | 47 | obj/$(SUB_BUILD_PATH)/%.o: %.cpp %.hpp 48 | $(dir_guard) 49 | $(CPPC) $(CPP_FLAGS) -c $< -o $@ 50 | 51 | clean : 52 | rm -f obj/$(SUB_BUILD_PATH)/*.o 53 | rm -f -R out/$(SUB_BUILD_PATH)/* 54 | 55 | rebuild : clean all 56 | -------------------------------------------------------------------------------- /examples/template/App.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // Application Template 5 | // 6 | // (c) 20xx XXXXX 7 | // 8 | 9 | #pragma once 10 | 11 | #include "Components/AppWindow.hpp" 12 | #include "Components/Application.hpp" 13 | #include "Components/InfoWindow.hpp" 14 | #include "Core/Singleton.hpp" 15 | #include "MUI/Core/MuiMasterBaseScope.hpp" 16 | 17 | class AppCore 18 | { 19 | friend class td::Singleton; 20 | 21 | // open MUI library, close on destructor 22 | MuiMasterBaseScope muiBase; 23 | 24 | Components::AppWindow mAppWindow; 25 | Components::InfoWindow mInfoWindow; 26 | Components::Application mApplication; 27 | 28 | AppCore(); 29 | ~AppCore(); 30 | 31 | public: 32 | void Run(); 33 | }; 34 | 35 | /// @brief main Application (singleton) object 36 | using App = td::Singleton; 37 | -------------------------------------------------------------------------------- /examples/template/Components/AppWindow.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // Application Template 5 | // 6 | // (c) 20xx XXXXX 7 | // 8 | 9 | #pragma once 10 | 11 | #include "Core/Root.hpp" 12 | #include "MUI/Window.hpp" 13 | 14 | namespace Components 15 | { 16 | class AppWindow : public Root 17 | { 18 | MUI::Window mComponent; 19 | 20 | public: 21 | AppWindow(const MUI::Root &rootObject); 22 | 23 | operator MUI::Window &() const 24 | { 25 | return (MUI::Window &)mComponent; 26 | } 27 | 28 | MUI::Window &muiRoot() const 29 | { 30 | return (MUI::Window &)mComponent; 31 | } 32 | 33 | protected: 34 | const MUI::Notify &muiNotify() const 35 | { 36 | return mComponent; 37 | } 38 | }; 39 | } 40 | -------------------------------------------------------------------------------- /examples/template/Components/Core/Root.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // Application Template 5 | // 6 | // (c) 20xx XXXXX 7 | // 8 | 9 | #include "Root.hpp" 10 | 11 | #include 12 | 13 | namespace Components 14 | { 15 | void Root::MuiAlert(const std::string &message) const 16 | { 17 | auto appObject = muiNotify().getApplicationObject(); 18 | MUI_Request(appObject, (ULONG)NULL, 0, (ULONG)NULL, (char *)"_Ok", (char *)message.c_str(), TAG_END); 19 | } 20 | 21 | void Root::MuiInfo(const std::string &message, const std::string &gadgets) const 22 | { 23 | auto appObject = muiNotify().getApplicationObject(); 24 | MUI_Request(appObject, (ULONG)NULL, 0, (ULONG)NULL, (char *)gadgets.c_str(), (char *)message.c_str(), TAG_END); 25 | } 26 | 27 | long Root::MuiRequest(const std::string &title, const std::string &message, const std::string &gadgets) const 28 | { 29 | auto appObject = muiNotify().getApplicationObject(); 30 | return MUI_Request(appObject, (ULONG)NULL, 0, (char *)title.c_str(), (char *)gadgets.c_str(), (char *)message.c_str(), TAG_END); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /examples/template/Components/Core/Root.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // Application Template 5 | // 6 | // (c) 20xx XXXXX 7 | // 8 | 9 | #pragma once 10 | 11 | #include "MUI/Notify.hpp" 12 | 13 | namespace Components 14 | { 15 | class Root 16 | { 17 | public: 18 | Object *muiObject() const 19 | { 20 | return muiNotify().muiObject(); 21 | } 22 | 23 | operator const MUI::Notify &() const 24 | { 25 | return muiNotify(); 26 | } 27 | 28 | void MuiAlert(const std::string &message) const; 29 | void MuiInfo(const std::string &message, const std::string &gadgets) const; 30 | long MuiRequest(const std::string &title, const std::string &message, const std::string &gadgets) const; 31 | 32 | protected: 33 | virtual const MUI::Notify &muiNotify() const = 0; 34 | }; 35 | } 36 | -------------------------------------------------------------------------------- /examples/template/Components/InfoWindow.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // Application Template 5 | // 6 | // (c) 20xx XXXXX 7 | // 8 | 9 | #pragma once 10 | 11 | #include "Core/Root.hpp" 12 | #include "MUI/Window.hpp" 13 | 14 | namespace Components 15 | { 16 | class InfoWindow : public Root 17 | { 18 | MUI::Window mComponent; 19 | 20 | public: 21 | InfoWindow(const MUI::Root &rootObject); 22 | 23 | operator MUI::Window &() const 24 | { 25 | return (MUI::Window &)mComponent; 26 | } 27 | 28 | MUI::Window &muiRoot() const 29 | { 30 | return (MUI::Window &)mComponent; 31 | } 32 | 33 | protected: 34 | const MUI::Notify &muiNotify() const 35 | { 36 | return mComponent; 37 | } 38 | }; 39 | } 40 | -------------------------------------------------------------------------------- /examples/template/Main.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // Application Template 5 | // 6 | // (c) 20xx XXXXX 7 | // 8 | 9 | #include "Main.hpp" 10 | 11 | #include 12 | 13 | #include "App.hpp" 14 | 15 | using namespace std; 16 | 17 | int main(int argc, char **argv) 18 | { 19 | try 20 | { 21 | App::instance().Run(); 22 | } 23 | catch (exception &e) 24 | { 25 | cerr << "Exception: " << e.what() << endl; 26 | return RETURN_FAIL; 27 | } 28 | catch (...) 29 | { 30 | cerr << "Exception(...)" << endl; 31 | return RETURN_FAIL; 32 | } 33 | 34 | cout << "Application finished!" << endl; 35 | 36 | return RETURN_OK; 37 | } -------------------------------------------------------------------------------- /examples/template/Main.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // Application Template 5 | // 6 | // (c) 20xx XXXXX 7 | // 8 | 9 | #pragma once 10 | -------------------------------------------------------------------------------- /tests/Makefile: -------------------------------------------------------------------------------- 1 | # placeholder 2 | # TODO tests 3 | 4 | amigaos_m68k: 5 | @echo "TODO tests" 6 | 7 | morphos_ppc: 8 | @echo "TODO tests" 9 | -------------------------------------------------------------------------------- /wrappers/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # MakeFile for AmigaOS MUI C++ wrapper 3 | # 4 | # (c) 2022-2024 TDolphin 5 | # 6 | 7 | all: 8 | @echo "make amigaos_m68k <--- cross compilation on linux" 9 | @echo "make morphos_ppc <--- build on MorphOS" 10 | @echo "make clean <--- remove all .o files" 11 | 12 | amigaos_m68k: 13 | @echo "# Build for AmigaOS m68k" 14 | $(MAKE) -f makefile.generic.gcc.mk \ 15 | AOSCPP_PATH=../../AmigaOS.cpp.wrapper \ 16 | SUB_BUILD_PATH=amigaos/m68k CPPC=m68k-amigaos-g++ AR=m68k-amigaos-ar all 17 | 18 | morphos_ppc: 19 | @echo "# Build for MorphOS PowerPC" 20 | $(MAKE) -f makefile.generic.gcc.mk \ 21 | AOSCPP_PATH=../../AmigaOS.cpp.wrapper \ 22 | SUB_BUILD_PATH=morphos/ppc CPPC=g++ AR=ar MORE_CPP_FLAGS=-noixemul all 23 | 24 | clean: 25 | rm -f -R obj/* 26 | rm -f -R lib/* 27 | -------------------------------------------------------------------------------- /wrappers/makefile.generic.gcc.mk: -------------------------------------------------------------------------------- 1 | # 2 | # AmigaOS MUI C++ wrapper 3 | # 4 | # (c) 2022-2024 TDolphin 5 | # 6 | # generic makefile for gcc 7 | # 8 | # for MorphOS (host) (ppc) 9 | # 10 | # requires: MUI dev (MorphOS SDK) 11 | # 12 | # for Linux (host) x86_64 (64-bit) 13 | # 14 | # cross compilation setup from -> https://github.com/bebbo/amiga-gcc 15 | # 16 | # requires: MUI3.8 or MUI5 dev 17 | # 18 | 19 | # replace , => space 20 | MORE_CPP_FLAGS_X = $(shell echo $(MORE_CPP_FLAGS) | tr ',' ' ') 21 | 22 | # trace flags 23 | # TRACE_MUI - trace MUI (-DTRACE_MUI) 24 | # TRACE_SSC - trace String Storage Collector (-DTRACE_SSC) 25 | DEBUG_FLAGS = #-ggdb -g3 26 | 27 | # compiler/linker flags 28 | # WARNING: use the same -Ox option for this lib and Your application, differnet values can case linking errors 29 | CPP_FLAGS = $(DEBUG_FLAGS) $(MORE_CPP_FLAGS_X) -I${AOSCPP_PATH}/wrappers/src -Isrc -O1 30 | AFLAGS = rcs 31 | 32 | dir_guard = mkdir -p $(@D) 33 | 34 | BINPATH = out/$(SUB_BUILD_PATH) 35 | 36 | AOS_WRAPPER_PATH = ${AOSCPP_PATH}/wrappers 37 | AOS_WRAPPER_MODULES = Core AOS 38 | AOS_WRAPPER_SRC_DIRS = $(addprefix $(AOS_WRAPPER_PATH)/src/,$(AOS_WRAPPER_MODULES)) 39 | AOS_WRAPPER_SRCS = $(foreach sdir,$(AOS_WRAPPER_SRC_DIRS),$(wildcard $(sdir)/*.cpp)) 40 | 41 | MODULES = AOS Core MUI MUI/Context MUI/Core MUI/MCC MUI/Notifier MUI/Notifier/Core MUI/Notifier/Dest MUI/Notifier/Source 42 | SRC_DIRS = src $(addprefix src/,$(MODULES)) 43 | SRCS = $(foreach sdir,$(SRC_DIRS),$(wildcard $(sdir)/*.cpp)) 44 | OBJS = $(patsubst src/%.cpp,obj/$(SUB_BUILD_PATH)/%.o,$(SRCS))\ 45 | $(patsubst $(AOS_WRAPPER_PATH)/src/%.cpp,$(AOS_WRAPPER_PATH)/obj/$(SUB_BUILD_PATH)/%.o,$(AOS_WRAPPER_SRCS)) 46 | 47 | # target lib 48 | LIB_MUICPP = lib/$(SUB_BUILD_PATH)/libMUIcpp.a 49 | 50 | all: $(LIB_MUICPP) 51 | 52 | obj/$(SUB_BUILD_PATH)/%.o: src/%.cpp src/%.hpp 53 | $(dir_guard) 54 | $(CPPC) $(CPP_FLAGS) -c $< -o $@ 55 | 56 | $(AOS_WRAPPER_PATH)/obj/$(SUB_BUILD_PATH)/%.o: $(AOS_WRAPPER_PATH)/src/%.cpp $(AOS_WRAPPER_PATH)/src/%.hpp 57 | $(dir_guard) 58 | $(CPPC) $(CPP_FLAGS) -c $< -o $@ 59 | 60 | $(LIB_MUICPP): $(OBJS) 61 | $(dir_guard) 62 | $(AR) $(AFLAGS) $@ $^ 63 | 64 | clean : 65 | rm -f obj/$(SUB_BUILD_PATH)/*.o 66 | rm -f lib/$(SUB_BUILD_PATH)/*.a 67 | 68 | rebuild : clean all 69 | -------------------------------------------------------------------------------- /wrappers/src/Core/StringStorage.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include "Core/Singleton.hpp" 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | /// @brief String Storage Collector (SSC), collect copies of strings as char* 19 | class StringStorageCore 20 | { 21 | friend class td::Singleton; 22 | 23 | unsigned long mObjectIdCounter; 24 | std::vector> mGarbageStrings; 25 | std::map>> mObjectIdToMap; // objectId -> map (tag -> value) 26 | std::map>> mObjectPtrToMap; // object -> map (tag -> value) 27 | 28 | public: 29 | StringStorageCore(); 30 | 31 | /// @brief add string to SSC for not yet created object for given object id (> 0), or for 0 to generate new id 32 | /// if string for objectId and tagName already exits, method throws exception 33 | /// @param objectId object id or 0 34 | /// @param tagName tag name/id 35 | /// @param string string to create copy 36 | /// @return pointer to string copy 37 | const char *Add(unsigned long &objectId, Tag tagName, const std::string &string); 38 | /// @brief invalidate (erase) all strings for not yet created object 39 | /// @param objectId id of object 40 | void Invalidate(const unsigned long objectId); 41 | /// @brief finalize not yet created object id with created object ptr, in case of any error throws exception 42 | /// @param objectId object id != 0 43 | /// @param object pointer to created object != nullptr 44 | void FinalizeObject(const unsigned long objectId, const Object *object); 45 | /// @brief change string for given object and for given tag, old string is removed (if exists), created new copy for new string 46 | /// @param object object ptr 47 | /// @param tagName tag name/id 48 | /// @param string new string 49 | /// @return pointer to string copy 50 | char *Change(const Object *object, Tag tagName, const std::string &string); 51 | }; 52 | 53 | using StringStorage = td::Singleton; 54 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Balance.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "Balance.hpp" 8 | 9 | namespace MUI 10 | { 11 | const std::string Balance::className = MUIC_Balance; 12 | 13 | BalanceBuilder::BalanceBuilder() { } 14 | } 15 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Balance.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include "Area.hpp" 10 | 11 | namespace MUI 12 | { 13 | class Balance : public Area 14 | { 15 | public: 16 | explicit Balance(Object *pMuiObject) 17 | : Area(pMuiObject) 18 | { 19 | } 20 | 21 | // instanceOf 22 | 23 | const static std::string className; 24 | 25 | static inline bool instanceOf(Object *pMuiObject) 26 | { 27 | return MUI::instanceOf(pMuiObject, className.c_str()); 28 | } 29 | }; 30 | 31 | template class BalanceBuilderTemplate : public AreaBuilderTemplate 32 | { 33 | public: 34 | BalanceBuilderTemplate(const std::string &uniqueId = MUI::EmptyUniqueId, const std::string &muiClassName = MUIC_Balance) 35 | : AreaBuilderTemplate(uniqueId, muiClassName) 36 | { 37 | } 38 | 39 | #ifdef MUIA_Balance_Quiet 40 | /// @brief [ @b MUIA_Balance_Quiet ] 41 | /// If set to true the balance object will show its frame only if the mouse is located over the object. Otherwise it will be 42 | /// invisible. By default is false. 43 | T &tagQuiet(const bool quiet); 44 | #endif 45 | }; 46 | 47 | class BalanceBuilder : public BalanceBuilderTemplate 48 | { 49 | public: 50 | BalanceBuilder(); 51 | }; 52 | 53 | #ifdef MUIA_Balance_Quiet 54 | template inline T &BalanceBuilderTemplate::tagQuiet(const bool quiet) 55 | { 56 | this->PushTag(MUIA_Balance_Quiet, quiet); 57 | return (T &)*this; 58 | } 59 | #endif 60 | } 61 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Coloradjust.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "Coloradjust.hpp" 8 | 9 | namespace MUI 10 | { 11 | const std::string Coloradjust::className = MUIC_Coloradjust; 12 | 13 | unsigned char Coloradjust::getBlue() const 14 | { 15 | return RGBColor::from32Bit(GetValueAsULong(MUIA_Coloradjust_Blue)); 16 | } 17 | 18 | unsigned char Coloradjust::getGreen() const 19 | { 20 | return RGBColor::from32Bit(GetValueAsULong(MUIA_Coloradjust_Green)); 21 | } 22 | 23 | unsigned long Coloradjust::getModeID() const 24 | { 25 | return GetValueAsULong(MUIA_Coloradjust_ModeID); 26 | } 27 | 28 | unsigned char Coloradjust::getRed() const 29 | { 30 | return RGBColor::from32Bit(GetValueAsULong(MUIA_Coloradjust_Red)); 31 | } 32 | 33 | RGBColor Coloradjust::getRGB() const 34 | { 35 | auto *rgb = (unsigned long *)GetValueAsPtr(MUIA_Coloradjust_RGB); 36 | return RGBColor(rgb); 37 | } 38 | 39 | Coloradjust &Coloradjust::setBlue(const unsigned char blue) 40 | { 41 | SetValue(MUIA_Coloradjust_Blue, RGBColor::to32Bit(blue)); 42 | return *this; 43 | } 44 | 45 | Coloradjust &Coloradjust::setGreen(const unsigned char green) 46 | { 47 | SetValue(MUIA_Coloradjust_Green, RGBColor::to32Bit(green)); 48 | return *this; 49 | } 50 | 51 | Coloradjust &Coloradjust::setModeID(const unsigned long modeID) 52 | { 53 | SetValue(MUIA_Coloradjust_ModeID, modeID); 54 | return *this; 55 | } 56 | 57 | Coloradjust &Coloradjust::setRed(const unsigned char red) 58 | { 59 | SetValue(MUIA_Coloradjust_Red, RGBColor::to32Bit(red)); 60 | return *this; 61 | } 62 | 63 | Coloradjust &Coloradjust::setRGB(const unsigned char red, const unsigned char green, const unsigned char blue) 64 | { 65 | unsigned long rgb[3] = { red, green, blue }; 66 | SetValue(MUIA_Coloradjust_RGB, (void *)rgb); 67 | return *this; 68 | } 69 | 70 | Coloradjust &Coloradjust::setRGB(const RGBColor &rgbColor) 71 | { 72 | unsigned long rgb[3] = { rgbColor.red32bit(), rgbColor.green32bit(), rgbColor.blue32bit() }; 73 | SetValue(MUIA_Coloradjust_RGB, (void *)rgb); 74 | return *this; 75 | } 76 | 77 | ColoradjustBuilder::ColoradjustBuilder() { } 78 | } 79 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Colorfield.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "Colorfield.hpp" 8 | 9 | namespace MUI 10 | { 11 | const std::string Colorfield::className = MUIC_Colorfield; 12 | 13 | unsigned char Colorfield::getBlue() const 14 | { 15 | return RGBColor::from32Bit(GetValueAsULong(MUIA_Colorfield_Blue)); 16 | } 17 | 18 | unsigned char Colorfield::getGreen() const 19 | { 20 | return RGBColor::from32Bit(GetValueAsULong(MUIA_Colorfield_Green)); 21 | } 22 | 23 | unsigned long Colorfield::getPen() const 24 | { 25 | return GetValueAsULong(MUIA_Colorfield_Pen); 26 | } 27 | 28 | unsigned char Colorfield::getRed() const 29 | { 30 | return RGBColor::from32Bit(GetValueAsULong(MUIA_Colorfield_Red)); 31 | } 32 | 33 | RGBColor Colorfield::getRGB() const 34 | { 35 | auto *rgb = (unsigned long *)GetValueAsPtr(MUIA_Colorfield_RGB); 36 | return RGBColor(rgb); 37 | } 38 | 39 | Colorfield &Colorfield::setBlue(const unsigned char blue) 40 | { 41 | SetValue(MUIA_Colorfield_Blue, RGBColor::to32Bit(blue)); 42 | return *this; 43 | } 44 | 45 | Colorfield &Colorfield::setGreen(const unsigned char green) 46 | { 47 | SetValue(MUIA_Colorfield_Green, RGBColor::to32Bit(green)); 48 | return *this; 49 | } 50 | 51 | Colorfield &Colorfield::setRed(const unsigned char red) 52 | { 53 | SetValue(MUIA_Colorfield_Red, RGBColor::to32Bit(red)); 54 | return *this; 55 | } 56 | 57 | Colorfield &Colorfield::setRGB(const unsigned char red, const unsigned char green, const unsigned char blue) 58 | { 59 | unsigned long rgb[3] = { red, green, blue }; 60 | SetValue(MUIA_Colorfield_RGB, (void *)rgb); 61 | return *this; 62 | } 63 | 64 | Colorfield &Colorfield::setRGB(const RGBColor &rgbColor) 65 | { 66 | unsigned long rgb[3] = { rgbColor.red32bit(), rgbColor.green32bit(), rgbColor.blue32bit() }; 67 | SetValue(MUIA_Colorfield_RGB, (void *)rgb); 68 | return *this; 69 | } 70 | 71 | ColorfieldBuilder::ColorfieldBuilder() { } 72 | } 73 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Context/ApplicationContext.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "ApplicationContext.hpp" 8 | 9 | #include 10 | 11 | #include 12 | 13 | #include "MUI/Application.hpp" 14 | #include "MUI/Menustrip.hpp" 15 | #include "MUI/Window.hpp" 16 | 17 | namespace MUI 18 | { 19 | ApplicationContextCore::ApplicationContextCore() { } 20 | 21 | ApplicationContextCore::~ApplicationContextCore() { } 22 | 23 | void ApplicationContextCore::Init(const Notify ¬ify) 24 | { 25 | mpMuiApplicationObject = notify.getApplicationObject(); 26 | if (mpMuiApplicationObject == nullptr) 27 | { 28 | auto error = std::string { __PRETTY_FUNCTION__ } + " getApplicationObject() returns null!"; 29 | throw std::runtime_error(error); 30 | } 31 | } 32 | 33 | void ApplicationContextCore::Init(const Application &application) 34 | { 35 | mpMuiApplicationObject = application.muiObject(); 36 | } 37 | 38 | Application ApplicationContextCore::getApplication() 39 | { 40 | return Application(mpMuiApplicationObject); 41 | } 42 | 43 | Menustrip ApplicationContextCore::getMenustrip() 44 | { 45 | return Application(mpMuiApplicationObject).getMenustrip(); 46 | } 47 | 48 | std::vector ApplicationContextCore::getWindows() 49 | { 50 | return Application(mpMuiApplicationObject).getWindowList(); 51 | } 52 | 53 | Window ApplicationContextCore::getAppWindow() 54 | { 55 | return Application(mpMuiApplicationObject).getWindowList().at(0); 56 | } 57 | 58 | Window ApplicationContextCore::getWindow(const AOS::Identifier &id) 59 | { 60 | auto windows = Application(mpMuiApplicationObject).getWindowList(); 61 | for (auto &window : windows) 62 | if (window.getID() == id) 63 | return window; 64 | 65 | auto error = std::string { __PRETTY_FUNCTION__ } + " undefined window " + id.toString() + "!"; 66 | throw std::runtime_error(error); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Context/ApplicationContext.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | 12 | #include "AOS/Identifier.hpp" 13 | #include "Core/Singleton.hpp" 14 | 15 | namespace MUI 16 | { 17 | class Application; 18 | class Notify; 19 | class Menustrip; 20 | class Window; 21 | 22 | /// @brief application context facade class to get application object and related objects 23 | /// NOTICE: to use it application have to be scoped by @b ApplicationScope which initialise 24 | // ApplicationContext by Init(const Application &); 25 | class ApplicationContextCore 26 | { 27 | friend class td::Singleton; 28 | friend class ApplicationScope; 29 | 30 | Object *mpMuiApplicationObject; 31 | 32 | ApplicationContextCore(); 33 | ~ApplicationContextCore(); 34 | 35 | void Init(const Notify ¬ify); 36 | void Init(const Application &application); 37 | 38 | public: 39 | /// @brief return current application object 40 | /// or throw excpetion if application not scoped by @b ApplicationScope 41 | /// @return Application object 42 | Application getApplication(); 43 | /// @brief return current menu strip of application 44 | /// @return Menustrip object 45 | Menustrip getMenustrip(); 46 | std::vector getWindows(); 47 | /// @brief return current main application window (first window) 48 | /// @return Window object 49 | Window getAppWindow(); 50 | /// @brief return window with given identifier, or throw excpetion if window doesn't exists 51 | /// @param id identifier of window to get 52 | /// @return Window object 53 | Window getWindow(const AOS::Identifier &id); 54 | }; 55 | 56 | using ApplicationContext = td::Singleton; 57 | } 58 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Core/BuilderRoot.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "BuilderRoot.hpp" 8 | 9 | namespace MUI 10 | { 11 | } 12 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Core/BuilderRoot.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include "AOS/TagBuilderRoot.hpp" 10 | #include "Core/StringStorage.hpp" 11 | #include "Core/ToString.hpp" 12 | #include "Object.hpp" 13 | 14 | namespace MUI 15 | { 16 | static std::string EmptyUniqueId = ""; 17 | 18 | template class BuilderRoot : public AOS::TagBuilderRoot 19 | { 20 | /// @brief not empty if class is internal for application, created based od other MUI builtin class 21 | const std::string mUniqueId; 22 | const std::string mClassName; 23 | unsigned long mStringStorageObjectId; 24 | 25 | public: 26 | /// @brief 27 | /// @param uniqueId be default set to empty "", only for internal app class is set 28 | /// @param className class name: #?.mui, #?.mcc 29 | BuilderRoot(const std::string &uniqueId, const std::string &className) 30 | : mUniqueId(uniqueId) 31 | , mClassName(className) 32 | , mStringStorageObjectId(0) 33 | { 34 | } 35 | 36 | T object() const 37 | { 38 | T object { T(mUniqueId.empty() ? muiObject(mClassName, getTags()) : amccObject(mUniqueId, mClassName, getTags())) }; 39 | if (mStringStorageObjectId != 0) 40 | StringStorage::instance().FinalizeObject(mStringStorageObjectId, static_cast(object)); 41 | return object; 42 | } 43 | 44 | protected: 45 | T object(const unsigned long dataSize, const void *pDispatcher) const 46 | { 47 | T object { T(mUniqueId.empty() ? muiObject(mClassName, getTags()) 48 | : amccObject(mUniqueId, mClassName, getTags(), dataSize, pDispatcher)) }; 49 | if (mStringStorageObjectId != 0) 50 | StringStorage::instance().FinalizeObject(mStringStorageObjectId, object); 51 | return object; 52 | } 53 | 54 | const char *StoreString(const unsigned long tagName, const std::string &string) 55 | { 56 | return StringStorage::instance().Add(mStringStorageObjectId, tagName, string); 57 | } 58 | }; 59 | } 60 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Core/CustomClassManager.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "CustomClassManager.hpp" 8 | 9 | #include 10 | 11 | #include "CustomClassScope.hpp" 12 | 13 | namespace MUI 14 | { 15 | CustomClassesLifeTimeScope::~CustomClassesLifeTimeScope() 16 | { 17 | #ifdef TRACE_MUI 18 | std::cout << __PRETTY_FUNCTION__ << std::endl; 19 | #endif 20 | CustomClassManager::instance().Clear(); 21 | } 22 | 23 | CustomClassManagerCore::CustomClassManagerCore() { } 24 | 25 | CustomClassManagerCore::~CustomClassManagerCore() 26 | { 27 | #ifdef TRACE_MUI 28 | std::cout << __PRETTY_FUNCTION__ << std::endl; 29 | #endif 30 | if (!mCustomClassesMap.empty()) 31 | std::cerr << __PRETTY_FUNCTION__ << " map is not empty, use CustomClassesLifeTimeScope!" << std::endl; 32 | } 33 | 34 | void CustomClassManagerCore::Clear() 35 | { 36 | #ifdef TRACE_MUI 37 | std::cout << __PRETTY_FUNCTION__ << std::endl; 38 | #endif 39 | 40 | mCustomClassesMap.clear(); 41 | } 42 | 43 | CustomClassScope &CustomClassManagerCore::get(const std::string &uniqueId, const std::string &superClassName, 44 | const unsigned long dataSize, const void *dispatcher) 45 | { 46 | auto result = mCustomClassesMap.find(uniqueId); 47 | if (result != mCustomClassesMap.end()) // class scope exists 48 | return result->second; 49 | 50 | auto emplace = mCustomClassesMap.emplace(uniqueId, CustomClassScope { superClassName, dataSize, dispatcher }); 51 | 52 | return emplace.first->second; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Core/CustomClassManager.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | 12 | #include "Core/Singleton.hpp" 13 | 14 | namespace MUI 15 | { 16 | class CustomClassScope; 17 | 18 | /// @brief call CustomClassManager::Clear() on destructor 19 | class CustomClassesLifeTimeScope 20 | { 21 | public: 22 | CustomClassesLifeTimeScope() = default; 23 | ~CustomClassesLifeTimeScope(); 24 | 25 | // explicitly no copy 26 | CustomClassesLifeTimeScope(const CustomClassesLifeTimeScope &) = delete; 27 | CustomClassesLifeTimeScope &operator=(const CustomClassesLifeTimeScope &) = delete; 28 | 29 | // explicitly no move 30 | CustomClassesLifeTimeScope(CustomClassesLifeTimeScope &&) = delete; 31 | CustomClassesLifeTimeScope &operator=(CustomClassScope &&) = delete; 32 | }; 33 | 34 | class CustomClassManagerCore 35 | { 36 | friend class td::Singleton; 37 | friend class CustomClassesLifeTimeScope; 38 | 39 | std::map mCustomClassesMap; 40 | 41 | CustomClassManagerCore(); 42 | ~CustomClassManagerCore(); 43 | 44 | void Clear(); 45 | 46 | public: 47 | /// @brief get or create&get if not exists custom class 48 | /// @param uniqueId unique id used by manager to identify internal (app) class, for external classes (#?.mcc) use method without 49 | /// this id 50 | /// @param superClassName name of MUI class (#?.mui) 51 | /// @param dataSize data size for object 52 | /// @param dispatcher dispatcher function 53 | /// @return pointer to CustomClassScope 54 | CustomClassScope &get(const std::string &uniqueId, const std::string &superClassName, const unsigned long dataSize = 0, 55 | const void *dispatcher = nullptr); 56 | }; 57 | 58 | using CustomClassManager = td::Singleton; 59 | } 60 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Core/CustomClassScope.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "CustomClassScope.hpp" 8 | 9 | #include 10 | #include 11 | 12 | #include 13 | #include 14 | 15 | #include "SDI/SDI_hook.h" 16 | 17 | DISPATCHER(Empty_Dispatcher) 18 | { 19 | return DoSuperMethodA(cl, obj, msg); 20 | } 21 | 22 | namespace MUI 23 | { 24 | CustomClassScope::CustomClassScope(const std::string &className, const unsigned long dataSize, const void *dispatcher) 25 | : mClassName(className) 26 | { 27 | #ifdef TRACE_MUI 28 | std::cout << __PRETTY_FUNCTION__ << " : " << className << std::endl; 29 | #endif 30 | 31 | mpCustomClass = MUI_CreateCustomClass(nullptr, (char *)className.c_str(), nullptr, dataSize, 32 | dispatcher ? (APTR)dispatcher : ENTRY(Empty_Dispatcher)); // nullptr 33 | if (mpCustomClass == nullptr) 34 | { 35 | auto error = std::string { __PRETTY_FUNCTION__ } + " MUI_CreateCustomClass(" + className + ") failed!"; 36 | throw std::runtime_error(error); 37 | } 38 | } 39 | 40 | CustomClassScope::~CustomClassScope() 41 | { 42 | #ifdef TRACE_MUI 43 | std::cout << __PRETTY_FUNCTION__ << " : " << mpCustomClass << std::endl; 44 | #endif 45 | if (mpCustomClass != nullptr) 46 | MUI_DeleteCustomClass(mpCustomClass); 47 | } 48 | 49 | CustomClassScope::CustomClassScope(CustomClassScope &&other) noexcept 50 | : mClassName(std::move(other.mClassName)) 51 | , mpCustomClass(other.mpCustomClass) 52 | { 53 | other.mpCustomClass = nullptr; 54 | } 55 | 56 | CustomClassScope &CustomClassScope::operator=(CustomClassScope &&other) noexcept 57 | { 58 | if (this != &other) 59 | { 60 | mClassName = std::move(other.mClassName); 61 | mpCustomClass = other.mpCustomClass; 62 | other.mpCustomClass = nullptr; 63 | } 64 | 65 | return *this; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Core/CustomClassScope.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | #include 12 | 13 | namespace MUI 14 | { 15 | class CustomClassScope 16 | { 17 | std::string mClassName; 18 | struct MUI_CustomClass *mpCustomClass; 19 | 20 | public: 21 | CustomClassScope(const std::string &className, const unsigned long dataSize = 0, const void *dispatcher = nullptr); 22 | ~CustomClassScope(); 23 | 24 | // explicitly no copy 25 | CustomClassScope(const CustomClassScope &) = delete; 26 | CustomClassScope &operator=(const CustomClassScope &) = delete; 27 | 28 | CustomClassScope(CustomClassScope &&other) noexcept; 29 | CustomClassScope &operator=(CustomClassScope &&other) noexcept; 30 | 31 | struct MUI_CustomClass *mcc() const 32 | { 33 | return mpCustomClass; 34 | } 35 | 36 | const std::string &className() const 37 | { 38 | return mClassName; 39 | } 40 | }; 41 | }; 42 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Core/MuiMasterBaseScope.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "MuiMasterBaseScope.hpp" 8 | 9 | #include 10 | 11 | #include 12 | #include 13 | 14 | struct Library *MUIMasterBase = nullptr; 15 | 16 | MuiMasterBaseScope::MuiMasterBaseScope() 17 | { 18 | if (MUIMasterBase != nullptr) 19 | { 20 | auto error = std::string { __PRETTY_FUNCTION__ } + " " + MUIMASTER_NAME + " already open!"; 21 | throw std::runtime_error(error); 22 | } 23 | 24 | if (!(MUIMasterBase = OpenLibrary(MUIMASTER_NAME, MUIMASTER_VMIN))) 25 | { 26 | auto error = std::string { __PRETTY_FUNCTION__ } + " failed to open: " + MUIMASTER_NAME + " " + std::to_string(MUIMASTER_VMIN); 27 | throw std::runtime_error(error); 28 | } 29 | } 30 | 31 | MuiMasterBaseScope::~MuiMasterBaseScope() 32 | { 33 | if (MUIMasterBase != nullptr) 34 | { 35 | CloseLibrary(MUIMasterBase); 36 | MUIMasterBase = nullptr; 37 | } 38 | } 39 | 40 | Library *MuiMasterBaseScope::library() const 41 | { 42 | return MUIMasterBase; 43 | } 44 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Core/MuiMasterBaseScope.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include 8 | 9 | class MuiMasterBaseScope 10 | { 11 | public: 12 | MuiMasterBaseScope(); 13 | ~MuiMasterBaseScope(); 14 | 15 | // explicitly no copy 16 | MuiMasterBaseScope(const MuiMasterBaseScope &) = delete; 17 | MuiMasterBaseScope &operator=(const MuiMasterBaseScope &) = delete; 18 | 19 | // explicitly no move 20 | MuiMasterBaseScope(MuiMasterBaseScope &&) = delete; 21 | MuiMasterBaseScope &operator=(MuiMasterBaseScope &&) = delete; 22 | 23 | Library *library() const; 24 | }; 25 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Core/NullObject.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "NullObject.hpp" 8 | 9 | namespace MUI 10 | { 11 | NullObject::NullObject() { } 12 | } 13 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Core/NullObject.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include "Root.hpp" 10 | 11 | namespace MUI 12 | { 13 | class NullObject : public Root 14 | { 15 | public: 16 | NullObject(); 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Core/Object.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include "AOS/TagItemObject.hpp" 10 | #include "Core/ToString.hpp" 11 | 12 | #include 13 | 14 | namespace MUI 15 | { 16 | Object *muiObject(const std::string &className, const std::vector &tags); 17 | /// @brief application (internal) mui custom class 18 | Object *amccObject(const std::string &uniqueId, const std::string &className, const std::vector &tags, 19 | const unsigned long dataSize = 0, const void *pDispatcher = nullptr); 20 | } 21 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Core/ObjectScope.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "ObjectScope.hpp" 8 | 9 | #include 10 | 11 | #include 12 | #include 13 | 14 | #ifdef TRACE_MUI 15 | #include 16 | #endif 17 | 18 | namespace MUI 19 | { 20 | ObjectScope::ObjectScope(const Root &root) 21 | : mpObject { root } 22 | { 23 | } 24 | 25 | ObjectScope::ObjectScope(Object *pObject) 26 | { 27 | #ifdef TRACE_MUI 28 | std::cout << __PRETTY_FUNCTION__ << " " << pObject << std::endl; 29 | #endif 30 | if (pObject == nullptr) 31 | { 32 | auto error = std::string { __PRETTY_FUNCTION__ } + " nullptr Object!"; 33 | throw std::runtime_error(error); 34 | } 35 | 36 | mpObject = pObject; 37 | } 38 | 39 | ObjectScope::~ObjectScope() 40 | { 41 | #ifdef TRACE_MUI 42 | std::cout << __PRETTY_FUNCTION__ << " MUI_DisposeObject(" << mpObject << ")" << std::endl; 43 | #endif 44 | 45 | MUI_DisposeObject(mpObject); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Core/ObjectScope.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include // Object 10 | 11 | #include "Root.hpp" 12 | 13 | namespace MUI 14 | { 15 | /// @brief scope for MUI object, calls @b MUI_DisposeObject on destructor 16 | class ObjectScope 17 | { 18 | Object *mpObject; 19 | 20 | public: 21 | /// @param pObject pointer to MUI Object 22 | ObjectScope(const Root &root); 23 | ObjectScope(Object *pObject); 24 | ~ObjectScope(); 25 | 26 | // explicitly no copy 27 | ObjectScope(const ObjectScope &) = delete; 28 | ObjectScope &operator=(const ObjectScope &) = delete; 29 | 30 | // explicitly no move 31 | ObjectScope(ObjectScope &&) = delete; 32 | ObjectScope &operator=(ObjectScope &&) = delete; 33 | 34 | Object *muiObject() const 35 | { 36 | return mpObject; 37 | } 38 | }; 39 | }; 40 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Core/RGBColor.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "RGBColor.hpp" 8 | 9 | namespace MUI 10 | { 11 | RGBColor::RGBColor() 12 | : red(0) 13 | , green(0) 14 | , blue(0) 15 | { 16 | } 17 | 18 | RGBColor::RGBColor(const unsigned char red, const unsigned char green, const unsigned char blue) 19 | : red(red) 20 | , green(green) 21 | , blue(blue) 22 | { 23 | } 24 | 25 | RGBColor::RGBColor(const unsigned long *rgb) 26 | { 27 | if (rgb == nullptr) 28 | { 29 | red = green = blue = 0; 30 | return; 31 | } 32 | 33 | red = from32Bit(rgb[0]); 34 | green = from32Bit(rgb[1]); 35 | blue = from32Bit(rgb[2]); 36 | } 37 | 38 | #if MUIMASTER_VMIN >= 20 // MUI5 39 | RGBColor::RGBColor(const MUI_RGBColor &rgbColor) 40 | #else 41 | RGBColor::RGBColor(const MUI_RGBcolor &rgbColor) 42 | #endif 43 | { 44 | red = from32Bit(rgbColor.red); 45 | green = from32Bit(rgbColor.green); 46 | blue = from32Bit(rgbColor.blue); 47 | } 48 | 49 | RGBColor::RGBColor(const unsigned long argb) 50 | { 51 | red = (argb & 0x00ff0000) >> 16; 52 | green = (argb & 0x0000ff00) >> 8; 53 | blue = (argb & 0x000000ff); 54 | } 55 | 56 | unsigned long RGBColor::rgb() const 57 | { 58 | return ((unsigned long)red << 16) | ((unsigned long)green << 8) | (unsigned long)blue; 59 | } 60 | 61 | unsigned long RGBColor::to32Bit(const unsigned char &colorComponent) 62 | { 63 | return (unsigned long)colorComponent | (unsigned long)colorComponent << 8 | (unsigned long)colorComponent << 16 64 | | (unsigned long)colorComponent << 24; 65 | } 66 | 67 | unsigned char RGBColor::from32Bit(const unsigned long &colorComponent) 68 | { 69 | return colorComponent >> 24; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Core/RGBColor.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | namespace MUI 12 | { 13 | struct RGBColor 14 | { 15 | unsigned char red; 16 | unsigned char green; 17 | unsigned char blue; 18 | 19 | RGBColor(); 20 | RGBColor(const unsigned char red, const unsigned char green, const unsigned char blue); 21 | RGBColor(const unsigned long *rgb); 22 | #if MUIMASTER_VMIN >= 20 // MUI5 23 | RGBColor(const MUI_RGBColor &rgbColor); 24 | #else 25 | RGBColor(const MUI_RGBcolor &rgbColor); 26 | #endif 27 | RGBColor(const unsigned long argb); // 0xAARRGGBB alpha red green blue .. alpha is ignored 28 | 29 | unsigned long red32bit() const 30 | { 31 | return to32Bit(red); 32 | } 33 | 34 | unsigned long green32bit() const 35 | { 36 | return to32Bit(green); 37 | } 38 | 39 | unsigned long blue32bit() const 40 | { 41 | return to32Bit(blue); 42 | } 43 | 44 | unsigned long rgb() const; 45 | 46 | static unsigned long to32Bit(const unsigned char &component); 47 | static unsigned char from32Bit(const unsigned long &component); 48 | }; 49 | } 50 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Cycle.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "Cycle.hpp" 8 | 9 | namespace MUI 10 | { 11 | const std::string Cycle::className = MUIC_Cycle; 12 | 13 | long Cycle::getActive() const 14 | { 15 | return GetValueAsLong(MUIA_Cycle_Active); 16 | } 17 | 18 | Cycle &Cycle::setActive(const enum Cycle_Active active) 19 | { 20 | SetValue(MUIA_Cycle_Active, (long)active); 21 | return *this; 22 | } 23 | 24 | Cycle &Cycle::setActiveNext() 25 | { 26 | setActive(MUIV_Cycle_Active_Next); 27 | return *this; 28 | } 29 | 30 | Cycle &Cycle::setActivePrev() 31 | { 32 | setActive(MUIV_Cycle_Active_Prev); 33 | return *this; 34 | } 35 | 36 | Cycle &Cycle::setActive(const unsigned long active) 37 | { 38 | SetValue(MUIA_Cycle_Active, active); 39 | return *this; 40 | } 41 | 42 | Cycle &Cycle::setEntries(const char *entries[]) 43 | { 44 | SetValue(MUIA_Cycle_Entries, entries); 45 | return *this; 46 | } 47 | 48 | CycleBuilder::CycleBuilder() { } 49 | } 50 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Dtpic.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "Dtpic.hpp" 8 | 9 | namespace MUI 10 | { 11 | const std::string Dtpic::className = MUIC_Dtpic; 12 | 13 | DtpicBuilder::DtpicBuilder() { } 14 | 15 | #ifdef MUIA_Dtpic_Alpha 16 | long Dtpic::getAlpha() const 17 | { 18 | return GetValueAsBool(MUIA_Dtpic_Alpha); 19 | } 20 | #endif 21 | 22 | #ifdef MUIA_Dtpic_DarkenSelState 23 | bool Dtpic::isDarkenSelState() const 24 | { 25 | return GetValueAsLong(MUIA_Dtpic_DarkenSelState); 26 | } 27 | #endif 28 | 29 | #ifdef MUIA_Dtpic_Fade 30 | long Dtpic::getFade() const 31 | { 32 | return GetValueAsBool(MUIA_Dtpic_Fade); 33 | } 34 | #endif 35 | 36 | #ifdef MUIA_Dtpic_LightenOnMouse 37 | long Dtpic::isLightenOnMouse() const 38 | { 39 | return GetValueAsLong(MUIA_Dtpic_LightenOnMouse); 40 | } 41 | #endif 42 | 43 | #ifdef MUIA_Dtpic_Name 44 | std::string Dtpic::getName() const 45 | { 46 | return GetValueAsString(MUIA_Dtpic_Name); 47 | } 48 | #endif 49 | 50 | #ifdef MUIA_Dtpic_Alpha 51 | Dtpic &Dtpic::setAlpha(const long alpha) 52 | { 53 | SetValue(MUIA_Dtpic_Alpha, alpha); 54 | return *this; 55 | } 56 | #endif 57 | 58 | #ifdef MUIA_Dtpic_Fade 59 | Dtpic &Dtpic::setFade(const long fade) 60 | { 61 | SetValue(MUIA_Dtpic_Fade, fade); 62 | return *this; 63 | } 64 | #endif 65 | 66 | #ifdef MUIA_Dtpic_Name 67 | Dtpic &Dtpic::setName(const std::string &name) 68 | { 69 | SetValue(MUIA_Dtpic_Name, StoreString(MUIA_Dtpic_Name, name)); 70 | return *this; 71 | } 72 | #endif 73 | } 74 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Family.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "Family.hpp" 8 | 9 | #include 10 | 11 | namespace MUI 12 | { 13 | const std::string Family::className = MUIC_Family; 14 | 15 | FamilyBuilder::FamilyBuilder() { } 16 | 17 | Family &Family::Insert(const MUI::Root &obj, const MUI::Root &pred) 18 | { 19 | DoMethod(muiObject(), MUIM_Family_Insert, obj.muiObject(), pred.muiObject()); 20 | return *this; 21 | } 22 | 23 | Family &Family::Remove(const MUI::Root &obj) 24 | { 25 | DoMethod(muiObject(), MUIM_Family_Remove, obj.muiObject()); 26 | return *this; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Family.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include "Notify.hpp" 10 | 11 | #undef Insert 12 | #undef Remove 13 | 14 | namespace MUI 15 | { 16 | class Family : public Notify 17 | { 18 | public: 19 | explicit Family(Object *pMuiObject) 20 | : Notify(pMuiObject) 21 | { 22 | } 23 | 24 | Family(const Root &root) 25 | : Notify(root.muiObject()) 26 | { 27 | } 28 | 29 | // instanceOf 30 | 31 | const static std::string className; 32 | 33 | static inline bool instanceOf(Object *pMuiObject) 34 | { 35 | return MUI::instanceOf(pMuiObject, className.c_str()); 36 | } 37 | 38 | // is/get/set (attributes), all setters return object reference 39 | 40 | // methods, some returns object reference 41 | 42 | /// @brief [ @b MUIM_Family_Insert ] 43 | Family &Insert(const MUI::Root &obj, const MUI::Root &pred); 44 | /// @brief [ @b MUIM_Family_Remove ] 45 | Family &Remove(const MUI::Root &obj); 46 | }; 47 | 48 | template class FamilyBuilderTemplate : public NotifyBuilderTemplate 49 | { 50 | public: 51 | FamilyBuilderTemplate(const std::string &uniqueId = MUI::EmptyUniqueId, const std::string &muiClassName = MUIC_Family) 52 | : NotifyBuilderTemplate(uniqueId, muiClassName) 53 | { 54 | } 55 | 56 | /// @brief [ @b MUIA_Family_Child ] 57 | T &tagChild(const MUI::Root &child); 58 | /// @brief [ @b MUIA_Family_Child ] 59 | T &tagChild(const Object *child); 60 | }; 61 | 62 | class FamilyBuilder : public FamilyBuilderTemplate 63 | { 64 | public: 65 | FamilyBuilder(); 66 | }; 67 | 68 | template inline T &FamilyBuilderTemplate::tagChild(const MUI::Root &child) 69 | { 70 | this->PushTag(MUIA_Family_Child, child.muiObject(), false); 71 | return (T &)*this; 72 | } 73 | 74 | template inline T &FamilyBuilderTemplate::tagChild(const Object *child) 75 | { 76 | if (child) 77 | this->PushTag(MUIA_Family_Child, child, false); 78 | return (T &)*this; 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Floattext.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "Floattext.hpp" 8 | 9 | #include 10 | 11 | namespace MUI 12 | { 13 | const std::string Floattext::className = MUIC_Floattext; 14 | 15 | bool Floattext::isJustify() const 16 | { 17 | return GetValueAsBool(MUIA_Floattext_Justify); 18 | } 19 | 20 | char *Floattext::getText() const 21 | { 22 | return (char *)GetValueAsPtr(MUIA_Floattext_Text); 23 | } 24 | 25 | Floattext &Floattext::setJustify(const bool justify) 26 | { 27 | SetValue(MUIA_Floattext_Justify, justify); 28 | return *this; 29 | } 30 | 31 | Floattext &Floattext::setSkipChars(const std::string &skipChars) 32 | { 33 | SetValue(MUIA_Floattext_SkipChars, skipChars); 34 | return *this; 35 | } 36 | 37 | Floattext &Floattext::setTabSize(const long tabSize) 38 | { 39 | SetValue(MUIA_Floattext_TabSize, tabSize); 40 | return *this; 41 | } 42 | 43 | Floattext &Floattext::setText(const std::string &text) 44 | { 45 | SetValue(MUIA_Floattext_Text, text); 46 | return *this; 47 | } 48 | 49 | #ifdef MUIM_Floattext_Append 50 | Floattext &Floattext::Append(const std::string &text) 51 | { 52 | DoMethod(muiObject(), MUIM_Floattext_Append, (ULONG)text.c_str()); 53 | return *this; 54 | } 55 | #endif 56 | 57 | FloattextBuilder::FloattextBuilder() { } 58 | } 59 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Fontpanel.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "Fontpanel.hpp" 8 | 9 | #ifdef MUIC_Fontpanel 10 | 11 | #include 12 | 13 | namespace MUI 14 | { 15 | const std::string Fontpanel::className = MUIC_Fontpanel; 16 | 17 | FontpanelBuilder::FontpanelBuilder() { } 18 | } 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Gadget.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "Gadget.hpp" 8 | 9 | namespace MUI 10 | { 11 | const std::string Gadget::className = MUIC_Gadget; 12 | 13 | GadgetBuilder::GadgetBuilder() { } 14 | 15 | ::Gadget *Gadget::getGadget() const 16 | { 17 | return (::Gadget *)GetValueAsPtr(MUIA_Gadget_Gadget); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Gadget.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include "Area.hpp" 10 | 11 | namespace MUI 12 | { 13 | class Gadget : public Area 14 | { 15 | public: 16 | explicit Gadget(Object *pMuiObject) 17 | : Area(pMuiObject) 18 | { 19 | } 20 | 21 | // instanceOf 22 | 23 | const static std::string className; 24 | 25 | static inline bool instanceOf(Object *pMuiObject) 26 | { 27 | return MUI::instanceOf(pMuiObject, className.c_str()); 28 | } 29 | 30 | // is/get/set (attributes), all setters return object reference 31 | 32 | /// @brief [ @b MUIA_Gadget_Gadget ] 33 | ::Gadget *getGadget() const; 34 | }; 35 | 36 | template class GadgetBuilderTemplate : public AreaBuilderTemplate 37 | { 38 | public: 39 | GadgetBuilderTemplate(const std::string &uniqueId = MUI::EmptyUniqueId, const std::string &muiClassName = MUIC_Gadget) 40 | : AreaBuilderTemplate(uniqueId, muiClassName) 41 | { 42 | } 43 | }; 44 | 45 | class GadgetBuilder : public GadgetBuilderTemplate 46 | { 47 | public: 48 | GadgetBuilder(); 49 | }; 50 | } 51 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Gauge.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "Gauge.hpp" 8 | 9 | namespace MUI 10 | { 11 | const std::string Gauge::className = MUIC_Gauge; 12 | 13 | GaugeBuilder::GaugeBuilder() { } 14 | 15 | long Gauge::getCurrent() const 16 | { 17 | return GetValueAsLong(MUIA_Gauge_Current); 18 | } 19 | 20 | unsigned long Gauge::getDivide() const 21 | { 22 | return GetValueAsULong(MUIA_Gauge_Divide); 23 | } 24 | 25 | #ifdef MUIA_Gauge_InfoRate 26 | long Gauge::getInfoRate() const 27 | { 28 | return GetValueAsLong(MUIA_Gauge_InfoRate); 29 | } 30 | #endif 31 | 32 | std::string Gauge::getInfoText() const 33 | { 34 | return GetValueAsString(MUIA_Gauge_InfoText); 35 | } 36 | 37 | long Gauge::getMax() const 38 | { 39 | return GetValueAsLong(MUIA_Gauge_Max); 40 | } 41 | 42 | Gauge &Gauge::setCurrent(const long current) 43 | { 44 | SetValue(MUIA_Gauge_Current, current); 45 | return *this; 46 | } 47 | 48 | Gauge &Gauge::setDivide(const unsigned long divide) 49 | { 50 | SetValue(MUIA_Gauge_Divide, divide); 51 | return *this; 52 | } 53 | 54 | #ifdef MUIA_Gauge_InfoRate 55 | Gauge &Gauge::setInfoRate(const long horiz) 56 | { 57 | SetValue(MUIA_Gauge_InfoRate, horiz); 58 | return *this; 59 | } 60 | #endif 61 | 62 | Gauge &Gauge::setInfoText(const std::string &infoText) 63 | { 64 | SetValue(MUIA_Gauge_InfoText, StoreString(MUIA_Gauge_InfoText, infoText)); 65 | return *this; 66 | } 67 | 68 | Gauge &Gauge::setMax(const long max) 69 | { 70 | SetValue(MUIA_Gauge_Max, max); 71 | return *this; 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Listview.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "Listview.hpp" 8 | 9 | namespace MUI 10 | { 11 | const std::string Listview::className = MUIC_Listview; 12 | 13 | #ifdef MUIA_Listview_AgainClick 14 | bool Listview::isAgainClick() const 15 | { 16 | return GetValueAsBool(MUIA_Listview_AgainClick); 17 | } 18 | #endif 19 | 20 | long Listview::getClickColumn() const 21 | { 22 | return GetValueAsLong(MUIA_Listview_ClickColumn); 23 | } 24 | 25 | long Listview::getDefClickColumn() const 26 | { 27 | return GetValueAsLong(MUIA_Listview_DefClickColumn); 28 | } 29 | 30 | bool Listview::isDoubleClick() const 31 | { 32 | return GetValueAsBool(MUIA_Listview_DoubleClick); 33 | } 34 | 35 | Listview_DragType Listview::getDragType() const 36 | { 37 | return Listview_DragType(GetValueAsLong(MUIA_Listview_DragType)); 38 | } 39 | 40 | List Listview::getList() const 41 | { 42 | return List(GetValueAsObjectPtr(MUIA_Listview_List)); 43 | } 44 | 45 | bool Listview::isSelectChange() const 46 | { 47 | return GetValueAsBool(MUIA_Listview_SelectChange); 48 | } 49 | 50 | Listview &Listview::setDefClickColumn(const long defClickColumn) 51 | { 52 | SetValue(MUIA_Listview_DefClickColumn, defClickColumn); 53 | return *this; 54 | } 55 | 56 | Listview &Listview::setDragType(const Listview_DragType dragType) 57 | { 58 | SetValue(MUIA_Listview_DragType, (long)dragType); 59 | return *this; 60 | } 61 | 62 | ListviewBuilder::ListviewBuilder() { } 63 | } 64 | -------------------------------------------------------------------------------- /wrappers/src/MUI/MCC/Busy.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "Busy.hpp" 8 | 9 | #include 10 | 11 | namespace MUI::MCC 12 | { 13 | const std::string Busy::className = MUIC_Busy; 14 | 15 | bool Busy::isSpeedOff() const 16 | { 17 | return GetValueAsLong(MUIA_Busy_Speed) == MUIV_Busy_Speed_Off; 18 | } 19 | 20 | bool Busy::isSpeedUser() const 21 | { 22 | return GetValueAsLong(MUIA_Busy_Speed) == MUIV_Busy_Speed_User; 23 | } 24 | 25 | long Busy::getSpeed() const 26 | { 27 | return GetValueAsLong(MUIA_Busy_Speed); 28 | } 29 | 30 | Busy &Busy::setSpeedOff() 31 | { 32 | SetValue(MUIA_Busy_Speed, (long)MUIV_Busy_Speed_Off); 33 | return *this; 34 | } 35 | 36 | Busy &Busy::setSpeedUser() 37 | { 38 | SetValue(MUIA_Busy_Speed, (long)MUIV_Busy_Speed_User); 39 | return *this; 40 | } 41 | 42 | Busy &Busy::setSpeed(const unsigned char speed) 43 | { 44 | SetValue(MUIA_Busy_Speed, (long)speed); 45 | return *this; 46 | } 47 | 48 | Busy &Busy::Move() 49 | { 50 | DoMethod(muiObject(), MUIM_Busy_Move); 51 | return *this; 52 | } 53 | 54 | BusyBuilder::BusyBuilder() { } 55 | } 56 | -------------------------------------------------------------------------------- /wrappers/src/MUI/MCC/ValueTypes/NList/Active.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | namespace MUI 12 | { 13 | enum class NList_Active 14 | { 15 | Off = MUIV_NList_Active_Off, 16 | Top = MUIV_NList_Active_Top, 17 | Bottom = MUIV_NList_Active_Bottom, 18 | Up = MUIV_NList_Active_Up, 19 | Down = MUIV_NList_Active_Down, 20 | PageUp = MUIV_NList_Active_PageUp, 21 | PageDown = MUIV_NList_Active_PageDown, 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /wrappers/src/MUI/MCC/ValueTypes/NList/DragType.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | namespace MUI::MCC 12 | { 13 | enum class NList_DragType 14 | { 15 | None = MUIV_NList_DragType_None, 16 | Default = MUIV_NList_DragType_Default, 17 | Immediate = MUIV_NList_DragType_Immediate, 18 | Borders = MUIV_NList_DragType_Borders, 19 | Qualifier = MUIV_NList_DragType_Qualifier, 20 | }; 21 | } 22 | -------------------------------------------------------------------------------- /wrappers/src/MUI/MCC/ValueTypes/NList/Exchange.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | #undef End 12 | 13 | namespace MUI 14 | { 15 | enum class NList_Exchange 16 | { 17 | Top = MUIV_NList_Exchange_Top, 18 | Active = MUIV_NList_Exchange_Active, 19 | Bottom = MUIV_NList_Exchange_Bottom, 20 | Next = MUIV_NList_Exchange_Next, 21 | Previous = MUIV_NList_Exchange_Previous, 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /wrappers/src/MUI/MCC/ValueTypes/NList/First.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | namespace MUI 12 | { 13 | enum class NList_First 14 | { 15 | Top = MUIV_NList_First_Top, 16 | Bottom = MUIV_NList_First_Bottom, 17 | Up = MUIV_NList_First_Up, 18 | Down = MUIV_NList_First_Down, 19 | PageUp = MUIV_NList_First_PageUp, 20 | PageDown = MUIV_NList_First_PageDown, 21 | Up2 = MUIV_NList_First_Up2, 22 | Down2 = MUIV_NList_First_Down2, 23 | Up4 = MUIV_NList_First_Up4, 24 | Down4 = MUIV_NList_First_Down4, 25 | }; 26 | } 27 | -------------------------------------------------------------------------------- /wrappers/src/MUI/MCC/ValueTypes/NList/HorizFirst.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | #undef End 12 | 13 | namespace MUI 14 | { 15 | enum class NList_HorizFirst 16 | { 17 | Start = MUIV_NList_Horiz_First_Start, 18 | End = MUIV_NList_Horiz_First_End, 19 | Left = MUIV_NList_Horiz_First_Left, 20 | Right = MUIV_NList_Horiz_First_Right, 21 | PageLeft = MUIV_NList_Horiz_First_PageLeft, 22 | PageRight = MUIV_NList_Horiz_First_PageRight, 23 | Left2 = MUIV_NList_Horiz_First_Left2, 24 | Right2 = MUIV_NList_Horiz_First_Right2, 25 | Left4 = MUIV_NList_Horiz_First_Left4, 26 | Right4 = MUIV_NList_Horiz_First_Right4, 27 | }; 28 | } 29 | -------------------------------------------------------------------------------- /wrappers/src/MUI/MCC/ValueTypes/NList/Insert.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | #undef End 12 | 13 | namespace MUI 14 | { 15 | enum class NList_Insert 16 | { 17 | Top = MUIV_NList_Insert_Top, 18 | Active = MUIV_NList_Insert_Active, 19 | Sorted = MUIV_NList_Insert_Sorted, 20 | Bottom = MUIV_NList_Insert_Bottom, 21 | Flag_Raw = MUIV_NList_Insert_Flag_Raw, 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /wrappers/src/MUI/MCC/ValueTypes/NList/Jump.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | #undef End 12 | 13 | namespace MUI 14 | { 15 | enum class NList_Jump 16 | { 17 | Top = MUIV_NList_Jump_Top, 18 | Active = MUIV_NList_Jump_Active, 19 | Bottom = MUIV_NList_Jump_Bottom, 20 | Down = MUIV_NList_Jump_Down, 21 | Up = MUIV_NList_Jump_Up, 22 | Active_Center = MUIV_NList_Jump_Active_Center, 23 | }; 24 | } 25 | -------------------------------------------------------------------------------- /wrappers/src/MUI/MCC/ValueTypes/NList/Move.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | #undef End 12 | 13 | namespace MUI 14 | { 15 | enum class NList_Move 16 | { 17 | Top = MUIV_NList_Move_Top, 18 | Active = MUIV_NList_Move_Active, 19 | Bottom = MUIV_NList_Move_Bottom, 20 | Next = MUIV_NList_Move_Next, 21 | Previous = MUIV_NList_Move_Previous, 22 | Selected = MUIV_NList_Move_Selected, 23 | }; 24 | } 25 | -------------------------------------------------------------------------------- /wrappers/src/MUI/MCC/ValueTypes/NList/MultiSelect.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | namespace MUI::MCC 12 | { 13 | enum class NList_MultiSelect 14 | { 15 | None = MUIV_NList_MultiSelect_None, 16 | Default = MUIV_NList_MultiSelect_Default, 17 | Shifted = MUIV_NList_MultiSelect_Shifted, 18 | Always = MUIV_NList_MultiSelect_Always, 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /wrappers/src/MUI/MCC/ValueTypes/NList/Redraw.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | #undef End 12 | 13 | namespace MUI 14 | { 15 | enum class NList_Redraw 16 | { 17 | Active = MUIV_NList_Redraw_Active, 18 | All = MUIV_NList_Redraw_All, 19 | Title = MUIV_NList_Redraw_Title, 20 | Selected = MUIV_NList_Redraw_Selected, 21 | VisibleCols = MUIV_NList_Redraw_VisibleCols, 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /wrappers/src/MUI/MCC/ValueTypes/NList/Remove.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | namespace MUI::MCC 12 | { 13 | enum class NList_Remove 14 | { 15 | First = MUIV_NList_Remove_First, 16 | Active = MUIV_NList_Remove_Active, 17 | Last = MUIV_NList_Remove_Last, 18 | Selected = MUIV_NList_Remove_Selected, 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /wrappers/src/MUI/MCC/ValueTypes/NList/Select.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | namespace MUI::MCC 12 | { 13 | enum class NList_Select // selection type 14 | { 15 | Off = MUIV_NList_Select_Off, 16 | On = MUIV_NList_Select_On, 17 | Toggle = MUIV_NList_Select_Toggle, 18 | Ask = MUIV_NList_Select_Ask, 19 | }; 20 | 21 | enum class NList_SelectPosition 22 | { 23 | Active = MUIV_NList_Select_Active, 24 | All = MUIV_NList_Select_All, 25 | }; 26 | } 27 | -------------------------------------------------------------------------------- /wrappers/src/MUI/MCC/ValueTypes/NList/TypeSelect.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | namespace MUI::MCC 12 | { 13 | enum class NList_TypeSelect 14 | { 15 | Line = MUIV_NList_TypeSelect_Line, 16 | Char = MUIV_NList_TypeSelect_Char 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /wrappers/src/MUI/MCC/ValueTypes/NListview/HSB.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | namespace MUI::MCC 12 | { 13 | enum class NListview_HSB 14 | { 15 | Always = MUIV_NListview_HSB_Always, 16 | Auto = MUIV_NListview_HSB_Auto, 17 | FullAuto = MUIV_NListview_HSB_FullAuto, 18 | None = MUIV_NListview_HSB_None, 19 | Default = MUIV_NListview_HSB_Default, 20 | On = MUIV_NListview_HSB_On, 21 | Off = MUIV_NListview_HSB_Off, 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /wrappers/src/MUI/MCC/ValueTypes/NListview/VSB.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | namespace MUI::MCC 12 | { 13 | enum class NListview_VSB 14 | { 15 | Always = MUIV_NListview_VSB_Always, 16 | Auto = MUIV_NListview_VSB_Auto, 17 | FullAuto = MUIV_NListview_VSB_FullAuto, 18 | None = MUIV_NListview_VSB_None, 19 | Default = MUIV_NListview_VSB_Default, 20 | Left = MUIV_NListview_VSB_Left, 21 | On = MUIV_NListview_VSB_On, 22 | Off = MUIV_NListview_VSB_Off, 23 | }; 24 | } 25 | -------------------------------------------------------------------------------- /wrappers/src/MUI/MCC/ValueTypes/TextEditor/InsertText.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | namespace MUI::MCC 12 | { 13 | enum class TextEditor_InsertText 14 | { 15 | Cursor = MUIV_TextEditor_InsertText_Cursor, 16 | Top = MUIV_TextEditor_InsertText_Top, 17 | Bottom = MUIV_TextEditor_InsertText_Bottom, 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /wrappers/src/MUI/MCC/ValueTypes/TextEditor/MarkText.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | namespace MUI::MCC 12 | { 13 | enum class TextEditor_MarkText 14 | { 15 | All = MUIV_TextEditor_MarkText_All, 16 | None = MUIV_TextEditor_MarkText_None, 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /wrappers/src/MUI/MCC/ValueTypes/TextEditor/SetBlock.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | namespace MUI::MCC 12 | { 13 | enum class TextEditor_SetBlock 14 | { 15 | Min = MUIV_TextEditor_SetBlock_Min, 16 | Max = MUIV_TextEditor_SetBlock_Max, 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /wrappers/src/MUI/MCC/ValueTypes/TextEditor/TabSize.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | namespace MUI::MCC 12 | { 13 | enum class TextEditor_TabSize 14 | { 15 | Default = MUIV_TextEditor_TabSize_Default, 16 | }; 17 | } 18 | -------------------------------------------------------------------------------- /wrappers/src/MUI/MCC/ValueTypes/TextEditor/WrapMode.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | namespace MUI::MCC 12 | { 13 | enum class TextEditor_WrapMode 14 | { 15 | NoWrap = MUIV_TextEditor_WrapMode_NoWrap, 16 | SoftWrap = MUIV_TextEditor_WrapMode_SoftWrap, 17 | HardWrap = MUIV_TextEditor_WrapMode_HardWrap, 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Menu.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "Menu.hpp" 8 | 9 | namespace MUI 10 | { 11 | const std::string Menu::className = MUIC_Menu; 12 | 13 | bool Menu::isEnabled() const 14 | { 15 | return GetValueAsBool(MUIA_Menu_Enabled); 16 | } 17 | 18 | std::string Menu::getTitle() const 19 | { 20 | return GetValueAsString(MUIA_Menu_Title); 21 | } 22 | 23 | Menu &Menu::setEnabled(const bool enabled) 24 | { 25 | SetValue(MUIA_Menu_Enabled, enabled); 26 | return *this; 27 | } 28 | 29 | Menu &Menu::setTitle(const std::string &title) 30 | { 31 | SetValue(MUIA_Menu_Title, title); 32 | return *this; 33 | } 34 | 35 | MenuBuilder::MenuBuilder() { } 36 | } 37 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Menustrip.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "Menustrip.hpp" 8 | 9 | namespace MUI 10 | { 11 | const std::string Menustrip::className = MUIC_Menustrip; 12 | 13 | #ifdef MUIA_Menustrip_CaseSensitive 14 | bool Menustrip::isCaseSensitive() const 15 | { 16 | return GetValueAsBool(MUIA_Menustrip_CaseSensitive); 17 | } 18 | #endif 19 | 20 | bool Menustrip::isEnabled() const 21 | { 22 | return GetValueAsBool(MUIA_Menustrip_Enabled); 23 | } 24 | 25 | Menustrip &Menustrip::setEnabled(const bool enabled) 26 | { 27 | SetValue(MUIA_Menustrip_Enabled, enabled); 28 | return *this; 29 | } 30 | 31 | MenustripBuilder::MenustripBuilder() { } 32 | } 33 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Notifier/Core/DestNotifierRoot.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "DestNotifierRoot.hpp" 8 | 9 | #include "MUI/Core/NullObject.hpp" 10 | #include "NotifyDestType.hpp" 11 | 12 | #include 13 | 14 | namespace MUI 15 | { 16 | DestNotifierRoot::DestNotifierRoot(const NotifierObject ¬ifierObject, const Root &root) 17 | : mNotifierObject(notifierObject) 18 | , notifyDestType(NotifyDestType::GivenObject) 19 | , mObject(root) 20 | { 21 | } 22 | 23 | DestNotifierRoot::DestNotifierRoot(const NotifierObject ¬ifierObject, const enum NotifyDestType notifyDestType) 24 | : mNotifierObject(notifierObject) 25 | , notifyDestType(notifyDestType) 26 | , mObject(MUI::NullObject {}) 27 | { 28 | } 29 | 30 | void *DestNotifierRoot::muiDestObject() const 31 | { 32 | switch (notifyDestType) 33 | { 34 | case NotifyDestType::GivenObject: 35 | return mObject.muiObject(); 36 | 37 | case NotifyDestType::Self: 38 | case NotifyDestType::Window: 39 | case NotifyDestType::Application: 40 | return (void *)notifyDestType; 41 | 42 | default: 43 | std::cerr << __PRETTY_FUNCTION__ << "destination object type: " << notifyDestType << " is not supported" << std::endl; 44 | return nullptr; 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Notifier/Core/DestNotifierRoot.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include "NotifierObject.hpp" 10 | 11 | #include 12 | 13 | namespace MUI 14 | { 15 | enum class NotifyDestType; 16 | 17 | class DestNotifierRoot 18 | { 19 | NotifierObject mNotifierObject; 20 | enum NotifyDestType notifyDestType; 21 | Root mObject; 22 | 23 | protected: 24 | DestNotifierRoot() = delete; 25 | 26 | DestNotifierRoot(const NotifierObject ¬ifierObject, const Root &root); 27 | DestNotifierRoot(const NotifierObject ¬ifierObject, const enum NotifyDestType notifyDestType); 28 | 29 | void *muiDestObject() const; 30 | 31 | Object *muiSourceObject() const 32 | { 33 | return mNotifierObject.getObject().muiObject(); 34 | } 35 | 36 | unsigned long getAttribute() const 37 | { 38 | return mNotifierObject.getAttribute(); 39 | } 40 | 41 | unsigned long getTriggerValue() const 42 | { 43 | return mNotifierObject.getTriggerValue().value(); 44 | } 45 | }; 46 | } 47 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Notifier/Core/NotifierObject.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "NotifierObject.hpp" 8 | 9 | namespace MUI 10 | { 11 | NotifierObject::NotifierObject(const Root &root, const unsigned long attribute, const AOS::ValueObject &triggerValue) 12 | : mObject(root) 13 | , mAttribute(attribute) 14 | , mTriggerValue(triggerValue) 15 | { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Notifier/Core/NotifierObject.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include "AOS/ValueObject.hpp" 10 | #include "MUI/Core/Root.hpp" 11 | 12 | namespace MUI 13 | { 14 | class NotifierObject 15 | { 16 | Root mObject; 17 | unsigned long mAttribute; 18 | AOS::ValueObject mTriggerValue; 19 | 20 | public: 21 | NotifierObject() = delete; 22 | 23 | NotifierObject(const Root &root, const unsigned long attribute, const AOS::ValueObject &triggerValue); 24 | 25 | Root getObject() const 26 | { 27 | return mObject; 28 | } 29 | 30 | unsigned long getAttribute() const 31 | { 32 | return mAttribute; 33 | } 34 | 35 | AOS::ValueObject getTriggerValue() const 36 | { 37 | return mTriggerValue; 38 | } 39 | }; 40 | } 41 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Notifier/Core/NotifyDestType.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "NotifyDestType.hpp" 8 | 9 | std::ostream &operator<<(std::ostream &os, const MUI::NotifyDestType notifyDestType) 10 | { 11 | os << "MUI::NotifyDestType::"; 12 | 13 | switch (notifyDestType) 14 | { 15 | case MUI::NotifyDestType::GivenObject: 16 | os << "GivenObject"; 17 | break; 18 | case MUI::NotifyDestType::Self: 19 | os << "Self"; 20 | break; 21 | case MUI::NotifyDestType::Window: 22 | os << "Window"; 23 | break; 24 | case MUI::NotifyDestType::Application: 25 | os << "Application"; 26 | break; 27 | case MUI::NotifyDestType::Parent: 28 | os << "Parent"; 29 | break; 30 | #ifdef MUIV_Notify_ParentParent 31 | case MUI::NotifyDestType::ParentParent: 32 | os << "ParentParent"; 33 | break; 34 | #endif 35 | #ifdef MUIV_Notify_ParentParentParent 36 | case MUI::NotifyDestType::ParentParentParent: 37 | os << "ParentParentParent"; 38 | break; 39 | #endif 40 | default: 41 | os << "UNKNOWN"; 42 | } 43 | 44 | return os; 45 | } 46 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Notifier/Core/NotifyDestType.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | 12 | namespace MUI 13 | { 14 | enum class NotifyDestType 15 | { 16 | GivenObject = 0, 17 | Self = MUIV_Notify_Self, 18 | Window = MUIV_Notify_Window, 19 | Application = MUIV_Notify_Application, 20 | Parent = MUIV_Notify_Parent, 21 | #ifdef MUIV_Notify_ParentParent 22 | ParentParent = MUIV_Notify_ParentParent, 23 | #endif 24 | #ifdef MUIV_Notify_ParentParentParent 25 | ParentParentParent = MUIV_Notify_ParentParentParent, 26 | #endif 27 | }; 28 | } 29 | 30 | std::ostream &operator<<(std::ostream &os, const enum MUI::NotifyDestType notifyDestType); 31 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Notifier/Dest/DestApplicationNotifier.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "DestApplicationNotifier.hpp" 8 | 9 | #include 10 | 11 | #include "MUI/Window.hpp" 12 | 13 | namespace MUI 14 | { 15 | DestApplicationNotifier::DestApplicationNotifier(const NotifierObject ¬ifierObject, const Application &application) 16 | : DestNotifyNotifier(notifierObject, application) 17 | { 18 | } 19 | 20 | DestApplicationNotifier::DestApplicationNotifier(const NotifierObject ¬ifierObject, const enum NotifyDestType notifyDestType) 21 | : DestNotifyNotifier(notifierObject, notifyDestType) 22 | { 23 | } 24 | 25 | DestApplicationNotifier &DestApplicationNotifier::aboutMUI(const Window &window) 26 | { 27 | DoMethod(muiSourceObject(), MUIM_Notify, getAttribute(), getTriggerValue(), muiDestObject(), 2, MUIM_Application_AboutMUI, 28 | window.muiObject()); 29 | return *this; 30 | } 31 | 32 | DestApplicationNotifier &DestApplicationNotifier::returnIDQuit() 33 | { 34 | DoMethod(muiSourceObject(), MUIM_Notify, getAttribute(), getTriggerValue(), muiDestObject(), 2, MUIM_Application_ReturnID, 35 | MUIV_Application_ReturnID_Quit); 36 | return *this; 37 | } 38 | 39 | DestApplicationNotifier &DestApplicationNotifier::returnID(const unsigned long returnId) 40 | { 41 | DoMethod(muiSourceObject(), MUIM_Notify, getAttribute(), getTriggerValue(), muiDestObject(), 2, MUIM_Application_ReturnID, 42 | returnId); 43 | return *this; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Notifier/Dest/DestApplicationNotifier.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include "DestNotifyNotifier.hpp" 10 | #include "MUI/Application.hpp" 11 | 12 | namespace MUI 13 | { 14 | class Window; 15 | 16 | class DestApplicationNotifier : public DestNotifyNotifier 17 | { 18 | friend class SourceNotifierRoot; 19 | template friend class SourceNotifier; 20 | 21 | protected: 22 | DestApplicationNotifier() = delete; 23 | DestApplicationNotifier(const NotifierObject ¬ifierObject, const Application &application); 24 | DestApplicationNotifier(const NotifierObject ¬ifierObject, const enum NotifyDestType notifyDestType); 25 | 26 | public: 27 | /// @brief [ @b MUIM_Application_AboutMUI ] 28 | DestApplicationNotifier &aboutMUI(const Window &window); 29 | /// @brief [ @b MUIM_Application_ReturnID, @b MUIV_Application_ReturnID_Quit ] 30 | DestApplicationNotifier &returnIDQuit(); 31 | /// @brief [ @b MUIM_Application_ReturnID ] 32 | DestApplicationNotifier &returnID(const unsigned long returnId); 33 | }; 34 | } 35 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Notifier/Dest/DestAreaNotifier.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include "DestNotifyNotifier.hpp" 10 | #include "MUI/Area.hpp" 11 | #include "MUI/ValueTypes/Notify/Trigger.hpp" 12 | 13 | namespace MUI 14 | { 15 | class DestAreaNotifier : public DestNotifyNotifier 16 | { 17 | friend class SourceNotifierRoot; 18 | template friend class SourceNotifier; 19 | 20 | protected: 21 | DestAreaNotifier() = delete; 22 | DestAreaNotifier(const NotifierObject ¬ifierObject, const Area &area); 23 | DestAreaNotifier(const NotifierObject ¬ifierObject, const enum NotifyDestType notifyDestType); 24 | 25 | public: 26 | /// @brief [ @b MUIM_Set / @b MUIM_NoNotifySet, @b MUIA_Disabled ] 27 | DestAreaNotifier &setDisabled(const bool disabled, bool notify = true); 28 | /// @brief [ @b MUIM_Set / @b MUIM_NoNotifySet, @b MUIA_Disabled = @b MUIV_TriggerValue ] 29 | DestAreaNotifier &setDisabledTriggerValue(bool notify = true, enum Trigger trigger = Trigger::Value); 30 | /// @brief [ @b MUIM_Set / @b MUIM_NoNotifySet, @b MUIA_Disabled = @b MUIV_NotTriggerValue ] 31 | DestAreaNotifier &setSelected(const bool selected, bool notify = true); 32 | /// @brief [ @b MUIM_Set / @b MUIM_NoNotifySet, @b MUIA_Selected = @b MUIV_TriggerValue ] 33 | DestAreaNotifier &setSelectedTriggerValue(bool notify = true, enum Trigger trigger = Trigger::Value); 34 | /// @brief [ @b MUIM_Set / @b MUIM_NoNotifySet, @b MUIA_Selected = @b MUIV_NotTriggerValue ] 35 | DestAreaNotifier &setShowMe(const bool showMe, bool notify = true); 36 | /// @brief [ @b MUIM_Set / @b MUIM_NoNotifySet, @b MUIA_ShowMe = @b MUIV_TriggerValue ] 37 | DestAreaNotifier &setShowMeTriggerValue(bool notify = true, enum Trigger trigger = Trigger::Value); 38 | }; 39 | } 40 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Notifier/Dest/DestCycleNotifier.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "DestCycleNotifier.hpp" 8 | 9 | #include 10 | 11 | namespace MUI 12 | { 13 | DestCycleNotifier::DestCycleNotifier(const NotifierObject ¬ifierObject, const Cycle &cycle) 14 | : DestGroupNotifier(notifierObject, cycle) 15 | { 16 | } 17 | 18 | DestCycleNotifier::DestCycleNotifier(const NotifierObject ¬ifierObject, const enum NotifyDestType notifyDestType) 19 | : DestGroupNotifier(notifierObject, notifyDestType) 20 | { 21 | } 22 | 23 | DestCycleNotifier &DestCycleNotifier::setActive(const enum Cycle_Active active, bool notify) 24 | { 25 | DoMethod(muiSourceObject(), MUIM_Notify, getAttribute(), getTriggerValue(), muiDestObject(), 3, 26 | notify ? MUIM_Set : MUIM_NoNotifySet, MUIA_Cycle_Active, (unsigned long)active); 27 | return *this; 28 | } 29 | 30 | DestCycleNotifier &DestCycleNotifier::setActiveTriggerValue(bool notify) 31 | { 32 | DoMethod(muiSourceObject(), MUIM_Notify, getAttribute(), getTriggerValue(), muiDestObject(), 3, 33 | notify ? MUIM_Set : MUIM_NoNotifySet, MUIA_Cycle_Active, MUIV_TriggerValue); 34 | return *this; 35 | } 36 | 37 | DestCycleNotifier &DestCycleNotifier::setEntries(const char *entries[], bool notify) 38 | { 39 | DoMethod(muiSourceObject(), MUIM_Notify, getAttribute(), getTriggerValue(), muiDestObject(), 3, 40 | notify ? MUIM_Set : MUIM_NoNotifySet, MUIA_Cycle_Entries, entries); 41 | return *this; 42 | } 43 | 44 | DestCycleNotifier &DestCycleNotifier::setEntriesTriggerValue(bool notify) 45 | { 46 | DoMethod(muiSourceObject(), MUIM_Notify, getAttribute(), getTriggerValue(), muiDestObject(), 3, 47 | notify ? MUIM_Set : MUIM_NoNotifySet, MUIA_Cycle_Entries, MUIV_TriggerValue); 48 | return *this; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Notifier/Dest/DestCycleNotifier.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include "DestGroupNotifier.hpp" 10 | #include "MUI/Cycle.hpp" 11 | 12 | namespace MUI 13 | { 14 | enum class Cycle_Active; 15 | 16 | class DestCycleNotifier : public DestGroupNotifier 17 | { 18 | friend class SourceNotifierRoot; 19 | template friend class SourceNotifier; 20 | 21 | protected: 22 | DestCycleNotifier() = delete; 23 | DestCycleNotifier(const NotifierObject ¬ifierObject, const Cycle &cycle); 24 | DestCycleNotifier(const NotifierObject ¬ifierObject, const enum NotifyDestType notifyDestType); 25 | 26 | public: 27 | /// @brief [ @b MUIM_Set / @b MUIM_NoNotifySet, @b MUIA_Cycle_Active ] 28 | DestCycleNotifier &setActive(const enum Cycle_Active active, bool notify = true); 29 | /// @brief [ @b MUIM_Set / @b MUIM_NoNotifySet, @b MUIA_Cycle_Active = @b MUIV_TriggerValue ] 30 | DestCycleNotifier &setActiveTriggerValue(bool notify = true); 31 | /// @brief [ @b MUIM_Set / @b MUIM_NoNotifySet, @b MUIA_Cycle_Entries ] 32 | DestCycleNotifier &setEntries(const char *entries[], bool notify = true); 33 | /// @brief [ @b MUIM_Set / @b MUIM_NoNotifySet, @b MUIA_Cycle_Entries = @b MUIV_TriggerValue ] 34 | DestCycleNotifier &setEntriesTriggerValue(bool notify = true); 35 | }; 36 | } 37 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Notifier/Dest/DestFamilyNotifier.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "DestFamilyNotifier.hpp" 8 | 9 | #include 10 | 11 | namespace MUI 12 | { 13 | DestFamilyNotifier::DestFamilyNotifier(const NotifierObject ¬ifierObject, const Family &family) 14 | : DestNotifyNotifier(notifierObject, family) 15 | { 16 | } 17 | 18 | DestFamilyNotifier::DestFamilyNotifier(const NotifierObject ¬ifierObject, const enum NotifyDestType notifyDestType) 19 | : DestNotifyNotifier(notifierObject, notifyDestType) 20 | { 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Notifier/Dest/DestFamilyNotifier.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include "DestNotifyNotifier.hpp" 10 | #include "MUI/Family.hpp" 11 | 12 | namespace MUI 13 | { 14 | class DestFamilyNotifier : public DestNotifyNotifier 15 | { 16 | friend class SourceNotifierRoot; 17 | template friend class SourceNotifier; 18 | 19 | protected: 20 | DestFamilyNotifier() = delete; 21 | DestFamilyNotifier(const NotifierObject ¬ifierObject, const Family &family); 22 | DestFamilyNotifier(const NotifierObject ¬ifierObject, const enum NotifyDestType notifyDestType); 23 | }; 24 | } 25 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Notifier/Dest/DestGadgetNotifier.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "DestGadgetNotifier.hpp" 8 | 9 | #include 10 | 11 | namespace MUI 12 | { 13 | DestGadgetNotifier::DestGadgetNotifier(const NotifierObject ¬ifierObject, const Gadget &gadget) 14 | : DestAreaNotifier(notifierObject, gadget) 15 | { 16 | } 17 | 18 | DestGadgetNotifier::DestGadgetNotifier(const NotifierObject ¬ifierObject, const enum NotifyDestType notifyDestType) 19 | : DestAreaNotifier(notifierObject, notifyDestType) 20 | { 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Notifier/Dest/DestGadgetNotifier.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include "DestAreaNotifier.hpp" 10 | #include "MUI/Gadget.hpp" 11 | 12 | namespace MUI 13 | { 14 | class DestGadgetNotifier : public DestAreaNotifier 15 | { 16 | friend class SourceNotifierRoot; 17 | template friend class SourceNotifier; 18 | 19 | protected: 20 | DestGadgetNotifier() = delete; 21 | DestGadgetNotifier(const NotifierObject ¬ifierObject, const Gadget &gadget); 22 | DestGadgetNotifier(const NotifierObject ¬ifierObject, const enum NotifyDestType notifyDestType); 23 | }; 24 | } 25 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Notifier/Dest/DestGroupNotifier.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "DestGroupNotifier.hpp" 8 | 9 | #include 10 | 11 | namespace MUI 12 | { 13 | DestGroupNotifier::DestGroupNotifier(const NotifierObject ¬ifierObject, const Group &group) 14 | : DestAreaNotifier(notifierObject, group) 15 | { 16 | } 17 | 18 | DestGroupNotifier::DestGroupNotifier(const NotifierObject ¬ifierObject, const enum NotifyDestType notifyDestType) 19 | : DestAreaNotifier(notifierObject, notifyDestType) 20 | { 21 | } 22 | 23 | DestGroupNotifier &DestGroupNotifier::setActivePage(const unsigned long activePage, bool notify) 24 | { 25 | DoMethod(muiSourceObject(), MUIM_Notify, getAttribute(), getTriggerValue(), muiDestObject(), 3, 26 | notify ? MUIM_Set : MUIM_NoNotifySet, MUIA_Group_ActivePage, activePage); 27 | return *this; 28 | } 29 | 30 | DestGroupNotifier &DestGroupNotifier::setActivePage(const enum Group_ActivePage activePage, bool notify) 31 | { 32 | DoMethod(muiSourceObject(), MUIM_Notify, getAttribute(), getTriggerValue(), muiDestObject(), 3, 33 | notify ? MUIM_Set : MUIM_NoNotifySet, MUIA_Group_ActivePage, (unsigned long)activePage); 34 | return *this; 35 | } 36 | 37 | DestGroupNotifier &DestGroupNotifier::setActivePageTriggerValue(bool notify) 38 | { 39 | DoMethod(muiSourceObject(), MUIM_Notify, getAttribute(), getTriggerValue(), muiDestObject(), 3, 40 | notify ? MUIM_Set : MUIM_NoNotifySet, MUIA_Group_ActivePage, MUIV_TriggerValue); 41 | return *this; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Notifier/Dest/DestGroupNotifier.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include "DestAreaNotifier.hpp" 10 | #include "MUI/Group.hpp" 11 | 12 | namespace MUI 13 | { 14 | enum class Group_ActivePage; 15 | 16 | class DestGroupNotifier : public DestAreaNotifier 17 | { 18 | friend class SourceNotifierRoot; 19 | template friend class SourceNotifier; 20 | 21 | protected: 22 | DestGroupNotifier() = delete; 23 | DestGroupNotifier(const NotifierObject ¬ifierObject, const Group &group); 24 | DestGroupNotifier(const NotifierObject ¬ifierObject, const enum NotifyDestType notifyDestType); 25 | 26 | public: 27 | /// @brief [ @b MUIM_Set / @b MUIM_NoNotifySet, @b MUIA_Group_ActivePage ] 28 | /// @param activePage index of page to activate (unsigned long to prevent pass #define < 0) 29 | DestGroupNotifier &setActivePage(const unsigned long activePage, bool notify = true); 30 | /// @brief [ @b MUIM_Set / @b MUIM_NoNotifySet, @b MUIA_Group_ActivePage ] 31 | DestGroupNotifier &setActivePage(const enum Group_ActivePage activePage, bool notify = true); 32 | /// @brief [ @b MUIM_Set / @b MUIM_NoNotifySet, @b MUIA_Group_ActivePage = @b MUIV_TriggerValue ] 33 | DestGroupNotifier &setActivePageTriggerValue(bool notify = true); 34 | }; 35 | } 36 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Notifier/Dest/DestListNotifier.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "DestListNotifier.hpp" 8 | 9 | #include 10 | 11 | namespace MUI 12 | { 13 | DestListNotifier::DestListNotifier(const NotifierObject ¬ifierObject, const List &list) 14 | : DestAreaNotifier(notifierObject, list) 15 | { 16 | } 17 | 18 | DestListNotifier::DestListNotifier(const NotifierObject ¬ifierObject, const enum NotifyDestType notifyDestType) 19 | : DestAreaNotifier(notifierObject, notifyDestType) 20 | { 21 | } 22 | 23 | DestListNotifier &DestListNotifier::setActive(const long active, bool notify) 24 | { 25 | DoMethod(muiSourceObject(), MUIM_Notify, getAttribute(), getTriggerValue(), muiDestObject(), 3, 26 | notify ? MUIM_Set : MUIM_NoNotifySet, MUIA_List_Active, active); 27 | return *this; 28 | } 29 | 30 | DestListNotifier &DestListNotifier::setActiveTriggerValue(bool notify) 31 | { 32 | DoMethod(muiSourceObject(), MUIM_Notify, getAttribute(), getTriggerValue(), muiDestObject(), 3, 33 | notify ? MUIM_Set : MUIM_NoNotifySet, MUIA_List_Active, MUIV_TriggerValue); 34 | return *this; 35 | } 36 | 37 | #ifdef MUIA_List_TopPixel 38 | DestListNotifier &DestListNotifier::setTopPixel(const long topPixel, bool notify) 39 | { 40 | DoMethod(muiSourceObject(), MUIM_Notify, getAttribute(), getTriggerValue(), muiDestObject(), 3, 41 | notify ? MUIM_Set : MUIM_NoNotifySet, MUIA_List_TopPixel, topPixel); 42 | return *this; 43 | } 44 | 45 | DestListNotifier &DestListNotifier::setTopPixelTriggerValue(bool notify) 46 | { 47 | DoMethod(muiSourceObject(), MUIM_Notify, getAttribute(), getTriggerValue(), muiDestObject(), 3, 48 | notify ? MUIM_Set : MUIM_NoNotifySet, MUIA_List_TopPixel, MUIV_TriggerValue); 49 | return *this; 50 | } 51 | #endif 52 | } 53 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Notifier/Dest/DestListNotifier.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include "DestAreaNotifier.hpp" 10 | #include "MUI/List.hpp" 11 | 12 | namespace MUI 13 | { 14 | enum class ListActivePage; 15 | 16 | class DestListNotifier : public DestAreaNotifier 17 | { 18 | friend class SourceNotifierRoot; 19 | template friend class SourceNotifier; 20 | 21 | protected: 22 | DestListNotifier() = delete; 23 | DestListNotifier(const NotifierObject ¬ifierObject, const List &list); 24 | DestListNotifier(const NotifierObject ¬ifierObject, const enum NotifyDestType notifyDestType); 25 | 26 | public: 27 | /// @brief [ @b MUIM_Set / @b MUIM_NoNotifySet, @b MUIA_List_Active ] 28 | DestListNotifier &setActive(const long active, bool notify = true); 29 | /// @brief [ @b MUIM_Set / @b MUIM_NoNotifySet, @b MUIA_List_Active = @b MUIV_TriggerValue ] 30 | DestListNotifier &setActiveTriggerValue(bool notify = true); 31 | #ifdef MUIA_List_TopPixel 32 | /// @brief [ @b MUIM_Set / @b MUIM_NoNotifySet, @b MUIA_List_TopPixel ] 33 | DestListNotifier &setTopPixel(const long topPixel, bool notify = true); 34 | /// @brief [ @b MUIM_Set / @b MUIM_NoNotifySet, @b MUIA_List_TopPixel = @b MUIV_TriggerValue ] 35 | DestListNotifier &setTopPixelTriggerValue(bool notify = true); 36 | #endif 37 | }; 38 | } 39 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Notifier/Dest/DestMenuitemNotifier.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "DestMenuitemNotifier.hpp" 8 | 9 | #include 10 | 11 | namespace MUI 12 | { 13 | DestMenuitemNotifier::DestMenuitemNotifier(const NotifierObject ¬ifierObject, const Menuitem &menuitem) 14 | : DestFamilyNotifier(notifierObject, menuitem) 15 | { 16 | } 17 | 18 | DestMenuitemNotifier::DestMenuitemNotifier(const NotifierObject ¬ifierObject, const enum NotifyDestType notifyDestType) 19 | : DestFamilyNotifier(notifierObject, notifyDestType) 20 | { 21 | } 22 | 23 | DestMenuitemNotifier &DestMenuitemNotifier::setChecked(const bool checked, bool notify) 24 | { 25 | DoMethod(muiSourceObject(), MUIM_Notify, getAttribute(), getTriggerValue(), muiDestObject(), 3, 26 | notify ? MUIM_Set : MUIM_NoNotifySet, MUIA_Menuitem_Checked, (unsigned long)checked); 27 | return *this; 28 | } 29 | 30 | DestMenuitemNotifier &DestMenuitemNotifier::setCheckedTriggerValue(bool notify) 31 | { 32 | DoMethod(muiSourceObject(), MUIM_Notify, getAttribute(), getTriggerValue(), muiDestObject(), 3, 33 | notify ? MUIM_Set : MUIM_NoNotifySet, MUIA_Menuitem_Checked, MUIV_TriggerValue); 34 | return *this; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Notifier/Dest/DestMenuitemNotifier.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include "DestFamilyNotifier.hpp" 10 | #include "MUI/Menuitem.hpp" 11 | 12 | namespace MUI 13 | { 14 | enum class MenuitemActivePage; 15 | 16 | class DestMenuitemNotifier : public DestFamilyNotifier 17 | { 18 | friend class SourceNotifierRoot; 19 | template friend class SourceNotifier; 20 | 21 | protected: 22 | DestMenuitemNotifier() = delete; 23 | DestMenuitemNotifier(const NotifierObject ¬ifierObject, const Menuitem &menuitem); 24 | DestMenuitemNotifier(const NotifierObject ¬ifierObject, const enum NotifyDestType notifyDestType); 25 | 26 | public: 27 | /// @brief [ @b MUIM_Set / @b MUIM_NoNotifySet, @b MUIA_Menuitem_Checked ] 28 | DestMenuitemNotifier &setChecked(const bool checked, bool notify = true); 29 | /// @brief [ @b MUIM_Set / @b MUIM_NoNotifySet, @b MUIA_Menuitem_Checked = @b MUIV_TriggerValue ] 30 | DestMenuitemNotifier &setCheckedTriggerValue(bool notify = true); 31 | }; 32 | } 33 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Notifier/Dest/DestNotifyNotifier.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include "../Core/DestNotifierRoot.hpp" 10 | #include "MUI/Notify.hpp" 11 | 12 | namespace MUI 13 | { 14 | class NotifierObject; 15 | 16 | class DestNotifyNotifier : public DestNotifierRoot 17 | { 18 | friend class SourceNotifierRoot; 19 | template friend class SourceNotifier; 20 | 21 | protected: 22 | DestNotifyNotifier() = delete; 23 | DestNotifyNotifier(const NotifierObject ¬ifierObject, const Notify ¬ify); 24 | DestNotifyNotifier(const NotifierObject ¬ifierObject, const enum NotifyDestType notifyDestType); 25 | 26 | public: 27 | /// @brief call any MUI method 28 | /// @param methodId id method 29 | DestNotifyNotifier &method(const unsigned long methodId); 30 | /// @brief [ @b MUIM_CallHook, no parameters ] 31 | DestNotifyNotifier &callHook(const void *hook); 32 | /// @brief [ @b MUIM_CallHook, one and more parameters ] 33 | DestNotifyNotifier &callHook(const void *hook, const std::initializer_list &args); 34 | /// @brief [ @b MUIM_WriteLong ] 35 | DestNotifyNotifier &writeLong(const unsigned long val, unsigned long *memory); 36 | /// @brief [ @b MUIM_WriteLong, @b MUIV_TriggerValue ] 37 | DestNotifyNotifier &writeLongTriggerValue(unsigned long *memory); 38 | /// @brief [ @b MUIM_WriteString ] 39 | DestNotifyNotifier &writeString(const char *str, char *memory); 40 | /// @brief [ @b MUIM_WriteString, @b MUIV_TriggerValue ] 41 | DestNotifyNotifier &writeStringTriggerValue(char *memory); 42 | }; 43 | } 44 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Notifier/Dest/DestPendisplayNotifier.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "DestPendisplayNotifier.hpp" 8 | 9 | #include 10 | 11 | namespace MUI 12 | { 13 | DestPendisplayNotifier::DestPendisplayNotifier(const NotifierObject ¬ifierObject, const Pendisplay &pendisplay) 14 | : DestAreaNotifier(notifierObject, pendisplay) 15 | { 16 | } 17 | 18 | DestPendisplayNotifier::DestPendisplayNotifier(const NotifierObject ¬ifierObject, const enum NotifyDestType notifyDestType) 19 | : DestAreaNotifier(notifierObject, notifyDestType) 20 | { 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Notifier/Dest/DestPendisplayNotifier.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include "DestAreaNotifier.hpp" 10 | #include "MUI/Pendisplay.hpp" 11 | 12 | namespace MUI 13 | { 14 | enum class Pendisplay_ActivePage; 15 | 16 | class DestPendisplayNotifier : public DestAreaNotifier 17 | { 18 | friend class SourceNotifierRoot; 19 | template friend class SourceNotifier; 20 | 21 | protected: 22 | DestPendisplayNotifier() = delete; 23 | DestPendisplayNotifier(const NotifierObject ¬ifierObject, const Pendisplay &pendisplay); 24 | DestPendisplayNotifier(const NotifierObject ¬ifierObject, const enum NotifyDestType notifyDestType); 25 | }; 26 | } 27 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Notifier/Dest/DestPropNotifier.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include "DestGadgetNotifier.hpp" 10 | #include "MUI/Prop.hpp" 11 | 12 | namespace MUI 13 | { 14 | class DestPropNotifier : public DestGadgetNotifier 15 | { 16 | friend class SourceNotifierRoot; 17 | template friend class SourceNotifier; 18 | 19 | protected: 20 | DestPropNotifier() = delete; 21 | DestPropNotifier(const NotifierObject ¬ifierObject, const Prop &prop); 22 | DestPropNotifier(const NotifierObject ¬ifierObject, const enum NotifyDestType notifyDestType); 23 | 24 | public: 25 | #ifdef MUIA_Prop_DeltaFactor 26 | /// @brief [ @b MUIM_Set / @b MUIM_NoNotifySet, @b MUIA_Prop_DeltaFactor ] 27 | DestPropNotifier &setDeltaFactor(const long deltaFactor, bool notify = true); 28 | /// @brief [ @b MUIM_Set / @b MUIM_NoNotifySet, @b MUIA_Prop_DeltaFactor = @b MUIV_TriggerValue ] 29 | DestPropNotifier &setDeltaFactorTriggerValue(bool notify = true); 30 | #endif 31 | /// @brief [ @b MUIM_Set / @b MUIM_NoNotifySet, @b MUIA_Prop_Entries ] 32 | DestPropNotifier &setEntries(const long entries, bool notify = true); 33 | /// @brief [ @b MUIM_Set / @b MUIM_NoNotifySet, @b MUIA_Prop_Entries = @b MUIV_TriggerValue ] 34 | DestPropNotifier &setEntriesTriggerValue(bool notify = true); 35 | /// @brief [ @b MUIM_Set / @b MUIM_NoNotifySet, @b MUIA_Prop_First ] 36 | DestPropNotifier &setFirst(const long first, bool notify = true); 37 | /// @brief [ @b MUIM_Set / @b MUIM_NoNotifySet, @b MUIA_Prop_First = @b MUIV_TriggerValue ] 38 | DestPropNotifier &setFirstTriggerValue(bool notify = true); 39 | /// @brief [ @b MUIM_Set / @b MUIM_NoNotifySet, @b MUIA_Prop_Visible ] 40 | DestPropNotifier &setVisible(const long visible, bool notify = true); 41 | /// @brief [ @b MUIM_Set / @b MUIM_NoNotifySet, @b MUIA_Prop_Visible = @b MUIV_TriggerValue ] 42 | DestPropNotifier &setVisibleTriggerValue(bool notify = true); 43 | }; 44 | } 45 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Notifier/Dest/DestRegisterNotifier.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "DestRegisterNotifier.hpp" 8 | 9 | #include 10 | 11 | namespace MUI 12 | { 13 | DestRegisterNotifier::DestRegisterNotifier(const NotifierObject ¬ifierObject, const Register ®isterObject) 14 | : DestGroupNotifier(notifierObject, registerObject) 15 | { 16 | } 17 | 18 | DestRegisterNotifier::DestRegisterNotifier(const NotifierObject ¬ifierObject, const enum NotifyDestType notifyDestType) 19 | : DestGroupNotifier(notifierObject, notifyDestType) 20 | { 21 | } 22 | 23 | DestRegisterNotifier &DestRegisterNotifier::setTitles(const char *titles[], bool notify) 24 | { 25 | DoMethod(muiSourceObject(), MUIM_Notify, getAttribute(), getTriggerValue(), muiDestObject(), 3, 26 | notify ? MUIM_Set : MUIM_NoNotifySet, MUIA_Register_Titles, titles); 27 | return *this; 28 | } 29 | 30 | DestRegisterNotifier &DestRegisterNotifier::setTitlesTriggerValue(bool notify) 31 | { 32 | DoMethod(muiSourceObject(), MUIM_Notify, getAttribute(), getTriggerValue(), muiDestObject(), 3, 33 | notify ? MUIM_Set : MUIM_NoNotifySet, MUIA_Register_Titles, MUIV_TriggerValue); 34 | return *this; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Notifier/Dest/DestRegisterNotifier.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include "DestGroupNotifier.hpp" 10 | #include "MUI/Register.hpp" 11 | 12 | namespace MUI 13 | { 14 | class DestRegisterNotifier : public DestGroupNotifier 15 | { 16 | friend class SourceNotifierRoot; 17 | template friend class SourceNotifier; 18 | 19 | protected: 20 | DestRegisterNotifier() = delete; 21 | DestRegisterNotifier(const NotifierObject ¬ifierObject, const Register ®isterObject); 22 | DestRegisterNotifier(const NotifierObject ¬ifierObject, const enum NotifyDestType notifyDestType); 23 | 24 | public: 25 | /// @brief [ @b MUIM_Set / @b MUIM_NoNotifySet, @b MUIA_Register_Titles ] 26 | DestRegisterNotifier &setTitles(const char *titles[], bool notify = true); 27 | /// @brief [ @b MUIM_Set / @b MUIM_NoNotifySet, @b MUIA_Register_Titles = @b MUIV_TriggerValue ] 28 | DestRegisterNotifier &setTitlesTriggerValue(bool notify = true); 29 | }; 30 | } 31 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Notifier/Dest/DestStringNotifier.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "DestStringNotifier.hpp" 8 | 9 | #include 10 | 11 | namespace MUI 12 | { 13 | DestStringNotifier::DestStringNotifier(const NotifierObject ¬ifierObject, const String &string) 14 | : DestAreaNotifier(notifierObject, string) 15 | { 16 | } 17 | 18 | DestStringNotifier::DestStringNotifier(const NotifierObject ¬ifierObject, const enum NotifyDestType notifyDestType) 19 | : DestAreaNotifier(notifierObject, notifyDestType) 20 | { 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Notifier/Dest/DestStringNotifier.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include "DestAreaNotifier.hpp" 10 | #include "MUI/String.hpp" 11 | 12 | namespace MUI 13 | { 14 | enum class StringActivePage; 15 | 16 | class DestStringNotifier : public DestAreaNotifier 17 | { 18 | friend class SourceNotifierRoot; 19 | template friend class SourceNotifier; 20 | 21 | protected: 22 | DestStringNotifier() = delete; 23 | DestStringNotifier(const NotifierObject ¬ifierObject, const String &string); 24 | DestStringNotifier(const NotifierObject ¬ifierObject, const enum NotifyDestType notifyDestType); 25 | }; 26 | } 27 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Notifier/Dest/DestWindowNotifier.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "DestWindowNotifier.hpp" 8 | 9 | #include 10 | 11 | namespace MUI 12 | { 13 | DestWindowNotifier::DestWindowNotifier(const NotifierObject ¬ifierObject, const Window &window) 14 | : DestNotifyNotifier(notifierObject, window) 15 | { 16 | } 17 | 18 | DestWindowNotifier::DestWindowNotifier(const NotifierObject ¬ifierObject, const enum NotifyDestType notifyDestType) 19 | : DestNotifyNotifier(notifierObject, notifyDestType) 20 | { 21 | } 22 | 23 | DestWindowNotifier &DestWindowNotifier::setOpen(const bool open, bool notify) 24 | { 25 | DoMethod(muiSourceObject(), MUIM_Notify, getAttribute(), getTriggerValue(), muiDestObject(), 3, 26 | notify ? MUIM_Set : MUIM_NoNotifySet, MUIA_Window_Open, (unsigned long)open); 27 | return *this; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Notifier/Dest/DestWindowNotifier.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include "DestNotifyNotifier.hpp" 10 | #include "MUI/Window.hpp" 11 | 12 | namespace MUI 13 | { 14 | class DestWindowNotifier : public DestNotifyNotifier 15 | { 16 | friend class SourceNotifierRoot; 17 | template friend class SourceNotifier; 18 | 19 | protected: 20 | DestWindowNotifier() = delete; 21 | DestWindowNotifier(const NotifierObject ¬ifierObject, const Window &window); 22 | DestWindowNotifier(const NotifierObject ¬ifierObject, const enum NotifyDestType notifyDestType); 23 | 24 | public: 25 | /// @brief [ @b MUIM_Set / @b MUIM_NoNotifySet, @b MUIA_Window_Open ] 26 | DestWindowNotifier &setOpen(const bool open, bool notify = true); 27 | }; 28 | } 29 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Notifier/Notifier.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "Notifier.hpp" 8 | 9 | namespace MUI 10 | { 11 | AreaNotifier<> Notifier::from(const Area &area) 12 | { 13 | return AreaNotifier<>(area); 14 | } 15 | 16 | CycleNotifier<> Notifier::from(const Cycle &cycle) 17 | { 18 | return CycleNotifier<>(cycle); 19 | } 20 | 21 | FamilyNotifier<> Notifier::from(const Family &family) 22 | { 23 | return FamilyNotifier<>(family); 24 | } 25 | 26 | GadgetNotifier<> Notifier::from(const Gadget &gadget) 27 | { 28 | return GadgetNotifier<>(gadget); 29 | } 30 | 31 | GroupNotifier<> Notifier::from(const Group &group) 32 | { 33 | return GroupNotifier<>(group); 34 | } 35 | 36 | ListNotifier<> Notifier::from(const List &list) 37 | { 38 | return ListNotifier<>(list); 39 | } 40 | 41 | MenuitemNotifier<> Notifier::from(const Menuitem &menuitem) 42 | { 43 | return MenuitemNotifier<>(menuitem); 44 | } 45 | 46 | NotifyNotifier<> Notifier::from(const Notify ¬ify) 47 | { 48 | return NotifyNotifier<>(notify); 49 | } 50 | 51 | PendisplayNotifier<> Notifier::from(const Pendisplay &pendisplay) 52 | { 53 | return PendisplayNotifier<>(pendisplay); 54 | } 55 | 56 | PropNotifier<> Notifier::from(const Prop &prop) 57 | { 58 | return PropNotifier<>(prop); 59 | } 60 | 61 | StringNotifier<> Notifier::from(const String &string) 62 | { 63 | return StringNotifier<>(string); 64 | } 65 | 66 | WindowNotifier<> Notifier::from(const Window &window) 67 | { 68 | return WindowNotifier<>(window); 69 | } 70 | 71 | } 72 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Notifier/Notifier.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include "Source/AreaNotifier.hpp" 10 | #include "Source/CycleNotifier.hpp" 11 | #include "Source/FamilyNotifier.hpp" 12 | #include "Source/GadgetNotifier.hpp" 13 | #include "Source/GroupNotifier.hpp" 14 | #include "Source/ListNotifier.hpp" 15 | #include "Source/MenuitemNotifier.hpp" 16 | #include "Source/NotifyNotifier.hpp" 17 | #include "Source/PendisplayNotifier.hpp" 18 | #include "Source/PropNotifier.hpp" 19 | #include "Source/StringNotifier.hpp" 20 | #include "Source/WindowNotifier.hpp" 21 | 22 | namespace MUI 23 | { 24 | /// @brief source notifiers factory 25 | class Notifier 26 | { 27 | public: 28 | static AreaNotifier<> from(const Area &area); 29 | static CycleNotifier<> from(const Cycle &cycle); 30 | static FamilyNotifier<> from(const Family &family); 31 | static GadgetNotifier<> from(const Gadget &gadget); 32 | static GroupNotifier<> from(const Group &group); 33 | static ListNotifier<> from(const List &list); 34 | static MenuitemNotifier<> from(const Menuitem &menuitem); 35 | static NotifyNotifier<> from(const Notify ¬ify); 36 | static PendisplayNotifier<> from(const Pendisplay &pendisplay); 37 | static PropNotifier<> from(const Prop &prop); 38 | static StringNotifier<> from(const String &string); 39 | static WindowNotifier<> from(const Window &window); 40 | }; 41 | } 42 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Notifier/Source/AreaNotifier.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include "MUI/Area.hpp" 10 | #include "NotifyNotifier.hpp" 11 | 12 | namespace MUI 13 | { 14 | template class AreaNotifier : public NotifyNotifier 15 | { 16 | public: 17 | AreaNotifier() = delete; 18 | AreaNotifier(const T &area) 19 | : NotifyNotifier(area) 20 | { 21 | } 22 | 23 | // notification methods 24 | 25 | /// @brief [ @b MUIM_Notify, @b MUIA_Selected ] 26 | SourceNotifier onSelected(const bool selected); 27 | /// @brief [ @b MUIM_Notify, @b MUIA_Selected == @b MUIV_EveryTime ] 28 | SourceNotifier onSelectedEveryTime(); 29 | /// @brief [ @b MUIM_Notify, @b MUIA_Pressed ] 30 | SourceNotifier onPressed(const bool pressed); 31 | /// @brief [ @b MUIM_Notify, @b MUIA_Pressed == @b MUIV_EveryTime ] 32 | SourceNotifier onPressedEveryTime(); 33 | }; 34 | 35 | template SourceNotifier inline AreaNotifier::onSelected(const bool selected) 36 | { 37 | return SourceNotifier(NotifyNotifier::mObject, MUIA_Selected, selected); 38 | } 39 | 40 | template SourceNotifier inline AreaNotifier::onSelectedEveryTime() 41 | { 42 | return SourceNotifier(NotifyNotifier::mObject, MUIA_Selected, (long)MUIV_EveryTime); 43 | } 44 | 45 | template SourceNotifier inline AreaNotifier::onPressed(const bool pressed) 46 | { 47 | return SourceNotifier(NotifyNotifier::mObject, MUIA_Pressed, pressed); 48 | } 49 | 50 | template SourceNotifier inline AreaNotifier::onPressedEveryTime() 51 | { 52 | return SourceNotifier(NotifyNotifier::mObject, MUIA_Pressed, (long)MUIV_EveryTime); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Notifier/Source/CycleNotifier.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include "GroupNotifier.hpp" 10 | #include "MUI/Cycle.hpp" 11 | 12 | namespace MUI 13 | { 14 | template class CycleNotifier : public GroupNotifier 15 | { 16 | public: 17 | CycleNotifier() = delete; 18 | CycleNotifier(const T &cycle) 19 | : GroupNotifier(cycle) 20 | { 21 | } 22 | 23 | // notification methods 24 | 25 | /// @brief [ @b MUIM_Notify, @b MUIA_Cycle_Active ] 26 | SourceNotifier onActive(const enum Cycle_Active active); 27 | /// @brief [ @b MUIM_Notify, @b MUIA_Cycle_Active == @b MUIV_EveryTime ] 28 | SourceNotifier onActiveEveryTime(); 29 | /// @brief [ @b MUIM_Notify, @b MUIA_Cycle_Entries == @b MUIV_EveryTime ] 30 | SourceNotifier onEntriesEveryTime(); 31 | }; 32 | 33 | template SourceNotifier inline CycleNotifier::onActive(const enum Cycle_Active active) 34 | { 35 | return SourceNotifier(NotifyNotifier::mObject, MUIA_Cycle_Active, (long)active); 36 | } 37 | 38 | template SourceNotifier inline CycleNotifier::onActiveEveryTime() 39 | { 40 | return SourceNotifier(NotifyNotifier::mObject, MUIA_Cycle_Active, (long)MUIV_EveryTime); 41 | } 42 | 43 | template SourceNotifier inline CycleNotifier::onEntriesEveryTime() 44 | { 45 | return SourceNotifier(NotifyNotifier::mObject, MUIA_Cycle_Entries, (long)MUIV_EveryTime); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Notifier/Source/FamilyNotifier.hpp: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // AmigaOS MUI C++ wrapper 4 | // 5 | // (c) 2022-2024 TDolphin 6 | // 7 | 8 | #pragma once 9 | 10 | #include "MUI/Family.hpp" 11 | #include "NotifyNotifier.hpp" 12 | 13 | namespace MUI 14 | { 15 | template class FamilyNotifier : public NotifyNotifier 16 | { 17 | public: 18 | FamilyNotifier() = delete; 19 | FamilyNotifier(const T &family) 20 | : NotifyNotifier(family) 21 | { 22 | } 23 | 24 | // notification methods 25 | }; 26 | } 27 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Notifier/Source/GadgetNotifier.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include "AreaNotifier.hpp" 10 | #include "MUI/Gadget.hpp" 11 | 12 | namespace MUI 13 | { 14 | template class GadgetNotifier : public AreaNotifier 15 | { 16 | public: 17 | GadgetNotifier() = delete; 18 | GadgetNotifier(const T &gadget) 19 | : AreaNotifier(gadget) 20 | { 21 | } 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Notifier/Source/GroupNotifier.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include "AreaNotifier.hpp" 10 | #include "MUI/Group.hpp" 11 | 12 | namespace MUI 13 | { 14 | template class GroupNotifier : public AreaNotifier 15 | { 16 | public: 17 | GroupNotifier() = delete; 18 | GroupNotifier(const T &group) 19 | : AreaNotifier(group) 20 | { 21 | } 22 | 23 | // notification methods 24 | 25 | /// @brief [ @b MUIM_Notify, @b MUIA_Group_ActivePage ] 26 | SourceNotifier onActivePage(const long activePage); 27 | /// @brief [ @b MUIM_Notify, @b MUIA_Group_ActivePage ] 28 | SourceNotifier onActivePage(const enum Group_ActivePage activePage); 29 | /// @brief [ @b MUIM_Notify, @b MUIA_Group_ActivePage == @b MUIV_EveryTime ] 30 | SourceNotifier onActivePageEveryTime(); 31 | }; 32 | 33 | template SourceNotifier inline GroupNotifier::onActivePage(const long activePage) 34 | { 35 | return SourceNotifier(NotifyNotifier::mObject, MUIA_Group_ActivePage, activePage); 36 | } 37 | 38 | template SourceNotifier inline GroupNotifier::onActivePage(const enum Group_ActivePage activePage) 39 | { 40 | return SourceNotifier(NotifyNotifier::mObject, MUIA_Group_ActivePage, (long)activePage); 41 | } 42 | 43 | template inline SourceNotifier GroupNotifier::onActivePageEveryTime() 44 | { 45 | return SourceNotifier(NotifyNotifier::mObject, MUIA_Group_ActivePage, (long)MUIV_EveryTime); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Notifier/Source/NotifyNotifier.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include "../Core/SourceNotifier.hpp" 10 | #include "MUI/Notify.hpp" 11 | 12 | namespace MUI 13 | { 14 | template class NotifyNotifier 15 | { 16 | protected: 17 | T mObject; 18 | 19 | public: 20 | NotifyNotifier() = delete; 21 | NotifyNotifier(const T &object) 22 | : mObject(object) 23 | { 24 | } 25 | 26 | // notification methods 27 | 28 | /// @brief [ @b MUIM_Notify, @b MUIA_HelpLine ] 29 | SourceNotifier onHelpLine(const long helpLine); 30 | }; 31 | 32 | template SourceNotifier inline NotifyNotifier::onHelpLine(const long helpLine) 33 | { 34 | return SourceNotifier(mObject, MUIA_HelpLine, helpLine); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Notifier/Source/PendisplayNotifier.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include "AreaNotifier.hpp" 10 | #include "MUI/Pendisplay.hpp" 11 | 12 | namespace MUI 13 | { 14 | template class PendisplayNotifier : public AreaNotifier 15 | { 16 | public: 17 | PendisplayNotifier() = delete; 18 | PendisplayNotifier(const T &pendisplay) 19 | : AreaNotifier(pendisplay) 20 | { 21 | } 22 | 23 | // notification methods 24 | 25 | /// @brief [ @b MUIM_Set / @b MUIM_NoNotifySet, @b MUIA_Pendisplay_Reference == @b MUIV_EveryTime ] 26 | SourceNotifier onReference(); 27 | /// @brief [ @b MUIM_Set / @b MUIM_NoNotifySet, @b MUIA_Pendisplay_RGBcolor == @b MUIV_EveryTime ] 28 | SourceNotifier onRGBcolor(); 29 | /// @brief [ @b MUIM_Set / @b MUIM_NoNotifySet, @b MUIA_Pendisplay_Spec == @b MUIV_EveryTime ] 30 | SourceNotifier onSpec(); 31 | }; 32 | 33 | template inline SourceNotifier PendisplayNotifier::onReference() 34 | { 35 | return SourceNotifier(NotifyNotifier::mObject, MUIA_Pendisplay_Reference, (long)MUIV_EveryTime); 36 | } 37 | 38 | template inline SourceNotifier PendisplayNotifier::onRGBcolor() 39 | { 40 | return SourceNotifier(NotifyNotifier::mObject, MUIA_Pendisplay_RGBcolor, (long)MUIV_EveryTime); 41 | } 42 | 43 | template inline SourceNotifier PendisplayNotifier::onSpec() 44 | { 45 | return SourceNotifier(NotifyNotifier::mObject, MUIA_Pendisplay_Spec, (long)MUIV_EveryTime); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Notifier/Source/StringNotifier.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include "AreaNotifier.hpp" 10 | #include "MUI/String.hpp" 11 | 12 | namespace MUI 13 | { 14 | template class StringNotifier : public AreaNotifier 15 | { 16 | public: 17 | StringNotifier() = delete; 18 | StringNotifier(const T &string) 19 | : AreaNotifier(string) 20 | { 21 | } 22 | 23 | // notification methods 24 | 25 | /// @brief [ @b MUIM_Notify, @b MUIA_String_Contents == @b MUIV_EveryTime ] 26 | SourceNotifier onContentsEveryTime(); 27 | }; 28 | 29 | template SourceNotifier inline StringNotifier::onContentsEveryTime() 30 | { 31 | return SourceNotifier(NotifyNotifier::mObject, MUIA_String_Contents, (long)MUIV_EveryTime); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Notifier/Source/WindowNotifier.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include "MUI/Window.hpp" 10 | #include "NotifyNotifier.hpp" 11 | 12 | namespace MUI 13 | { 14 | template class WindowNotifier : public NotifyNotifier 15 | { 16 | public: 17 | WindowNotifier() = delete; 18 | WindowNotifier(const T &window) 19 | : NotifyNotifier(window) 20 | { 21 | } 22 | 23 | // notification methods 24 | 25 | /// @brief [ @b MUIM_Notify, @b MUIA_Window_Activate ] 26 | SourceNotifier onActivate(const bool activate); 27 | /// @brief [ @b MUIM_Notify, @b MUIA_Window_CloseRequest ] 28 | SourceNotifier onCloseRequest(const bool closeRequest); 29 | /// @brief [ @b MUIM_Notify, @b MUIA_Window_Open ] 30 | SourceNotifier onOpen(const bool open); 31 | }; 32 | 33 | template SourceNotifier inline WindowNotifier::onActivate(const bool activate) 34 | { 35 | return SourceNotifier(NotifyNotifier::mObject, MUIA_Window_Activate, activate); 36 | } 37 | 38 | template SourceNotifier inline WindowNotifier::onCloseRequest(const bool closeRequest) 39 | { 40 | return SourceNotifier(NotifyNotifier::mObject, MUIA_Window_CloseRequest, closeRequest); 41 | } 42 | 43 | template SourceNotifier inline WindowNotifier::onOpen(const bool open) 44 | { 45 | return SourceNotifier(NotifyNotifier::mObject, MUIA_Window_Open, open); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Panel.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "Panel.hpp" 8 | 9 | #ifdef MUIC_Panel 10 | 11 | #include 12 | 13 | namespace MUI 14 | { 15 | const std::string Panel::className = MUIC_Panel; 16 | 17 | PanelBuilder::PanelBuilder() { } 18 | 19 | Panel &Panel::Run(Object *app, Object *win) 20 | { 21 | DoMethod(muiObject(), MUIM_Panel_Run, app, win); 22 | return *this; 23 | } 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Panel.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include "Group.hpp" 10 | 11 | #ifdef MUIC_Panel 12 | 13 | namespace MUI 14 | { 15 | class Panel : public Group 16 | { 17 | public: 18 | explicit Panel(Object *pMuiObject) 19 | : Group(pMuiObject) 20 | { 21 | } 22 | 23 | // instanceOf 24 | 25 | const static std::string className; 26 | 27 | static inline bool instanceOf(Object *pMuiObject) 28 | { 29 | return MUI::instanceOf(pMuiObject, className.c_str()); 30 | } 31 | 32 | // methods, some returns object reference 33 | 34 | /// @brief [ @b MUIM_Panel_Run ] 35 | /// This method opens the panel window and eventually "runs" the panel asynchronously to the main MUI application in a separate 36 | /// process. 37 | /// @param app the application object to let the panel run asynchronously to the main application 38 | /// @param win the window object containing the panel object 39 | Panel &Run(Object *app, Object *win); 40 | }; 41 | 42 | template class PanelBuilderTemplate : public GroupBuilderTemplate 43 | { 44 | public: 45 | PanelBuilderTemplate(const std::string &uniqueId = MUI::EmptyUniqueId, const std::string &muiClassName = MUIC_Panel) 46 | : GroupBuilderTemplate(uniqueId, muiClassName) 47 | { 48 | } 49 | }; 50 | 51 | class PanelBuilder : public PanelBuilderTemplate 52 | { 53 | public: 54 | PanelBuilder(); 55 | }; 56 | } 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Popasl.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "Popasl.hpp" 8 | 9 | namespace MUI 10 | { 11 | const std::string Popasl::className = MUIC_Popasl; 12 | 13 | PopaslBuilder::PopaslBuilder() { } 14 | 15 | bool Popasl::isActive() const 16 | { 17 | return GetValueAsBool(MUIA_Popasl_Active); 18 | } 19 | 20 | Hook *Popasl::getStartHook() const 21 | { 22 | return GetValueAsHookPtr(MUIA_Popasl_StartHook); 23 | } 24 | 25 | Hook *Popasl::getStopHook() const 26 | { 27 | return GetValueAsHookPtr(MUIA_Popasl_StopHook); 28 | } 29 | 30 | unsigned long Popasl::getType() const 31 | { 32 | return GetValueAsULong(MUIA_Popasl_Type); 33 | } 34 | 35 | Popasl &Popasl::setStartHook(const Hook *startHook) 36 | { 37 | SetValue(MUIA_Popasl_StartHook, startHook); 38 | return *this; 39 | } 40 | 41 | Popasl &Popasl::setStopHook(const Hook *stopHook) 42 | { 43 | SetValue(MUIA_Popasl_StopHook, stopHook); 44 | return *this; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Poppen.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "Poppen.hpp" 8 | 9 | namespace MUI 10 | { 11 | const std::string Poppen::className = MUIC_Poppen; 12 | 13 | PoppenBuilder::PoppenBuilder() { } 14 | } 15 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Poppen.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include "Pendisplay.hpp" 10 | 11 | namespace MUI 12 | { 13 | class Poppen : public Pendisplay 14 | { 15 | public: 16 | explicit Poppen(Object *pMuiObject) 17 | : Pendisplay(pMuiObject) 18 | { 19 | } 20 | 21 | // instanceOf 22 | 23 | const static std::string className; 24 | 25 | static inline bool instanceOf(Object *pMuiObject) 26 | { 27 | return MUI::instanceOf(pMuiObject, className.c_str()); 28 | } 29 | }; 30 | 31 | template class PoppenBuilderTemplate : public PendisplayBuilderTemplate 32 | { 33 | public: 34 | PoppenBuilderTemplate(const std::string &uniqueId = MUI::EmptyUniqueId, const std::string &muiClassName = MUIC_Poppen) 35 | : PendisplayBuilderTemplate(uniqueId, muiClassName) 36 | { 37 | } 38 | 39 | /// @brief [ @b MUIA_Window_Title ] 40 | /// You can control the window title of the popup window using the MUIA_Window_Title on the Poppen object. It will remember its 41 | /// value and use it when creating the popup window. 42 | T &tagWindowTitle(const std::string &title); 43 | }; 44 | 45 | class PoppenBuilder : public PoppenBuilderTemplate 46 | { 47 | public: 48 | PoppenBuilder(); 49 | }; 50 | 51 | template inline T &PoppenBuilderTemplate::tagWindowTitle(const std::string &title) 52 | { 53 | auto copy = this->StoreString(MUIA_ShortHelp, title); 54 | this->PushTag(MUIA_Window_Title, copy); 55 | return (T &)*this; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Popstring.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "Popstring.hpp" 8 | 9 | #include 10 | 11 | namespace MUI 12 | { 13 | const std::string Popstring::className = MUIC_Popstring; 14 | 15 | PopstringBuilder::PopstringBuilder() { } 16 | 17 | Object *Popstring::getButton() const 18 | { 19 | return GetValueAsObjectPtr(MUIA_Popstring_Button); 20 | } 21 | 22 | Hook *Popstring::getCloseHook() const 23 | { 24 | return GetValueAsHookPtr(MUIA_Popstring_CloseHook); 25 | } 26 | 27 | Hook *Popstring::getOpenHook() const 28 | { 29 | return GetValueAsHookPtr(MUIA_Popstring_OpenHook); 30 | } 31 | 32 | Object *Popstring::getString() const 33 | { 34 | return GetValueAsObjectPtr(MUIA_Popstring_String); 35 | } 36 | 37 | bool Popstring::isToggle() const 38 | { 39 | return GetValueAsBool(MUIA_Popstring_Toggle); 40 | } 41 | 42 | Popstring &Popstring::setCloseHook(const Hook *closeHook) 43 | { 44 | SetValue(MUIA_Popstring_CloseHook, closeHook); 45 | return *this; 46 | } 47 | 48 | Popstring &Popstring::setOpenHook(const Hook *openHook) 49 | { 50 | SetValue(MUIA_Popstring_OpenHook, openHook); 51 | return *this; 52 | } 53 | 54 | Popstring &Popstring::setToggle(const bool toggle) 55 | { 56 | SetValue(MUIA_Popstring_Toggle, toggle); 57 | return *this; 58 | } 59 | 60 | Popstring &Popstring::Close(long result) 61 | { 62 | DoMethod(muiObject(), MUIM_Popstring_Close, result); 63 | return *this; 64 | } 65 | 66 | Popstring &Popstring::Open() 67 | { 68 | DoMethod(muiObject(), MUIM_Popstring_Open); 69 | return *this; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Prop.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "Prop.hpp" 8 | 9 | #include 10 | 11 | namespace MUI 12 | { 13 | const std::string Prop::className = MUIC_Prop; 14 | 15 | PropBuilder::PropBuilder() { } 16 | 17 | #ifdef MUIA_Prop_DeltaFactor 18 | long Prop::getDeltaFactor() const 19 | { 20 | return GetValueAsLong(MUIA_Prop_DeltaFactor); 21 | } 22 | #endif 23 | 24 | long Prop::getEntries() const 25 | { 26 | return GetValueAsLong(MUIA_Prop_Entries); 27 | } 28 | 29 | long Prop::getFirst() const 30 | { 31 | return GetValueAsLong(MUIA_Prop_First); 32 | } 33 | 34 | bool Prop::isHoriz() const 35 | { 36 | return GetValueAsBool(MUIA_Prop_Horiz); 37 | } 38 | 39 | long Prop::getVisible() const 40 | { 41 | return GetValueAsLong(MUIA_Prop_Visible); 42 | } 43 | 44 | #ifdef MUIA_Prop_DeltaFactor 45 | Prop &Prop::setDeltaFactor(const long deltaFactor) 46 | { 47 | SetValue(MUIA_Prop_DeltaFactor, deltaFactor); 48 | return *this; 49 | } 50 | #endif 51 | 52 | Prop &Prop::setEntries(const long entries) 53 | { 54 | SetValue(MUIA_Prop_Entries, entries); 55 | return *this; 56 | } 57 | 58 | Prop &Prop::setFirst(const long first) 59 | { 60 | SetValue(MUIA_Prop_First, first); 61 | return *this; 62 | } 63 | 64 | Prop &Prop::setVisible(const long visible) 65 | { 66 | SetValue(MUIA_Prop_Visible, visible); 67 | return *this; 68 | } 69 | 70 | Notify &Prop::Decrease(const long amount) 71 | { 72 | DoMethod(muiObject(), MUIM_Prop_Decrease, amount); 73 | return *this; 74 | } 75 | 76 | Notify &Prop::Increase(const long amount) 77 | { 78 | DoMethod(muiObject(), MUIM_Prop_Increase, amount); 79 | return *this; 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Radio.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "Radio.hpp" 8 | 9 | namespace MUI 10 | { 11 | const std::string Radio::className = MUIC_Radio; 12 | 13 | long Radio::getActive() const 14 | { 15 | return GetValueAsLong(MUIA_Radio_Active); 16 | } 17 | 18 | Radio &Radio::setActive(const unsigned long active) 19 | { 20 | SetValue(MUIA_Radio_Active, active); 21 | return *this; 22 | } 23 | 24 | RadioBuilder::RadioBuilder() { } 25 | } 26 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Rectangle.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "Rectangle.hpp" 8 | 9 | namespace MUI 10 | { 11 | const std::string Rectangle::className = MUIC_Rectangle; 12 | 13 | RectangleBuilder::RectangleBuilder() { } 14 | 15 | std::string Rectangle::getBarTitle() const 16 | { 17 | return GetValueAsString(MUIA_Rectangle_HBar); 18 | } 19 | 20 | bool Rectangle::isHBar() const 21 | { 22 | return GetValueAsBool(MUIA_Rectangle_HBar); 23 | } 24 | 25 | bool Rectangle::isVBar() const 26 | { 27 | return GetValueAsBool(MUIA_Rectangle_VBar); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Register.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "Register.hpp" 8 | 9 | namespace MUI 10 | { 11 | const std::string Register::className = MUIC_Register; 12 | 13 | RegisterBuilder::RegisterBuilder() { } 14 | 15 | char **Register::getTitles() const 16 | { 17 | return GetValueAsCharArrayPtr(MUIA_Register_Titles); 18 | } 19 | 20 | #if MUIMASTER_VMIN >= 20 // MUI5 21 | Register &Register::setTitles(const char *titles[]) 22 | { 23 | SetValue(MUIA_Register_Titles, titles); 24 | return *this; 25 | } 26 | #endif 27 | } 28 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Register.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include "Group.hpp" 10 | 11 | namespace MUI 12 | { 13 | class Register : public Group 14 | { 15 | public: 16 | explicit Register(Object *pMuiObject) 17 | : Group(pMuiObject) 18 | { 19 | } 20 | 21 | // instanceOf 22 | 23 | const static std::string className; 24 | 25 | static inline bool instanceOf(Object *pMuiObject) 26 | { 27 | return MUI::instanceOf(pMuiObject, className.c_str()); 28 | } 29 | 30 | // is/get/set (attributes), all setters return object reference 31 | 32 | /// @brief [ @b MUIA_Register_Titles ] 33 | char **getTitles() const; 34 | 35 | #if MUIMASTER_VMIN >= 20 // MUI5 36 | /// @brief [ @b MUIA_Register_Titles ] 37 | Register &setTitles(const char *titles[]); 38 | #endif 39 | }; 40 | 41 | template class RegisterBuilderTemplate : public GroupBuilderTemplate 42 | { 43 | public: 44 | RegisterBuilderTemplate(const std::string &uniqueId = MUI::EmptyUniqueId, const std::string &muiClassName = MUIC_Register) 45 | : GroupBuilderTemplate(uniqueId, muiClassName) 46 | { 47 | } 48 | 49 | /// @brief [ @b MUIA_Register_Titles ] 50 | /// @param pTitles pointer to array (array of char *) 51 | T &tagTitles(const char *pTitles[]); 52 | }; 53 | 54 | class RegisterBuilder : public RegisterBuilderTemplate 55 | { 56 | public: 57 | RegisterBuilder(); 58 | }; 59 | 60 | template inline T &RegisterBuilderTemplate::tagTitles(const char *titles[]) 61 | { 62 | this->PushTag(MUIA_Register_Titles, (const char **)titles); 63 | return (T &)*this; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Scale.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "Scale.hpp" 8 | 9 | namespace MUI 10 | { 11 | const std::string Scale::className = MUIC_Scale; 12 | 13 | ScaleBuilder::ScaleBuilder() { } 14 | 15 | #ifdef MUIA_Scale_Horiz 16 | bool Scale::getHoriz() const 17 | { 18 | return GetValueAsBool(MUIA_Scale_Horiz); 19 | } 20 | 21 | Scale &Scale::setHoriz(const bool horiz) 22 | { 23 | SetValue(MUIA_Scale_Horiz, horiz); 24 | return *this; 25 | } 26 | #endif 27 | } 28 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Scale.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include "Area.hpp" 10 | 11 | namespace MUI 12 | { 13 | class Scale : public Area 14 | { 15 | public: 16 | explicit Scale(Object *pMuiObject) 17 | : Area(pMuiObject) 18 | { 19 | } 20 | 21 | // instanceOf 22 | 23 | const static std::string className; 24 | 25 | static inline bool instanceOf(Object *pMuiObject) 26 | { 27 | return MUI::instanceOf(pMuiObject, className.c_str()); 28 | } 29 | 30 | // is/get/set (attributes), all setters return object reference 31 | 32 | #ifdef MUIA_Scale_Horiz 33 | /// @brief [ @b MUIA_Scale_Horiz ] 34 | bool getHoriz() const; 35 | 36 | /// @brief [ @b MUIA_Scale_Horiz ] 37 | Scale &setHoriz(const bool horiz); 38 | #endif 39 | }; 40 | 41 | template class ScaleBuilderTemplate : public AreaBuilderTemplate 42 | { 43 | public: 44 | ScaleBuilderTemplate(const std::string &uniqueId = MUI::EmptyUniqueId, const std::string &muiClassName = MUIC_Scale) 45 | : AreaBuilderTemplate(uniqueId, muiClassName) 46 | { 47 | } 48 | 49 | #ifdef MUIA_Scale_Horiz 50 | /// @brief [ @b MUIA_Scale_Horiz ] 51 | T &tagHoriz(const bool horiz); 52 | #endif 53 | }; 54 | 55 | class ScaleBuilder : public ScaleBuilderTemplate 56 | { 57 | public: 58 | ScaleBuilder(); 59 | }; 60 | 61 | #ifdef MUIA_Scale_Horiz 62 | template inline T &ScaleBuilderTemplate::tagHoriz(const bool horiz) 63 | { 64 | this->PushTag(MUIA_Scale_Horiz, horiz); 65 | return (T &)*this; 66 | } 67 | #endif 68 | } 69 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Scrollbar.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "Scrollbar.hpp" 8 | 9 | namespace MUI 10 | { 11 | const std::string Scrollbar::className = MUIC_Scrollbar; 12 | 13 | ScrollbarBuilder::ScrollbarBuilder() { } 14 | 15 | #ifdef MUIA_Scrollbar_IncDecSize 16 | unsigned long Scrollbar::getIncDecSize() const 17 | { 18 | return GetValueAsULong(MUIA_Scrollbar_IncDecSize); 19 | } 20 | 21 | Scrollbar &Scrollbar::setIncDecSize(unsigned long incDecSize) 22 | { 23 | SetValue(MUIA_Scrollbar_IncDecSize, incDecSize); 24 | return *this; 25 | } 26 | #endif 27 | } 28 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Scrollbar.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include "Group.hpp" 10 | 11 | #include "ValueTypes/Scrollbar/Type.hpp" 12 | 13 | namespace MUI 14 | { 15 | class Scrollbar : public Group 16 | { 17 | public: 18 | explicit Scrollbar(Object *pMuiObject) 19 | : Group(pMuiObject) 20 | { 21 | } 22 | 23 | // instanceOf 24 | 25 | const static std::string className; 26 | 27 | static inline bool instanceOf(Object *pMuiObject) 28 | { 29 | return MUI::instanceOf(pMuiObject, className.c_str()); 30 | } 31 | 32 | // is/get/set (attributes), all setters return object reference 33 | 34 | #ifdef MUIA_Scrollbar_IncDecSize 35 | /// @brief [ @b MUIA_Scrollbar_IncDecSize ] 36 | unsigned long getIncDecSize() const; 37 | 38 | /// @brief [ @b MUIA_Scrollbar_IncDecSize ] 39 | Scrollbar &setIncDecSize(unsigned long incDecSize); 40 | #endif 41 | }; 42 | 43 | template class ScrollbarBuilderTemplate : public GroupBuilderTemplate 44 | { 45 | public: 46 | ScrollbarBuilderTemplate(const std::string &uniqueId = MUI::EmptyUniqueId, const std::string &muiClassName = MUIC_Scrollbar) 47 | : GroupBuilderTemplate(uniqueId, muiClassName) 48 | { 49 | } 50 | #ifdef MUIA_Scrollbar_IncDecSize 51 | /// @brief [ @b MUIA_Scrollbar_IncDecSize ] 52 | T &tagIncDecSize(const unsigned long incDecSize); 53 | #endif 54 | /// @brief [ @b MUIA_Scrollbar_Type ] 55 | T &tagType(const enum Scrollbar_Type type); 56 | }; 57 | 58 | class ScrollbarBuilder : public ScrollbarBuilderTemplate 59 | { 60 | public: 61 | ScrollbarBuilder(); 62 | }; 63 | 64 | #ifdef MUIA_Scrollbar_IncDecSize 65 | template inline T &ScrollbarBuilderTemplate::tagIncDecSize(const unsigned long incDecSize) 66 | { 67 | this->PushTag(MUIA_Scrollbar_IncDecSize, incDecSize); 68 | return (T &)*this; 69 | } 70 | #endif 71 | 72 | template inline T &ScrollbarBuilderTemplate::tagType(const enum Scrollbar_Type type) 73 | { 74 | this->PushTag(MUIA_Scrollbar_Type, (long)type); 75 | return (T &)*this; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Scrollgroup.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "Scrollgroup.hpp" 8 | 9 | namespace MUI 10 | { 11 | const std::string Scrollgroup::className = MUIC_Scrollgroup; 12 | 13 | ScrollgroupBuilder::ScrollgroupBuilder() { } 14 | } 15 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Slider.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "Slider.hpp" 8 | 9 | namespace MUI 10 | { 11 | const std::string Slider::className = MUIC_Slider; 12 | 13 | SliderBuilder::SliderBuilder() { } 14 | 15 | bool Slider::getHoriz() const 16 | { 17 | return GetValueAsBool(MUIA_Slider_Horiz); 18 | } 19 | 20 | Slider &Slider::setHoriz(const bool horiz) 21 | { 22 | SetValue(MUIA_Slider_Horiz, horiz); 23 | return *this; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Slider.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include "Numeric.hpp" 10 | 11 | #undef Slider 12 | 13 | namespace MUI 14 | { 15 | class Slider : public Numeric 16 | { 17 | public: 18 | explicit Slider(Object *pMuiObject) 19 | : Numeric(pMuiObject) 20 | { 21 | } 22 | 23 | // instanceOf 24 | 25 | const static std::string className; 26 | 27 | static inline bool instanceOf(Object *pMuiObject) 28 | { 29 | return MUI::instanceOf(pMuiObject, className.c_str()); 30 | } 31 | 32 | // is/get/set (attributes), all setters return object reference 33 | 34 | /// @brief [ @b MUIA_Slider_Horiz ] 35 | bool getHoriz() const; 36 | 37 | /// @brief [ @b MUIA_Slider_Horiz ] 38 | Slider &setHoriz(const bool horiz); 39 | }; 40 | 41 | template class SliderBuilderTemplate : public NumericBuilderTemplate 42 | { 43 | public: 44 | SliderBuilderTemplate(const std::string &uniqueId = MUI::EmptyUniqueId, const std::string &muiClassName = MUIC_Slider) 45 | : NumericBuilderTemplate(uniqueId, muiClassName) 46 | { 47 | } 48 | 49 | /// @brief [ @b MUIA_Slider_Horiz ] 50 | T &tagHoriz(const bool horiz); 51 | /// @brief [ @b MUIA_Slider_Quiet ] 52 | T &tagQuiet(const bool quiet); 53 | }; 54 | 55 | class SliderBuilder : public SliderBuilderTemplate 56 | { 57 | public: 58 | SliderBuilder(); 59 | }; 60 | 61 | template inline T &SliderBuilderTemplate::tagHoriz(const bool horiz) 62 | { 63 | this->PushTag(MUIA_Slider_Horiz, horiz); 64 | return (T &)*this; 65 | } 66 | 67 | template inline T &SliderBuilderTemplate::tagQuiet(const bool quiet) 68 | { 69 | this->PushTag(MUIA_Slider_Quiet, quiet); 70 | return (T &)*this; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /wrappers/src/MUI/String.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "String.hpp" 8 | 9 | namespace MUI 10 | { 11 | const std::string String::className = MUIC_String; 12 | 13 | std::string String::getContents() const 14 | { 15 | return GetValueAsString(MUIA_String_Contents); 16 | } 17 | 18 | String &String::setContents(const std::string &contents) 19 | { 20 | SetValue(MUIA_String_Contents, contents); 21 | return *this; 22 | } 23 | 24 | String &String::Clear() 25 | { 26 | SetValue(MUIA_String_Contents, ""); 27 | return *this; 28 | } 29 | 30 | StringBuilder::StringBuilder() { } 31 | } 32 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Text.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "Text.hpp" 8 | 9 | namespace MUI 10 | { 11 | const std::string Text::className = MUIC_Text; 12 | 13 | std::string Text::getContents() const 14 | { 15 | return GetValueAsString(MUIA_Text_Contents); 16 | } 17 | 18 | Text &Text::setContents(const std::string &contents) 19 | { 20 | SetValue(MUIA_Text_Contents, contents); 21 | return *this; 22 | } 23 | 24 | Text &Text::Clear() 25 | { 26 | SetValue(MUIA_Text_Contents, nullptr); 27 | return *this; 28 | } 29 | 30 | TextBuilder::TextBuilder() { } 31 | } 32 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Title.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "Title.hpp" 8 | 9 | #ifdef MUIC_Title 10 | 11 | namespace MUI 12 | { 13 | const std::string Title::className = MUIC_Title; 14 | 15 | TitleBuilder::TitleBuilder() { } 16 | 17 | bool Title::getClosable() const 18 | { 19 | return GetValueAsBool(MUIA_Title_Closable); 20 | } 21 | 22 | bool Title::getNewable() const 23 | { 24 | return GetValueAsBool(MUIA_Title_Newable); 25 | } 26 | 27 | enum Title_Position Title::getPosition() const 28 | { 29 | return (Title_Position)GetValueAsLong(MUIA_Title_Position); 30 | } 31 | 32 | long Title::getSortable() const 33 | { 34 | return GetValueAsLong(MUIA_Title_Sortable); 35 | } 36 | 37 | Title &Title::setClosable(const bool closable) 38 | { 39 | SetValue(MUIA_Title_Closable, closable); 40 | return *this; 41 | } 42 | 43 | Title &Title::setNewable(const bool newable) 44 | { 45 | SetValue(MUIA_Title_Newable, newable); 46 | return *this; 47 | } 48 | 49 | Title &Title::setOnLastClose(const enum Title_OnLastClose onLastClose) 50 | { 51 | SetValue(MUIA_Title_OnLastClose, (long)onLastClose); 52 | return *this; 53 | } 54 | 55 | Title &Title::setPosition(const enum Title_Position position) 56 | { 57 | SetValue(MUIA_Title_Position, (long)position); 58 | return *this; 59 | } 60 | 61 | Title &Title::setSortable(const bool sortable) 62 | { 63 | SetValue(MUIA_Title_Sortable, sortable); 64 | return *this; 65 | } 66 | } 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /wrappers/src/MUI/ValueTypes/Area/Font.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | namespace MUI 12 | { 13 | enum class Font 14 | { 15 | Inherit = MUIV_Font_Inherit, // the same font as the surrounding object, this is the default 16 | Normal = MUIV_Font_Normal, // the normal font 17 | List = MUIV_Font_List, // the font configured for lists 18 | Tiny = MUIV_Font_Tiny, // the tiny font 19 | Fixed = MUIV_Font_Fixed, // the fixed width font 20 | Title = MUIV_Font_Title, // the font configured for group titles 21 | Big = MUIV_Font_Big, // the big font 22 | Button = MUIV_Font_Button, // the font configured for buttons 23 | #ifdef MUIV_Font_Slider 24 | Slider = MUIV_Font_Slider, // the font configured for sliders 25 | Gauge = MUIV_Font_Gauge, // the font configured for gauges 26 | Menu = MUIV_Font_Menu, // the font configured for menus 27 | Tab = MUIV_Font_Tab, // the font configured for tab buttons 28 | Bubble = MUIV_Font_Bubble, // the font configured for bubble help 29 | Huge = MUIV_Font_Huge, // the huge font 30 | Last = MUIV_Font_Last, 31 | Count = MUIV_Font_Count, 32 | #endif 33 | }; 34 | } 35 | -------------------------------------------------------------------------------- /wrappers/src/MUI/ValueTypes/Area/Frame.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | namespace MUI 12 | { 13 | enum class Frame 14 | { 15 | None = MUIV_Frame_None, 16 | Button = MUIV_Frame_Button, // for standard buttons with text in it 17 | ImageButton = MUIV_Frame_ImageButton, // for small buttons with images, e.g. the arrows of a scrollbar 18 | Text = MUIV_Frame_Text, // for a text field, e.g. a status line display 19 | String = MUIV_Frame_String, // for a string gadget 20 | ReadList = MUIV_Frame_ReadList, // for a read only list 21 | InputList = MUIV_Frame_InputList, // for a list that handles input (has a cursor) 22 | Prop = MUIV_Frame_Prop, // for proportional gadgets 23 | Gauge = MUIV_Frame_Gauge, 24 | Group = MUIV_Frame_Group, // for groups 25 | PopUp = MUIV_Frame_PopUp, 26 | Virtual = MUIV_Frame_Virtual, 27 | Slider = MUIV_Frame_Slider, 28 | #ifdef MUIV_Frame_SliderKnob 29 | SliderKnob = MUIV_Frame_SliderKnob, 30 | GaugeInner = MUIV_Frame_GaugeInner, 31 | Menudisplay = MUIV_Frame_Menudisplay, 32 | MenudisplayMenu = MUIV_Frame_MenudisplayMenu, 33 | PropKnob = MUIV_Frame_PropKnob, 34 | Window = MUIV_Frame_Window, 35 | Requester = MUIV_Frame_Requester, 36 | Page = MUIV_Frame_Page, 37 | Register = MUIV_Frame_Register, 38 | GroupTitle = MUIV_Frame_GroupTitle, 39 | RegisterTitle = MUIV_Frame_RegisterTitle, 40 | #endif 41 | Count = MUIV_Frame_Count, 42 | }; 43 | } 44 | -------------------------------------------------------------------------------- /wrappers/src/MUI/ValueTypes/Area/InputMode.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | namespace MUI 12 | { 13 | enum class InputMode 14 | { 15 | None = MUIV_InputMode_None, 16 | RelVerify = MUIV_InputMode_RelVerify, 17 | Immediate = MUIV_InputMode_Immediate, 18 | Toggle = MUIV_InputMode_Toggle 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /wrappers/src/MUI/ValueTypes/Cycle/Active.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | namespace MUI 12 | { 13 | enum class Cycle_Active 14 | { 15 | Next = MUIV_Cycle_Active_Next, 16 | Prev = MUIV_Cycle_Active_Prev 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /wrappers/src/MUI/ValueTypes/Fontpanel/ShowCollection.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | #ifdef MUIC_Fontpanel 12 | 13 | namespace MUI 14 | { 15 | enum class Fontpanel_ShowCollection 16 | { 17 | All = MUIV_Fontpanel_ShowCollection_All, 18 | FixedWidth = MUIV_Fontpanel_ShowCollection_FixedWidth, 19 | Bitmap = MUIV_Fontpanel_ShowCollection_Bitmap, 20 | TrueType = MUIV_Fontpanel_ShowCollection_TrueType, 21 | User = MUIV_Fontpanel_ShowCollection_User 22 | }; 23 | } 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /wrappers/src/MUI/ValueTypes/Group/ActivePage.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | namespace MUI 12 | { 13 | enum class Group_ActivePage 14 | { 15 | First = MUIV_Group_ActivePage_First, 16 | Second, 17 | Third, 18 | Fourth, 19 | Fifth, 20 | Last = MUIV_Group_ActivePage_Last, 21 | Prev = MUIV_Group_ActivePage_Prev, 22 | Next = MUIV_Group_ActivePage_Next, 23 | Advance = MUIV_Group_ActivePage_Advance 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /wrappers/src/MUI/ValueTypes/Group/HorizCenter.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | namespace MUI 12 | { 13 | enum class Group_HorizCenter 14 | { 15 | #ifdef MUIV_Group_HorizCenter_Left 16 | Left = MUIV_Group_HorizCenter_Left, 17 | Center = MUIV_Group_HorizCenter_Center, 18 | Right = MUIV_Group_HorizCenter_Right 19 | #endif 20 | }; 21 | } 22 | -------------------------------------------------------------------------------- /wrappers/src/MUI/ValueTypes/Group/VertCenter.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | namespace MUI 12 | { 13 | enum class Group_VertCenter 14 | { 15 | #ifdef MUIV_Group_VertCenter_Top 16 | Top = MUIV_Group_VertCenter_Top, 17 | Center = MUIV_Group_VertCenter_Center, 18 | Bottom = MUIV_Group_VertCenter_Bottom 19 | #endif 20 | }; 21 | } 22 | -------------------------------------------------------------------------------- /wrappers/src/MUI/ValueTypes/List/Active.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | namespace MUI 12 | { 13 | enum class List_Active 14 | { 15 | Off = MUIV_List_Active_Off, 16 | Top = MUIV_List_Active_Top, 17 | Bottom = MUIV_List_Active_Bottom, 18 | Up = MUIV_List_Active_Up, 19 | Down = MUIV_List_Active_Down, 20 | PageUp = MUIV_List_Active_PageUp, 21 | PageDown = MUIV_List_Active_PageDown, 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /wrappers/src/MUI/ValueTypes/List/DragType.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | #ifdef MUIA_List_DragType 12 | namespace MUI 13 | { 14 | enum class List_DragType 15 | { 16 | None = MUIV_List_DragType_None, 17 | Immediate = MUIV_List_DragType_Immediate, 18 | }; 19 | } 20 | #endif 21 | -------------------------------------------------------------------------------- /wrappers/src/MUI/ValueTypes/List/HScrollerVisibility.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | #ifdef MUIA_List_HScrollerVisibility 12 | 13 | namespace MUI 14 | { 15 | enum class List_HScrollerVisibility 16 | { 17 | Always = MUIV_List_HScrollerVisibility_Always, 18 | Never = MUIV_List_HScrollerVisibility_Never, 19 | Auto = MUIV_List_HScrollerVisibility_Auto, 20 | }; 21 | } 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /wrappers/src/MUI/ValueTypes/List/Jump.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | namespace MUI 12 | { 13 | enum class List_Jump 14 | { 15 | Top = MUIV_List_Jump_Top, 16 | Active = MUIV_List_Jump_Active, 17 | Bottom = MUIV_List_Jump_Bottom, 18 | Up = MUIV_List_Jump_Up, 19 | Down = MUIV_List_Jump_Down, 20 | }; 21 | } 22 | -------------------------------------------------------------------------------- /wrappers/src/MUI/ValueTypes/List/MultiSelect.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | #ifdef MUIA_List_MultiSelect 12 | 13 | namespace MUI 14 | { 15 | enum class List_MultiSelect 16 | { 17 | /// @brief The listview cannot multiselect at all. 18 | None = MUIV_List_MultiSelect_None, 19 | /// @brief The multi select type (with or without shift) depends on the user's preferences setting. 20 | Default = MUIV_List_MultiSelect_Default, 21 | /// @brief Overrides the users prefs, multi selecting only together with shift key. 22 | Shifted = MUIV_List_MultiSelect_Shifted, 23 | /// @brief Overrides the users prefs, multi selecting without shift key. 24 | Always = MUIV_List_MultiSelect_Always, 25 | }; 26 | } 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /wrappers/src/MUI/ValueTypes/List/NextSelected.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | #undef End 12 | 13 | namespace MUI 14 | { 15 | enum class List_NextSelected 16 | { 17 | Start = MUIV_List_NextSelected_Start, 18 | End = MUIV_List_NextSelected_End 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /wrappers/src/MUI/ValueTypes/List/ScrollerPos.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | #ifdef MUIA_List_ScrollerPos 12 | 13 | namespace MUI 14 | { 15 | enum class List_ScrollerPos 16 | { 17 | Default = MUIV_List_ScrollerPos_Default, 18 | Left = MUIV_List_ScrollerPos_Left, 19 | Right = MUIV_List_ScrollerPos_Right, 20 | None = MUIV_List_ScrollerPos_None, 21 | }; 22 | } 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /wrappers/src/MUI/ValueTypes/Listview/DragType.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | namespace MUI 12 | { 13 | enum class Listview_DragType 14 | { 15 | None = MUIV_Listview_DragType_None, 16 | Immediate = MUIV_Listview_DragType_Immediate, 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /wrappers/src/MUI/ValueTypes/Listview/MultiSelect.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | namespace MUI 12 | { 13 | enum class Listview_MultiSelect 14 | { 15 | None = MUIV_Listview_MultiSelect_None, 16 | Default = MUIV_Listview_MultiSelect_Default, 17 | Shifted = MUIV_Listview_MultiSelect_Shifted, 18 | Always = MUIV_Listview_MultiSelect_Always, 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /wrappers/src/MUI/ValueTypes/Listview/ScrollerPos.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | namespace MUI 12 | { 13 | enum class Listview_ScrollerPos 14 | { 15 | Default = MUIV_Listview_ScrollerPos_Default, 16 | Left = MUIV_Listview_ScrollerPos_Left, 17 | Right = MUIV_Listview_ScrollerPos_Right, 18 | None = MUIV_Listview_ScrollerPos_None, 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /wrappers/src/MUI/ValueTypes/Menuitem/Shortcut.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | namespace MUI 12 | { 13 | enum class Menuitem_Shortcut 14 | { 15 | Check = MUIV_Menuitem_Shortcut_Check, 16 | }; 17 | } 18 | -------------------------------------------------------------------------------- /wrappers/src/MUI/ValueTypes/Notify/Trigger.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | namespace MUI 12 | { 13 | enum class Trigger 14 | { 15 | /// @brief value 16 | Value = MUIV_TriggerValue, 17 | /// @brief not/negative value 18 | NotValue = MUIV_NotTriggerValue, 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /wrappers/src/MUI/ValueTypes/Prop/UseWinBorder.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | namespace MUI 12 | { 13 | enum class Prop_UseWinBorder 14 | { 15 | None = MUIV_Prop_UseWinBorder_None, 16 | Left = MUIV_Prop_UseWinBorder_Left, 17 | Right = MUIV_Prop_UseWinBorder_Right, 18 | Bottom = MUIV_Prop_UseWinBorder_Bottom, 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /wrappers/src/MUI/ValueTypes/Scrollbar/Type.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | namespace MUI 12 | { 13 | enum class Scrollbar_Type 14 | { 15 | Default = MUIV_Scrollbar_Type_Default, 16 | Bottom = MUIV_Scrollbar_Type_Bottom, 17 | Top = MUIV_Scrollbar_Type_Top, 18 | Sym = MUIV_Scrollbar_Type_Sym, 19 | #ifdef MUIV_Scrollbar_Type_None 20 | None = MUIV_Scrollbar_Type_None, 21 | #endif 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /wrappers/src/MUI/ValueTypes/String/Format.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | namespace MUI 12 | { 13 | enum class String_Format 14 | { 15 | Left = MUIV_String_Format_Left, 16 | Center = MUIV_String_Format_Center, 17 | Right = MUIV_String_Format_Right, 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /wrappers/src/MUI/ValueTypes/Text/Shorten.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | #ifdef MUIA_Text_Shorten 12 | 13 | namespace MUI 14 | { 15 | enum class Text_Shorten 16 | { 17 | Nothing = MUIV_Text_Shorten_Nothing, 18 | Cutoff = MUIV_Text_Shorten_Cutoff, 19 | /// @brief will hide all text completely if there is not enough space 20 | Hide = MUIV_Text_Shorten_Hide, 21 | #ifndef __MORPHOS__ 22 | /// @brief will shorten the text by replacing as many characters as necessary by inserting an ellipsis ("...") at the left 23 | ElideLeft = MUIV_Text_Shorten_ElideLeft, 24 | /// @brief will shorten the text by replacing as many characters as necessary by inserting an ellipsis ("...") in the center 25 | ElideCenter = MUIV_Text_Shorten_ElideCenter, 26 | /// @brief will shorten the text by replacing as many characters as necessary by inserting an ellipsis ("...") at the right 27 | ElideRight = MUIV_Text_Shorten_ElideRight 28 | #endif 29 | }; 30 | } 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /wrappers/src/MUI/ValueTypes/Title/OnLastClose.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | #ifdef MUIC_Title 12 | 13 | namespace MUI 14 | { 15 | enum class Title_OnLastClose 16 | { 17 | Remove = MUIV_Title_OnLastClose_Remove, 18 | WindowAction = MUIV_Title_OnLastClose_WindowAction, 19 | }; 20 | } 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /wrappers/src/MUI/ValueTypes/Title/Position.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | namespace MUI 12 | { 13 | enum class Title_Position 14 | { 15 | Top = MUIV_Title_Position_Top, 16 | Bottom = MUIV_Title_Position_Bottom, 17 | Left = MUIV_Title_Position_Left, 18 | Right = MUIV_Title_Position_Right, 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Virtgroup.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "Virtgroup.hpp" 8 | 9 | namespace MUI 10 | { 11 | const std::string Virtgroup::className = MUIC_Virtgroup; 12 | 13 | VirtgroupBuilder::VirtgroupBuilder() { } 14 | } 15 | -------------------------------------------------------------------------------- /wrappers/src/MUI/Window.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AmigaOS MUI C++ wrapper 3 | // 4 | // (c) 2022-2024 TDolphin 5 | // 6 | 7 | #include "Window.hpp" 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | namespace MUI 14 | { 15 | const std::string Window::className = MUIC_Window; 16 | 17 | bool Window::isOpen() const 18 | { 19 | return GetValueAsBool(MUIA_Window_Open); 20 | } 21 | 22 | AOS::Identifier Window::getID() const 23 | { 24 | return AOS::Identifier(GetValueAsULong(MUIA_Window_ID)); 25 | } 26 | 27 | Object *Window::getRootObject() const 28 | { 29 | return GetValueAsObjectPtr(MUIA_Window_RootObject); 30 | } 31 | 32 | std::string Window::getScreenTitle() const 33 | { 34 | return GetValueAsString(MUIA_Window_ScreenTitle); 35 | } 36 | 37 | Window &Window::setID(const AOS::Identifier &id) 38 | { 39 | SetValue(MUIA_Window_ID, id.value()); 40 | return *this; 41 | } 42 | 43 | Window &Window::setRootObject(const Object *rootObject) 44 | { 45 | SetValue(MUIA_Window_RootObject, rootObject); 46 | return *this; 47 | } 48 | 49 | Window &Window::setScreenTitle(const std::string &screenTitle) 50 | { 51 | SetValue(MUIA_Window_ScreenTitle, screenTitle); 52 | return *this; 53 | } 54 | 55 | Window &Window::Open() 56 | { 57 | SetValue(MUIA_Window_Open, true); 58 | return *this; 59 | } 60 | 61 | Window &Window::Close() 62 | { 63 | SetValue(MUIA_Window_Open, false); 64 | return *this; 65 | } 66 | 67 | WindowBuilder::WindowBuilder() { } 68 | 69 | WindowScope::WindowScope(Window &window) 70 | : mWindow(window) 71 | { 72 | if (!mWindow.Open().isOpen()) 73 | { 74 | auto error = std::string { __PRETTY_FUNCTION__ } + ", failed to open window!"; 75 | throw std::runtime_error(error); 76 | } 77 | } 78 | 79 | WindowScope::~WindowScope() 80 | { 81 | mWindow.Close(); 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /wrappers/src/SDI/SDI_compiler.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tdolphin-org/AmigaOS.MUI.cpp.wrapper/c6a991d9d9c0345680caf885e0ff410f76cde5b3/wrappers/src/SDI/SDI_compiler.h --------------------------------------------------------------------------------