├── debian ├── compat ├── docs ├── source │ ├── format │ └── options ├── manpages ├── .gitignore ├── icon │ └── 64x64 │ │ └── pocketHome.png ├── install ├── desktop │ └── pocket-home.desktop ├── rules └── control ├── Source ├── Files │ ├── Config │ │ ├── Implementation │ │ │ ├── Config_AlertWindow.cpp │ │ │ ├── Config_MainResource.cpp │ │ │ ├── Config_MainResource.h │ │ │ ├── Config_AlertWindow.h │ │ │ └── Config_ListenerInterface.h │ │ ├── Config_MainListener.cpp │ │ ├── Config_MainListener.h │ │ └── Config_DataKey.cpp │ ├── DesktopEntry │ │ ├── DesktopEntry_UpdateListener.cpp │ │ ├── Types │ │ │ └── DesktopEntry_CallbackID.h │ │ ├── DesktopEntry_UpdateListener.h │ │ └── Exceptions │ │ │ └── DesktopEntry_FileError.h │ ├── Assets │ │ └── Assets_XPMLoader.h │ └── Icon │ │ ├── Types │ │ ├── Icon_RequestID.h │ │ └── Icon_Context.h │ │ └── Icon_Loader.cpp ├── GUI │ ├── Theme │ │ ├── Image │ │ │ ├── Theme_Image_ConfigListener.cpp │ │ │ └── Theme_Image_ConfigListener.h │ │ └── Colour │ │ │ ├── Theme_Colour_Element.cpp │ │ │ └── Theme_Colour_UICategory.h │ ├── AppMenu │ │ ├── AppMenu.cpp │ │ ├── Formats │ │ │ ├── AppMenu_Format.h │ │ │ ├── Paged │ │ │ │ └── AppMenu_Paged_Initializer.cpp │ │ │ └── Scrolling │ │ │ │ └── AppMenu_Scrolling_Initializer.cpp │ │ ├── Data │ │ │ └── JSON │ │ │ │ ├── AppMenu_ConfigJSON.cpp │ │ │ │ └── AppMenu_MenuFile.cpp │ │ ├── AppMenu.h │ │ └── Components │ │ │ └── Editors │ │ │ └── AppMenu_CategoryEditor.cpp │ ├── Page │ │ ├── Interface │ │ │ ├── Page_Interface_Component.cpp │ │ │ ├── Page_Interface_FactoryHolder.cpp │ │ │ ├── Page_Interface_Factory.h │ │ │ └── Page_Interface_FactoryHolder.h │ │ ├── Page_Type.h │ │ ├── PageTypes │ │ │ ├── Page_WifiConnection.cpp │ │ │ ├── Page_WifiConnection.h │ │ │ ├── Page_InputSettings.h │ │ │ └── Page_PasswordRemover.h │ │ └── Page_Factory.h │ ├── Settings │ │ ├── Settings_HomeBackgroundPicker.cpp │ │ ├── Settings_CursorModePicker.cpp │ │ ├── Settings_VolumeSlider.cpp │ │ ├── Settings_VolumeSlider.h │ │ ├── Settings_CalibrationButton.cpp │ │ ├── Settings_BrightnessSlider.cpp │ │ ├── Settings_BrightnessSlider.h │ │ ├── Settings_CursorModePicker.h │ │ ├── Settings_CalibrationButton.h │ │ ├── Settings_ClockModePicker.h │ │ └── Settings_HomeBackgroundPicker.h │ ├── Layout │ │ ├── Component │ │ │ ├── Layout_Component_TextSize.h │ │ │ └── Layout_Component_Manager.cpp │ │ └── Transition │ │ │ └── Layout_Transition_Type.h │ ├── Widgets │ │ ├── Widgets_BoundedLabel.cpp │ │ ├── Widgets_TextEditor.h │ │ ├── Widgets_DelayedIconSlider.cpp │ │ ├── Widgets_TextEditor.cpp │ │ └── Widgets_LayoutContainer.cpp │ └── Info │ │ ├── Info_SignalIcon.h │ │ └── Info_SignalIcon.cpp ├── Framework │ ├── SharedResource │ │ ├── Implementation │ │ │ ├── SharedResource_ReferenceInterface.cpp │ │ │ ├── SharedResource_LockType.h │ │ │ └── SharedResource_ReferenceInterface.h │ │ └── Thread │ │ │ ├── SharedResource_Thread_ScopedReadLock.cpp │ │ │ ├── SharedResource_Thread_ScopedWriteLock.cpp │ │ │ ├── SharedResource_Thread_Resource.cpp │ │ │ ├── SharedResource_Thread_ScopedReadLock.h │ │ │ └── SharedResource_Thread_ScopedWriteLock.h │ ├── Locale │ │ ├── Locale.cpp │ │ └── Locale.h │ ├── GLib │ │ ├── Borrowed │ │ │ └── GLib_Borrowed_SharedContainer.cpp │ │ ├── DBus │ │ │ └── Variant │ │ │ │ ├── GLib_BasicValueWrapper.h │ │ │ │ └── GLib_Variant.h │ │ └── SmartPointers │ │ │ ├── GLib_LoopPtr.h │ │ │ ├── GLib_VariantPtr.h │ │ │ ├── GLib_ContextPtr.h │ │ │ ├── GLib_ObjectPtr.cpp │ │ │ └── GLib_ErrorPtr.cpp │ └── Util │ │ ├── Util_TempTimer.cpp │ │ ├── Util_SafeCall.h │ │ └── Util_Math.h ├── Development │ ├── Debug │ │ ├── Debug_Component.h │ │ ├── Debug_ScopeTimer.cpp │ │ ├── Debug_ScopeTimer.h │ │ └── Debug_ScopeTimerRecords.h │ └── Testing │ │ ├── Testing_DelayUtils.cpp │ │ ├── Testing_Window.cpp │ │ ├── Testing_DelayUtils.h │ │ └── Testing_Window.h ├── System │ ├── Wifi │ │ ├── LibNM │ │ │ ├── GObjects │ │ │ │ └── Owned │ │ │ │ │ └── Settings │ │ │ │ │ └── Wifi_LibNM_Settings_Object.cpp │ │ │ ├── Wifi_LibNM_APMode.h │ │ │ ├── Wifi_LibNM_SecurityType.h │ │ │ ├── Wifi_LibNM_ContextTest.h │ │ │ └── Signal │ │ │ │ └── Wifi_LibNM_Signal_APHandler.cpp │ │ ├── Wifi_FocusUpdater.cpp │ │ ├── Wifi_Module.cpp │ │ ├── Connection │ │ │ ├── Saved │ │ │ │ ├── Wifi_Connection_Saved_Deleter.cpp │ │ │ │ └── Wifi_Connection_Saved_Deleter.h │ │ │ ├── Record │ │ │ │ └── Wifi_Connection_Record_Listener.cpp │ │ │ └── Control │ │ │ │ └── Wifi_Connection_Control_Handler.cpp │ │ ├── Device │ │ │ ├── Wifi_Device_Listener.cpp │ │ │ ├── Wifi_Device_Controller.h │ │ │ ├── Wifi_Device_Reader.cpp │ │ │ ├── Wifi_Device_Reader.h │ │ │ └── Wifi_Device_UpdateInterface.h │ │ ├── APList │ │ │ ├── Wifi_APList_Listener.cpp │ │ │ ├── Wifi_APList_Reader.cpp │ │ │ ├── Wifi_APList_UpdateInterface.h │ │ │ └── Wifi_APList_Reader.h │ │ ├── AP │ │ │ └── Wifi_AP_UpdateInterface.h │ │ └── Wifi_FocusUpdater.h │ ├── Windows │ │ ├── Windows_Alert.cpp │ │ ├── Windows_FocusListener.cpp │ │ ├── Windows_Info.cpp │ │ ├── Windows_FocusInterface.h │ │ ├── Windows_Alert.h │ │ ├── Windows_FocusTracker.cpp │ │ └── Windows_Info.h │ ├── Bluetooth │ │ └── Bluetooth_BluezAdapter.h │ └── Hardware │ │ ├── Hardware_Audio.h │ │ └── Hardware_Display.cpp └── Main.cpp ├── .gitmodules ├── .ycm_extra_conf.pyc ├── assets ├── icons │ ├── alex4.png │ ├── chip.png │ ├── help.png │ ├── pico8.png │ ├── default.png │ ├── install.png │ ├── terminal.png │ ├── update.png │ ├── window.png │ ├── youtube.png │ ├── calculator.png │ ├── texteditor.png │ ├── virtualboy.png │ ├── webbrowser.png │ ├── filebrowser.png │ ├── imageviewer.png │ ├── mediaplayer.png │ ├── pico8terminal.png │ └── musicsequencer.png ├── login │ ├── background.png │ ├── chipVector.png │ └── ntcbanner.png ├── fonts │ └── Lato-Regular.ttf ├── wallpaper │ ├── chipDark.png │ └── chipLight.png ├── scripts │ ├── setBrightness.sh │ ├── sleepCheck.sh │ ├── calibrate.sh │ ├── printVolume.sh │ ├── printPublicIP.sh │ └── printLocalIP.sh ├── configuration │ ├── menuOptions.json │ ├── configTest.json │ └── config.json ├── commands.json └── bluetooth.json ├── docs ├── images │ ├── ChipPaint.png │ ├── repo-card.png │ ├── chipBismuth.png │ └── screenshots │ │ ├── paged.gif │ │ ├── mainHome.png │ │ ├── pages │ │ ├── fel.png │ │ ├── color.png │ │ ├── home.png │ │ ├── input.png │ │ ├── power.png │ │ ├── wifiList.png │ │ ├── setPassword.png │ │ ├── homeSettings.png │ │ ├── quickSettings.png │ │ ├── settingsList1.png │ │ ├── settingsList2.png │ │ ├── changePassword.png │ │ └── removePassword.png │ │ ├── scrolling.gif │ │ ├── wifi │ │ ├── new.png │ │ ├── saved.png │ │ └── connected.png │ │ ├── menus │ │ ├── folder.png │ │ ├── main.png │ │ ├── shortcut.png │ │ └── desktopEntry.png │ │ ├── passwordAuth.png │ │ └── editors │ │ ├── folder.png │ │ ├── category.png │ │ ├── shortcut.png │ │ └── desktopEntry.png ├── templates │ ├── config │ │ ├── ExampleListener.cpp │ │ ├── example.json │ │ ├── ExampleListener.h │ │ ├── ExampleObject.cpp │ │ └── ExampleObject.h │ └── ModuleDoc.md ├── implementation │ ├── NewTests.md │ ├── NewGLib.md │ ├── NewDBus.md │ ├── NewResource.md │ └── NewModules.md ├── userGuide │ ├── flashing.md │ ├── inputSettings.md │ ├── settingsList.md │ ├── homeSettings.md │ ├── color.md │ ├── power.md │ ├── wifi.md │ └── quickSettings.md ├── modules │ ├── Bluetooth.md │ ├── Testing.md │ ├── Process.md │ ├── Locale.md │ ├── Password.md │ ├── Hardware.md │ ├── Info.md │ ├── Debug.md │ └── Assets.md ├── UserGuide.md ├── taskList │ ├── KnownBugs.md │ └── DesignChanges.md ├── Main.md ├── configuration │ └── menuOptions.md ├── Libraries.md └── Configuration.md ├── .gitignore ├── project-scripts ├── GdbLocal.sh ├── ColourIdElementManager.pl ├── PrefixFile.sh ├── ListFiles.pl ├── MarkdownGen.pl ├── TestCppGen.pl ├── TestClassGen.pl └── DepClean.sh ├── JuceLibraryCode ├── include_juce_core.mm ├── include_juce_core.cpp ├── include_juce_events.cpp ├── include_juce_events.mm ├── include_juce_graphics.cpp ├── include_juce_graphics.mm ├── include_juce_gui_basics.cpp ├── include_juce_gui_basics.mm ├── include_juce_data_structures.cpp ├── include_juce_data_structures.mm ├── ReadMe.txt ├── Makefile └── JuceHeader.h ├── pack-debian └── DEBIAN │ ├── postinst │ └── control ├── .clang-format ├── Tests ├── Files │ └── Config │ │ ├── Config_Test_Listener.cpp │ │ ├── Config_Test_ObjectData.cpp │ │ ├── Config_Test_Listener.h │ │ └── Config_Test_ObjectData.h └── GUI │ └── AppMenu │ └── AppMenu_Test_MenuFileTest.cpp └── makefiles ├── Testing.mk ├── Bluetooth.mk ├── Locale.mk ├── Icon.mk ├── Password.mk ├── Debug.mk ├── Process.mk ├── Assets.mk ├── Hardware.mk ├── Util.mk ├── Info.mk └── DesktopEntry.mk /debian/compat: -------------------------------------------------------------------------------- 1 | 9 2 | -------------------------------------------------------------------------------- /debian/docs: -------------------------------------------------------------------------------- 1 | README.md 2 | docs/* 3 | -------------------------------------------------------------------------------- /debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (native) 2 | -------------------------------------------------------------------------------- /debian/manpages: -------------------------------------------------------------------------------- 1 | debian/pocket-home.1 2 | -------------------------------------------------------------------------------- /debian/source/options: -------------------------------------------------------------------------------- 1 | diff-ignore 2 | tar-ignore 3 | -------------------------------------------------------------------------------- /Source/Files/Config/Implementation/Config_AlertWindow.cpp: -------------------------------------------------------------------------------- 1 | #include "Config_AlertWindow.h" 2 | -------------------------------------------------------------------------------- /debian/.gitignore: -------------------------------------------------------------------------------- 1 | files 2 | pocket-home.debhelper.log 3 | pocket-home.substvars 4 | pocket-home/* -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "deps/JUCE"] 2 | path = deps/JUCE 3 | url = https://github.com/WeAreROLI/JUCE 4 | -------------------------------------------------------------------------------- /.ycm_extra_conf.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/.ycm_extra_conf.pyc -------------------------------------------------------------------------------- /assets/icons/alex4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/assets/icons/alex4.png -------------------------------------------------------------------------------- /assets/icons/chip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/assets/icons/chip.png -------------------------------------------------------------------------------- /assets/icons/help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/assets/icons/help.png -------------------------------------------------------------------------------- /assets/icons/pico8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/assets/icons/pico8.png -------------------------------------------------------------------------------- /assets/icons/default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/assets/icons/default.png -------------------------------------------------------------------------------- /assets/icons/install.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/assets/icons/install.png -------------------------------------------------------------------------------- /assets/icons/terminal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/assets/icons/terminal.png -------------------------------------------------------------------------------- /assets/icons/update.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/assets/icons/update.png -------------------------------------------------------------------------------- /assets/icons/window.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/assets/icons/window.png -------------------------------------------------------------------------------- /assets/icons/youtube.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/assets/icons/youtube.png -------------------------------------------------------------------------------- /docs/images/ChipPaint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/docs/images/ChipPaint.png -------------------------------------------------------------------------------- /docs/images/repo-card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/docs/images/repo-card.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | pack-debian/usr/ 3 | debian/.debhelper/* 4 | debian/debhelper-build-stamp 5 | assets/testing/* 6 | -------------------------------------------------------------------------------- /assets/icons/calculator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/assets/icons/calculator.png -------------------------------------------------------------------------------- /assets/icons/texteditor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/assets/icons/texteditor.png -------------------------------------------------------------------------------- /assets/icons/virtualboy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/assets/icons/virtualboy.png -------------------------------------------------------------------------------- /assets/icons/webbrowser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/assets/icons/webbrowser.png -------------------------------------------------------------------------------- /assets/login/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/assets/login/background.png -------------------------------------------------------------------------------- /assets/login/chipVector.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/assets/login/chipVector.png -------------------------------------------------------------------------------- /assets/login/ntcbanner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/assets/login/ntcbanner.png -------------------------------------------------------------------------------- /docs/images/chipBismuth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/docs/images/chipBismuth.png -------------------------------------------------------------------------------- /assets/fonts/Lato-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/assets/fonts/Lato-Regular.ttf -------------------------------------------------------------------------------- /assets/icons/filebrowser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/assets/icons/filebrowser.png -------------------------------------------------------------------------------- /assets/icons/imageviewer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/assets/icons/imageviewer.png -------------------------------------------------------------------------------- /assets/icons/mediaplayer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/assets/icons/mediaplayer.png -------------------------------------------------------------------------------- /assets/icons/pico8terminal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/assets/icons/pico8terminal.png -------------------------------------------------------------------------------- /assets/wallpaper/chipDark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/assets/wallpaper/chipDark.png -------------------------------------------------------------------------------- /assets/wallpaper/chipLight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/assets/wallpaper/chipLight.png -------------------------------------------------------------------------------- /assets/icons/musicsequencer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/assets/icons/musicsequencer.png -------------------------------------------------------------------------------- /debian/icon/64x64/pocketHome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/debian/icon/64x64/pocketHome.png -------------------------------------------------------------------------------- /docs/images/screenshots/paged.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/docs/images/screenshots/paged.gif -------------------------------------------------------------------------------- /docs/images/screenshots/mainHome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/docs/images/screenshots/mainHome.png -------------------------------------------------------------------------------- /docs/images/screenshots/pages/fel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/docs/images/screenshots/pages/fel.png -------------------------------------------------------------------------------- /docs/images/screenshots/scrolling.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/docs/images/screenshots/scrolling.gif -------------------------------------------------------------------------------- /docs/images/screenshots/wifi/new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/docs/images/screenshots/wifi/new.png -------------------------------------------------------------------------------- /docs/images/screenshots/menus/folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/docs/images/screenshots/menus/folder.png -------------------------------------------------------------------------------- /docs/images/screenshots/menus/main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/docs/images/screenshots/menus/main.png -------------------------------------------------------------------------------- /docs/images/screenshots/pages/color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/docs/images/screenshots/pages/color.png -------------------------------------------------------------------------------- /docs/images/screenshots/pages/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/docs/images/screenshots/pages/home.png -------------------------------------------------------------------------------- /docs/images/screenshots/pages/input.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/docs/images/screenshots/pages/input.png -------------------------------------------------------------------------------- /docs/images/screenshots/pages/power.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/docs/images/screenshots/pages/power.png -------------------------------------------------------------------------------- /docs/images/screenshots/passwordAuth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/docs/images/screenshots/passwordAuth.png -------------------------------------------------------------------------------- /docs/images/screenshots/wifi/saved.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/docs/images/screenshots/wifi/saved.png -------------------------------------------------------------------------------- /docs/images/screenshots/editors/folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/docs/images/screenshots/editors/folder.png -------------------------------------------------------------------------------- /docs/images/screenshots/menus/shortcut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/docs/images/screenshots/menus/shortcut.png -------------------------------------------------------------------------------- /docs/images/screenshots/pages/wifiList.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/docs/images/screenshots/pages/wifiList.png -------------------------------------------------------------------------------- /docs/images/screenshots/wifi/connected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/docs/images/screenshots/wifi/connected.png -------------------------------------------------------------------------------- /docs/images/screenshots/editors/category.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/docs/images/screenshots/editors/category.png -------------------------------------------------------------------------------- /docs/images/screenshots/editors/shortcut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/docs/images/screenshots/editors/shortcut.png -------------------------------------------------------------------------------- /docs/images/screenshots/pages/setPassword.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/docs/images/screenshots/pages/setPassword.png -------------------------------------------------------------------------------- /docs/templates/config/ExampleListener.cpp: -------------------------------------------------------------------------------- 1 | #include "ExampleListener.h" 2 | #include "ExampleResource.h" 3 | 4 | ExampleListener::ExampleListener() { } 5 | -------------------------------------------------------------------------------- /docs/images/screenshots/menus/desktopEntry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/docs/images/screenshots/menus/desktopEntry.png -------------------------------------------------------------------------------- /docs/images/screenshots/pages/homeSettings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/docs/images/screenshots/pages/homeSettings.png -------------------------------------------------------------------------------- /docs/images/screenshots/pages/quickSettings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/docs/images/screenshots/pages/quickSettings.png -------------------------------------------------------------------------------- /docs/images/screenshots/pages/settingsList1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/docs/images/screenshots/pages/settingsList1.png -------------------------------------------------------------------------------- /docs/images/screenshots/pages/settingsList2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/docs/images/screenshots/pages/settingsList2.png -------------------------------------------------------------------------------- /Source/Files/Config/Config_MainListener.cpp: -------------------------------------------------------------------------------- 1 | #include "Config_MainListener.h" 2 | #include "Config_MainResource.h" 3 | 4 | Config::MainListener::MainListener() { } 5 | -------------------------------------------------------------------------------- /assets/scripts/setBrightness.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Sets the display brightness percentage 4 | # 5 | 6 | echo "$1" > /sys/class/backlight/backlight/brightness 7 | -------------------------------------------------------------------------------- /docs/images/screenshots/editors/desktopEntry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/docs/images/screenshots/editors/desktopEntry.png -------------------------------------------------------------------------------- /docs/images/screenshots/pages/changePassword.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/docs/images/screenshots/pages/changePassword.png -------------------------------------------------------------------------------- /docs/images/screenshots/pages/removePassword.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/centuryglass/Pocket-Home-Bismuth/HEAD/docs/images/screenshots/pages/removePassword.png -------------------------------------------------------------------------------- /debian/install: -------------------------------------------------------------------------------- 1 | build/Release/pocket-home /usr/bin 2 | debian/desktop/* /usr/share/applications 3 | assets/* /usr/share/pocket-home 4 | debian/icon/* /usr/share/icons/hicolor 5 | -------------------------------------------------------------------------------- /Source/GUI/Theme/Image/Theme_Image_ConfigListener.cpp: -------------------------------------------------------------------------------- 1 | #include "Theme_Image_ConfigListener.h" 2 | #include "Theme_Image_JSONResource.h" 3 | 4 | Theme::Image::ConfigListener::ConfigListener() { } 5 | -------------------------------------------------------------------------------- /project-scripts/GdbLocal.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Launch pocket-home with gdb, using local libraries compiled with debug flags. 3 | env LD_LIBRARY_PATH=/home/$USER/.local/lib:$LD_LIBRARY_PATH gdb pocket-home 4 | -------------------------------------------------------------------------------- /assets/configuration/menuOptions.json: -------------------------------------------------------------------------------- 1 | { 2 | "AppMenu format": "Paged", 3 | "scrolling AppMenu max rows" : 8, 4 | "paged AppMenu max columns" : 3, 5 | "paged AppMenu max rows" : 2, 6 | "application launch timeout" : 18000 7 | } 8 | -------------------------------------------------------------------------------- /debian/desktop/pocket-home.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Encoding=UTF-8 3 | Name=pocket-home 4 | Comment=Home screen for mobile devices 5 | Categories=System; 6 | Exec=pocket-home 7 | Icon=pocketHome 8 | NotShowIn=pocket-home 9 | Type=Application 10 | -------------------------------------------------------------------------------- /docs/implementation/NewTests.md: -------------------------------------------------------------------------------- 1 | # Using Test Classes (WIP) 2 | When and where to create test classes. 3 | 4 | 1. Test class paths and naming conventions. 5 | 2. Using the Test template file. 6 | 3. Where to add test support classes. 7 | 4. Running application tests. 8 | 9 | -------------------------------------------------------------------------------- /assets/scripts/sleepCheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Checks if the display is off. 4 | # 5 | # Returns 0 if the display is off, 1 if the display is on. 6 | # 7 | status=$(xset q) 8 | if [[ "$status" =~ .*Monitor\sis\sOff.* ]]; then 9 | exit 0 10 | fi 11 | exit 1 12 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_core.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /Source/Files/DesktopEntry/DesktopEntry_UpdateListener.cpp: -------------------------------------------------------------------------------- 1 | #define DESKTOP_ENTRY_IMPLEMENTATION 2 | #include "DesktopEntry_UpdateListener.h" 3 | #include "DesktopEntry_LoadingThread.h" 4 | 5 | DesktopEntry::UpdateListener::UpdateListener() : 6 | SharedResource::Handler() { } 7 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_core.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /Source/Framework/SharedResource/Implementation/SharedResource_ReferenceInterface.cpp: -------------------------------------------------------------------------------- 1 | #include "SharedResource_ReferenceInterface.h" 2 | 3 | // Gets the lock used to control this reference. 4 | juce::CriticalSection& SharedResource::ReferenceInterface::getLock() 5 | { 6 | return lock; 7 | } 8 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_events.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_events.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /pack-debian/DEBIAN/postinst: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "Removing the default invisible cursor" 4 | sed -i.bak s/'awful.util.spawn_with_shell("xsetroot -cursor'/'-- awful.util.spawn_with_shell("xsetroot -cursor'/g /home/chip/.config/awesome/rc.lua 5 | echo "Please REBOOT to make the changes effective" 6 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_graphics.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_graphics.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_gui_basics.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_gui_basics.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | 3 | DPKG_EXPORT_BUILDFLAGS = 1 4 | include /usr/share/dpkg/default.mk 5 | 6 | %: 7 | dh $@ --parallel 8 | 9 | # Everything install by install file 10 | override_dh_auto_install: 11 | true 12 | 13 | override_dh_install: 14 | dh_install --exclude=Lato-Regular.ttf 15 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_data_structures.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_data_structures.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /Source/GUI/AppMenu/AppMenu.cpp: -------------------------------------------------------------------------------- 1 | #define APPMENU_IMPLEMENTATION 2 | #include "AppMenu.h" 3 | #include "AppMenu_MainComponent.h" 4 | 5 | // Creates an AppMenu::MainComponent, initialized with the menu format saved 6 | // through AppMenu::Settings. 7 | juce::Component* AppMenu::createAppMenu() 8 | { 9 | return new MainComponent(); 10 | } 11 | -------------------------------------------------------------------------------- /Source/Framework/SharedResource/Thread/SharedResource_Thread_ScopedReadLock.cpp: -------------------------------------------------------------------------------- 1 | #include "SharedResource_Thread_ScopedReadLock.h" 2 | #include "SharedResource_Thread_Lock.h" 3 | 4 | // Locks a resource lock for reading for as long as this object exists. 5 | SharedResource::Thread::ScopedReadLock::ScopedReadLock(Lock& threadLock) : 6 | juceLock(threadLock.getResourceLock()) { } 7 | -------------------------------------------------------------------------------- /docs/implementation/NewGLib.md: -------------------------------------------------------------------------------- 1 | # Creating GLib Object Classes (WIP) 2 | Include a brief description here of GLib's object system and why it's obnoxious to work with directly. 3 | 4 | 1. Borrowed vs. Owned objects 5 | 2. Creating property access functions. 6 | 3. Creating GLib function wrappers. 7 | 4. Managing GLib pointers with RAII techniques. 8 | 5. Handling GLib object signals. 9 | -------------------------------------------------------------------------------- /Source/Framework/SharedResource/Thread/SharedResource_Thread_ScopedWriteLock.cpp: -------------------------------------------------------------------------------- 1 | #include "SharedResource_Thread_ScopedWriteLock.h" 2 | #include "SharedResource_Thread_Lock.h" 3 | 4 | // Locks a resource lock for writing for as long as this object exists. 5 | SharedResource::Thread::ScopedWriteLock::ScopedWriteLock(Lock& threadLock) : 6 | juceLock(threadLock.getResourceLock()) { } 7 | -------------------------------------------------------------------------------- /assets/configuration/configTest.json: -------------------------------------------------------------------------------- 1 | { 2 | "test object": { 3 | "test object num": 5, 4 | "test object bool": false 5 | }, 6 | "test array": [ 7 | 1, 8 | 2, 9 | 3 10 | ], 11 | "test integer": 10, 12 | "test string": "This file is used to test config file management.", 13 | "test boolean": true, 14 | "test double": 0.01000 15 | } 16 | -------------------------------------------------------------------------------- /docs/userGuide/flashing.md: -------------------------------------------------------------------------------- 1 | # Flash Page 2 | The flash page reboots PocketCHIP systems into fel mode so that new system software can be flashed. 3 | 4 | ![Flash Page](../images/screenshots/pages/fel.png?raw=true "Flash page guide") 5 | 1. Immediately reboots the system into fel mode. This will only work on PocketCHIP systems. 6 | 2. Closes the page, returning to the [power page](./power.md). 7 | -------------------------------------------------------------------------------- /docs/implementation/NewDBus.md: -------------------------------------------------------------------------------- 1 | # Creating D-Bus Proxy Classes(WIP) 2 | Include a brief overview here of D-Bus proxies and the GLib::DBus module. 3 | 4 | 1. Creating a DBus proxy class for a remote D-Bus object. 5 | 2. Accessing DBus object properties with GVariants 6 | 3. Calling DBus object methods, and handling method parameters and return values. 7 | 4. Handling signals from DBus objects. 8 | 9 | -------------------------------------------------------------------------------- /docs/templates/config/example.json: -------------------------------------------------------------------------------- 1 | { 2 | "example integer": 10, 3 | "example string" : "This is a config file implementation example.", 4 | "example bool" : true, 5 | "example double" : 0.01, 6 | "example array" : [1, 2, 3], 7 | "example object" : 8 | { 9 | "example object num" : 5, 10 | "example object bool" : false 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /assets/scripts/calibrate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Calibrates the touch screen. If possible, the calibration settings are saved. 4 | # 5 | settings=$(xinput_calibrator) 6 | 7 | # Check for returned calibration settings 8 | settings=`expr match "$settings" 'Section .*'` 9 | 10 | # TODO: Check this output, then remove old settings from file, and add these new 11 | # settings. 12 | echo $settings 13 | -------------------------------------------------------------------------------- /assets/scripts/printVolume.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Prints the system volume percentage 4 | # 5 | 6 | #The mixer simple control to check: 7 | 8 | # For PocketCHIP: 9 | simpleControl='Power Amplifier' 10 | 11 | # For Linux desktop testing: 12 | #simpleControl='Master' 13 | 14 | status=`amixer sget "$simpleControl"` 15 | if [[ $status =~ \[([0-9]+)\% ]]; then 16 | echo "${BASH_REMATCH[1]}" 17 | fi 18 | 19 | -------------------------------------------------------------------------------- /Source/Development/Debug/Debug_Component.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file Debug_Component.h 4 | * 5 | * @brief Provides tools for debugging juce::Component objects. 6 | */ 7 | 8 | #include "JuceHeader.h" 9 | 10 | namespace Debug 11 | { 12 | namespace Component 13 | { 14 | /** 15 | * @brief Prints the structure of the component tree to debug output. 16 | */ 17 | void trace(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /assets/configuration/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "Wifi AP scan frequency": 30000, 3 | "Wifi interface" : "wlan0", 4 | "Terminal launch command": "vala-terminal -e", 5 | "Show cursor": true, 6 | "Show clock": true, 7 | "Use 24h mode": true, 8 | "Use IP label on home page": false, 9 | "Use IP label on settings page": true, 10 | "IP label prints local IP": true, 11 | "IP label prints public IP": false 12 | } 13 | -------------------------------------------------------------------------------- /pack-debian/DEBIAN/control: -------------------------------------------------------------------------------- 1 | Source: pocket-home 2 | Version: 0.1.1 3 | Section: x11 4 | Priority: optional 5 | Maintainer: Anthony Brown 6 | Homepage: https://github.com/centuryglass 7 | Package: pocket-home 8 | Architecture: armhf 9 | Depends: ${shlibs:Depends}, ${misc:Depends}, libnm-glib4, network-manager 10 | Description: Home screen for portable devices 11 | An application launcher and system manager for portable Linux devices. 12 | -------------------------------------------------------------------------------- /Source/GUI/Page/Interface/Page_Interface_Component.cpp: -------------------------------------------------------------------------------- 1 | #include "Page_Interface_Component.h" 2 | 3 | // Gets the page component's interface to the page stack. 4 | Page::Interface::Stack* Page::Interface::Component::getStackInterface() 5 | { 6 | return stackInterface; 7 | } 8 | 9 | 10 | // Sets the page component's interface to the page stack. 11 | void Page::Interface::Component::setStackInterface(Stack* stack) 12 | { 13 | stackInterface = stack; 14 | } 15 | -------------------------------------------------------------------------------- /assets/scripts/printPublicIP.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Prints the system's public ip address. 3 | 4 | # Arguments to use if able to load IP over DNS using dig: 5 | DNS_ARGS='@resolver1.opendns.com -4 ANY myip.opendns.com +short' 6 | # Arguments to use if requesting IP over curl: 7 | CURL_ARGS='-s -4 icanhazip.com' 8 | 9 | if [ `command -v dig` ]; then 10 | ADDR=`dig $DNS_ARGS` 11 | fi 12 | 13 | if [ -z "$ADDR" ]; then 14 | ADDR=`curl $CURL_ARGS` 15 | fi 16 | 17 | echo $ADDR 18 | -------------------------------------------------------------------------------- /docs/userGuide/inputSettings.md: -------------------------------------------------------------------------------- 1 | # Input Settings Page 2 | ![Input Settings Guide](../images/screenshots/pages/input.png?raw=true "Input settings guide") 3 | 1. Closes the page, returning to the [settings list page](./settingsList.md) 4 | 2. Shows or hides the mouse cursor when the application is focused. 5 | 3. Launches an application to calibrate the touch screen. The touch screen calibration command is stored under the **"calibrate"** key in the [system command file](../configuration/commands.md). 6 | -------------------------------------------------------------------------------- /Source/Files/DesktopEntry/Types/DesktopEntry_CallbackID.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file DesktopEntry_CallbackID.h 4 | * 5 | * @brief Defines the CallbackID type used to identify and cancel pending 6 | * callback functions. 7 | */ 8 | 9 | #include "JuceHeader.h" 10 | 11 | namespace DesktopEntry 12 | { 13 | typedef juce::uint32 CallbackID; 14 | 15 | static inline bool isNullCallback(const CallbackID callback) 16 | { 17 | return callback == 0; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /docs/modules/Bluetooth.md: -------------------------------------------------------------------------------- 1 | # Bluetooth Module Documentation 2 | 3 | The Bluetooth module is currently incomplete and non-functional, and should not be used. Once it has been implemented, it will connect with Bluez over D-Bus to view and control connected bluetooth devices. 4 | 5 | #### [Bluetooth\::BluezAdapter](../../Source/System/Bluetooth/Bluetooth_BluezAdapter.h) 6 | BluezAdapter is an extremely early prototype [GLib\::DBusProxy](../../Source/Framework/GLib/DBus/GLib_DBus_Proxy.h) class for accessing the Bluetooth adapter over D-Bus. 7 | -------------------------------------------------------------------------------- /Source/GUI/Page/Interface/Page_Interface_FactoryHolder.cpp: -------------------------------------------------------------------------------- 1 | #include "Page_Interface_FactoryHolder.h" 2 | #include "Page_Interface_Factory.h" 3 | 4 | // Gets the factory holder's interface to the page factory. 5 | Page::Interface::Factory* Page::Interface::FactoryHolder::getFactoryInterface() 6 | { 7 | return factoryInterface; 8 | } 9 | 10 | 11 | // Sets the factory holder's factory interface pointer. 12 | void Page::Interface::FactoryHolder::setFactoryInterface(Factory* pageFactory) 13 | { 14 | factoryInterface = pageFactory; 15 | } 16 | -------------------------------------------------------------------------------- /docs/templates/config/ExampleListener.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file ExampleListener.h 4 | * 5 | * @brief A listener that tracks updates to the example.json file. 6 | */ 7 | 8 | #include "Config_Listener.h" 9 | 10 | class ExampleResource; 11 | 12 | /** 13 | * @brief Receives updates when relevant values change within the example 14 | * configuration file. 15 | */ 16 | class ExampleListener : public Config::Listener 17 | { 18 | public: 19 | ExampleListener(); 20 | virtual ~ExampleListener() { } 21 | }; 22 | -------------------------------------------------------------------------------- /docs/implementation/NewResource.md: -------------------------------------------------------------------------------- 1 | # Adding Shared Application Resources (WIP) 2 | Brief description of the SharedResource module here. 3 | 4 | 1. Consider if it's appropriate to implement a feature using the SharedResource module. 5 | 2. Decide what kind of resource class to create. 6 | 7 | ### Using SharedResource::Resource 8 | 9 | ### Using SharedResource::Modular::Resource 10 | 11 | ### Using SharedResource::Thread::Resource 12 | 13 | ### Using SharedResource::Handler for Resource Access 14 | 15 | ### Using SharedResource::Handler as a Resource Listener 16 | -------------------------------------------------------------------------------- /assets/scripts/printLocalIP.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Prints the system's local ip address. 3 | 4 | IFCONFIG=`ip a` 5 | IFACE=$1 6 | if [ -z "$IFACE" ]; then 7 | # Get first active interface if one isn't provided: 8 | if [[ $IFCONFIG =~ [0-9]:\ ([^:]*):[^:]*state\ UP ]]; then 9 | IFACE="${BASH_REMATCH[1]}" 10 | fi 11 | fi 12 | 13 | # Quit if no interface was found. 14 | if [ -z "$IFACE" ]; then 15 | exit 0 16 | fi 17 | 18 | # Match interface's local IP 19 | EXPR="$IFACE.*inet ([^/]*)" 20 | if [[ $IFCONFIG =~ $EXPR ]]; then 21 | echo "${BASH_REMATCH[1]}" 22 | fi 23 | -------------------------------------------------------------------------------- /Source/Development/Debug/Debug_ScopeTimer.cpp: -------------------------------------------------------------------------------- 1 | #include "Debug_ScopeTimer.h" 2 | #include "Debug_ScopeTimerRecords.h" 3 | 4 | 5 | // Starts the timer on construction. 6 | Debug::ScopeTimer::ScopeTimer(const juce::String scopeName) : 7 | scopeName(scopeName), 8 | threadID(juce::Thread::getCurrentThreadId()) 9 | { 10 | ScopeTimerRecords::addStartRecord(scopeName, threadID); 11 | } 12 | 13 | 14 | // Saves the total amount of time this object existed before it is destroyed. 15 | Debug::ScopeTimer::~ScopeTimer() 16 | { 17 | ScopeTimerRecords::addStopRecord(scopeName, threadID); 18 | } 19 | -------------------------------------------------------------------------------- /Source/Framework/Locale/Locale.cpp: -------------------------------------------------------------------------------- 1 | #include "Locale.h" 2 | #include "JuceHeader.h" 3 | 4 | // Default locale to use if no other is found: 5 | static const constexpr char* defaultLocale = "en_US"; 6 | 7 | // Get the name of the system locale. 8 | juce::String Locale::getLocaleName() 9 | { 10 | std::locale l(""); 11 | return juce::String(l.name()).initialSectionNotContaining("."); 12 | } 13 | 14 | 15 | // Gets a default locale to use when the system locale is undefined or 16 | // unsupported. 17 | juce::String Locale::getDefaultLocale() 18 | { 19 | return defaultLocale; 20 | } 21 | -------------------------------------------------------------------------------- /docs/templates/config/ExampleObject.cpp: -------------------------------------------------------------------------------- 1 | #include "ExampleObject.h" 2 | 3 | 4 | // Constructs the example object, permanently setting its stored data. 5 | ExampleObject::ExampleObject(const int exampleNum, const bool exampleBool) : 6 | exampleNum(exampleNum), exampleBool(exampleBool) { } 7 | 8 | 9 | // Gets the custom object's stored integer value. 10 | int ExampleObject::getExampleNum() const 11 | { 12 | return exampleNum; 13 | } 14 | 15 | 16 | // Gets the custom object's stored boolean value. 17 | bool ExampleObject::getExampleBool() const 18 | { 19 | return exampleBool; 20 | } 21 | -------------------------------------------------------------------------------- /Source/GUI/Settings/Settings_HomeBackgroundPicker.cpp: -------------------------------------------------------------------------------- 1 | #include "Settings_HomeBackgroundPicker.h" 2 | 3 | // Loads the saved background image as the editor's initial value. 4 | Settings::HomeBackgroundPicker::HomeBackgroundPicker() 5 | { 6 | setText(imageConfig.getHomeBackgroundPath(), false); 7 | addFileSelectListener(this); 8 | } 9 | 10 | 11 | // Updates the selected image when a new file is selected. 12 | void Settings::HomeBackgroundPicker::fileSelected 13 | (Widgets::FilePathEditor* thisEditor) 14 | { 15 | jassert(thisEditor == this); 16 | imageConfig.setHomeBackgroundPath(getText()); 17 | } 18 | -------------------------------------------------------------------------------- /Source/System/Wifi/LibNM/GObjects/Owned/Settings/Wifi_LibNM_Settings_Object.cpp: -------------------------------------------------------------------------------- 1 | #include "Wifi_LibNM_Settings_Object.h" 2 | #include "Wifi_LibNM_ContextTest.h" 3 | #include 4 | 5 | namespace WifiNMSettings = Wifi::LibNM::Settings; 6 | 7 | // Creates a Settings object to contain NMSetting data. 8 | WifiNMSettings::Object::Object(NMSetting* toAssign, const GType settingType) : 9 | GLib::Owned::Object(G_OBJECT(toAssign), settingType) { } 10 | 11 | 12 | // @brief Creates a null Settings object. 13 | WifiNMSettings::Object::Object(const GType settingType) : 14 | GLib::Owned::Object(settingType) { } 15 | -------------------------------------------------------------------------------- /Source/Files/Config/Config_MainListener.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file Config_MainListener.h 4 | * 5 | * @brief A listener that tracks updates in the main config.json file. 6 | */ 7 | 8 | #include "Config_Listener.h" 9 | 10 | namespace Config 11 | { 12 | class MainListener; 13 | class MainResource; 14 | } 15 | 16 | /** 17 | * @brief Receives updates when relevant values change within the main 18 | * application configuration file. 19 | */ 20 | class Config::MainListener : public Listener 21 | { 22 | public: 23 | MainListener(); 24 | virtual ~MainListener() { } 25 | }; 26 | -------------------------------------------------------------------------------- /Source/System/Wifi/Wifi_FocusUpdater.cpp: -------------------------------------------------------------------------------- 1 | #define WIFI_IMPLEMENTATION 2 | #include "Wifi_FocusUpdater.h" 3 | #include "Wifi_Connection_Record_Handler.h" 4 | 5 | #ifdef JUCE_DEBUG 6 | // Print the full class name before all debug output: 7 | static const constexpr char* dbgPrefix = "Wifi::FocusUpdater::"; 8 | #endif 9 | 10 | // Scans for missed Wifi connection events when window focus is regained. 11 | void Wifi::FocusUpdater::windowFocusGained() 12 | { 13 | DBG(dbgPrefix << __func__ << ": Updating connection records:"); 14 | Connection::Record::Handler recordHandler; 15 | recordHandler.updateRecords(); 16 | } 17 | -------------------------------------------------------------------------------- /Source/System/Wifi/LibNM/Wifi_LibNM_APMode.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file Wifi_LibNM_APMode.h 4 | * 5 | * @brief Defines the basic access point types recognized by LibNM. 6 | */ 7 | namespace Wifi { namespace LibNM { enum class APMode; } } 8 | 9 | /** 10 | * @brief Enumerates all Wifi access point types. 11 | * 12 | * Any combination of APMode and SecurityType values may be used as bitflags 13 | * in a single byte. 14 | */ 15 | enum class Wifi::LibNM::APMode 16 | { 17 | unknown = 0b0000000, 18 | adhoc = 0b0000001, 19 | infrastructure = 0b0000010, 20 | hotspot = 0b0000100 21 | }; 22 | -------------------------------------------------------------------------------- /.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | BasedOnStyle: Mozilla 3 | ColumnLimit: 100 4 | IndentWidth: 2 5 | ContinuationIndentWidth: 4 6 | Standard: Cpp11 7 | AllowShortFunctionsOnASingleLine: Empty 8 | AllowShortIfStatementsOnASingleLine: true 9 | AllowShortLoopsOnASingleLine: true 10 | ConstructorInitializerIndentWidth: 0 11 | ConstructorInitializerAllOnOneLineOrOnePerLine: true 12 | PointerAlignment: Right 13 | AlwaysBreakTemplateDeclarations: true 14 | BreakConstructorInitializersBeforeComma: false 15 | MaxEmptyLinesToKeep: 2 16 | BreakBeforeBraces: Attach 17 | AlwaysBreakAfterDefinitionReturnType: None 18 | KeepEmptyLinesAtTheStartOfBlocks: false 19 | ... 20 | -------------------------------------------------------------------------------- /Source/Framework/GLib/Borrowed/GLib_Borrowed_SharedContainer.cpp: -------------------------------------------------------------------------------- 1 | #include "GLib_Borrowed_SharedContainer.h" 2 | 3 | // Creates a SharedContainer holding GObject* data. 4 | GLib::Borrowed::SharedContainer::SharedContainer(GObject* object) : 5 | Nullable(object) { } 6 | 7 | 8 | // Casts the SharedContainer directly to its stored GObject* value. 9 | GLib::Borrowed::SharedContainer::operator GObject*() const 10 | { 11 | return getData(); 12 | } 13 | 14 | 15 | // Permanently sets the SharedContainer object's data to nullptr. 16 | void GLib::Borrowed::SharedContainer::clearData() 17 | { 18 | getDataReference() = nullptr; 19 | } 20 | -------------------------------------------------------------------------------- /Source/System/Wifi/Wifi_Module.cpp: -------------------------------------------------------------------------------- 1 | #define WIFI_IMPLEMENTATION 2 | #include "Wifi_Module.h" 3 | #include "Wifi_Resource.h" 4 | 5 | // Connects the module to its Resource. 6 | Wifi::Module::Module(Resource& parentResource) : 7 | SharedResource::Modular::Module(parentResource) { } 8 | 9 | 10 | // Packages an asynchronous action so that it will check if the Wifi::Resource 11 | // instance that created it is still valid. 12 | std::function Wifi::Module::buildAsyncFunction 13 | (SharedResource::LockType lockType, std::function action) 14 | { 15 | return getResource().buildAsyncFunction(lockType, action); 16 | } 17 | -------------------------------------------------------------------------------- /Source/GUI/Settings/Settings_CursorModePicker.cpp: -------------------------------------------------------------------------------- 1 | #include "Settings_CursorModePicker.h" 2 | #include "Config_MainFile.h" 3 | 4 | 5 | // Initializes the component with the current cursor visibility setting. 6 | Settings::CursorModePicker::CursorModePicker() 7 | { 8 | Config::MainFile mainConfig; 9 | setToggleState(mainConfig.getShowCursor()); 10 | addListener(this); 11 | } 12 | 13 | 14 | // Updates the cursor visibility mode when the user selects a new mode. 15 | void Settings::CursorModePicker::buttonClicked(juce::Button* cursorSwitch) 16 | { 17 | Config::MainFile mainConfig; 18 | mainConfig.setShowCursor(getToggleState()); 19 | } 20 | -------------------------------------------------------------------------------- /project-scripts/ColourIdElementManager.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | ### ColourId Element Manager ################################################### 3 | # Provides options for automatically generating, updating, and managing the 4 | # JUCE ColourId element list and the list of configurable UI colour value keys. 5 | ################################################################################ 6 | 7 | use strict; 8 | use warnings; 9 | use lib './project-scripts/ColourID'; 10 | use IOUtils; 11 | use lib './project-scripts/ColourID/Menus'; 12 | use MainMenu; 13 | 14 | my $cache = new IDCache(); 15 | IOUtils::cacheCodeFiles($cache); 16 | MainMenu::openMenu($cache); 17 | -------------------------------------------------------------------------------- /Source/Framework/SharedResource/Implementation/SharedResource_LockType.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file SharedResource_LockType.h 4 | * 5 | * @brief Describes the types of locks that can be applied to a Resource. 6 | */ 7 | 8 | namespace SharedResource { enum class LockType; } 9 | 10 | enum class SharedResource::LockType 11 | { 12 | // Allow multiple threads to read from the resource, but keep them 13 | // from writing to the resource until all read locks are released. 14 | read, 15 | // Allows a single thread to read from and write to the resource, 16 | // blocking all others until the write lock is released. 17 | write 18 | }; 19 | -------------------------------------------------------------------------------- /Source/Main.cpp: -------------------------------------------------------------------------------- 1 | #include "JuceHeader.h" 2 | #include "PocketHomeApplication.h" 3 | 4 | // //The macro START_JUCE_APPLICATION(PocketHomeApplication) 5 | // //expands to this code when building for Linux: 6 | 7 | // juce::JUCEApplicationBase* juce_CreateApplication(); 8 | // juce::JUCEApplicationBase* juce_CreateApplication() { 9 | // return new PocketHomeApplication(); 10 | // } 11 | 12 | 13 | // extern "C" int main(int argc, char* argv[]) 14 | // { 15 | // juce::JUCEApplicationBase::createInstance = &juce_CreateApplication; 16 | // return juce::JUCEApplicationBase::main( argc, (const char**) argv ); 17 | // } 18 | 19 | START_JUCE_APPLICATION(PocketHomeApplication) -------------------------------------------------------------------------------- /Source/Development/Testing/Testing_DelayUtils.cpp: -------------------------------------------------------------------------------- 1 | #include "Testing_DelayUtils.h" 2 | 3 | // Runs the juce dispatch loop until an expected condition is true. 4 | bool Testing::DelayUtils::idleUntil 5 | (const std::function waitCondition, int testFrequencyMS, int timeoutMS) 6 | { 7 | juce::int64 startTime = juce::Time::currentTimeMillis(); 8 | while (juce::Time::currentTimeMillis() < (startTime + timeoutMS)) 9 | { 10 | if (waitCondition()) 11 | { 12 | return true; 13 | } 14 | juce::MessageManager::getInstance()->runDispatchLoopUntil 15 | (testFrequencyMS); 16 | } 17 | return false; 18 | } 19 | -------------------------------------------------------------------------------- /Source/Files/Config/Config_DataKey.cpp: -------------------------------------------------------------------------------- 1 | #include "Config_DataKey.h" 2 | 3 | 4 | // Initializes a DataKey, constructing its key from a C-string. 5 | Config::DataKey::DataKey(const char* keyString, const DataType dataType) : 6 | key(juce::Identifier(keyString)), dataType(dataType) { } 7 | 8 | 9 | // Initializes a DataKey, constructing its key from an existing Identifier. 10 | Config::DataKey::DataKey 11 | (const juce::Identifier& key, const DataType dataType) : 12 | key(key), dataType(dataType) { } 13 | 14 | 15 | // Allow the DataKey to be used as if it was just its key value. 16 | Config::DataKey::operator const juce::Identifier&() const 17 | { 18 | return key; 19 | } 20 | -------------------------------------------------------------------------------- /Source/System/Wifi/LibNM/Wifi_LibNM_SecurityType.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file Wifi_LibNM_SecurityType.h 4 | * 5 | * @brief Defines the basic categories of Wifi security handled by LibNM. 6 | */ 7 | 8 | namespace Wifi { namespace LibNM { enum class SecurityType; } } 9 | 10 | /** 11 | * @brief Enumerates all basic Wifi security types. 12 | * 13 | * Any combination of APMode and SecurityType values may be used as bitflags 14 | * in a single byte. 15 | */ 16 | enum class Wifi::LibNM::SecurityType 17 | { 18 | unsecured = 0b0001000, 19 | securedWEP = 0b0010000, 20 | securedWPA = 0b0100000, 21 | securedRSN = 0b1000000 22 | }; 23 | -------------------------------------------------------------------------------- /Source/GUI/AppMenu/Formats/AppMenu_Format.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file AppMenu_Format.h 4 | * 5 | * @brief Defines the available menu implementations. Each one(besides Invalid) 6 | * has a namespace of the same name within the AppMenu namespace where 7 | * all of its classes are declared. 8 | */ 9 | 10 | namespace AppMenu{ enum class Format; } 11 | 12 | enum class AppMenu::Format 13 | { 14 | // Displays the menu as vertical scrolling menu folder panels: 15 | Scrolling, 16 | // Displays the menu as pages of menu item grids: 17 | Paged, 18 | // The Format value returned if the menu is somehow null or invalid: 19 | Invalid 20 | }; 21 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: pocket-home 2 | Section: x11 3 | Priority: optional 4 | Maintainer: Anthony Brown 5 | Build-Depends: debhelper (>= 9), libasound2-dev, libx11-dev, libxrandr-dev, libxcursor-dev, libxft-dev, libxinerama-dev, libxpm-dev, libnm-glib-dev, network-manager-dev, libi2c-dev, libssl-dev, libnm-gtk-dev, libglib2.0-dev 6 | Standards-Version: 3.9.8 7 | Homepage: https://github.com/centuryglass 8 | 9 | Package: pocket-home 10 | Architecture: any 11 | Depends: ${shlibs:Depends}, ${misc:Depends}, libnm-glib4, network-manager 12 | Description: Home screen for portable devices 13 | An application launcher and system manager for portable Linux devices. 14 | -------------------------------------------------------------------------------- /docs/modules/Testing.md: -------------------------------------------------------------------------------- 1 | # Testing Module Documentation 2 | The testing module provides tools used for building test classes. 3 | 4 | #### [Testing\::Window](../../Source/Development/Testing/Testing_Window.h) 5 | Window quickly creates and shows a window containing a single test component. 6 | 7 | #### [Testing\::StressTest](../../Source/Development/Testing/Testing_StressTest.h) 8 | StressTest objects test execution of many simultaneous random tests running on different threads. 9 | 10 | #### [Testing\::DelayUtils](../../Source/Development/Testing/Testing_DelayUtils.h) 11 | DelayUtils provides a function that allows tests to run the JUCE event loop until some condition is met. 12 | 13 | -------------------------------------------------------------------------------- /Source/GUI/Page/Page_Type.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file Page_Type.h 4 | * 5 | * @brief Defines all types of Page::Component that other pages may create. 6 | */ 7 | 8 | namespace Page { enum class Type; } 9 | 10 | /** 11 | * @brief Defines each subclass of Page::Component that another page may 12 | * create. 13 | */ 14 | enum class Page::Type 15 | { 16 | power, 17 | quickSettings, 18 | settingsList, 19 | inputSettings, 20 | setPassword, 21 | removePassword, 22 | colourSettings, 23 | homeSettings, 24 | #ifdef CHIP_FEATURES 25 | fel, 26 | #endif 27 | #ifdef WIFI_SUPPORTED 28 | wifiConnection 29 | #endif 30 | }; 31 | -------------------------------------------------------------------------------- /Tests/Files/Config/Config_Test_Listener.cpp: -------------------------------------------------------------------------------- 1 | #define TEST_RESOURCE_IMPLEMENTATION 2 | #include "Config_Test_Listener.h" 3 | #include "Config_Test_Resource.h" 4 | 5 | Config::Test::Listener::Listener() { } 6 | 7 | 8 | // Gets the last updated key this listener received. 9 | juce::String Config::Test::Listener::getLastUpdated() const 10 | { 11 | if (lastUpdated == nullptr) 12 | { 13 | return "nullptr"; 14 | } 15 | return lastUpdated->toString(); 16 | } 17 | 18 | 19 | // Saves the updated key when the configuration file is updated. 20 | void Config::Test::Listener::configValueChanged 21 | (const juce::Identifier& propertyKey) 22 | { 23 | lastUpdated = &propertyKey; 24 | } 25 | -------------------------------------------------------------------------------- /Source/System/Wifi/Connection/Saved/Wifi_Connection_Saved_Deleter.cpp: -------------------------------------------------------------------------------- 1 | #define WIFI_IMPLEMENTATION 2 | #include "Wifi_Connection_Saved_Deleter.h" 3 | #include "Wifi_Connection_Saved_Module.h" 4 | #include "Wifi_Resource.h" 5 | #include "Wifi_AccessPoint.h" 6 | 7 | Wifi::Connection::Saved::Deleter::Deleter() { } 8 | 9 | 10 | // Removes all saved network connections that match a particular access point. 11 | void Wifi::Connection::Saved::Deleter::removeSavedConnection 12 | (const AccessPoint toRemove) const 13 | { 14 | SharedResource::Modular::LockedPtr savedConnections 15 | = getWriteLockedResource(); 16 | savedConnections->removeSavedConnection(toRemove); 17 | } 18 | -------------------------------------------------------------------------------- /Source/System/Windows/Windows_Alert.cpp: -------------------------------------------------------------------------------- 1 | #include "Windows_Alert.h" 2 | #include "JuceHeader.h" 3 | 4 | // Requests user confirmation before performing some action. 5 | void Windows::Alert::confirmAction( 6 | const juce::String title, 7 | const juce::String message, 8 | const std::function onConfirm) 9 | { 10 | juce::NativeMessageBox::showOkCancelBox(juce::AlertWindow::QuestionIcon, 11 | title, message, nullptr, 12 | juce::ModalCallbackFunction::create([onConfirm](int response) 13 | { 14 | if (response == 1) 15 | { 16 | onConfirm(); 17 | } 18 | })); 19 | } 20 | -------------------------------------------------------------------------------- /docs/UserGuide.md: -------------------------------------------------------------------------------- 1 | # Pocket-Home Bismuth User Guide 2 | 3 | - ### [Installation Guide](./BuildAndInstall.md) 4 | - ### [Configuration Files](./Configuration.md) 5 | 6 | ## Application Pages 7 | - ### [Home Page and Application Menu](./userGuide/home.md) 8 | - ### [Power Page](./userGuide/power.md) 9 | - ### [Quick Settings Page](./userGuide/quickSettings.md) 10 | - ### [Wifi Connection Page](./userGuide/wifi.md) 11 | - ### [Settings List Page](./userGuide/settingsList.md) 12 | - ### [Home Settings Page](./userGuide/homeSettings.md) 13 | - ### [Color Configuration Page](./userGuide/color.md) 14 | - ### [Input Settings Page](./userGuide/inputSettings.md) 15 | - ### [Password Pages](./userGuide/password.md) 16 | -------------------------------------------------------------------------------- /Source/Files/Assets/Assets_XPMLoader.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file Assets_XPMLoader.h 4 | * 5 | * @brief Loads juce::Image objects from .xpm files. 6 | */ 7 | 8 | namespace juce 9 | { 10 | class Image; 11 | class File; 12 | } 13 | 14 | namespace Assets 15 | { 16 | namespace XPMLoader 17 | { 18 | /** 19 | * @brief Loads a juce Image object from a xpm image file. 20 | * 21 | * @param xpmFile A xpm file object. 22 | * 23 | * @return An image loaded from the file, or a null image if 24 | * the file was not a valid xpm file. 25 | */ 26 | juce::Image loadXPMImage(const juce::File xpmFile); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /docs/taskList/KnownBugs.md: -------------------------------------------------------------------------------- 1 | ## Known Issues 2 | 3 | ### DesktopEntry Module 4 | - Poorly formatted .desktop files may cause unexpected behavior. 5 | - Problems occur when recreating custom .desktop files that still exist as hidden entries. 6 | 7 | ### Theme Module 8 | - Changes to colour values are usually not applied to components until the application restarts. 9 | - Popup windows do a poor job of formatting text to fit. 10 | - The file label gets cut off in file selection windows. 11 | 12 | ### Wifi Module 13 | - Segmentation faults with no clear cause occasionally arise from gio or gdbus. 14 | - Immediate segmentation fault on load in x86 Debian virtual machine with no 15 | Wifi after detecting that there is no Wifi device. 16 | -------------------------------------------------------------------------------- /Source/GUI/Layout/Component/Layout_Component_TextSize.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file Layout_Component_TextSize.h 4 | * 5 | * @brief Represents the three main text size options defined by the 6 | * Layout::Component::JSONResource. 7 | */ 8 | 9 | namespace Layout { namespace Component { enum class TextSize; } } 10 | 11 | /** 12 | * @brief Represents the three main text size options. 13 | * 14 | * The actual size of each of these options is set in layout.json, either as a 15 | * fraction of the smallest window dimension(if textSize <= 1) or as a fixed 16 | * height in pixels(if textSize > 1). 17 | */ 18 | enum class Layout::Component::TextSize 19 | { 20 | smallText, 21 | mediumText, 22 | largeText 23 | }; 24 | -------------------------------------------------------------------------------- /docs/userGuide/settingsList.md: -------------------------------------------------------------------------------- 1 | # Settings List Page 2 | 3 | ![Settings List Guide](../images/screenshots/pages/settingsList1.png?raw=true "First settings list page") 4 | 5 | ![Settings List Guide](../images/screenshots/pages/settingsList2.png?raw=true "Second settings list page") 6 | 1. Closes the page, returning to the [quick settings page](./quickSettings.md). 7 | 2. Opens the [home settings page](./homeSettings.md). 8 | 3. Opens the [color configuration page](./color.md). 9 | 4. Opens the [input settings page](./inputSettings.md). 10 | 5. Opens the [set/change password page](./password.md). 11 | 6. Scrolls down to the next page in the list. 12 | 7. Scrolls back to the first page in the list. 13 | 8. Opens the [remove password page](./password.md). 14 | -------------------------------------------------------------------------------- /Source/Files/Config/Implementation/Config_MainResource.cpp: -------------------------------------------------------------------------------- 1 | #include "Config_MainResource.h" 2 | #include "Config_MainKeys.h" 3 | 4 | // Filename of the JSON configuration file 5 | static const constexpr char * configFilename = "config.json"; 6 | 7 | // SharedResource object key 8 | const juce::Identifier Config::MainResource::resourceKey 9 | = "Config::MainResource"; 10 | 11 | 12 | Config::MainResource::MainResource() : 13 | FileResource(resourceKey, configFilename) 14 | { 15 | loadJSONData(); 16 | } 17 | 18 | 19 | // Gets the set of all basic(non-array, non-object) properties tracked by this 20 | // ConfigJSON. 21 | const std::vector& Config::MainResource::getConfigKeys() const 22 | { 23 | return MainKeys::allKeys; 24 | } 25 | -------------------------------------------------------------------------------- /Source/Framework/SharedResource/Thread/SharedResource_Thread_Resource.cpp: -------------------------------------------------------------------------------- 1 | #include "SharedResource_Thread_Resource.h" 2 | 3 | // Creates a new Thread::Resource. 4 | SharedResource::Thread::Resource::Resource 5 | (const juce::Identifier& resourceKey, const juce::String& threadName) : 6 | SharedResource::Resource(resourceKey), Thread(threadName) { } 7 | 8 | 9 | // Gets the Thread::Resource's resource key. 10 | const juce::Identifier& 11 | SharedResource::Thread::Resource::getThreadResourceKey() const 12 | { 13 | return getResourceKey(); 14 | } 15 | 16 | 17 | // Gets the number of references connected to this Thread::Resource. 18 | int SharedResource::Thread::Resource::getThreadReferenceCount() const 19 | { 20 | return getReferenceCount(); 21 | } 22 | -------------------------------------------------------------------------------- /docs/userGuide/homeSettings.md: -------------------------------------------------------------------------------- 1 | # Home Settings Page 2 | The home settings page configures the [home page and application menu](./home.md). 3 | 4 | ![Home Settings Guide](../images/screenshots/pages/homeSettings.png?raw=true "Home settings guide") 5 | 1. Closes the page, returning to the [settings list page](./settingsList.md) 6 | 2. Sets the background image displayed behind the home page. 7 | 3. Sets the clock between AM/PM mode and 24 hour mode, or hides it entirely. 8 | 4. Selects the application menu format. 9 | 5. Sets how many rows of application menu items are displayed on-screen at one time. 10 | 6. Sets how many columns of application menu items are displayed on-screen at one time. This field is only available when the paged menu format is selected. 11 | -------------------------------------------------------------------------------- /Source/GUI/Theme/Colour/Theme_Colour_Element.cpp: -------------------------------------------------------------------------------- 1 | #include "Theme_Colour_Element.h" 2 | 3 | // Constructs a colour element object for a JUCE ColourID value. 4 | Theme::Colour::Element::Element 5 | (const int colourId, const UICategory category) : 6 | colourId(colourId), category(category) { } 7 | 8 | 9 | // Creates an empty colour element object. 10 | Theme::Colour::Element::Element() : 11 | colourId(0), category(UICategory::none) { } 12 | 13 | 14 | // Gets this object's JUCE ColourId value. 15 | int Theme::Colour::Element::getColourId() const 16 | { 17 | return colourId; 18 | } 19 | 20 | 21 | // Gets this object's UI element category. 22 | Theme::Colour::UICategory Theme::Colour::Element::getColourCategory() const 23 | { 24 | return category; 25 | } 26 | -------------------------------------------------------------------------------- /Source/GUI/Theme/Colour/Theme_Colour_UICategory.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file Theme_Colour_UICategory.h 4 | * 5 | * @brief Defines broad categories of UI element types used to assign default 6 | * colour values. 7 | */ 8 | 9 | namespace Theme { namespace Colour { enum class UICategory; } } 10 | 11 | /** 12 | * @brief All JUCE ColourId values used by this program are assigned to one of 13 | * these categories. 14 | */ 15 | enum class Theme::Colour::UICategory 16 | { 17 | windowBackground = 0, 18 | widgetBackground, 19 | widgetOn, 20 | widgetOff, 21 | menuBackground, 22 | outline, 23 | focusedOutline, 24 | text, 25 | highlightedText, 26 | textField, 27 | highlightedTextField, 28 | none 29 | }; 30 | -------------------------------------------------------------------------------- /JuceLibraryCode/ReadMe.txt: -------------------------------------------------------------------------------- 1 | May 7 2019: 2 | This project no longer uses the Projucer, so the rest of this file no longer 3 | applies. 4 | 5 | #### 6 | Important Note!! 7 | ================ 8 | 9 | The purpose of this folder is to contain files that are auto-generated by the Projucer, 10 | and ALL files in this folder will be mercilessly DELETED and completely re-written whenever 11 | the Projucer saves your project. 12 | 13 | Therefore, it's a bad idea to make any manual changes to the files in here, or to 14 | put any of your own files in here if you don't want to lose them. (Of course you may choose 15 | to add the folder's contents to your version-control system so that you can re-merge your own 16 | modifications after the Projucer has saved its changes). 17 | -------------------------------------------------------------------------------- /Source/Files/Icon/Types/Icon_RequestID.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file Icon_RequestID.h 4 | * 5 | * @brief Defines a type used to identify pending icon requests. 6 | */ 7 | 8 | namespace Icon 9 | { 10 | /** 11 | * @brief Identifies pending icon requests so that they can be cancelled. 12 | */ 13 | typedef unsigned int RequestID; 14 | 15 | /** 16 | * @brief Checks if a RequestID value represents an invalid request ID. 17 | * 18 | * @param request The value to check. 19 | * 20 | * @return Whether the request value does not represent a valid 21 | * request. 22 | */ 23 | static inline bool isNullRequest(const RequestID request) 24 | { 25 | return request == 0; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Source/GUI/Page/PageTypes/Page_WifiConnection.cpp: -------------------------------------------------------------------------------- 1 | #include "Page_WifiConnection.h" 2 | 3 | // Initializes the page layout. 4 | Page::WifiConnection::WifiConnection() 5 | { 6 | using namespace Layout::Group; 7 | RelativeLayout layout( 8 | { 9 | Row(1, { RowItem(&connectionList) }) 10 | }); 11 | setLayout(layout); 12 | setBackButton(BackButtonType::left); 13 | } 14 | 15 | 16 | // Makes the page's back button deselect the active list item instead of 17 | // closing the page when an item in the connection list is selected. 18 | bool Page::WifiConnection::overrideBackButton() 19 | { 20 | if (connectionList.getSelectedIndex() != -1) 21 | { 22 | connectionList.deselect(); 23 | return true; 24 | } 25 | return false; 26 | } 27 | -------------------------------------------------------------------------------- /Source/GUI/Theme/Image/Theme_Image_ConfigListener.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file Theme_Image_ConfigListener.h 4 | * 5 | * @brief Receives updates when basic image path values set through the 6 | * Image::JSONResource change. 7 | */ 8 | 9 | #include "Config_Listener.h" 10 | 11 | namespace Theme 12 | { 13 | namespace Image 14 | { 15 | class ConfigListener; 16 | class JSONResource; 17 | } 18 | } 19 | 20 | /** 21 | * @brief Listens for relevant updated image paths shared by the configuration 22 | * FileResource that controls image resource paths. 23 | */ 24 | class Theme::Image::ConfigListener : public Config::Listener 25 | { 26 | public: 27 | ConfigListener(); 28 | virtual ~ConfigListener() { } 29 | }; 30 | -------------------------------------------------------------------------------- /docs/modules/Process.md: -------------------------------------------------------------------------------- 1 | # Process Module Documentation 2 | The process module creates and manages child processes to launch applications. 3 | 4 | #### [Process\::State](../../Source/System/Process/Process_State.h) 5 | State represents all possible Linux process states read from the system. 6 | 7 | #### [Process\::Data](../../Source/System/Process/Process_Data.h) 8 | Data objects shares data about a single process that they look up on construction. 9 | 10 | #### [Process\::Launched](../../Source/System/Process/Process_Launched.h) 11 | Each Launched object creates, represents, and controls a child process used to launch an application. 12 | 13 | #### [Process\::Launcher](../../Source/System/Process/Process_Launcher.h) 14 | Launcher objects create and track launched application processes. 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Source/GUI/AppMenu/Data/JSON/AppMenu_ConfigJSON.cpp: -------------------------------------------------------------------------------- 1 | #define APPMENU_IMPLEMENTATION 2 | #include "AppMenu_ConfigKeys.h" 3 | #include "AppMenu_ConfigJSON.h" 4 | 5 | // SharedResource object key 6 | const juce::Identifier AppMenu::ConfigJSON::resourceKey 7 | = "AppMenu::ConfigJSON"; 8 | 9 | // JSON configuration file name 10 | static const constexpr char * jsonFilename = "menuOptions.json"; 11 | 12 | // Initializes the menu data tree. 13 | AppMenu::ConfigJSON::ConfigJSON() : 14 | Config::FileResource(resourceKey, jsonFilename) 15 | { 16 | loadJSONData(); 17 | } 18 | 19 | 20 | // Gets all parameters with basic data types tracked by this ConfigFile. 21 | const std::vector& AppMenu::ConfigJSON::getConfigKeys() const 22 | { 23 | return ConfigKeys::allKeys; 24 | } 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /docs/modules/Locale.md: -------------------------------------------------------------------------------- 1 | # Locale Module Documentation 2 | The Locale module attempts to provide localized display text for the system's current locale. Supported locales must provide all display text values in a JSON file named after the locale, placed in the locale subdirectory of the application's assets folder. 3 | 4 | #### [Locale](../../Source/Framework/Locale/Locale.h) 5 | Locale provides functions for selecting an appropriate localization file. 6 | 7 | #### [Locale\::TextUser](../../Source/Framework/Locale/Locale_TextUser.h) 8 | TextUser objects load a set of localized display text strings from the selected locale file. 9 | 10 | #### [Locale\::Time](../../Source/Framework/Locale/Locale_Time.h) 11 | Time is a TextUser subclass that generates localized text representing an amount of time that has passed. 12 | -------------------------------------------------------------------------------- /makefiles/Testing.mk: -------------------------------------------------------------------------------- 1 | ############################### Testing Module ################################# 2 | TEST_DIR = Source/Development/Testing 3 | 4 | TEST_PREFIX := Testing_ 5 | TEST_OBJ := $(JUCE_OBJDIR)/$(TEST_PREFIX) 6 | 7 | OBJECTS_TEST := \ 8 | $(TEST_OBJ)StressTest.o \ 9 | $(TEST_OBJ)Window.o \ 10 | $(TEST_OBJ)DelayUtils.o 11 | 12 | 13 | ifeq ($(BUILD_TESTS), 1) 14 | DEVELOPMENT_MODULES := $(DEVELOPMENT_MODULES) testing 15 | OBJECTS_APP := $(OBJECTS_APP) $(OBJECTS_TEST) 16 | endif 17 | 18 | testing : $(OBJECTS_TEST) 19 | @echo " Built Testing module" 20 | 21 | $(TEST_OBJ)StressTest.o: \ 22 | $(TEST_DIR)/$(TEST_PREFIX)StressTest.cpp 23 | $(TEST_OBJ)Window.o: \ 24 | $(TEST_DIR)/$(TEST_PREFIX)Window.cpp 25 | $(TEST_OBJ)DelayUtils.o: \ 26 | $(TEST_DIR)/$(TEST_PREFIX)DelayUtils.cpp 27 | -------------------------------------------------------------------------------- /Tests/Files/Config/Config_Test_ObjectData.cpp: -------------------------------------------------------------------------------- 1 | #include "Config_Test_ObjectData.h" 2 | 3 | 4 | // Constructs the test object, permanently setting its stored data. 5 | Config::Test::ObjectData::ObjectData(const int testNum, const bool testBool) : 6 | testNum(testNum), testBool(testBool) { } 7 | 8 | 9 | // Gets the custom object's stored integer value. 10 | int Config::Test::ObjectData::getTestNum() const 11 | { 12 | return testNum; 13 | } 14 | 15 | 16 | // Gets the custom object's stored boolean value. 17 | bool Config::Test::ObjectData::getTestBool() const 18 | { 19 | return testBool; 20 | } 21 | 22 | 23 | // Compares this object with another. 24 | bool Config::Test::ObjectData::operator== (const ObjectData& rhs) const 25 | { 26 | return (testNum == rhs.testNum) && (testBool == rhs.testBool); 27 | } 28 | -------------------------------------------------------------------------------- /docs/taskList/DesignChanges.md: -------------------------------------------------------------------------------- 1 | # Project Design Plans 2 | This document tracks all changes to the way this project is designed and structured that are currently under consideration. 3 | 4 | ## Module Changes 5 | 6 | ### Page 7 | - Pick a more descriptive name for Page::Component. 8 | - Have Page::Component inherit functionality from Widgets::LayoutContainer. 9 | 10 | ### GLib Module 11 | - Rename to something that suggests the library name rather than using the same name for the module. 12 | 13 | ### Layout 14 | - Find a more elegant place for TextSize, or at least a more elegant way to integrate it into Layout::Component. 15 | 16 | ### Theme 17 | - Divide the LookAndFeel class into more manageable pieces. 18 | 19 | ### Wifi 20 | - Get rid of distinct Owned and Borrowed subdirectories for GLib::Object classes. 21 | -------------------------------------------------------------------------------- /makefiles/Bluetooth.mk: -------------------------------------------------------------------------------- 1 | ########################## Bluetooth Module #################################### 2 | BLUETOOTH_DIR = Source/System/Bluetooth 3 | BLUETOOTH_TEST_DIR = Tests/System/Bluetooth 4 | 5 | BLUETOOTH_PREFIX = Bluetooth_ 6 | BLUETOOTH_OBJ := $(JUCE_OBJDIR)/$(BLUETOOTH_PREFIX) 7 | 8 | OBJECTS_BLUETOOTH := \ 9 | $(BLUETOOTH_OBJ)BluezAdapter.o 10 | 11 | OBJECTS_BLUETOOTH_TEST := 12 | 13 | ifeq ($(BUILD_TESTS), 1) 14 | OBJECTS_BLUETOOTH := $(OBJECTS_BLUETOOTH) $(OBJECTS_BLUETOOTH_TEST) 15 | endif 16 | 17 | SYSTEM_MODULES := $(SYSTEM_MODULES) bluetooth 18 | 19 | OBJECTS_APP := $(OBJECTS_APP) $(OBJECTS_BLUETOOTH) 20 | 21 | bluetooth : $(OBJECTS_BLUETOOTH) 22 | @echo " Built Bluetooth module" 23 | 24 | $(BLUETOOTH_OBJ)BluezAdapter.o : \ 25 | $(BLUETOOTH_DIR)/$(BLUETOOTH_PREFIX)BluezAdapter.cpp 26 | -------------------------------------------------------------------------------- /docs/Main.md: -------------------------------------------------------------------------------- 1 | # Pocket-Home Bismuth Documentation 2 | 3 | ### [Code Modules](./Modules.md) 4 | 5 | An overview of the project's code structure, with links to documentation pages for each code module. 6 | 7 | ### [Configuration Files](./Configuration.md) 8 | 9 | Documents this project's configurable JSON files and the values they define. 10 | 11 | ### [Implementation Guides](./Implementation.md) 12 | 13 | Guides for extending and updating this project. 14 | 15 | ### [Project Style Guide](./StyleGuide.md) 16 | 17 | An overview of the preferred coding and documentation conventions used by this project. 18 | 19 | ### [Library References](./Libraries.md) 20 | 21 | Lists and explains the libraries directly required by this project. 22 | 23 | ### [User Guide](./UserGuide.md) 24 | 25 | Guides for using and configuring Pocket-Home Bismuth. 26 | -------------------------------------------------------------------------------- /Source/Framework/Locale/Locale.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file Locale.h 4 | * 5 | * @brief Gets the system's selected locale. 6 | */ 7 | 8 | namespace juce { class String; } 9 | 10 | namespace Locale 11 | { 12 | /** 13 | * @brief Gets the name of the system locale. 14 | * 15 | * @return The short locale name, used for naming locale text files and 16 | * identifying locale in .desktop files. 17 | */ 18 | juce::String getLocaleName(); 19 | 20 | /** 21 | * @brief Gets a default locale to use when the system locale is undefined 22 | * or unsupported. 23 | * 24 | * @return The American English locale name, to use by default if more 25 | * appropriate localization data is unavailable. 26 | */ 27 | juce::String getDefaultLocale(); 28 | } 29 | -------------------------------------------------------------------------------- /Source/System/Windows/Windows_FocusListener.cpp: -------------------------------------------------------------------------------- 1 | #include "Windows_FocusListener.h" 2 | #include "Windows_FocusTracker.h" 3 | 4 | // Connects to the FocusTracker on construction, creating the tracker instance 5 | // if necessary. 6 | Windows::FocusListener::FocusListener() { } 7 | 8 | 9 | // Checks if the main application window is currently focused. 10 | bool Windows::FocusListener::getFocusState() const 11 | { 12 | SharedResource::LockedPtr focusTracker 13 | = getReadLockedResource(); 14 | return focusTracker->getFocusState(); 15 | } 16 | 17 | 18 | // Signals that the main application window just gained focus. 19 | void Windows::FocusListener::windowFocusGained() { } 20 | 21 | 22 | // Signals that the main application window just lost focus. 23 | void Windows::FocusListener::windowFocusLost() { } 24 | -------------------------------------------------------------------------------- /Source/Framework/GLib/DBus/Variant/GLib_BasicValueWrapper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file GLib_BasicValueWrapper.h 4 | * 5 | * @brief Wraps a basic value type in an object wrapper, which can be treated 6 | * exactly like the contained type. 7 | */ 8 | 9 | namespace GLib { template class BasicValueWrapper; } 10 | 11 | /** 12 | * @brief Allows different template specializations for synonymous types. 13 | * 14 | * @tparam basicType The basic data type this wrapper contains. 15 | */ 16 | template 17 | class GLib::BasicValueWrapper 18 | { 19 | public: 20 | BasicValueWrapper(basicType value) : value(value) { } 21 | virtual ~BasicValueWrapper() { } 22 | 23 | operator basicType&() 24 | { 25 | return value; 26 | }; 27 | 28 | private: 29 | basicType value; 30 | }; 31 | -------------------------------------------------------------------------------- /Source/GUI/Page/Interface/Page_Interface_Factory.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file Page_Interface_Factory.h 4 | * 5 | * @brief Allows individual page components to create new pages. 6 | */ 7 | 8 | namespace Page 9 | { 10 | namespace Interface 11 | { 12 | class Factory; 13 | } 14 | class Component; 15 | enum class Type; 16 | } 17 | 18 | /** 19 | * @brief The Page::Component's interface to the page factory. 20 | */ 21 | class Page::Interface::Factory 22 | { 23 | public: 24 | Factory() { } 25 | 26 | virtual ~Factory() { } 27 | 28 | protected: 29 | friend Page::Component; 30 | 31 | /** 32 | * @brief Creates a new page to push on top of the page stack. 33 | * 34 | * @param PageType The type of page to create. 35 | */ 36 | virtual Component* createPage(const Type pageType) = 0; 37 | }; 38 | -------------------------------------------------------------------------------- /Source/System/Wifi/Device/Wifi_Device_Listener.cpp: -------------------------------------------------------------------------------- 1 | #define WIFI_IMPLEMENTATION 2 | #include "Wifi_Device_Listener.h" 3 | #include "Wifi_Device_Module.h" 4 | #include "Wifi_Resource.h" 5 | 6 | Wifi::Device::Listener::Listener() { } 7 | 8 | 9 | // Checks if a Wifi device managed by NetworkManager exists. 10 | bool Wifi::Device::Listener::wifiDeviceExists() const 11 | { 12 | SharedResource::Modular::LockedPtr deviceModule 13 | = getReadLockedResource(); 14 | return deviceModule->wifiDeviceExists(); 15 | } 16 | 17 | 18 | // Checks if the managed Wifi device is currently enabled. 19 | bool Wifi::Device::Listener::wifiDeviceEnabled() const 20 | { 21 | SharedResource::Modular::LockedPtr deviceModule 22 | = getReadLockedResource(); 23 | return deviceModule->wifiDeviceEnabled(); 24 | } 25 | -------------------------------------------------------------------------------- /project-scripts/PrefixFile.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Recursively adds a prefix string to the name of each file within a directory. 3 | # Use: ./prefixFile.sh /path/to/directory "PrefixString" 4 | if [[ ! -d $1 ]]; then 5 | echo "$1 is not a valid directory." 6 | exit 0 7 | fi 8 | if [[ -z $2 ]]; then 9 | echo "Failed to provide a filename prefix string." 10 | exit 0 11 | fi 12 | 13 | rootDir=$1 14 | prefix=$2 15 | count=0 16 | 17 | function recursiveRename() 18 | { 19 | local searchDir=$1 20 | for filePath in $searchDir/*; do 21 | if [[ -d $filePath ]]; then 22 | recursiveRename $filePath 23 | else 24 | fileName=$(basename $filePath) 25 | mv $filePath "$searchDir/$prefix$fileName" 26 | ((count++)) 27 | fi 28 | done 29 | } 30 | recursiveRename $rootDir 31 | echo "Renamed $count files." 32 | -------------------------------------------------------------------------------- /makefiles/Locale.mk: -------------------------------------------------------------------------------- 1 | ########################## Locale Module ###################################### 2 | LOCALE_DIR = Source/Framework/Locale 3 | 4 | LOCALE_PREFIX := Locale_ 5 | LOCALE_OBJ := $(JUCE_OBJDIR)/$(LOCALE_PREFIX) 6 | 7 | OBJECTS_LOCALE := \ 8 | $(LOCALE_OBJ)Time.o \ 9 | $(LOCALE_OBJ)TextUser.o \ 10 | $(LOCALE_OBJ)Locale.o 11 | 12 | OBJECTS_LOCALE_TEST := 13 | 14 | ifeq ($(BUILD_TESTS), 1) 15 | OBJECTS_LOCALE := $(OBJECTS_LOCALE) $(OBJECTS_LOCALE_TEST) 16 | endif 17 | 18 | FRAMEWORK_MODULES := $(FRAMEWORK_MODULES) locale 19 | OBJECTS_APP := $(OBJECTS_APP) $(OBJECTS_LOCALE) 20 | 21 | locale : $(OBJECTS_LOCALE) 22 | @echo " Built Locale module" 23 | 24 | $(LOCALE_OBJ)Time.o: \ 25 | $(LOCALE_DIR)/$(LOCALE_PREFIX)Time.cpp 26 | $(LOCALE_OBJ)TextUser.o: \ 27 | $(LOCALE_DIR)/$(LOCALE_PREFIX)TextUser.cpp 28 | $(LOCALE_OBJ)Locale.o: \ 29 | $(LOCALE_DIR)/Locale.cpp 30 | -------------------------------------------------------------------------------- /Source/GUI/AppMenu/AppMenu.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file AppMenu.h 4 | * 5 | * @brief Creates the AppMenu application menu component, and returns it as a 6 | * generic juce::Component pointer. 7 | */ 8 | 9 | #include "JuceHeader.h" 10 | 11 | /** 12 | * @brief Provides the interface used outside the AppMenu to create application 13 | * menu objects. 14 | * 15 | * The application menu is returned as a generic juce::Component pointer, and 16 | * can be treated like any other Component. 17 | */ 18 | namespace AppMenu 19 | { 20 | /** 21 | * @brief Creates an AppMenu::MainComponent, initialized with the menu 22 | * format saved through AppMenu::Settings. 23 | * 24 | * @return A pointer to a newly allocated and initialized 25 | * AppMenu::MainComponent. 26 | */ 27 | juce::Component* createAppMenu(); 28 | } 29 | -------------------------------------------------------------------------------- /docs/userGuide/color.md: -------------------------------------------------------------------------------- 1 | # Color Configuration Page 2 | Sets configurable color values used by this application. Changes made within this page will be applied when the application is restarted. 3 | 4 | ![Color Page Guide](../images/screenshots/pages/color.png?raw=true "Color page") 5 | 1. The UI element list. All UI elements and UI element categories with configurable colors are listed here. 6 | 2. The selected list item being edited. 7 | 3. Closes the page, returning to the [settings list page](./settingsList.md). 8 | 4. Shows a preview of the edited color value. 9 | 5. Shows previously selected color values. Clicking these boxes will re-select their color values. 10 | 6. ARGB color sliders, used to change the selected color. 11 | 7. A text field where new color values can be directly entered as eight-digit ARGB hexadecimal color values. 12 | 8. Applies the selected color to the selected UI element. 13 | -------------------------------------------------------------------------------- /Source/Framework/Util/Util_TempTimer.cpp: -------------------------------------------------------------------------------- 1 | #include "Util_TempTimer.h" 2 | 3 | // Starts a new timer. 4 | void Util::TempTimer::initTimer(const int runTimeMS, 5 | const std::function callback) 6 | { 7 | new TempTimer(runTimeMS, callback); 8 | } 9 | 10 | 11 | // Starts the timer on construction. 12 | Util::TempTimer::TempTimer 13 | (const int runTimeMS, const std::function callback) : 14 | callback(callback) 15 | { 16 | selfRef = this; 17 | startTimer(runTimeMS); 18 | } 19 | 20 | 21 | // Runs the timer callback function, and asynchronously deletes the timer. 22 | void Util::TempTimer::timerCallback() 23 | { 24 | stopTimer(); 25 | callback(); 26 | // Can't delete this timer while running its callback, so schedule 27 | // it to delete asynchronously. 28 | juce::MessageManager::callAsync([this]() 29 | { 30 | selfRef = nullptr; 31 | }); 32 | } 33 | -------------------------------------------------------------------------------- /Source/GUI/Settings/Settings_VolumeSlider.cpp: -------------------------------------------------------------------------------- 1 | #include "Settings_VolumeSlider.h" 2 | #include "Theme_Image_JSONKeys.h" 3 | #include "Hardware_Audio.h" 4 | 5 | // Frequency in milliseconds to run volume updates while the slider is dragged: 6 | static const constexpr int updateFreq = 200; 7 | 8 | // Slider value range: 9 | static const constexpr int minValue = 1; 10 | static const constexpr int maxValue = 100; 11 | // Constructs the volume slider frequency and display icons. 12 | Settings::VolumeSlider::VolumeSlider() : 13 | Widgets::DelayedIconSlider(Theme::Image::JSONKeys::volumeSlider, updateFreq) 14 | { 15 | setRange(minValue, maxValue, 1); 16 | setValue(Hardware::Audio::getVolumePercent()); 17 | } 18 | 19 | 20 | // Changes the system volume when the slider value changes. 21 | void Settings::VolumeSlider::valueChanged(const double newValue) 22 | { 23 | Hardware::Audio::setVolume(newValue); 24 | } 25 | -------------------------------------------------------------------------------- /Source/Framework/GLib/SmartPointers/GLib_LoopPtr.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file GLib_LoopPtr.h 4 | * 5 | * @brief Provides a ScopedGPointer class that holds GMainLoop data pointers. 6 | */ 7 | 8 | #include "GLib_ScopedGPointer.h" 9 | #include 10 | 11 | namespace GLib 12 | { 13 | /** 14 | * @brief Provides the unreferencing function used for GMainLoop* data. 15 | */ 16 | struct LoopUnref 17 | { 18 | /** 19 | * @brief Unreferences MainLoopPtr data. 20 | * 21 | * @param context A non-null GMainLoop pointer to unreference. 22 | */ 23 | static void unref(GMainLoop* loop) 24 | { 25 | g_main_loop_unref(loop); 26 | } 27 | }; 28 | 29 | /** 30 | * @brief Stores and automatically unreferences a GMainLoop*. 31 | */ 32 | typedef ScopedGPointer LoopPtr; 33 | } 34 | -------------------------------------------------------------------------------- /Source/System/Windows/Windows_Info.cpp: -------------------------------------------------------------------------------- 1 | #include "Windows_Info.h" 2 | #include "JuceHeader.h" 3 | 4 | // Gets the size of the main application window. 5 | juce::Rectangle Windows::Info::getBounds() 6 | { 7 | juce::Component * windowComp 8 | = juce::Desktop::getInstance().getComponent(0); 9 | if (windowComp == nullptr) 10 | { 11 | return juce::Rectangle(); 12 | } 13 | return windowComp->getBounds(); 14 | } 15 | 16 | 17 | // Gets the width of the main application window. 18 | int Windows::Info::getWidth() 19 | { 20 | return getBounds().getWidth(); 21 | } 22 | 23 | 24 | // Gets the height of the main application window. 25 | int Windows::Info::getHeight() 26 | { 27 | return getBounds().getHeight(); 28 | } 29 | 30 | 31 | // Checks if the window is in portrait mode. 32 | bool Windows::Info::inPortraitMode() 33 | { 34 | return getHeight() > getWidth(); 35 | } 36 | -------------------------------------------------------------------------------- /Source/System/Wifi/APList/Wifi_APList_Listener.cpp: -------------------------------------------------------------------------------- 1 | #define WIFI_IMPLEMENTATION 2 | #include "Wifi_APList_Listener.h" 3 | #include "Wifi_APList_Module.h" 4 | #include "Wifi_Resource.h" 5 | #include "Wifi_AccessPoint.h" 6 | 7 | Wifi::APList::Listener::Listener() { } 8 | 9 | 10 | // Gets the list of all visible access points from the access point list 11 | // resource. 12 | juce::Array Wifi::APList::Listener::getVisibleAPs() const 13 | { 14 | SharedResource::Modular::LockedPtr apList 15 | = getReadLockedResource(); 16 | return apList->getAccessPoints(); 17 | } 18 | 19 | 20 | // Signals that a new access point was discovered. 21 | void Wifi::APList::Listener::accessPointAdded(const AccessPoint newAP) { } 22 | 23 | 24 | // Signals that a tracked access point was lost. 25 | void Wifi::APList::Listener::accessPointRemoved 26 | (const AccessPoint removedAP) { } 27 | -------------------------------------------------------------------------------- /Source/Framework/GLib/SmartPointers/GLib_VariantPtr.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file GLib_VariantPtr.h 4 | * 5 | * @brief Provides a ScopedGPointer class that holds GVariant data pointers. 6 | */ 7 | 8 | #include "GLib_ScopedGPointer.h" 9 | #include 10 | 11 | namespace GLib 12 | { 13 | /** 14 | * @brief Provides the unreferencing function used for GVariant* data. 15 | */ 16 | struct VariantUnref 17 | { 18 | /** 19 | * @brief Unreferences GVariant data. 20 | * 21 | * @param context A non-null variant pointer to unreference. 22 | */ 23 | static void unref(GVariant* variant) 24 | { 25 | g_variant_unref(variant); 26 | } 27 | }; 28 | 29 | /** 30 | * @brief Stores and automatically unreferences a GVariant*. 31 | */ 32 | typedef ScopedGPointer VariantPtr; 33 | } 34 | -------------------------------------------------------------------------------- /Source/GUI/AppMenu/Formats/Paged/AppMenu_Paged_Initializer.cpp: -------------------------------------------------------------------------------- 1 | #define APPMENU_IMPLEMENTATION 2 | #include "AppMenu_Paged_Initializer.h" 3 | #include "AppMenu_Paged_MenuComponent.h" 4 | #include "AppMenu_Paged_InputHandler.h" 5 | 6 | // Gets the format this object initializes. 7 | AppMenu::Format AppMenu::Paged::Initializer::getMenuFormat() const 8 | { 9 | return Format::Paged; 10 | } 11 | 12 | 13 | // Creates a new paged menu component. 14 | AppMenu::MenuComponent* AppMenu::Paged::Initializer::createMenuComponent() 15 | const 16 | { 17 | return new AppMenu::Paged::MenuComponent(); 18 | } 19 | 20 | 21 | // Creates a new paged menu input handler. 22 | AppMenu::InputHandler* AppMenu::Paged::Initializer::createInputHandler( 23 | AppMenu::MenuComponent* const menuComponent, 24 | AppMenu::Controller* const controller) const 25 | { 26 | return new AppMenu::Paged::InputHandler(menuComponent, controller); 27 | } 28 | -------------------------------------------------------------------------------- /Source/GUI/Settings/Settings_VolumeSlider.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file Settings_VolumeSlider.h 4 | * 5 | * @brief A UI component used to adjust the system volume. 6 | */ 7 | 8 | #include "Widgets_DelayedIconSlider.h" 9 | 10 | namespace Settings { class VolumeSlider; } 11 | 12 | /** 13 | * @brief Updates the system volume, avoiding overly frequent updates. 14 | */ 15 | class Settings::VolumeSlider : public Widgets::DelayedIconSlider 16 | { 17 | public: 18 | /** 19 | * @brief Constructs the volume slider using an appropriate update 20 | * frequency and display icons. 21 | */ 22 | VolumeSlider(); 23 | 24 | virtual ~VolumeSlider() { } 25 | 26 | private: 27 | /** 28 | * @brief Changes the system volume when the slider value changes. 29 | * 30 | * @param newValue The updated slider value. 31 | */ 32 | virtual void valueChanged(const double newValue) override; 33 | }; 34 | -------------------------------------------------------------------------------- /Source/GUI/Settings/Settings_CalibrationButton.cpp: -------------------------------------------------------------------------------- 1 | #include "Settings_CalibrationButton.h" 2 | #include "Util_Commands.h" 3 | 4 | // Localized text class key: 5 | static const juce::Identifier localeClassKey = "Settings::CalibrationButton"; 6 | 7 | // Localized text string key: 8 | static const constexpr char* calibrateKey = "calibrate"; 9 | 10 | // Loads localized button text and starts listening for click events on 11 | // construction. 12 | Settings::CalibrationButton::CalibrationButton() : 13 | Locale::TextUser(localeClassKey) 14 | { 15 | setButtonText(localeText(calibrateKey)); 16 | addListener(this); 17 | } 18 | 19 | 20 | // Launches the calibration application when the button is clicked. 21 | void Settings::CalibrationButton::buttonClicked(juce::Button* button) 22 | { 23 | jassert(button == this); 24 | Util::Commands systemCommands; 25 | systemCommands.runActionCommand(Util::CommandTypes::Action::calibrate); 26 | } 27 | -------------------------------------------------------------------------------- /project-scripts/ListFiles.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # 3 | # Finds all .cpp and .h project files, and lists them alphabetically by name, 4 | # removing file extensions and duplicates. 5 | # 6 | use strict; 7 | use warnings; 8 | use File::Find; 9 | use File::Slurp; 10 | use lib './project-scripts'; 11 | use Paths; 12 | 13 | my $projectDir = Paths::PROJECT_DIR; 14 | my $sourceDir = "$projectDir/Source"; 15 | my $testDir = "$projectDir/Tests"; 16 | my %names; 17 | 18 | my ($dirName) = ($projectDir =~ /.*\/(.*?$)/s); 19 | 20 | sub findModules 21 | { 22 | my $name = $File::Find::name; 23 | if ($name =~ /^.+\.(h|cpp)$/) 24 | { 25 | $name =~ s/\..*//; 26 | $name =~ s/.*$dirName//g; 27 | 28 | $names{$name} = 1;; 29 | } 30 | } 31 | find(\&findModules, $sourceDir); 32 | find(\&findModules, $testDir); 33 | 34 | my @names = sort( keys(%names)); 35 | 36 | foreach my $name (@names) 37 | { 38 | print("$name\n"); 39 | } 40 | -------------------------------------------------------------------------------- /Source/System/Wifi/APList/Wifi_APList_Reader.cpp: -------------------------------------------------------------------------------- 1 | #define WIFI_IMPLEMENTATION 2 | #include "Wifi_APList_Reader.h" 3 | #include "Wifi_APList_Module.h" 4 | #include "Wifi_Resource.h" 5 | #include "Wifi_AccessPoint.h" 6 | #include "Wifi_LibNM_APHash.h" 7 | 8 | Wifi::APList::Reader::Reader() { } 9 | 10 | 11 | // Gets Wifi::AccessPoint objects for all visible access points. 12 | juce::Array Wifi::APList::Reader::getAccessPoints() const 13 | { 14 | SharedResource::Modular::LockedPtr apList 15 | = getReadLockedResource(); 16 | return apList->getAccessPoints(); 17 | 18 | } 19 | 20 | 21 | // Finds a single Wifi::AccessPoint 22 | Wifi::AccessPoint Wifi::APList::Reader::getAccessPoint 23 | (LibNM::APHash apHash) const 24 | { 25 | SharedResource::Modular::LockedPtr apList 26 | = getReadLockedResource(); 27 | return apList->getAccessPoint(apHash); 28 | } 29 | -------------------------------------------------------------------------------- /Source/GUI/AppMenu/Formats/Scrolling/AppMenu_Scrolling_Initializer.cpp: -------------------------------------------------------------------------------- 1 | #define APPMENU_IMPLEMENTATION 2 | #include "AppMenu_Scrolling_Initializer.h" 3 | #include "AppMenu_Scrolling_MenuComponent.h" 4 | #include "AppMenu_Scrolling_InputHandler.h" 5 | 6 | // Gets the format this object initializes. 7 | AppMenu::Format AppMenu::Scrolling::Initializer::getMenuFormat() const 8 | { 9 | return Format::Scrolling; 10 | } 11 | 12 | 13 | // Creates a new scrolling menu component. 14 | AppMenu::MenuComponent* 15 | AppMenu::Scrolling::Initializer::createMenuComponent() const 16 | { 17 | return new Scrolling::MenuComponent(); 18 | } 19 | 20 | 21 | // Creates a new scrolling menu input handler. 22 | AppMenu::InputHandler* AppMenu::Scrolling::Initializer::createInputHandler( 23 | AppMenu::MenuComponent* const menuComponent, 24 | AppMenu::Controller* const controller) const 25 | { 26 | return new Scrolling::InputHandler(menuComponent, controller); 27 | } 28 | -------------------------------------------------------------------------------- /Source/Framework/GLib/SmartPointers/GLib_ContextPtr.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file GLib_ContextPtr.h 4 | * 5 | * @brief Provides a ScopedGPointer class that holds GMainContext data 6 | * pointers. 7 | */ 8 | 9 | #include "GLib_ScopedGPointer.h" 10 | #include 11 | 12 | namespace GLib 13 | { 14 | /** 15 | * @brief Provides the unreferencing function used for GMainContext* data. 16 | */ 17 | struct ContextUnref 18 | { 19 | /** 20 | * @brief Unreferences MainContextPtr data. 21 | * 22 | * @param context A non-null context pointer to unreference. 23 | */ 24 | static void unref(GMainContext* context) 25 | { 26 | g_main_context_unref(context); 27 | } 28 | }; 29 | 30 | /** 31 | * @brief Stores and automatically unreferences a GMainContext*. 32 | */ 33 | typedef ScopedGPointer ContextPtr; 34 | } 35 | -------------------------------------------------------------------------------- /Source/Framework/GLib/SmartPointers/GLib_ObjectPtr.cpp: -------------------------------------------------------------------------------- 1 | #include "GLib_ObjectPtr.h" 2 | #include "GLib_Object.h" 3 | 4 | 5 | // Creates this ObjectPtr to access a GLib::Object's internal GObject* data. 6 | GLib::ObjectPtr::ObjectPtr(const Object& dataSource) : 7 | objectData(dataSource.getGObject()), 8 | shouldUnreference(dataSource.isOwned()) { } 9 | 10 | 11 | // Creates an ObjectPtr to hold a GObject* value. 12 | GLib::ObjectPtr::ObjectPtr(GObject* dataSource) : 13 | objectData(dataSource), shouldUnreference(true) { } 14 | 15 | 16 | // If necessary, unreferences the stored GObject* value. 17 | GLib::ObjectPtr::~ObjectPtr() 18 | { 19 | if (objectData != nullptr && shouldUnreference) 20 | { 21 | g_object_unref(objectData); 22 | } 23 | } 24 | 25 | 26 | // Allows this ObjectPtr to be directly used as if it was its stored GObject* 27 | // value. 28 | GLib::ObjectPtr::operator GObject* const() const 29 | { 30 | return objectData; 31 | } 32 | -------------------------------------------------------------------------------- /Source/GUI/Settings/Settings_BrightnessSlider.cpp: -------------------------------------------------------------------------------- 1 | #include "Settings_BrightnessSlider.h" 2 | #include "Theme_Image_JSONKeys.h" 3 | #include "Hardware_Display.h" 4 | 5 | // Frequency in milliseconds to run brightness updates while the slider is 6 | // dragged: 7 | static const constexpr int updateFreq = 200; 8 | 9 | // Slider value range: 10 | static const constexpr int minValue = 1; 11 | static const constexpr int maxValue = 10; 12 | 13 | // Constructs the brightness slider frequency and display icons. 14 | Settings::BrightnessSlider::BrightnessSlider() : 15 | Widgets::DelayedIconSlider(Theme::Image::JSONKeys::brightnessSlider, 16 | updateFreq) 17 | { 18 | setRange(minValue, maxValue, 1); 19 | setValue(Hardware::Display::getBrightness()); 20 | } 21 | 22 | 23 | // Changes the display's brightness when the slider value changes. 24 | void Settings::BrightnessSlider::valueChanged(const double newValue) 25 | { 26 | Hardware::Display::setBrightness(newValue); 27 | } 28 | -------------------------------------------------------------------------------- /Source/GUI/Settings/Settings_BrightnessSlider.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file Settings_BrightnessSlider.h 4 | * 5 | * @brief A UI component used to adjust the display brightness. 6 | */ 7 | 8 | #include "Widgets_DelayedIconSlider.h" 9 | 10 | namespace Settings { class BrightnessSlider; } 11 | 12 | /** 13 | * @brief Updates the display brightness, avoiding overly frequent updates. 14 | */ 15 | class Settings::BrightnessSlider : public Widgets::DelayedIconSlider 16 | { 17 | public: 18 | /** 19 | * @brief Constructs the brightness slider using an appropriate update 20 | * frequency and display icons. 21 | */ 22 | BrightnessSlider(); 23 | 24 | virtual ~BrightnessSlider() { } 25 | 26 | private: 27 | /** 28 | * @brief Changes the display's brightness when the slider value changes. 29 | * 30 | * @param newValue The updated slider value. 31 | */ 32 | virtual void valueChanged(const double newValue) override; 33 | }; 34 | -------------------------------------------------------------------------------- /docs/modules/Password.md: -------------------------------------------------------------------------------- 1 | # Password Module Documentation 2 | The password module allows the user to set, change or remove an application password. This password will be required to close the LoginPage. 3 | 4 | #### [Password](../../Source/GUI/Password/Password.h) 5 | The Password namespace provides functions for setting or checking the current application password. 6 | 7 | #### [Password\::UpdateController](../../Source/GUI/Password/Password_UpdateController.h) 8 | The UpdateController controls a set of UI components that allow the user to attempt to set or change the application password. 9 | 10 | #### [Password\::RemovalController](../../Source/GUI/Password/Password_RemovalController.h) 11 | The RemovalController controls a set of UI components that allow the user to remove the application password. 12 | 13 | #### [Password\::LoginScreen](../../Source/GUI/Password/Password_LoginScreen.h) 14 | The LoginScreen blocks all other application content until the user enters their password. 15 | 16 | -------------------------------------------------------------------------------- /docs/modules/Hardware.md: -------------------------------------------------------------------------------- 1 | # Hardware Module Documentation 2 | The hardware module provides tools for monitoring and controlling system hardware devices. 3 | 4 | #### [Hardware\::Display](../../Source/System/Hardware/Hardware_Display.h) 5 | Display provides functions for working with the system's main display. It reads display size, and gets and sets display brightness. 6 | 7 | #### [Hardware\::Audio](../../Source/System/Hardware/Hardware_Audio.h) 8 | Audio provides functions for working with the system's primary audio output device. It gets and sets volume levels, and fixes a minor PocketCHIP audio bug. 9 | 10 | #### [Hardware\::I2CBus](../../Source/System/Hardware/Hardware_I2CBus.h) 11 | I2CBus objects represent a connection to the PocketCHIP I2C bus, used to check power levels and put the system into flashing mode. 12 | 13 | #### [Hardware\::Battery](../../Source/System/Hardware/Hardware_Battery.h) 14 | Battery objects check the charge percentage and charging state of the system's battery. 15 | 16 | -------------------------------------------------------------------------------- /docs/userGuide/power.md: -------------------------------------------------------------------------------- 1 | # System Power Page 2 | 3 | # ![Power Page Guide](../images/screenshots/pages/power.png?raw=true "Power page guide") 4 | 1. The shutdown button powers off the system. The shutdown command is stored under the **"shutdown"** key in the [system command file](../configuration/commands.md). 5 | 2. The sleep button turns off the display until the user presses a key or moves the mouse cursor. When the screen turns back on, the login screen will be shown. The commands to turn off the display, turn on the display, and check if the display is currently off are stored under the **"sleep"**, **"wake"**, and **"sleep check"** keys in the [system command file](../configuration/commands.md). 6 | 3. The reboot button powers off and restarts the system. The reboot command is stored under the **"restart"** key in the [system command file](../configuration/commands.md). 7 | 4. The flash software button opens the [flash page](./flashing.md). 8 | 5. Closes the power page, returning to the [home page](./home.md). 9 | -------------------------------------------------------------------------------- /makefiles/Icon.mk: -------------------------------------------------------------------------------- 1 | ############################## Icon Module ##################################### 2 | ICON_DIR = Source/Files/Icon 3 | ICON_TEST_DIR = Tests/Files/Icon 4 | 5 | ICON_PREFIX := Icon_ 6 | ICON_OBJ := $(JUCE_OBJDIR)/$(ICON_PREFIX) 7 | 8 | OBJECTS_ICON := \ 9 | $(ICON_OBJ)Cache.o \ 10 | $(ICON_OBJ)Loader.o \ 11 | $(ICON_OBJ)ThemeIndex.o \ 12 | $(ICON_OBJ)ThreadResource.o 13 | 14 | OBJECTS_ICON_TEST := 15 | 16 | ifeq ($(BUILD_TESTS), 1) 17 | OBJECTS_ICON := $(OBJECTS_ICON) $(OBJECTS_ICON_TEST) 18 | endif 19 | 20 | GUI_MODULES := $(GUI_MODULES) icon 21 | 22 | OBJECTS_APP := $(OBJECTS_APP) $(OBJECTS_ICON) 23 | 24 | icon : $(OBJECTS_ICON) 25 | @echo " Built Icon module" 26 | 27 | $(ICON_OBJ)Cache.o: \ 28 | $(ICON_DIR)/$(ICON_PREFIX)Cache.cpp 29 | $(ICON_OBJ)Loader.o: \ 30 | $(ICON_DIR)/$(ICON_PREFIX)Loader.cpp 31 | $(ICON_OBJ)ThemeIndex.o: \ 32 | $(ICON_DIR)/$(ICON_PREFIX)ThemeIndex.cpp 33 | $(ICON_OBJ)ThreadResource.o: \ 34 | $(ICON_DIR)/$(ICON_PREFIX)ThreadResource.cpp 35 | -------------------------------------------------------------------------------- /Source/System/Wifi/AP/Wifi_AP_UpdateInterface.h: -------------------------------------------------------------------------------- 1 | #ifndef WIFI_IMPLEMENTATION 2 | #error File included directly outside of Wifi module implementation. 3 | #endif 4 | #pragma once 5 | /** 6 | * @file Wifi_AP_UpdateInterface.h 7 | * 8 | * @brief The interface used by the Wifi::Signal::APModule to send updates to 9 | * all Wifi::AP::StrengthListener objects. 10 | */ 11 | 12 | namespace Wifi { namespace AP { class UpdateInterface; } } 13 | namespace Wifi { class AccessPoint; } 14 | 15 | /** 16 | * @brief An abstract interface used for sending signal strength updates. 17 | */ 18 | class Wifi::AP::UpdateInterface 19 | { 20 | public: 21 | UpdateInterface() { } 22 | 23 | virtual ~UpdateInterface() { } 24 | 25 | /** 26 | * @brief Called whenever a AccessPoint object's signal strength changes. 27 | * 28 | * @param updatedAP The access point with a new signal strength value. 29 | */ 30 | virtual void signalStrengthChanged(const AccessPoint updatedAP) = 0; 31 | }; 32 | -------------------------------------------------------------------------------- /docs/implementation/NewModules.md: -------------------------------------------------------------------------------- 1 | ## Module Implementation Guide 2 | Follow these steps when adding new modules to the project: 3 | 4 | 1. Figure out where the module fits. What module category does it belong in? Would it make more sense as a submodule of an existing module? 5 | 2. Choose a short, descriptive name for the new module. 6 | 3. Create module directories in `[ProjectDir]/Source` and `[ProjectDir]/Tests`. 7 | 4. Create a makefile for the module at `[ProjectDir]/makefiles/[moduleName].mk`,using the [module makefile template](../templates/ModuleMakefile.mk) as a guide. 8 | 5. Create a documentation file for the module at `[ProjectDir]/docs/modules/[ModuleName].md`, using the [module documentation template](../templates/ModuleDoc.md) as a guide. 9 | 6. Add a brief description of the module in the [main module documentation](../Modules.md) under the appropriate category, linking to the module's guide document. 10 | 7. Add classes/enums/etc. to the module following the [new module class guide](./NewClasses.md). 11 | -------------------------------------------------------------------------------- /Source/GUI/Widgets/Widgets_BoundedLabel.cpp: -------------------------------------------------------------------------------- 1 | #include "Widgets_BoundedLabel.h" 2 | #include "Layout_Component_ConfigFile.h" 3 | 4 | Widgets::BoundedLabel::BoundedLabel(const juce::String componentName, 5 | const juce::String labelText, const int fontPadding) : 6 | juce::Label(componentName, labelText), 7 | fontPadding(fontPadding) 8 | { 9 | #if JUCE_DEBUG 10 | setName(juce::String("BoundedLabel:") + labelText); 11 | #endif 12 | } 13 | 14 | 15 | // Sets the maximum height of the label text. 16 | void Widgets::BoundedLabel::setMaximumTextSize 17 | (const Layout::Component::TextSize newMaximum) 18 | { 19 | maxSize = newMaximum; 20 | resized(); 21 | } 22 | 23 | 24 | // Updates the font size when label bounds change. 25 | void Widgets::BoundedLabel::resized() 26 | { 27 | Layout::Component::ConfigFile config; 28 | int fontHeight = std::min(config.getFontHeight(maxSize), 29 | config.getFontHeight(getLocalBounds(), getText())); 30 | setFont(getFont().withHeight(fontHeight)); 31 | } 32 | -------------------------------------------------------------------------------- /docs/configuration/menuOptions.md: -------------------------------------------------------------------------------- 1 | # Application Menu Configuration 2 | The [menuOptions.json](../../assets/configuration/menuOptions.json) configuration file holds options that control the format and behavior of the application launch menu. 3 | 4 | Key | Permitted Values | Description 5 | ---------------------------- | --------------------- | --- 6 | "AppMenu format" | "Paged", "Scrolling" | The application launch menu format used. 7 | "scrolling AppMenu max rows" | Any positive integer. | Maximum number of menu rows to fit within the window when using the scrolling menu format. 8 | "paged AppMenu max columns" | Any positive integer. | Maximum number of menu columns to fit within a single page of the paged menu format. 9 | "paged AppMenu max rows" | Any positive integer. | Maximum number of menu rows to fit within a single page of the paged menu format. 10 | "application launch timeout" | Any positive integer. | Milliseconds to wait before assuming an application launch failed. 11 | -------------------------------------------------------------------------------- /docs/modules/Info.md: -------------------------------------------------------------------------------- 1 | # Info Module Documentation 2 | The info module provides components solely meant to show information to the user. 3 | 4 | #### [Info\::Clock](../../Source/GUI/Info/Info_Clock.h) 5 | The Clock object displays the current time, printed in either 12-hour or 24-hour format. 6 | 7 | #### [Info\::BatteryIcon](../../Source/GUI/Info/Info_BatteryIcon.h) 8 | The BatteryIcon object displays the current battery percentage, if applicable. 9 | 10 | #### [Info\::SignalIcon](../../Source/GUI/Info/Info_SignalIcon.h) 11 | SignalIcon is an image component used to represent a signal strength. 12 | 13 | #### [Info\::ConnectionIcon](../../Source/GUI/Info/Info_ConnectionIcon.h) 14 | ConnectionIcon is a SignalIcon that tracks the strength of the active Wifi connection, or to display that there is no connection or no Wifi device. 15 | 16 | #### [Info\::IPLabel](../../Source/GUI/Info/Info_IPLabel.h) 17 | IPLabel is a configurable label component that can print the system's local IP address, its public IP address, or both. 18 | 19 | -------------------------------------------------------------------------------- /Source/System/Bluetooth/Bluetooth_BluezAdapter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file Bluetooth_BluezAdapter.h 4 | * 5 | * @brief Extremely incomplete DBus proxy class that will eventually be used 6 | * to control Bluetooth connections. 7 | */ 8 | 9 | #include "GLib_DBus_Proxy.h" 10 | 11 | namespace Bluetooth { class BluezAdapter; } 12 | 13 | class Bluetooth::BluezAdapter : private GLib::DBus::Proxy 14 | { 15 | public: 16 | BluezAdapter(); 17 | 18 | virtual ~BluezAdapter() { } 19 | 20 | juce::String getDeviceAddress(); 21 | 22 | juce::String getDeviceName(); 23 | 24 | juce::StringArray getUUIDs(); 25 | 26 | bool isPowered(); 27 | 28 | bool isDiscoverable(); 29 | 30 | bool isPairable(); 31 | 32 | void startDiscovery(); 33 | 34 | void stopDiscovery(); 35 | 36 | void setPowered(bool powered); 37 | 38 | void setDiscoverable(bool discoverable); 39 | 40 | void setPairable(bool pairable); 41 | 42 | #ifdef JUCE_DEBUG 43 | void printDebug(); 44 | #endif 45 | }; 46 | -------------------------------------------------------------------------------- /JuceLibraryCode/Makefile: -------------------------------------------------------------------------------- 1 | ########################## Juce Library Modules ################################ 2 | JUCE_PREFIX := $(JUCE_OBJDIR)/juce_ 3 | JUCE_ROOT = JuceLibraryCode 4 | 5 | OBJECTS_JUCE := \ 6 | $(JUCE_PREFIX)core.o \ 7 | $(JUCE_PREFIX)data_structures.o \ 8 | $(JUCE_PREFIX)events.o \ 9 | $(JUCE_PREFIX)graphics.o \ 10 | $(JUCE_PREFIX)gui_basics.o \ 11 | $(JUCE_PREFIX)BinaryData.o 12 | 13 | MODULES := juce $(MODULES) 14 | 15 | OBJECTS_APP := $(OBJECTS_APP) $(OBJECTS_JUCE) 16 | 17 | juce : $(OBJECTS_JUCE) 18 | @echo "Built JUCE library modules" 19 | 20 | $(JUCE_PREFIX)BinaryData.o: \ 21 | $(JUCE_ROOT)/BinaryData.cpp 22 | $(JUCE_PREFIX)core.o: \ 23 | $(JUCE_ROOT)/include_juce_core.cpp 24 | $(JUCE_PREFIX)data_structures.o: \ 25 | $(JUCE_ROOT)/include_juce_data_structures.cpp 26 | $(JUCE_PREFIX)events.o: \ 27 | $(JUCE_ROOT)/include_juce_events.cpp 28 | $(JUCE_PREFIX)graphics.o: \ 29 | $(JUCE_ROOT)/include_juce_graphics.cpp 30 | $(JUCE_PREFIX)gui_basics.o: \ 31 | $(JUCE_ROOT)/include_juce_gui_basics.cpp 32 | -------------------------------------------------------------------------------- /Source/GUI/Settings/Settings_CursorModePicker.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file Settings_CursorModePicker.h 4 | * 5 | * @brief Provides a switch for changing mouse cursor visibility. 6 | */ 7 | 8 | #include "Locale_TextUser.h" 9 | #include "Widgets_Switch.h" 10 | 11 | namespace Settings { class CursorModePicker; } 12 | 13 | /** 14 | * @brief Allows the user to choose between showing or hiding the mouse cursor. 15 | */ 16 | class Settings::CursorModePicker : public Widgets::Switch, 17 | private juce::Button::Listener 18 | { 19 | public: 20 | /** 21 | * @brief Initializes the component with the current cursor visibility 22 | * setting. 23 | */ 24 | CursorModePicker(); 25 | 26 | virtual ~CursorModePicker() { } 27 | 28 | private: 29 | /** 30 | * @brief Updates the cursor visibility mode when the user selects a new 31 | * mode. 32 | * 33 | * @param cursorSwitc This switch. 34 | */ 35 | void buttonClicked(juce::Button* cursorSwitch); 36 | }; 37 | 38 | -------------------------------------------------------------------------------- /Source/System/Wifi/LibNM/Wifi_LibNM_ContextTest.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file Wifi_LibNM_ContextTest. 4 | * 5 | * @brief A debugging macro used to find inappropriate LibNM data access 6 | * outside of the global default main context. 7 | */ 8 | 9 | #ifdef JUCE_DEBUG 10 | 11 | /** 12 | * @brief Asserts that this check is running within the LibNM thread event 13 | * loop. 14 | * 15 | * LibNM::Object classes controlled by the LibNM library should call this at 16 | * the beginning of most functions. These assertions will only run within debug 17 | * builds. 18 | */ 19 | #define ASSERT_NM_CONTEXT \ 20 | if (!g_main_context_is_owner(g_main_context_default())) \ 21 | { \ 22 | DBG("LibNM: Accessed LibNM data outside of the LibNM thread!"); \ 23 | jassertfalse; \ 24 | } 25 | 26 | #else 27 | #define ASSERT_NM_CONTEXT 28 | #endif 29 | -------------------------------------------------------------------------------- /Source/System/Windows/Windows_FocusInterface.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file Windows_FocusInterface.h 4 | * 5 | * @brief The interface used by Windows::FocusTracker to send updates to 6 | * Windows::FocusListener objects. 7 | */ 8 | 9 | namespace Windows { class FocusInterface; } 10 | 11 | /** 12 | * @brief An interface for sending updates signaling that the main application 13 | * window gained or lost focus. 14 | */ 15 | class Windows::FocusInterface 16 | { 17 | protected: 18 | FocusInterface() { } 19 | 20 | public: 21 | // Only the FocusTracker resource may use this interface. 22 | friend class FocusTracker; 23 | 24 | virtual ~FocusInterface() { } 25 | 26 | private: 27 | 28 | /** 29 | * @brief Signals that the main application window just gained focus. 30 | */ 31 | virtual void windowFocusGained() = 0; 32 | 33 | /** 34 | * @brief Signals that the main application window just lost focus. 35 | */ 36 | virtual void windowFocusLost() = 0; 37 | }; 38 | -------------------------------------------------------------------------------- /Source/GUI/Settings/Settings_CalibrationButton.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file Settings_CalibrationButton.h 4 | * 5 | * @brief Allows the user to calibrate touchscreen input. 6 | */ 7 | 8 | #include "Locale_TextUser.h" 9 | #include "JuceHeader.h" 10 | 11 | namespace Settings { class CalibrationButton; } 12 | 13 | /** 14 | * @brief Launches a touchscreen calibration application when clicked. 15 | */ 16 | class Settings::CalibrationButton : public juce::TextButton, 17 | public Locale::TextUser, private juce::Button::Listener 18 | { 19 | public: 20 | /** 21 | * @brief Loads localized button text and starts listening for click 22 | * events on construction. 23 | */ 24 | CalibrationButton(); 25 | 26 | virtual ~CalibrationButton() { } 27 | 28 | private: 29 | /** 30 | * @brief Launches the calibration application when the button is clicked. 31 | * 32 | * @param button This button component. 33 | */ 34 | virtual void buttonClicked(juce::Button* button) override; 35 | }; 36 | -------------------------------------------------------------------------------- /Source/Files/Config/Implementation/Config_MainResource.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file Config_MainResource.h 4 | * 5 | * @brief Loads general application settings from the config.json file. 6 | */ 7 | 8 | #include "Config_FileResource.h" 9 | #include "JuceHeader.h" 10 | 11 | namespace Config { class MainResource; } 12 | 13 | /** 14 | * @brief A FileResource that manages access to the main application 15 | * configuration file. 16 | */ 17 | class Config::MainResource : public FileResource 18 | { 19 | public: 20 | // SharedResource object key 21 | static const juce::Identifier resourceKey; 22 | 23 | MainResource(); 24 | 25 | virtual ~MainResource() { } 26 | 27 | private: 28 | /** 29 | * @brief Gets the set of all basic(non-array, non-object) properties 30 | * tracked by this ConfigJSON. 31 | * 32 | * @return The keys to all variables tracked in this config file. 33 | */ 34 | virtual const std::vector& getConfigKeys() 35 | const final override; 36 | }; 37 | -------------------------------------------------------------------------------- /Source/GUI/Settings/Settings_ClockModePicker.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file Settings_ClockModePicker.h 4 | * 5 | * @brief Provides a combo box for selecting the clock mode. 6 | */ 7 | 8 | #include "Locale_TextUser.h" 9 | #include "JuceHeader.h" 10 | 11 | namespace Settings { class ClockModePicker; } 12 | 13 | /** 14 | * @brief Allows the user to choose between hiding the clock, showing twelve 15 | * hour time, and showing twenty four hour time. 16 | */ 17 | class Settings::ClockModePicker : public juce::ComboBox, 18 | public Locale::TextUser, private juce::ComboBox::Listener 19 | { 20 | public: 21 | /** 22 | * @brief Initializes the component with the current saved clock mode. 23 | */ 24 | ClockModePicker(); 25 | 26 | virtual ~ClockModePicker() { } 27 | 28 | private: 29 | /** 30 | * @brief Updates the clock mode when the user selects a new mode. 31 | * 32 | * @param comboBox This combo box. 33 | */ 34 | virtual void comboBoxChanged(juce::ComboBox* comboBox); 35 | }; 36 | 37 | -------------------------------------------------------------------------------- /Source/Development/Testing/Testing_Window.cpp: -------------------------------------------------------------------------------- 1 | #include "Testing_Window.h" 2 | #include "JuceHeader.h" 3 | 4 | // Creates and shows a window holding a test component. 5 | Testing::Window::Window(const juce::String testName, 6 | juce::Component* const testComponent, 7 | const int xPos, 8 | const int yPos, 9 | const int width, 10 | const int height) : 11 | Windows::MainWindow(testName, juce::Colours::white, 12 | juce::DocumentWindow::allButtons) 13 | { 14 | setBounds(xPos, yPos, width, height); 15 | setLookAndFeel(&juce::LookAndFeel::getDefaultLookAndFeel()); 16 | setUsingNativeTitleBar(true); 17 | setResizable(true, false); 18 | setVisible(true); 19 | if (testComponent != nullptr) 20 | { 21 | if (testComponent->getBounds().isEmpty()) 22 | { 23 | testComponent->setBounds(0, 0, width, height); 24 | } 25 | testComponent->setVisible(true); 26 | DocumentWindow::setContentOwned(testComponent, false); 27 | } 28 | addToDesktop(); 29 | } 30 | -------------------------------------------------------------------------------- /Source/Files/Icon/Icon_Loader.cpp: -------------------------------------------------------------------------------- 1 | #include "Icon_Loader.h" 2 | #include "Icon_ThreadResource.h" 3 | 4 | Icon::Loader::Loader() { } 5 | 6 | 7 | // Adds a request to the list of queued tasks. 8 | Icon::RequestID Icon::Loader::loadIcon( 9 | const juce::String icon, 10 | const int size, 11 | const std::function assignImage, 12 | const Context context, 13 | const int scale) 14 | { 15 | SharedResource::LockedPtr iconThread 16 | = getWriteLockedResource(); 17 | ThreadResource::IconRequest newJob = 18 | { 19 | icon, 20 | size, 21 | scale, 22 | context, 23 | assignImage 24 | }; 25 | return iconThread->addRequest(newJob); 26 | } 27 | 28 | 29 | // Cancels a pending image assignment. 30 | void Icon::Loader::cancelImageRequest(const RequestID toCancel) 31 | { 32 | SharedResource::LockedPtr iconThread 33 | = getWriteLockedResource(); 34 | iconThread->cancelRequest(toCancel); 35 | } 36 | 37 | 38 | -------------------------------------------------------------------------------- /Source/GUI/Page/Page_Factory.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file PageFactory.h 4 | * 5 | * @brief Creates all page components. 6 | */ 7 | 8 | #include "Page_Interface_Factory.h" 9 | #include 10 | 11 | namespace Page 12 | { 13 | class Factory; 14 | class Component; 15 | enum class Type; 16 | } 17 | 18 | /** 19 | * @brief Creates all new Page::Component objects, and allows pages to create 20 | * other pages. 21 | */ 22 | class Page::Factory : public Page::Interface::Factory 23 | { 24 | public: 25 | Factory() { } 26 | 27 | virtual ~Factory() { } 28 | 29 | /** 30 | * @brief Creates an instance of the application's home page. 31 | * 32 | * @return A pointer to the new home page. 33 | */ 34 | Page::Component* createHomePage(); 35 | 36 | private: 37 | /** 38 | * @brief Creates a new page to push on top of the page stack. 39 | * 40 | * @param PageType The type of page to create. 41 | */ 42 | virtual Page::Component* createPage(const Type pageType) override; 43 | }; 44 | -------------------------------------------------------------------------------- /docs/templates/ModuleDoc.md: -------------------------------------------------------------------------------- 1 | # Example Module Documentation 2 | Describe the intent and purpose of your module here. This should be the main place used to document the module as a whole. If the module is relatively straightforward, a few sentences here is enough, but feel free to go into greater depth if necessary. 3 | 4 | #### [Example\::Object](../../Source/ModuleCategory/Example/Example_Object.h) 5 | Provide a brief description of the Example::Object class/namespace/enum/etc. This can be directly copied from the @brief tag in the header file's documentation block. Include an entry like this for each header file in the module. Save more in-depth documentation for inside the actual header file. 6 | 7 | ## Example Submodule 8 | Describe the intent and purpose of this inner category module within the main module. This should be the main place the submodule is documented, and may be as short or as long as is necessary. Entries for header files or inner submodules within this submodule should be placed below this section. All submodules in the module should be documented with a section like this. 9 | -------------------------------------------------------------------------------- /Source/System/Wifi/Connection/Record/Wifi_Connection_Record_Listener.cpp: -------------------------------------------------------------------------------- 1 | #define WIFI_IMPLEMENTATION 2 | #include "Wifi_Connection_Record_Listener.h" 3 | #include "Wifi_Connection_Record_Module.h" 4 | #include "Wifi_Resource.h" 5 | #include "Wifi_AccessPoint.h" 6 | 7 | namespace WifiRecord = Wifi::Connection::Record; 8 | 9 | WifiRecord::Listener::Listener() { } 10 | 11 | 12 | // Signals that a new active Wifi connection is being opened. 13 | void WifiRecord::Listener::startedConnecting 14 | (const AccessPoint connectingAP) { } 15 | 16 | 17 | // Signals that an attempt to open a Wifi connection failed due to improper 18 | // authentication, usually because of an incorrect Wifi password. 19 | void WifiRecord::Listener::connectionAuthFailed 20 | (const AccessPoint connectingAP) { } 21 | 22 | 23 | // Signals that a new Wifi connection was opened successfully. 24 | void WifiRecord::Listener::connected(const AccessPoint connectedAP) { } 25 | 26 | 27 | // Signals that an active Wifi connection was closed. 28 | void WifiRecord::Listener::disconnected(const AccessPoint disconnectedAP) { } 29 | -------------------------------------------------------------------------------- /Source/Framework/SharedResource/Thread/SharedResource_Thread_ScopedReadLock.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file SharedResource_Thread_ScopedReadLock.h 4 | * 5 | * @brief Locks a SharedResource::Thread::Lock for reading while it remains in 6 | * scope. 7 | */ 8 | 9 | #include "JuceHeader.h" 10 | 11 | namespace SharedResource 12 | { 13 | namespace Thread 14 | { 15 | class ScopedReadLock; 16 | class Lock; 17 | } 18 | } 19 | 20 | /** 21 | * @brief A juce::ScopedReadLock created from a Thread::Lock instead of a 22 | * juce::ReadWriteLock. 23 | */ 24 | class SharedResource::Thread::ScopedReadLock 25 | { 26 | public: 27 | /** 28 | * @brief Locks a resource lock for reading for as long as this object 29 | * exists. 30 | * 31 | * @param threadLock The resource lock object to lock. 32 | */ 33 | ScopedReadLock(Lock& threadLock); 34 | 35 | virtual ~ScopedReadLock() { } 36 | 37 | private: 38 | // Private lock object that provides all lock functionality: 39 | juce::ScopedReadLock juceLock; 40 | }; 41 | -------------------------------------------------------------------------------- /Source/System/Windows/Windows_Alert.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file Windows_Alert.h 4 | * 5 | * @brief Provides convenience functions for creating simple popup alert 6 | * windows. 7 | */ 8 | 9 | namespace juce { class String; } 10 | 11 | #include 12 | 13 | namespace Windows 14 | { 15 | namespace Alert 16 | { 17 | /** 18 | * @brief Requests user confirmation before performing some action. 19 | * 20 | * @param title The text to print at the top of the confirmation 21 | * box. 22 | * 23 | * @param message Detailed information text about the action being 24 | * confirmed. 25 | * 26 | * @param onConfirm If the user presses the "OK" button, this callback 27 | * function will run. 28 | */ 29 | void confirmAction( 30 | const juce::String title, 31 | const juce::String message, 32 | const std::function onConfirm); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /docs/modules/Debug.md: -------------------------------------------------------------------------------- 1 | # Debug Module Documentation 2 | The Debug module provides tools for testing application performance and locating errors. 3 | 4 | #### [Debug\::ScopeTimer](../../Source/Development/Debug/Debug_ScopeTimer.h) 5 | ScopeTimer saves the time of its creation and the time it goes out of scope. This allows scope execution times to be recorded by declaring a ScopeTimer at the top of the scope. 6 | 7 | #### [Debug\::ScopeTimerRecords](../../Source/Development/Debug/Debug_ScopeTimerRecords.h) 8 | ScopeTimerRecords stores the records saved by all ScopeTimer objects, and prints them out when the application finishes executing. 9 | 10 | #### [Debug\::Component](../../Source/Development/Debug/Debug_Component.h) 11 | The Component namespace provides functions for inspecting and debugging juce\::Component objects. Currently, it includes a single function to print the tree of all visible components. 12 | 13 | #### [Debug\::AddressLog](../../Source/Development/Debug/Debug_AddressLog.h) 14 | The AddressLog keeps and prints logs of events associated with particular memory addresses. 15 | 16 | 17 | -------------------------------------------------------------------------------- /Source/Framework/SharedResource/Thread/SharedResource_Thread_ScopedWriteLock.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file SharedResource_Thread_ScopedWriteLock.h 4 | * 5 | * @brief Locks a SharedResource::Thread::Lock for writing while it remains in 6 | * scope. 7 | */ 8 | 9 | #include "JuceHeader.h" 10 | 11 | namespace SharedResource 12 | { 13 | namespace Thread 14 | { 15 | class ScopedWriteLock; 16 | class Lock; 17 | } 18 | } 19 | 20 | /** 21 | * @brief A juce::ScopedWriteLock created from a Thread::Lock instead of a 22 | * juce::ReadWriteLock. 23 | */ 24 | class SharedResource::Thread::ScopedWriteLock 25 | { 26 | public: 27 | /** 28 | * @brief Locks a resource lock for writing for as long as this object 29 | * exists. 30 | * 31 | * @param threadLock The resource lock object to lock. 32 | */ 33 | ScopedWriteLock(Lock& threadLock); 34 | 35 | virtual ~ScopedWriteLock() { } 36 | 37 | private: 38 | // Private lock object that provides all lock functionality: 39 | juce::ScopedWriteLock juceLock; 40 | }; 41 | -------------------------------------------------------------------------------- /Tests/GUI/AppMenu/AppMenu_Test_MenuFileTest.cpp: -------------------------------------------------------------------------------- 1 | #define APPMENU_IMPLEMENTATION 2 | #include "AppMenu_MenuFile.h" 3 | #include "AppMenu_MenuItem.h" 4 | #include "JuceHeader.h" 5 | 6 | namespace AppMenu { namespace Test { class MenuFileTest; } } 7 | 8 | /** 9 | * @brief Tests that the AppMenu successfully loads the root menu folder from 10 | * the AppMenu configuration file. 11 | */ 12 | class AppMenu::Test::MenuFileTest : public juce::UnitTest 13 | { 14 | public: 15 | MenuFileTest() : juce::UnitTest("AppMenu::MenuFile testing") {} 16 | 17 | void runTest() override 18 | { 19 | using namespace AppMenu; 20 | beginTest("AppMenu::MenuFile test"); 21 | AppMenu::MenuFile appConfig; 22 | MenuItem rootItem = appConfig.getRootFolderItem(); 23 | expect(!rootItem.isNull(), "Root folder item was null!"); 24 | expect(rootItem.isFolder(), "Root item was not a folder!"); 25 | expectGreaterThan(rootItem.getFolderSize(), 0, 26 | "Root folder item was empty!"); 27 | } 28 | }; 29 | 30 | static AppMenu::Test::MenuFileTest test; 31 | -------------------------------------------------------------------------------- /Source/GUI/Info/Info_SignalIcon.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file Info_SignalIcon.h 4 | * 5 | * @brief Displays a network signal strength icon. 6 | */ 7 | 8 | #include "Theme_Image_Component.h" 9 | 10 | namespace Info { class SignalIcon; } 11 | 12 | /** 13 | * @brief An image Component representing a network signal strength. 14 | */ 15 | class Info::SignalIcon : public Theme::Image::Component<> 16 | { 17 | public: 18 | /** 19 | * @brief Initializes the icon with the image assets defined in the image 20 | * configuration file. 21 | */ 22 | SignalIcon(); 23 | 24 | virtual ~SignalIcon() { } 25 | 26 | /** 27 | * @brief Updates the signal icon to represent a new signal strength. 28 | * 29 | * @param signalStrength The signal strength, as a number between zero and 30 | * 100, inclusive. 31 | */ 32 | void setSignalStrengthImage(const unsigned int signalStrength); 33 | 34 | /** 35 | * @brief Updates the signal icon to show that the signal is disabled. 36 | */ 37 | void setDisabledImage(); 38 | }; 39 | -------------------------------------------------------------------------------- /Source/Development/Debug/Debug_ScopeTimer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file Debug_ScopeTimer.h 4 | * 5 | * @brief Measures execution time of some scope within this program. 6 | */ 7 | 8 | #include "JuceHeader.h" 9 | 10 | namespace Debug { class ScopeTimer; } 11 | 12 | /** 13 | * @brief Measures execution time by logging the time between its creation and 14 | * destruction. 15 | */ 16 | class Debug::ScopeTimer 17 | { 18 | public: 19 | /** 20 | * @brief Starts the timer on construction. 21 | * 22 | * @param scopeName A name identifying the portion of the program the 23 | * timer is tracking. 24 | */ 25 | ScopeTimer(const juce::String scopeName); 26 | 27 | /** 28 | * @brief Saves the total amount of time this object existed before it is 29 | * destroyed. 30 | */ 31 | virtual ~ScopeTimer(); 32 | 33 | private: 34 | // The timer name saved on construction: 35 | const juce::String scopeName; 36 | 37 | // The ID of the thread where this timer was created: 38 | const juce::Thread::ThreadID threadID; 39 | }; 40 | -------------------------------------------------------------------------------- /Source/Files/DesktopEntry/DesktopEntry_UpdateListener.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file DesktopEntry/UpdateListener.h" 4 | * 5 | * @brief Receives notifications when desktop entry data is updated. 6 | */ 7 | 8 | #include "DesktopEntry_UpdateInterface.h" 9 | #include "SharedResource_Handler.h" 10 | 11 | namespace DesktopEntry { class UpdateListener; } 12 | namespace DesktopEntry { class LoadingThread; } 13 | 14 | /** 15 | * @brief Listens for updates to the DesktopEntry resource's cache of saved 16 | * desktop entry data. 17 | * 18 | * Whenever the desktop entry loader updates its cached desktop entry data, it 19 | * notifies all UpdateListeners of all added, changed, or removed entries. 20 | * UpdateListener classes must implement DesktopEntry::UpdateInterface's 21 | * functions to handle these notifications. 22 | * 23 | * @see DesktopEntry/UpdateInterface.h 24 | */ 25 | class DesktopEntry::UpdateListener : public UpdateInterface, 26 | public SharedResource::Handler 27 | { 28 | protected: 29 | UpdateListener(); 30 | 31 | public: 32 | virtual ~UpdateListener() { } 33 | }; 34 | -------------------------------------------------------------------------------- /Source/System/Wifi/Wifi_FocusUpdater.h: -------------------------------------------------------------------------------- 1 | #ifndef WIFI_IMPLEMENTATION 2 | #error File included directly outside of Wifi module implementation. 3 | #endif 4 | #pragma once 5 | /** 6 | * @file Wifi_FocusUpdater.h 7 | * 8 | * @brief Updates Wifi records when window focus is regained. 9 | */ 10 | 11 | #include "Windows_FocusListener.h" 12 | 13 | namespace Wifi { class FocusUpdater; } 14 | 15 | /** 16 | * @brief Ensures the tracked active Wifi connection is up to date whenever 17 | * window focus is regained. 18 | * 19 | * The Wifi thread only remains active while the main application window is 20 | * focused. When window focus is regained, the FocusUpdater ensures that the 21 | * Connection::Record::Module checks for missed connection changes. 22 | */ 23 | class Wifi::FocusUpdater : public Windows::FocusListener 24 | { 25 | public: 26 | FocusUpdater() { } 27 | 28 | virtual ~FocusUpdater() { } 29 | 30 | private: 31 | /** 32 | * @brief Scans for missed Wifi connection events when window focus is 33 | * regained. 34 | */ 35 | virtual void windowFocusGained() override; 36 | }; 37 | -------------------------------------------------------------------------------- /project-scripts/MarkdownGen.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # 3 | # Generates markdown files with links to all header files within a directory. 4 | # 5 | use strict; 6 | use warnings; 7 | use File::Find; 8 | use File::Slurp; 9 | use lib './project-scripts'; 10 | use Paths; 11 | 12 | my $projectDir = Paths::PROJECT_DIR; 13 | 14 | if ( (scalar @ARGV) < 2) 15 | { 16 | die("Usage: ./MarkdownGen.pl \"Path/To/Module/Dir\"" 17 | ." \"MarkdownOutput.md\"\n"); 18 | } 19 | my $moduleDir = $ARGV[0]; 20 | my $markdownFile = $ARGV[1]; 21 | my $moduleName = substr($moduleDir, rindex($moduleDir, '/') + 1); 22 | 23 | my $markdownText = "# $moduleName Module Documentation\n\n"; 24 | 25 | sub findFiles 26 | { 27 | my $fullPath = $File::Find::name; 28 | if ($fullPath =~ /^.+\.h$/) 29 | { 30 | my $relativePath = "../../".$fullPath; 31 | my $name = $_; 32 | $name = substr($name, 0, length($name) - 2); 33 | $name =~ s/_/::/g; 34 | $markdownText = $markdownText."#### [$name]($relativePath)\n\n"; 35 | } 36 | } 37 | find(\&findFiles, $moduleDir); 38 | write_file($markdownFile, $markdownText); 39 | -------------------------------------------------------------------------------- /project-scripts/TestCppGen.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # 3 | # Make .cpp test files for each header file in the project within a test 4 | # directory to test the CppGen.pl script. 5 | # 6 | use strict; 7 | use warnings; 8 | use File::Find; 9 | use File::Slurp; 10 | use lib './project-scripts'; 11 | use Paths; 12 | 13 | my $projectDir = Paths::PROJECT_DIR; 14 | my $sourceDir = "$projectDir/Source"; 15 | my $testDir = "$projectDir/project-scripts/cppTest"; 16 | 17 | my @commands; 18 | 19 | sub findModules 20 | { 21 | my $header = substr($File::Find::name, length($projectDir) + 1); 22 | if ($header =~ /^.+\.h$/) 23 | { 24 | my $cppFile = substr($File::Find::name, length($sourceDir)); 25 | $cppFile =~ s/\..*/.cpp/; 26 | $cppFile =~ s/\//-/g; 27 | $cppFile = $testDir.'/'.$cppFile; 28 | my $command = "./project-scripts/MakeCpp.pl $header $cppFile"; 29 | push(@commands, $command); 30 | } 31 | } 32 | find(\&findModules, $sourceDir); 33 | 34 | system("rm -r $testDir"); 35 | system("mkdir $testDir"); 36 | foreach my $command (@commands) 37 | { 38 | system($command); 39 | } 40 | 41 | -------------------------------------------------------------------------------- /makefiles/Password.mk: -------------------------------------------------------------------------------- 1 | ############################# Password Module ################################## 2 | PASSWORD_DIR = Source/GUI/Password 3 | 4 | PASSWORD_PREFIX = Password_ 5 | PASSWORD_OBJ := $(JUCE_OBJDIR)/$(PASSWORD_PREFIX) 6 | 7 | OBJECTS_PASSWORD := \ 8 | $(PASSWORD_OBJ)Password.o \ 9 | $(PASSWORD_OBJ)UpdateController.o \ 10 | $(PASSWORD_OBJ)RemovalController.o \ 11 | $(PASSWORD_OBJ)LoginScreen.o 12 | 13 | OBJECTS_PASSWORD_TEST := 14 | 15 | ifeq ($(BUILD_TESTS), 1) 16 | OBJECTS_PASSWORD := $(OBJECTS_PASSWORD) $(OBJECTS_PASSWORD_TEST) 17 | endif 18 | 19 | GUI_MODULES := $(GUI_MODULES) password 20 | 21 | OBJECTS_APP := $(OBJECTS_APP) $(OBJECTS_PASSWORD) 22 | 23 | password : $(OBJECTS_PASSWORD) 24 | @echo " Built Password module" 25 | 26 | $(PASSWORD_OBJ)Password.o : \ 27 | $(PASSWORD_DIR)/Password.cpp 28 | $(PASSWORD_OBJ)UpdateController.o : \ 29 | $(PASSWORD_DIR)/$(PASSWORD_PREFIX)UpdateController.cpp 30 | $(PASSWORD_OBJ)RemovalController.o : \ 31 | $(PASSWORD_DIR)/$(PASSWORD_PREFIX)RemovalController.cpp 32 | $(PASSWORD_OBJ)LoginScreen.o : \ 33 | $(PASSWORD_DIR)/$(PASSWORD_PREFIX)LoginScreen.cpp 34 | -------------------------------------------------------------------------------- /Source/GUI/Widgets/Widgets_TextEditor.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file Widgets_TextEditor.h 4 | * 5 | * @brief A juce::TextEditor that automatically scales its font size to match 6 | * its current height. 7 | */ 8 | 9 | #include "JuceHeader.h" 10 | 11 | namespace Widgets { class TextEditor; } 12 | 13 | /** 14 | * @brief A widget class that allows the user to input or edit text values, 15 | * displaying those values at an appropriate size to fit within the 16 | * object bounds. 17 | */ 18 | class Widgets::TextEditor : public juce::TextEditor 19 | { 20 | public: 21 | using juce::TextEditor::TextEditor; 22 | 23 | virtual ~TextEditor() { } 24 | 25 | private: 26 | /** 27 | * @brief Updates the font height, and immediately applies the change to 28 | * the edited text. 29 | * 30 | * @param newHeight The new font height to apply. 31 | */ 32 | void setFontHeight(const int newHeight); 33 | 34 | /** 35 | * @brief Updates internal text size to match changes to the component's 36 | * height. 37 | */ 38 | virtual void resized() override; 39 | }; 40 | -------------------------------------------------------------------------------- /Source/System/Wifi/Connection/Saved/Wifi_Connection_Saved_Deleter.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file Wifi_Connection_Saved_Deleter.h 3 | * 4 | * @brief Deletes saved network connections from the system. 5 | */ 6 | #include "Wifi_Module.h" 7 | 8 | namespace Wifi 9 | { 10 | class Resource; 11 | class AccessPoint; 12 | namespace Connection 13 | { 14 | namespace Saved 15 | { 16 | class Deleter; 17 | class Module; 18 | } 19 | } 20 | } 21 | 22 | /** 23 | * @brief Connects to the Connection::Saved::Module to delete saved 24 | * connections. 25 | */ 26 | class Wifi::Connection::Saved::Deleter : 27 | public SharedResource::Modular::Handler 28 | { 29 | public: 30 | Deleter(); 31 | 32 | virtual ~Deleter() { } 33 | 34 | /** 35 | * @brief Removes all saved network connections that match a particular 36 | * access point. 37 | * 38 | * @param toRemove The access point used to select saved connections to 39 | * delete. 40 | */ 41 | void removeSavedConnection(const AccessPoint toRemove) const; 42 | }; 43 | -------------------------------------------------------------------------------- /Source/Framework/SharedResource/Implementation/SharedResource_ReferenceInterface.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file SharedResource_ReferenceInterface.h 4 | * 5 | * @brief The interface shared by Reference and Instance objects to control 6 | * Reference access. 7 | */ 8 | #include "JuceHeader.h" 9 | 10 | namespace SharedResource { class ReferenceInterface; } 11 | 12 | /** 13 | * @brief The interface extended by the Reference class and used by Instance 14 | * objects to manage their connected Reference objects. 15 | */ 16 | class SharedResource::ReferenceInterface 17 | { 18 | public: 19 | virtual ~ReferenceInterface() { } 20 | 21 | protected: 22 | // Only the Reference and its Instance may access the lock. 23 | friend class Instance; 24 | 25 | /** 26 | * @brief Gets the lock used to control this Reference. 27 | * 28 | * This lock prevents the Reference from being destroyed while its 29 | * resource Instance is accessing it. 30 | * 31 | * @return The reference lock. 32 | */ 33 | juce::CriticalSection& getLock(); 34 | 35 | private: 36 | juce::CriticalSection lock; 37 | }; 38 | -------------------------------------------------------------------------------- /docs/modules/Assets.md: -------------------------------------------------------------------------------- 1 | # Assets Module Documentation 2 | The Assets module locates and loads application asset files. Default asset files are stored in /usr/share/pocket-home, but custom asset files may be loaded from other directories. 3 | 4 | #### [Assets](../../Source/Files/Assets/Assets.h) 5 | Assets provides functions to find and loads application asset files, preferring matches found in the default application data directory. Assets provides functions to load generic file objects, juce\::Image objects from image files, or juce\::var objects from JSON files. 6 | 7 | #### [Assets\::XDGDirectories](../../Source/Files/Assets/Assets_XDGDirectories.h) 8 | XDGDirectories follows the XDG base directory specification to determine the most appropriate directories to use when locating or saving different file types. 9 | 10 | #### [Assets\::JSONFile](../../Source/Files/Assets/Assets_JSONFile.h) 11 | JSONFile objects read from and write to a single JSON data file. All file data access is type checked. 12 | 13 | #### [Assets\::XPMLoader](../../Source/Files/Assets/Assets_XPMLoader.h) 14 | XPMLoader loads XPM image files into juce\::Image objects. 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Source/System/Wifi/Device/Wifi_Device_Controller.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file Wifi_Device_Controller.h 4 | * 5 | * @brief Sends basic commands to the Wifi device. 6 | */ 7 | 8 | #include "SharedResource_Modular_Handler.h" 9 | 10 | namespace Wifi 11 | { 12 | namespace Device 13 | { 14 | class Controller; 15 | class Module; 16 | } 17 | class Resource; 18 | } 19 | 20 | /** 21 | * @brief Accesses the wifi device module to turn Wifi on and off, and to make 22 | * the Wifi * device rescan visible access points. 23 | */ 24 | class Wifi::Device::Controller : 25 | public SharedResource::Modular::Handler 26 | { 27 | public: 28 | Controller(); 29 | 30 | virtual ~Controller() { } 31 | 32 | /** 33 | * @brief Enables or disables the Wifi device. 34 | * 35 | * @param enableWifi If true, Wifi will be enabled, if false, Wifi will be 36 | * disabled. 37 | */ 38 | void setEnabled(const bool enableWifi); 39 | 40 | /** 41 | * @brief Makes the Wifi device rescan nearby access points. 42 | */ 43 | void scanAccessPoints(); 44 | }; 45 | -------------------------------------------------------------------------------- /Source/System/Wifi/Device/Wifi_Device_Reader.cpp: -------------------------------------------------------------------------------- 1 | #define WIFI_IMPLEMENTATION 2 | #include "Wifi_Device_Reader.h" 3 | #include "Wifi_Device_Module.h" 4 | #include "Wifi_Resource.h" 5 | 6 | Wifi::Device::Reader::Reader() { } 7 | 8 | 9 | // Checks if the wifi device is enabled. 10 | bool Wifi::Device::Reader::wifiDeviceEnabled() const 11 | { 12 | SharedResource::Modular::LockedPtr deviceModule 13 | = getReadLockedResource(); 14 | return deviceModule->wifiDeviceEnabled(); 15 | 16 | } 17 | 18 | 19 | // Checks if a Wifi device managed by NetworkManager exists. 20 | bool Wifi::Device::Reader::wifiDeviceExists() const 21 | { 22 | SharedResource::Modular::LockedPtr deviceModule 23 | = getReadLockedResource(); 24 | return deviceModule->wifiDeviceExists(); 25 | } 26 | 27 | 28 | // Checks if wifi is currently being enabled or disabled. 29 | bool Wifi::Device::Reader::isDeviceStateChanging() const 30 | { 31 | SharedResource::Modular::LockedPtr deviceModule 32 | = getReadLockedResource(); 33 | return deviceModule->isDeviceStateChanging(); 34 | } 35 | -------------------------------------------------------------------------------- /Source/GUI/Layout/Transition/Layout_Transition_Type.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file Layout_Transition_Type.h 4 | * 5 | * @brief Lists the types of Component transition that can be created using 6 | * Layout::Transition::Animator functions. 7 | */ 8 | 9 | namespace Layout { namespace Transition { enum class Type; } } 10 | 11 | 12 | //Lists all available transition animations 13 | enum class Layout::Transition::Type 14 | { 15 | // Old items slide off the top of the window, new ones slide in from the 16 | // bottom. 17 | moveUp, 18 | // Old items slide off the bottom of the window, new ones slide in from the 19 | // top. 20 | moveDown, 21 | // Old items slide off the left side of the window, new ones slide in from 22 | // the right. 23 | moveLeft, 24 | // Old items slide off the right side of the window, new ones slide in from 25 | // the left. 26 | moveRight, 27 | // Old items are immediately removed, new items move from their current 28 | // bounds to their destination bounds. 29 | toDestination, 30 | // Old items are immediately replaced with new items without animating. 31 | none 32 | }; 33 | -------------------------------------------------------------------------------- /Source/GUI/Page/PageTypes/Page_WifiConnection.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file Page_WifiConnection.h 4 | * 5 | * @brief The application page used to control the active Wifi connection. 6 | */ 7 | 8 | #include "Page_Component.h" 9 | #include "Settings_WifiList_ListComponent.h" 10 | 11 | namespace Page { class WifiConnection; } 12 | 13 | /** 14 | * @brief A page component that contains the Wifi connection list. 15 | */ 16 | class Page::WifiConnection final : public Component 17 | { 18 | public: 19 | /** 20 | * @brief Initializes the page layout. 21 | */ 22 | WifiConnection(); 23 | 24 | virtual ~WifiConnection() { } 25 | 26 | private: 27 | 28 | /** 29 | * @brief Makes the page's back button deselect the active list item 30 | * instead of closing the page when an item in the connection list 31 | * is selected. 32 | * 33 | * @return Whether the default back button action was replaced. 34 | */ 35 | virtual bool overrideBackButton() override; 36 | 37 | // The list component used to view and control possible connections: 38 | Settings::WifiList::ListComponent connectionList; 39 | }; 40 | -------------------------------------------------------------------------------- /Source/System/Wifi/Connection/Control/Wifi_Connection_Control_Handler.cpp: -------------------------------------------------------------------------------- 1 | #define WIFI_IMPLEMENTATION 2 | #include "Wifi_Connection_Control_Handler.h" 3 | #include "Wifi_Connection_Control_Module.h" 4 | #include "Wifi_Resource.h" 5 | #include "Wifi_AccessPoint.h" 6 | #include "Wifi_LibNM_ActiveConnection.h" 7 | #include "Wifi_LibNM_ContextTest.h" 8 | 9 | namespace WifiConnect = Wifi::Connection; 10 | 11 | WifiConnect::Control::Handler::Handler() { } 12 | 13 | 14 | // Attempts to open a Wifi network connection point. 15 | void WifiConnect::Control::Handler::connectToAccessPoint 16 | (const AccessPoint toConnect, juce::String securityKey) 17 | { 18 | SharedResource::Modular::LockedPtr controller 19 | = getWriteLockedResource(); 20 | controller->connectToAccessPoint(toConnect, securityKey); 21 | } 22 | 23 | 24 | // Disconnects the active Wifi connection. If there is no active wifi 25 | // connection, no action is taken. 26 | void WifiConnect::Control::Handler::disconnect() 27 | { 28 | SharedResource::Modular::LockedPtr controller 29 | = getWriteLockedResource(); 30 | controller->disconnect(); 31 | } 32 | -------------------------------------------------------------------------------- /makefiles/Debug.mk: -------------------------------------------------------------------------------- 1 | ############################ Debug Module #################################### 2 | DEBUG_DIR = Source/Development/Debug 3 | DEBUG_TEST_DIR = Tests/Development/Debug 4 | 5 | DEBUG_PREFIX = Debug_ 6 | DEBUG_OBJ := $(JUCE_OBJDIR)/$(DEBUG_PREFIX) 7 | OBJECTS_DEBUG := \ 8 | $(DEBUG_OBJ)AddressLog.o \ 9 | $(DEBUG_OBJ)Component.o \ 10 | $(DEBUG_OBJ)ScopeTimer.o \ 11 | $(DEBUG_OBJ)ScopeTimerRecords.o 12 | 13 | DEBUG_DEBUG_PREFIX := $(DEBUG_PREFIX)Test_ 14 | DEBUG_DEBUG_OBJ := $(DEBUG_OBJ)Test_ 15 | OBJECTS_DEBUG_TEST := 16 | 17 | ifeq ($(BUILD_TESTS), 1) 18 | OBJECTS_DEBUG := $(OBJECTS_DEBUG) $(OBJECTS_DEBUG_TEST) 19 | endif 20 | 21 | DEVELOPMENT_MODULES := $(DEVELOPMENT_MODULES) debugging 22 | 23 | OBJECTS_APP := $(OBJECTS_APP) $(OBJECTS_DEBUG) 24 | 25 | debugging : $(OBJECTS_DEBUG) 26 | @echo " Built Debug module" 27 | 28 | $(DEBUG_OBJ)AddressLog.o: \ 29 | $(DEBUG_DIR)/$(DEBUG_PREFIX)AddressLog.cpp 30 | $(DEBUG_OBJ)Component.o: \ 31 | $(DEBUG_DIR)/$(DEBUG_PREFIX)Component.cpp 32 | $(DEBUG_OBJ)ScopeTimer.o: \ 33 | $(DEBUG_DIR)/$(DEBUG_PREFIX)ScopeTimer.cpp 34 | $(DEBUG_OBJ)ScopeTimerRecords.o: \ 35 | $(DEBUG_DIR)/$(DEBUG_PREFIX)ScopeTimerRecords.cpp 36 | -------------------------------------------------------------------------------- /Source/Framework/Util/Util_SafeCall.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file Util_SafeCall.h 3 | * 4 | * @brief Provides a template function for safely running asynchronous calls 5 | * on the JUCE message thread to update a component. 6 | */ 7 | 8 | #include "JuceHeader.h" 9 | 10 | namespace Util { namespace SafeCall { 11 | 12 | /** 13 | * @brief Asynchronously runs a function call on a component pointer on the 14 | * JUCE message thread unless the component is destroyed before the call 15 | * can run. 16 | * 17 | * @tparam ComponentType The juce::Component subclass of the component pointer. 18 | * 19 | * @param component The component pointer that the call will update. 20 | * 21 | * @param call A function that asynchronously updates the component. 22 | */ 23 | template 24 | void callAsync 25 | (ComponentType* component, const std::function call) 26 | { 27 | juce::Component::SafePointer safePtr(component); 28 | juce::MessageManager::callAsync([safePtr, call]() 29 | { 30 | if (ComponentType* componentPtr = safePtr.getComponent()) 31 | { 32 | call(componentPtr); 33 | } 34 | }); 35 | } 36 | 37 | } } 38 | -------------------------------------------------------------------------------- /Source/GUI/Page/PageTypes/Page_InputSettings.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file Page_InputSettings.h 4 | * 5 | * @brief Sets cursor visibility and opens screen calibration. 6 | */ 7 | 8 | #include "Page_Component.h" 9 | #include "Locale_TextUser.h" 10 | #include "Widgets_BoundedLabel.h" 11 | #include "Settings_CursorModePicker.h" 12 | #include "Settings_CalibrationButton.h" 13 | 14 | namespace Page { class InputSettings; } 15 | 16 | /** 17 | * @brief A Page class that provides control components to the user for 18 | * changing application input settings. 19 | */ 20 | class Page::InputSettings : public Page::Component, public Locale::TextUser 21 | { 22 | public: 23 | /** 24 | * @brief Loads the page layout on construction. 25 | */ 26 | InputSettings(); 27 | 28 | virtual ~InputSettings() { } 29 | 30 | private: 31 | // Page title label: 32 | Widgets::BoundedLabel titleLabel; 33 | 34 | // Sets cursor visibility: 35 | Widgets::BoundedLabel cursorModeLabel; 36 | Settings::CursorModePicker cursorModePicker; 37 | 38 | // Launches calibration application: 39 | Settings::CalibrationButton calibrateButton; 40 | 41 | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(InputSettings) 42 | }; 43 | -------------------------------------------------------------------------------- /Source/Framework/GLib/DBus/Variant/GLib_Variant.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file GLib/DBus/Variant/Variant.h 4 | * 5 | * @brief An incomplete container object for GLib's GVariant objects. 6 | */ 7 | 8 | namespace GLib { class Variant; } 9 | 10 | /** 11 | * @brief An immutable object that may be created to hold data using one of 12 | * many different data types. 13 | */ 14 | class GLib::Variant 15 | { 16 | enum class GVarType 17 | { 18 | boolean, 19 | byte, 20 | int16, 21 | uint16, 22 | int32, 23 | uint32, 24 | int64, 25 | uint64, 26 | handle, 27 | doubleFloat, 28 | string, 29 | objectPath, 30 | signature, 31 | variant, 32 | array, 33 | tuple, 34 | emptyTuple, 35 | dictEntry, 36 | dictionary, 37 | stringArray, 38 | objectPathArray, 39 | byteString, 40 | byteStringArray, 41 | varDict 42 | }; 43 | 44 | // template 45 | // bool isType() 46 | // 47 | // Type getType() 48 | // 49 | // template 50 | // StoredType getValue(StoredType defaultValue); 51 | // 52 | 53 | }; 54 | -------------------------------------------------------------------------------- /makefiles/Process.mk: -------------------------------------------------------------------------------- 1 | ############################### Process Module ################################# 2 | PROCESS_DIR = Source/System/Process 3 | PROCESS_TEST_DIR = Tests/System/Process 4 | 5 | PROCESS_PREFIX := Process_ 6 | PROCESS_OBJ := $(JUCE_OBJDIR)/$(PROCESS_PREFIX) 7 | 8 | OBJECTS_PROCESS := \ 9 | $(PROCESS_OBJ)State.o \ 10 | $(PROCESS_OBJ)Data.o \ 11 | $(PROCESS_OBJ)Launched.o \ 12 | $(PROCESS_OBJ)Launcher.o 13 | 14 | OBJECTS_PROCESS_TEST := \ 15 | $(PROCESS_OBJ)LaunchedTest.o 16 | 17 | ifeq ($(BUILD_TESTS), 1) 18 | OBJECTS_PROCESS := $(OBJECTS_PROCESS) $(OBJECTS_PROCESS_TEST) 19 | endif 20 | 21 | SYSTEM_MODULES := $(SYSTEM_MODULES) process 22 | 23 | OBJECTS_APP := $(OBJECTS_APP) $(OBJECTS_PROCESS) 24 | 25 | process : $(OBJECTS_PROCESS) 26 | @echo " Built Process module" 27 | 28 | $(PROCESS_OBJ)State.o : \ 29 | $(PROCESS_DIR)/$(PROCESS_PREFIX)State.cpp 30 | $(PROCESS_OBJ)Data.o : \ 31 | $(PROCESS_DIR)/$(PROCESS_PREFIX)Data.cpp 32 | $(PROCESS_OBJ)Launched.o : \ 33 | $(PROCESS_DIR)/$(PROCESS_PREFIX)Launched.cpp 34 | $(PROCESS_OBJ)Launcher.o : \ 35 | $(PROCESS_DIR)/$(PROCESS_PREFIX)Launcher.cpp 36 | 37 | # Tests: 38 | $(PROCESS_OBJ)LaunchedTest.o : \ 39 | $(PROCESS_TEST_DIR)/$(PROCESS_PREFIX)LaunchedTest.cpp 40 | -------------------------------------------------------------------------------- /Tests/Files/Config/Config_Test_Listener.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file Config_Test_Listener.h 4 | * 5 | * @brief A listener that tracks updates to the configTest.json file. 6 | */ 7 | 8 | #include "Config_Listener.h" 9 | 10 | namespace Config 11 | { 12 | namespace Test 13 | { 14 | class Resource; 15 | class Listener; 16 | } 17 | } 18 | 19 | /** 20 | * @brief Receives updates when relevant values change within the test 21 | * configuration file. 22 | */ 23 | class Config::Test::Listener : public Config::Listener 24 | { 25 | public: 26 | Listener(); 27 | virtual ~Listener() { } 28 | 29 | /** 30 | * @brief Gets the last updated key this listener received. 31 | * 32 | * @return The string value of the last updated key value the listener 33 | * received. 34 | */ 35 | juce::String getLastUpdated() const; 36 | 37 | private: 38 | /** 39 | * @brief Saves the updated key when the configuration file is updated. 40 | * 41 | * @param propertyKey The key to the updated property value. 42 | */ 43 | void configValueChanged(const juce::Identifier& propertyKey) override; 44 | 45 | const juce::Identifier* lastUpdated = nullptr; 46 | }; 47 | -------------------------------------------------------------------------------- /docs/templates/config/ExampleObject.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file ExampleObject.h 4 | * 5 | * @brief An example of a custom object data structure to load from a 6 | * configuration file. 7 | */ 8 | 9 | class ExampleObject 10 | { 11 | public: 12 | /** 13 | * @brief Constructs the example object, permanently setting its stored 14 | * data. Custom config objects don't need to be immutable, but it 15 | * simplifies things if they are. 16 | * 17 | * @param exampleNum An arbitrary stored int value used as an example. 18 | * 19 | * @param exampleBool An arbitrary stored boolean value used as an example. 20 | */ 21 | ExampleObject(const int exampleNum, const bool exampleBool); 22 | 23 | virtual ~ExampleObject() { } 24 | 25 | /** 26 | * @brief Gets the custom object's stored integer value. 27 | * 28 | * @return The object's integer value. 29 | */ 30 | int getExampleNum() const; 31 | 32 | /** 33 | * @brief Gets the custom object's stored boolean value. 34 | * 35 | * @return The object's boolean value. 36 | */ 37 | bool getExampleBool() const; 38 | 39 | private: 40 | const int exampleNum; 41 | const bool exampleBool; 42 | }; 43 | -------------------------------------------------------------------------------- /makefiles/Assets.mk: -------------------------------------------------------------------------------- 1 | ############################ Assets Module #################################### 2 | ASSETS_DIR = Source/Files/Assets 3 | ASSETS_TEST_DIR = Tests/Files/Assets 4 | 5 | ASSETS_PREFIX = Assets_ 6 | ASSETS_OBJ := $(JUCE_OBJDIR)/$(ASSETS_PREFIX) 7 | 8 | OBJECTS_ASSETS := \ 9 | $(ASSETS_OBJ)Assets.o \ 10 | $(ASSETS_OBJ)JSONFile.o \ 11 | $(ASSETS_OBJ)XDGDirectories.o \ 12 | $(ASSETS_OBJ)XPMLoader.o 13 | 14 | ASSETS_TEST_PREFIX := $(ASSETS_PREFIX)Test_ 15 | ASSETS_TEST_OBJ := $(ASSETS_OBJ)Test_ 16 | OBJECTS_ASSETS_TEST := $(ASSETS_OBJ)XpmTest.o 17 | 18 | ifeq ($(BUILD_TESTS), 1) 19 | OBJECTS_ASSETS := $(OBJECTS_ASSETS) $(OBJECTS_ASSETS_TEST) 20 | endif 21 | 22 | FILE_MODULES := $(FILE_MODULES) assets 23 | 24 | OBJECTS_APP := $(OBJECTS_APP) $(OBJECTS_ASSETS) 25 | 26 | assets : $(OBJECTS_ASSETS) 27 | @echo " Built Assets module" 28 | 29 | $(ASSETS_OBJ)Assets.o : \ 30 | $(ASSETS_DIR)/Assets.cpp 31 | $(ASSETS_OBJ)JSONFile.o : \ 32 | $(ASSETS_DIR)/$(ASSETS_PREFIX)JSONFile.cpp 33 | $(ASSETS_OBJ)XDGDirectories.o : \ 34 | $(ASSETS_DIR)/$(ASSETS_PREFIX)XDGDirectories.cpp 35 | $(ASSETS_OBJ)XPMLoader.o : \ 36 | $(ASSETS_DIR)/$(ASSETS_PREFIX)XPMLoader.cpp 37 | 38 | $(ASSETS_OBJ)XpmTest.o: \ 39 | $(ASSETS_TEST_DIR)/$(ASSETS_PREFIX)XpmTest.cpp 40 | -------------------------------------------------------------------------------- /Source/Files/DesktopEntry/Exceptions/DesktopEntry_FileError.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file DesktopEntry_FileError.h 4 | * 5 | * @brief Helps prevent errors caused by malformed desktop entry files. 6 | */ 7 | 8 | #include "JuceHeader.h" 9 | #include 10 | 11 | namespace DesktopEntry { struct FileError; } 12 | 13 | /** 14 | * @brief Signals that a desktop entry file is invalid. 15 | */ 16 | struct DesktopEntry::FileError : public std::exception 17 | { 18 | public: 19 | /** 20 | * @brief Creates a new exception for an invalid desktop entry file. 21 | * 22 | * @param file The invalid file being read. 23 | * 24 | * @param error A brief description of the problem encountered. 25 | */ 26 | FileError(const juce::File& file, const juce::String error) : 27 | errorMessage(file.getFullPathName() + ": " + error) { } 28 | 29 | /** 30 | * @brief Gets a string describing the error. 31 | * 32 | * @return A string containing the file's path and a short description of 33 | * the file error. 34 | */ 35 | virtual const char* what() const noexcept override 36 | { 37 | return errorMessage.toRawUTF8(); 38 | } 39 | 40 | private: 41 | juce::String errorMessage; 42 | }; 43 | -------------------------------------------------------------------------------- /Source/Files/Icon/Types/Icon_Context.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file Icon_Context.h 4 | * 5 | * @brief Describes the purpose of an icon directory. 6 | */ 7 | 8 | namespace Icon { enum class Context; } 9 | 10 | /** 11 | * @brief Describes the purpose of an icon directory. 12 | */ 13 | enum class Icon::Context 14 | { 15 | // Icons used in menus and dialogs for user interaction: 16 | actions, 17 | // Animated images used to represent background processing: 18 | animations, 19 | // Icons representing individual applications: 20 | applications, 21 | // Icons representing application categories: 22 | categories, 23 | // Icons representing hardware devices: 24 | devices, 25 | // Icons for tags and file properties(e.g. "read-only", "photos"): 26 | emblems, 27 | // Icons for emoticons used in text/messenger applications: 28 | emotes, 29 | // Different national flags, etc.: 30 | international, 31 | //Icons for specific data types(e.g. "audio", "image") 32 | mimeTypes, 33 | // Icons representing file locations: 34 | places, 35 | // Icons for presenting statuses to the user, such as error icons: 36 | status, 37 | // Icon directory has a missing or unexpected context value: 38 | unknown 39 | }; 40 | -------------------------------------------------------------------------------- /Source/GUI/AppMenu/Components/Editors/AppMenu_CategoryEditor.cpp: -------------------------------------------------------------------------------- 1 | #define APPMENU_IMPLEMENTATION 2 | #include "AppMenu_CategoryEditor.h" 3 | 4 | // Localized object class key: 5 | static const juce::Identifier localeClassKey = "AppMenu::CategoryEditor"; 6 | 7 | // Localized text value key: 8 | static const juce::Identifier editCategoryTitleKey = "editCategoryTitle"; 9 | 10 | // Creates a new category editor, setting the initial categories and the 11 | // confirmation callback function. 12 | AppMenu::CategoryEditor::CategoryEditor(juce::StringArray categories, 13 | std::function onConfirm) : 14 | Locale::TextUser(localeClassKey), 15 | Widgets::PopupEditor( [this, onConfirm](Widgets::PopupEditor* thisPopup) 16 | { 17 | onConfirm(categoryList.getListItems()); 18 | }), 19 | categoryList(categories) 20 | { 21 | #if JUCE_DEBUG 22 | setName("AppMenu::CategoryEditor"); 23 | #endif 24 | setEditorTitle(localeText(editCategoryTitleKey)); 25 | 26 | using namespace Layout::Group; 27 | RelativeLayout layout({ 28 | Row(40, 29 | { 30 | RowItem(&categoryList, 10) 31 | }) 32 | } 33 | ); 34 | layout.setXMarginFraction(0.03); 35 | layout.setYMarginFraction(0.03); 36 | setLayout(layout); 37 | } 38 | 39 | -------------------------------------------------------------------------------- /Source/System/Wifi/APList/Wifi_APList_UpdateInterface.h: -------------------------------------------------------------------------------- 1 | #ifndef WIFI_IMPLEMENTATION 2 | #error File included directly outside of Wifi module implementation. 3 | #endif 4 | #pragma once 5 | /** 6 | * @file Wifi_APList_UpdateInterface.h 7 | * 8 | * @brief The interface used by the Wifi::APList::Module to update all 9 | * Wifi::APList::Listener objects when access points are added or 10 | * removed. 11 | */ 12 | 13 | namespace Wifi 14 | { 15 | namespace APList { class UpdateInterface; } 16 | class AccessPoint; 17 | } 18 | 19 | /** 20 | * @brief An abstract interface used for sending access point list updates. 21 | */ 22 | class Wifi::APList::UpdateInterface 23 | { 24 | public: 25 | UpdateInterface() { } 26 | 27 | virtual ~UpdateInterface() { } 28 | 29 | /** 30 | * @brief Signals that a new access point was discovered. 31 | * 32 | * @param newAP The new Wifi::AccessPoint object. 33 | */ 34 | virtual void accessPointAdded(const AccessPoint newAP) = 0; 35 | 36 | /** 37 | * @brief Signals that a tracked access point was lost. 38 | * 39 | * @param removedAP The Wifi::AccessPoint that is no longer visible. 40 | */ 41 | virtual void accessPointRemoved(const AccessPoint removedAP) = 0; 42 | }; 43 | -------------------------------------------------------------------------------- /Source/System/Windows/Windows_FocusTracker.cpp: -------------------------------------------------------------------------------- 1 | #include "Windows_FocusTracker.h" 2 | #include "Windows_FocusInterface.h" 3 | 4 | // SharedResource object key: 5 | const juce::Identifier Windows::FocusTracker::resourceKey 6 | = "Windows::FocusTracker"; 7 | 8 | Windows::FocusTracker::FocusTracker() : 9 | SharedResource::Resource(resourceKey) { } 10 | 11 | 12 | // Checks if the main application window is focused. 13 | bool Windows::FocusTracker::getFocusState() const 14 | { 15 | return isFocused; 16 | } 17 | 18 | 19 | // Updates whether the main application window is currently focused. 20 | void Windows::FocusTracker::setFocusState 21 | (const bool windowFocused, const bool notifyListeners) 22 | { 23 | if (windowFocused != isFocused) 24 | { 25 | isFocused = windowFocused; 26 | if (notifyListeners) 27 | { 28 | foreachHandler( 29 | [this](FocusInterface* focusListener) 30 | { 31 | if (isFocused) 32 | { 33 | focusListener->windowFocusGained(); 34 | } 35 | else 36 | { 37 | focusListener->windowFocusLost(); 38 | } 39 | }); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Source/Framework/GLib/SmartPointers/GLib_ErrorPtr.cpp: -------------------------------------------------------------------------------- 1 | #include "GLib_ErrorPtr.h" 2 | 3 | // Creates an error pointer, optionally setting a custom error handling 4 | // function. 5 | GLib::ErrorPtr::ErrorPtr(std::function errorHandler) : 6 | errorHandler(errorHandler) { } 7 | 8 | 9 | // Creates an error pointer to manage an existing error value. 10 | GLib::ErrorPtr::ErrorPtr(GError* error) : error(error), 11 | errorHandler([](GError* error) 12 | { 13 | DBG("Error: " << juce::String(error->message)); 14 | }) { } 15 | 16 | 17 | // Handles and frees the stored error structure if it is non-null. 18 | GLib::ErrorPtr::~ErrorPtr() 19 | { 20 | handleError(); 21 | } 22 | 23 | 24 | // Gets the address of the internal GError pointer, so that GLib functions may 25 | // assign an error structure to it. 26 | GError** GLib::ErrorPtr::getAddress() 27 | { 28 | return &error; 29 | } 30 | 31 | 32 | // If the stored error value is non-null, the error value will be passed to the 33 | // errorHandler function, freed, and set to nullptr. 34 | void GLib::ErrorPtr::handleError() 35 | { 36 | if (error != nullptr) 37 | { 38 | if (errorHandler) 39 | { 40 | errorHandler(error); 41 | } 42 | g_clear_error(&error); 43 | } 44 | } 45 | 46 | -------------------------------------------------------------------------------- /Source/GUI/Widgets/Widgets_DelayedIconSlider.cpp: -------------------------------------------------------------------------------- 1 | #include "Widgets_DelayedIconSlider.h" 2 | 3 | // Sets the displayed images and update frequency on construction. 4 | Widgets::DelayedIconSlider::DelayedIconSlider 5 | (const juce::Identifier& imageKey, const int updateFrequency) : 6 | IconSlider(imageKey), 7 | updateFrequency(updateFrequency) 8 | { 9 | addListener(this); 10 | } 11 | 12 | 13 | // Cancels the slider timer when visibility is lost. 14 | void Widgets::DelayedIconSlider::visibilityChanged() 15 | { 16 | if (!isVisible()) 17 | { 18 | stopTimer(); 19 | } 20 | } 21 | 22 | 23 | // Periodically calls valueChanged while the slider is dragged. 24 | void Widgets::DelayedIconSlider::timerCallback() 25 | { 26 | valueChanged(getValue()); 27 | startTimer(updateFrequency); 28 | } 29 | 30 | 31 | // Starts a timer to update the slider values as its being dragged. 32 | void Widgets::DelayedIconSlider::sliderDragStarted(juce::Slider* slider) 33 | { 34 | if (!isTimerRunning()) 35 | { 36 | startTimer(updateFrequency); 37 | } 38 | } 39 | 40 | 41 | // Stops the timer and immediately updates slider values. 42 | void Widgets::DelayedIconSlider::sliderDragEnded(juce::Slider* slider) 43 | { 44 | stopTimer(); 45 | valueChanged(getValue()); 46 | } 47 | -------------------------------------------------------------------------------- /Source/System/Windows/Windows_Info.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file Windows_Info.h 4 | * 5 | * @brief Provides functions for getting information about the main 6 | * application window. 7 | */ 8 | 9 | namespace juce { template class Rectangle; } 10 | 11 | namespace Windows 12 | { 13 | namespace Info 14 | { 15 | /** 16 | * @brief Gets the size of the main application window. 17 | * 18 | * @return The bounds of the application window, measured in pixels. 19 | */ 20 | juce::Rectangle getBounds(); 21 | 22 | /** 23 | * @brief Gets the width of the main application window. 24 | * 25 | * @return The application window width, measured in pixels. 26 | */ 27 | int getWidth(); 28 | 29 | /** 30 | * @brief Gets the height of the main application window. 31 | * 32 | * @return The application window height, measured in pixels. 33 | */ 34 | int getHeight(); 35 | 36 | /** 37 | * @brief Checks if the window is in portrait mode. 38 | * 39 | * @return Whether the window's width is less than its height. 40 | */ 41 | bool inPortraitMode(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Source/Development/Testing/Testing_DelayUtils.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "JuceHeader.h" 3 | 4 | /** 5 | * @file Testing_DelayUtils.h 6 | * 7 | * @brief Handles tests that require waiting until some particular event is 8 | * true. 9 | */ 10 | namespace Testing { class DelayUtils; } 11 | 12 | /** 13 | * @brief Provides the static idleUntil function used to run the JUCE event 14 | * loop until some condition is met or times out. 15 | */ 16 | class Testing::DelayUtils 17 | { 18 | public: 19 | /** 20 | * @brief Runs the juce dispatch loop until an expected condition is true. 21 | * 22 | * @param waitCondition Tests if the expected condition is true yet. 23 | * 24 | * @param testFrequencyMS Milliseconds to wait between tests of the 25 | * expected condition. 26 | * 27 | * @param timeoutMS Milliseconds to wait before assuming the 28 | * condition will never be met. 29 | * 30 | * @return Whether waitCondition returned true before the 31 | * timeout period ended. 32 | */ 33 | static bool idleUntil(const std::function waitCondition, 34 | int testFrequencyMS, int timeoutMS); 35 | }; 36 | 37 | -------------------------------------------------------------------------------- /assets/commands.json: -------------------------------------------------------------------------------- 1 | { 2 | "POCKET_HOME_SCRIPTS" : "/usr/share/pocket-home/scripts", 3 | 4 | "shutdown" : "systemctl poweroff", 5 | "restart" : "systemctl reboot", 6 | "sleep" : "xset dpms force off", 7 | "wake" : "xset dpms force on", 8 | "calibrate" : "POCKET_HOME_SCRIPTS/calibrate.sh", 9 | "set volume" : "amixer sset 'Power Amplifier'", 10 | "set brightness" : "POCKET_HOME_SCRIPTS/setBrightness.sh", 11 | 12 | "sleep check" : "POCKET_HOME_SCRIPTS/sleepCheck.sh", 13 | "command check" : "command -v", 14 | "set password" : "pkexec POCKET_HOME_SCRIPTS/passwordManager.sh", 15 | 16 | "get volume" : "POCKET_HOME_SCRIPTS/printVolume.sh", 17 | "get battery percent" : "cat /usr/lib/pocketchip-batt/gauge", 18 | "get brightness" : "cat /sys/class/backlight/backlight/brightness", 19 | 20 | "get local IP" : "POCKET_HOME_SCRIPTS/printLocalIP.sh", 21 | "get public IP" : "POCKET_HOME_SCRIPTS/printPublicIP.sh", 22 | 23 | "find battery" : "POCKET_HOME_SCRIPTS/batteryCheck.sh", 24 | "get battery percent" : "POCKET_HOME_SCRIPTS/batteryPercent.sh", 25 | "is battery charging" : "POCKET_HOME_SCRIPTS/batteryCharging.sh" 26 | } 27 | -------------------------------------------------------------------------------- /docs/Libraries.md: -------------------------------------------------------------------------------- 1 | # Project Libraries 2 | This page will hold documentation links for major libraries used by this project, along with brief descriptions of their role in this project. 3 | 4 | ## [JUCE](https://docs.juce.com/master/index.html) 5 | The JUCE Library is the framework this project is built upon. Pocket-Home Bismuth uses the JUCE Library's GUI system, event handling, thread handling, unit test system, and innumerable other features. 6 | 7 | ## [libnm-glib](https://developer.gnome.org/libnm-glib/stable/) 8 | Libnm-glib connects with NetworkManager to monitor network connection status and to provide network connection controls. Pocket-Home Bismuth uses libnm-glib to implement its [Wifi connection module](./modules/Wifi.md). This library is deprecated, but still in use because the PocketCHIP's Debian Jesse repositories lack the updated libnm library. 9 | 10 | ## [GLib](https://developer.gnome.org/glib/) 11 | GLib provides a large collection of basic tools used to implement other libraries and applications, including libnm-glib. Pocket-Home Bismuth uses GLib's object and event systems to work with LibNM, and its D-Bus communication tools to handle additional inter-process communication with NetworkManager. This project's [GLib module](./modules/GLib.md) exists to simplify interaction with the GLib library. 12 | -------------------------------------------------------------------------------- /makefiles/Hardware.mk: -------------------------------------------------------------------------------- 1 | ########################## Hardware Module ################################### 2 | HARDWARE_DIR = Source/System/Hardware 3 | HARDWARE_TEST_DIR = Tests/System/Hardware 4 | 5 | HARDWARE_PREFIX = Hardware_ 6 | HARDWARE_OBJ := $(JUCE_OBJDIR)/$(HARDWARE_PREFIX) 7 | 8 | OBJECTS_HARDWARE := \ 9 | $(HARDWARE_OBJ)Audio.o \ 10 | $(HARDWARE_OBJ)Battery.o \ 11 | $(HARDWARE_OBJ)Display.o 12 | ifeq ($(CHIP_FEATURES), 1) 13 | OBJECTS_HARDWARE := $(OBJECTS_HARDWARE) $(HARDWARE_OBJ)I2CBus.o 14 | endif 15 | 16 | HARDWARE_TEST_PREFIX := $(HARDWARE_PREFIX)Test_ 17 | HARDWARE_TEST_OBJ := $(HARDWARE_OBJ)Test_ 18 | OBJECTS_HARDWARE_TEST := 19 | 20 | ifeq ($(BUILD_TESTS), 1) 21 | OBJECTS_HARDWARE := $(OBJECTS_HARDWARE) $(OBJECTS_HARDWARE_TEST) 22 | endif 23 | 24 | SYSTEM_MODULES := $(SYSTEM_MODULES) hardware 25 | 26 | OBJECTS_APP := $(OBJECTS_APP) $(OBJECTS_HARDWARE) 27 | 28 | hardware : $(OBJECTS_HARDWARE) 29 | @echo " Built Hardware module" 30 | 31 | $(HARDWARE_OBJ)Audio.o : \ 32 | $(HARDWARE_DIR)/$(HARDWARE_PREFIX)Audio.cpp 33 | $(HARDWARE_OBJ)Battery.o : \ 34 | $(HARDWARE_DIR)/$(HARDWARE_PREFIX)Battery.cpp 35 | $(HARDWARE_OBJ)Display.o : \ 36 | $(HARDWARE_DIR)/$(HARDWARE_PREFIX)Display.cpp 37 | $(HARDWARE_OBJ)I2CBus.o : \ 38 | $(HARDWARE_DIR)/$(HARDWARE_PREFIX)I2CBus.cpp 39 | -------------------------------------------------------------------------------- /Source/System/Hardware/Hardware_Audio.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file Hardware_Audio.h 4 | * 5 | * @brief Provides functions for initializing system audio and viewing/changing 6 | * system volume. 7 | */ 8 | 9 | namespace Hardware 10 | { 11 | namespace Audio 12 | { 13 | #ifdef CHIP_FEATURES 14 | /** 15 | * @brief Opens a connection to Alsa audio. 16 | * 17 | * This is used as a quick fix to a PocketCHIP bug where touch screen 18 | * presses cause buzzing when no application has opened Alsa. 19 | * 20 | * @return Whether the Alsa connection was successfully initialized. 21 | */ 22 | bool chipAudioInit(); 23 | #endif 24 | 25 | /** 26 | * @brief Gets the system's volume level. 27 | * 28 | * @return The system audio volume level, as a percentage of the 29 | * maximum volume. 30 | */ 31 | int getVolumePercent(); 32 | 33 | /** 34 | * @brief Changes the system audio volume level. 35 | * 36 | * @param volumePercent The volume level, which will be constrained to 37 | * values between 0 and 100. 38 | */ 39 | void setVolume(const int volumePercent); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /assets/bluetooth.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name" : "Keyboard", 4 | "mac" : "62:c8:47:50:35:00", 5 | "connected" : true, 6 | "paired" : true 7 | }, 8 | { 9 | "name": "Mouse", 10 | "mac" : "62:c1:47:50:35:00", 11 | "connected" : true, 12 | "paired" : true 13 | }, 14 | { 15 | "name": "Speaker", 16 | "mac" : "62:c4:47:50:35:00", 17 | "connected" : false, 18 | "paired" : false 19 | }, 20 | { 21 | "name": "Game Controller", 22 | "mac" : "62:c5:43:50:35:00", 23 | "connected" : false, 24 | "paired" : false 25 | }, 26 | { 27 | "name": "Headset", 28 | "mac" : "62:c5:41:50:35:00", 29 | "connected" : false, 30 | "paired" : false 31 | }, 32 | { 33 | "name": "Refrigerator", 34 | "mac" : "62:c5:40:50:35:00", 35 | "connected" : false, 36 | "paired" : false 37 | }, 38 | { 39 | "name": "Toaster", 40 | "mac" : "62:c5:27:50:35:00", 41 | "connected" : false, 42 | "paired" : false 43 | }, 44 | { 45 | "name": "Drone", 46 | "mac" : "62:c5:07:50:35:00", 47 | "connected" : false, 48 | "paired" : false 49 | }, 50 | { 51 | "name": "Massager", 52 | "mac" : "62:c5:11:50:35:00", 53 | "connected" : false, 54 | "paired" : false 55 | } 56 | ] 57 | -------------------------------------------------------------------------------- /project-scripts/TestClassGen.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # 3 | # Generates empty unit test classes for project source files. 4 | # 5 | # Use: ./TestGen.pl "path/in/Source/dir/to/file.cpp" "Test Category Name" 6 | 7 | use strict; 8 | use warnings; 9 | use File::Slurp; 10 | use lib './project-scripts'; 11 | use Paths; 12 | 13 | my $projectRoot = Paths::PROJECT_DIR; 14 | 15 | my $path = $ARGV[0] or die "Missing source file path!\n"; 16 | my $category = $ARGV[1] or die "Missing test category!\n"; 17 | my $className; 18 | if ($path =~ /\/(.+)\.cpp$/) 19 | { 20 | $className = $1; 21 | } 22 | else 23 | { 24 | die "Failed to parse classname from file path $path\n"; 25 | } 26 | my $testClassName = $className."Test"; 27 | my $header = $path; 28 | $header =~ s/cpp/h/; 29 | 30 | my $testFile = qq 31 | [#include "JuceHeader.h" 32 | #include "$header" 33 | 34 | class $testClassName : public juce::UnitTest 35 | { 36 | public: 37 | $testClassName() : juce::UnitTest("$category\::$className Testing", 38 | "$category") {} 39 | 40 | void runTest() override 41 | { 42 | } 43 | }; 44 | 45 | static $testClassName test; 46 | ]; 47 | 48 | my $subDir = $path; 49 | $subDir =~ s/^.*Source\///; 50 | my $testPath = "$projectRoot/Tests/$subDir"; 51 | write_file($testPath, $testFile) or die "Failed to write to $testPath\n"; 52 | -------------------------------------------------------------------------------- /Source/Framework/Util/Util_Math.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file Util_Math.h 4 | * 5 | * @brief Provides miscellaneous mathematical functions. 6 | */ 7 | 8 | namespace Util 9 | { 10 | namespace Math 11 | { 12 | /** 13 | * @brief Finds the median of three values. 14 | * 15 | * @param a The first of the values to compare. 16 | * 17 | * @param b The second of the values to compare. 18 | * 19 | * @param c The third of the values to compare. 20 | * 21 | * @tparam T The compared value type. 22 | * 23 | * @return The median of a, b, and c. 24 | */ 25 | template 26 | T median(const T a, const T b, const T c) 27 | { 28 | if (a > b) 29 | { 30 | if (b > c) 31 | { 32 | return b; 33 | } 34 | if (a < c) 35 | { 36 | return a; 37 | } 38 | return c; 39 | } 40 | if (a > c) 41 | { 42 | return a; 43 | } 44 | if (b < c) 45 | { 46 | return b; 47 | } 48 | return c; 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /docs/userGuide/wifi.md: -------------------------------------------------------------------------------- 1 | # Wifi Connection Page 2 | 3 | ![Wifi Page Guide](../images/screenshots/pages/wifiList.png?raw=true "Wifi page guide") 4 | 1. Closes the page, returning to the [quick settings page](./quickSettings.md). 5 | 2. The list of visible Wifi access points. Clicking any of these access points will open Wifi connection controls. 6 | 7 | #### New Access Point Controls 8 | ![New Access Point](../images/screenshots/wifi/new.png?raw=true "New AP guide") 9 | 1. Closes connection controls and shows the main access point list. 10 | 2. Enter the Wifi connection password here. 11 | 3. Toggles between showing and hiding the contents of the password field. 12 | 4. Attempts to connect to the access point using the provided password. 13 | 14 | #### Saved Access Point Controls 15 | ![Saved Access Point](../images/screenshots/wifi/saved.png?raw=true "Saved AP guide") 16 | 1. Closes connection controls and shows the main access point list. 17 | 2. Deletes all saved connections associated with this access point. 18 | 3. Connects to the access point using saved connection data. 19 | 20 | #### Connected Access Point Controls 21 | ![Connected Access Point](../images/screenshots/wifi/connected.png?raw=true "Connected AP guide") 22 | 1. Closes connection controls and shows the main access point list. 23 | 2. Disconnects from the connected access point. 24 | -------------------------------------------------------------------------------- /Source/System/Wifi/APList/Wifi_APList_Reader.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file Wifi_APList_Reader.h 4 | * 5 | * @brief Reads the list of visible Wifi access points. 6 | */ 7 | 8 | #include "SharedResource_Modular_Handler.h" 9 | 10 | namespace Wifi 11 | { 12 | namespace APList 13 | { 14 | class Reader; 15 | class Module; 16 | } 17 | class Resource; 18 | class AccessPoint; 19 | namespace LibNM { class APHash; } 20 | } 21 | 22 | /** 23 | * @brief Connects to the APList::Module to read access point list data. 24 | */ 25 | class Wifi::APList::Reader : 26 | public SharedResource::Modular::Handler 27 | { 28 | public: 29 | Reader(); 30 | 31 | virtual ~Reader() { } 32 | 33 | /** 34 | * @brief Gets Wifi::AccessPoint objects for all visible access points. 35 | * 36 | * @return The entire list of visible access points. 37 | */ 38 | juce::Array getAccessPoints() const; 39 | 40 | /** 41 | * @brief Finds a single Wifi::AccessPoint using its hash value. 42 | * 43 | * @param apHash An access point hash value. 44 | * 45 | * @return The matching AccessPoint, or a null AccessPoint if no 46 | * match is found. 47 | */ 48 | AccessPoint getAccessPoint(LibNM::APHash apHash) const; 49 | }; 50 | -------------------------------------------------------------------------------- /Source/GUI/Info/Info_SignalIcon.cpp: -------------------------------------------------------------------------------- 1 | #include "Info_SignalIcon.h" 2 | #include "Theme_Image_JSONKeys.h" 3 | 4 | // Initializes the icon with the image assets defined in the image 5 | // configuration file. 6 | Info::SignalIcon::SignalIcon() : 7 | Theme::Image::Component<>(Theme::Image::JSONKeys::signalIcon) { } 8 | 9 | /** 10 | * @brief All signal state icon images. 11 | * 12 | * Each should correspond to an image asset file defined in components.json. 13 | */ 14 | enum class ImageAsset 15 | { 16 | off, 17 | strength0, 18 | strength1, 19 | strength2, 20 | strength3 21 | }; 22 | 23 | // Updates the Wifi signal icon to represent a new signal strength. 24 | void Info::SignalIcon::setSignalStrengthImage 25 | (const unsigned int signalStrength) 26 | { 27 | const int minStrengthIdx = (int) ImageAsset::strength0; 28 | const int maxStrengthIdx = (int) ImageAsset::strength3; 29 | const int numStrengthImages = 1 + maxStrengthIdx - minStrengthIdx; 30 | const int strengthIndex = std::min(maxStrengthIdx, 31 | minStrengthIdx + signalStrength / (100 / numStrengthImages)); 32 | setImageAssetIndex(strengthIndex); 33 | } 34 | 35 | 36 | // Updates the Wifi signal icon to show that Wifi is disabled. 37 | void Info::SignalIcon::setDisabledImage() 38 | { 39 | setImageAssetIndex((int) ImageAsset::off); 40 | } 41 | -------------------------------------------------------------------------------- /Source/GUI/Settings/Settings_HomeBackgroundPicker.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file Settings_HomeBackgroundPicker.h 4 | * 5 | * @brief Provides UI controls for selecting the HomePage background image. 6 | */ 7 | 8 | #include "Widgets_FilePathEditor.h" 9 | #include "Theme_Image_ConfigFile.h" 10 | 11 | namespace Settings { class HomeBackgroundPicker; } 12 | 13 | /** 14 | * @brief A file selection widget that saves a user-selected image path as the 15 | * HomePage background image. 16 | */ 17 | class Settings::HomeBackgroundPicker : public Widgets::FilePathEditor, 18 | public Widgets::FilePathEditor::Listener 19 | { 20 | public: 21 | /** 22 | * @brief Loads the saved background image as the editor's initial value. 23 | */ 24 | HomeBackgroundPicker(); 25 | 26 | virtual ~HomeBackgroundPicker() { } 27 | 28 | private: 29 | /** 30 | * @brief Updates the selected image when a new file is selected. 31 | * 32 | * @param thisEditor The updated editor. This should always be the 33 | * HomeBackgroundPicker. 34 | */ 35 | virtual void fileSelected(Widgets::FilePathEditor* thisEditor) override; 36 | 37 | // Reads and writes the background image, and ensures the image JSON file 38 | // resource remains available. 39 | Theme::Image::ConfigFile imageConfig; 40 | }; 41 | -------------------------------------------------------------------------------- /JuceLibraryCode/JuceHeader.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | This is the header file that your files should include in order to get all the 7 | JUCE library headers. You should avoid including the JUCE headers directly in 8 | your own source files, because that wouldn't pick up the correct configuration 9 | options for your app. 10 | 11 | */ 12 | 13 | #pragma once 14 | 15 | #include "AppConfig.h" 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | #include "BinaryData.h" 24 | 25 | #if ! DONT_SET_USING_JUCE_NAMESPACE 26 | // If your code uses a lot of JUCE classes, then this will obviously save you 27 | // a lot of typing, but can be disabled by setting DONT_SET_USING_JUCE_NAMESPACE. 28 | using namespace juce; 29 | #endif 30 | 31 | #if ! JUCE_DONT_DECLARE_PROJECTINFO 32 | namespace ProjectInfo 33 | { 34 | const char* const projectName = "pocket-home"; 35 | const char* const versionString = "0.1.1"; 36 | const int versionNumber = 0x80c; 37 | } 38 | #endif 39 | -------------------------------------------------------------------------------- /Source/GUI/Widgets/Widgets_TextEditor.cpp: -------------------------------------------------------------------------------- 1 | #include "Widgets_TextEditor.h" 2 | #include "Layout_Component_ConfigFile.h" 3 | #include "Layout_Component_TextSize.h" 4 | 5 | // Minimum fraction of extra space to leave between edited text and component 6 | // bounds: 7 | static const constexpr float minPadding = 0.1; 8 | 9 | // Updates the font height, and immediately applies the change to the edited 10 | // text. 11 | void Widgets::TextEditor::setFontHeight(const int newHeight) 12 | { 13 | juce::Font newFont(newHeight); 14 | applyFontToAllText(newFont, true); 15 | } 16 | 17 | 18 | // Update internal text size to match changes to the component's height. 19 | void Widgets::TextEditor::resized() 20 | { 21 | juce::TextEditor::resized(); 22 | const int minHeight = getHeight() - getHeight() * minPadding; 23 | 24 | using namespace Layout::Component; 25 | ConfigFile layoutConfig; 26 | const juce::Array sizes = 27 | { 28 | TextSize::largeText, 29 | TextSize::mediumText, 30 | TextSize::smallText 31 | }; 32 | 33 | for (const TextSize& sizeType : sizes) 34 | { 35 | const int size = layoutConfig.getFontHeight(sizeType); 36 | if (size <= minHeight) 37 | { 38 | setFontHeight(size); 39 | return; 40 | } 41 | } 42 | setFontHeight(minHeight); 43 | } 44 | -------------------------------------------------------------------------------- /Source/System/Wifi/Device/Wifi_Device_Reader.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file Wifi_Device_Reader.h 3 | * 4 | * @brief Checks the status of the system's Wifi device. 5 | */ 6 | 7 | #include "SharedResource_Modular_Handler.h" 8 | 9 | namespace Wifi 10 | { 11 | class Resource; 12 | namespace Device 13 | { 14 | class Reader; 15 | class Module; 16 | } 17 | } 18 | 19 | /** 20 | * @brief Connects to the Device::Module object to check the state of the 21 | * primary Wifi device. 22 | */ 23 | class Wifi::Device::Reader : 24 | public SharedResource::Modular::Handler 25 | { 26 | public: 27 | Reader(); 28 | 29 | virtual ~Reader() { } 30 | 31 | /** 32 | * @brief Checks if the wifi device is enabled. 33 | * 34 | * @return Whether a Wifi device managed by NetworkManager is enabled. 35 | */ 36 | bool wifiDeviceEnabled() const; 37 | 38 | /** 39 | * @brief Checks if a Wifi device managed by NetworkManager exists. 40 | * 41 | * @return Whether a managed Wifi device was found. 42 | */ 43 | bool wifiDeviceExists() const; 44 | 45 | /** 46 | * @brief Checks if wifi is currently being enabled or disabled. 47 | * 48 | * @return Whether the wifi device is changing its enabled state. 49 | */ 50 | bool isDeviceStateChanging() const; 51 | }; 52 | -------------------------------------------------------------------------------- /Source/Development/Debug/Debug_ScopeTimerRecords.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file Debug_ScopeTimerRecords.h 4 | * 5 | * @brief Records and organizes times recorded by all ScopeTimer objects. 6 | */ 7 | 8 | #include "JuceHeader.h" 9 | 10 | namespace Debug 11 | { 12 | namespace ScopeTimerRecords 13 | { 14 | /** 15 | * @brief Records the start of a ScopeTimer's measurement period. 16 | * 17 | * @param scopeName A name identifying the measured scope. 18 | * 19 | * @param threadID The thread where the timer was created and 20 | * destroyed. 21 | */ 22 | void addStartRecord(const juce::String scopeName, 23 | const juce::Thread::ThreadID threadID); 24 | 25 | /** 26 | * @brief Records the end of a ScopeTimer's measurement period. 27 | * 28 | * @param scopeName A name identifying the measured scope. 29 | * 30 | * @param threadID The thread where the timer was created and 31 | * destroyed. 32 | */ 33 | void addStopRecord(const juce::String scopeName, 34 | const juce::Thread::ThreadID threadID); 35 | 36 | /** 37 | * @brief Organizes and prints all records chronologically. 38 | */ 39 | void printRecords(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /docs/Configuration.md: -------------------------------------------------------------------------------- 1 | # Configuration Guide 2 | This page links to guides to all configuration files used by this application. These files store all configurable options as JSON data. Other than the system command file, these files are all stored in the `~/XDG_CONFIG_HOME/pocket-home` directory, or `~/.config/pocket-home` if the XDG_CONFIG_HOME environment variable is not defined. 3 | 4 | #### [General Application Configuration](./configuration/config.md): 5 | Setting general application options defined in config.json. 6 | 7 | #### [AppMenu Structure](./configuration/appMenu.md): 8 | Setting the structure of the application menu using appMenu.json. 9 | 10 | #### [AppMenu Format Configuration](./configuration/menuOptions.md): 11 | Configuring the application menu format and properties using menuOptions.json. 12 | 13 | #### [Colour Configuration](./configuration/colours.md): 14 | Configuring application UI colors using colours.json. 15 | 16 | #### [Image Asset Configuration](./configuration/imageAssets.md): 17 | Configuring custom application image assets using imageAssets.json. 18 | 19 | #### [Component Layout Configuration](./configuration/layout.md): 20 | Configuring individual component layout definitions using layout.json. 21 | 22 | #### [System Command Configuration](./configuration/commands.md): 23 | Setting application system commands using commands.json and overrideCommands.json. 24 | -------------------------------------------------------------------------------- /Source/Files/Config/Implementation/Config_AlertWindow.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file Config_AlertWindow.h 4 | * 5 | * @brief Displays pop-up error messages when something goes wrong with reading 6 | * or writing JSON configuration files. 7 | */ 8 | 9 | // TODO: Localized error messages for: 10 | // -Bad permissions on config files 11 | // -Inability to create new files 12 | // -Inappropriate data types in config files 13 | // -Missing default config files 14 | 15 | #include "Locale_TextUser.h" 16 | #include "JuceHeader.h" 17 | 18 | namespace Config { class AlertWindow; } 19 | 20 | /** 21 | * @brief Alerts the user to a problem with reading or writing configuration 22 | * files. 23 | */ 24 | class Config::AlertWindow : private Locale::TextUser 25 | { 26 | public: 27 | AlertWindow() : Locale::TextUser("ConfigAlertWindows") { } 28 | 29 | virtual ~AlertWindow() { } 30 | 31 | /** 32 | * @brief Shows a simple alert window with error text. 33 | * 34 | * This should be replaced when ConfigErrorMessage is properly implemented. 35 | */ 36 | void showPlaceholderError(juce::String errorMessage) 37 | { 38 | juce::AlertWindow::showMessageBoxAsync( 39 | juce::AlertWindow::AlertIconType::WarningIcon, 40 | "ConfigFile Error", 41 | errorMessage); 42 | } 43 | }; 44 | -------------------------------------------------------------------------------- /Source/Development/Testing/Testing_Window.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file Testing_Window.h 4 | * 5 | * @brief Creates a basic window for testing a single component. 6 | */ 7 | 8 | #include "Windows_MainWindow.h" 9 | 10 | namespace Testing { class Window; } 11 | 12 | /** 13 | * @file Testing_Window.h 14 | * 15 | * @brief A simple window object that owns a single component. 16 | */ 17 | class Testing::Window : public Windows::MainWindow 18 | { 19 | public: 20 | /** 21 | * @brief Creates and shows a window holding a test component. 22 | * 23 | * @param testName The name of the tested component, to use as the 24 | * window title. 25 | * 26 | * @param testComponent The component that the window will display. 27 | * 28 | * @param xPos The initial x-coordinate position of the window. 29 | * 30 | * @param yPos The initial y-coordinate position of the window. 31 | * 32 | * @param width The initial width of the window. 33 | * 34 | * @param height The initial height of the window. 35 | */ 36 | Window(const juce::String testName, 37 | juce::Component* const testComponent, 38 | const int xPos, 39 | const int yPos, 40 | const int width, 41 | const int height); 42 | 43 | virtual ~Window() { } 44 | }; 45 | -------------------------------------------------------------------------------- /Source/GUI/Page/PageTypes/Page_PasswordRemover.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file Page_PasswordRemover.h 4 | * 5 | * @brief Allows the user to remove the application password. 6 | */ 7 | 8 | #include "Page_Component.h" 9 | #include "Password_RemovalController.h" 10 | #include "Locale_TextUser.h" 11 | #include "Widgets_BoundedLabel.h" 12 | #include "JuceHeader.h" 13 | 14 | namespace Page { class PasswordRemover; } 15 | 16 | /** 17 | * @brief A Page class that shows controls that allow the user to remove the 18 | * application's password. 19 | */ 20 | class Page::PasswordRemover : public Page::Component, public Locale::TextUser 21 | { 22 | public: 23 | /** 24 | * @brief Sets the page layout and initializes password removal 25 | * functionality on construction. 26 | */ 27 | PasswordRemover(); 28 | 29 | virtual ~PasswordRemover() { } 30 | 31 | private: 32 | // Title of the page: 33 | Widgets::BoundedLabel titleLabel; 34 | 35 | // Text field for the current password: 36 | Widgets::BoundedLabel currentPasswordLabel; 37 | juce::TextEditor currentPasswordField; 38 | 39 | // Triggers the attempted password removal: 40 | juce::TextButton removerButton; 41 | 42 | // Provides password removal functionality: 43 | Password::RemovalController removalController; 44 | 45 | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(PasswordRemover) 46 | }; 47 | -------------------------------------------------------------------------------- /Source/System/Wifi/LibNM/Signal/Wifi_LibNM_Signal_APHandler.cpp: -------------------------------------------------------------------------------- 1 | #define WIFI_IMPLEMENTATION 2 | #include "Wifi_LibNM_Signal_APHandler.h" 3 | #include "Wifi_AccessPoint.h" 4 | #include "Wifi_LibNM_AccessPoint.h" 5 | #include "Wifi_LibNM_ContextTest.h" 6 | 7 | namespace NMSignal = Wifi::LibNM::Signal; 8 | 9 | // Disconnects the signal handler from all access points. 10 | void NMSignal::APHandler::disconnect() 11 | { 12 | disconnectAll(); 13 | } 14 | 15 | 16 | // Subscribes to signal strength signals from a single AccessPoint. 17 | void NMSignal::APHandler::connectAllSignals(const AccessPoint source) 18 | { 19 | ASSERT_NM_CONTEXT; 20 | createPropertyConnection(NM_ACCESS_POINT_STRENGTH, source); 21 | } 22 | 23 | 24 | // Notifies the signal handler of a change in access point signal strength. 25 | void NMSignal::APHandler::signalStrengthChanged 26 | (const AccessPoint updatedAP, unsigned int newStrength) { } 27 | 28 | 29 | // Builds signalStrengthChanged() calls from generic property change 30 | // notifications. 31 | void NMSignal::APHandler::propertyChanged 32 | (const AccessPoint source, juce::String property) 33 | { 34 | ASSERT_NM_CONTEXT; 35 | if (property == NM_ACCESS_POINT_STRENGTH) 36 | { 37 | if (!source.isNull()) 38 | { 39 | unsigned int strength = source.getSignalStrength(); 40 | signalStrengthChanged(source, strength); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Source/GUI/Page/Interface/Page_Interface_FactoryHolder.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file Page_Interface_FactoryHolder.h 4 | * 5 | * @brief Allows the page factory to connect itself to page component objects. 6 | */ 7 | 8 | namespace Page 9 | { 10 | namespace Interface 11 | { 12 | class Factory; 13 | class FactoryHolder; 14 | } 15 | class Factory; 16 | } 17 | /** 18 | * @brief Creates the connection between the page and its factory. 19 | */ 20 | class Page::Interface::FactoryHolder 21 | { 22 | public: 23 | FactoryHolder() { } 24 | 25 | virtual ~FactoryHolder() { } 26 | 27 | protected: 28 | /** 29 | * @brief Gets the factory holder's interface to the page factory. 30 | * 31 | * @return The factory interface pointer, or nullptr if the factory 32 | * holder was not created by a Page::Factory. 33 | */ 34 | Factory* getFactoryInterface(); 35 | 36 | private: 37 | friend Page::Factory; 38 | 39 | /** 40 | * @brief Sets the factory holder's factory interface pointer. 41 | * 42 | * The Page::Factory must use this function to pass itself to each 43 | * FactoryHolder it creates that needs to access the factory. 44 | * 45 | * @param pageFactory The factory interface pointer to set. 46 | */ 47 | void setFactoryInterface(Factory* pageFactory); 48 | 49 | Factory* factoryInterface = nullptr; 50 | }; 51 | -------------------------------------------------------------------------------- /Source/System/Hardware/Hardware_Display.cpp: -------------------------------------------------------------------------------- 1 | #include "Hardware_Display.h" 2 | #include "JuceHeader.h" 3 | #include "Util_Commands.h" 4 | #include "Util_Math.h" 5 | 6 | // Gets the current display brightness level. 7 | int Hardware::Display::getBrightness() 8 | { 9 | Util::Commands systemCommands; 10 | juce::String brightness = systemCommands.runTextCommand( 11 | Util::CommandTypes::Text::getBrightness); 12 | if (brightness.isNotEmpty()) 13 | { 14 | return brightness.getIntValue(); 15 | } 16 | return 0; 17 | } 18 | 19 | 20 | // Sets the display brightness level. 21 | void Hardware::Display::setBrightness(const int brightness) 22 | { 23 | juce::String newBrightness(Util::Math::median(1, brightness, 10)); 24 | Util::Commands systemCommands; 25 | systemCommands.runActionCommand(Util::CommandTypes::Action::setBrightness, 26 | newBrightness); 27 | } 28 | 29 | 30 | // Gets the size of the main display. 31 | juce::Rectangle Hardware::Display::getSize() 32 | { 33 | return juce::Desktop::getInstance().getDisplays().getMainDisplay() 34 | .userArea; 35 | } 36 | 37 | 38 | // Gets the width of the main display. 39 | int Hardware::Display::getWidth() 40 | { 41 | return getSize().getWidth(); 42 | } 43 | 44 | 45 | // Gets the height of the main display. 46 | int Hardware::Display::getHeight() 47 | { 48 | return getSize().getHeight(); 49 | } 50 | -------------------------------------------------------------------------------- /Source/GUI/Layout/Component/Layout_Component_Manager.cpp: -------------------------------------------------------------------------------- 1 | #include "Layout_Component_Manager.h" 2 | #include "Layout_Component_ConfigFile.h" 3 | 4 | namespace ComponentLayout = Layout::Component; 5 | 6 | // Sets the layout manager's component and layout on construction. 7 | ComponentLayout::Manager::Manager 8 | (juce::Component* component, const juce::Identifier& layoutKey) : 9 | component(component), 10 | layoutKey(layoutKey) 11 | { 12 | ConfigFile layoutReader; 13 | layout = layoutReader.getLayout(layoutKey); 14 | } 15 | 16 | 17 | // Uses configuration data to set the component's bounds. 18 | void ComponentLayout::Manager::applyConfigBounds() 19 | { 20 | if (component != nullptr) 21 | { 22 | juce::Rectangle newBounds = component->getBounds(); 23 | newBounds.setX(layout.getX(newBounds.getX())); 24 | newBounds.setY(layout.getY(newBounds.getY())); 25 | newBounds.setWidth(layout.getWidth(newBounds.getWidth())); 26 | newBounds.setHeight(layout.getHeight(newBounds.getHeight())); 27 | component->setBounds(newBounds); 28 | } 29 | } 30 | 31 | 32 | // Gets the key that selects the component's layout. 33 | const juce::Identifier& ComponentLayout::Manager::getLayoutKey() const 34 | { 35 | return layoutKey; 36 | } 37 | 38 | 39 | // Gets the layout object this Manager will apply. 40 | ComponentLayout::ConfigLayout ComponentLayout::Manager::getLayout() const 41 | { 42 | return layout; 43 | } 44 | -------------------------------------------------------------------------------- /Source/GUI/AppMenu/Data/JSON/AppMenu_MenuFile.cpp: -------------------------------------------------------------------------------- 1 | #define APPMENU_IMPLEMENTATION 2 | #include "AppMenu_MenuFile.h" 3 | #include "AppMenu_MenuJSON.h" 4 | 5 | // Creates the MenuJSON resource on construction if necessary. 6 | AppMenu::MenuFile::MenuFile() { } 7 | 8 | 9 | // Gets a menu item representing the root folder of the application menu. 10 | AppMenu::MenuItem AppMenu::MenuFile::getRootFolderItem() 11 | { 12 | SharedResource::LockedPtr appJSON = getReadLockedResource(); 13 | return appJSON->getRootFolderItem(); 14 | } 15 | 16 | 17 | // Adds a new menu item to the list of items shown in a menu folder. 18 | AppMenu::MenuItem AppMenu::MenuFile::addMenuItem( 19 | const juce::String& title, 20 | const juce::String& icon, 21 | const juce::String& command, 22 | const bool launchInTerm, 23 | const juce::StringArray& categories, 24 | MenuItem& parentFolder, 25 | const int index) 26 | { 27 | SharedResource::LockedPtr appJSON = getWriteLockedResource(); 28 | appJSON->addMenuItem(title, icon, command, launchInTerm, categories, 29 | parentFolder, index); 30 | return parentFolder.getFolderItem(index); 31 | } 32 | 33 | 34 | // Write all changes to the menu structure back to the menu's JSON file. 35 | void AppMenu::MenuFile::saveChanges() 36 | { 37 | SharedResource::LockedPtr appJSON = getWriteLockedResource(); 38 | appJSON->writeMenuChanges(); 39 | } 40 | -------------------------------------------------------------------------------- /makefiles/Util.mk: -------------------------------------------------------------------------------- 1 | ########################## Utility Module ###################################### 2 | UTIL_DIR = Source/Framework/Util 3 | UTIL_TEST_DIR = Tests/Framework/Util 4 | 5 | UTIL_PREFIX = Util_ 6 | UTIL_OBJ := $(JUCE_OBJDIR)/$(UTIL_PREFIX) 7 | 8 | OBJECTS_UTIL := \ 9 | $(UTIL_OBJ)Commands.o \ 10 | $(UTIL_OBJ)TempTimer.o \ 11 | $(UTIL_OBJ)ShutdownListener.o \ 12 | $(UTIL_OBJ)ConditionChecker.o 13 | 14 | UTIL_TEST_PREFIX := $(UTIL_PREFIX)Test_ 15 | UTIL_TEST_OBJ := $(UTIL_OBJ)Test_ 16 | OBJECTS_UTIL_TEST := \ 17 | $(UTIL_TEST_OBJ)ShutdownListenerTest.o \ 18 | $(UTIL_TEST_OBJ)ConditionTest.o 19 | 20 | ifeq ($(BUILD_TESTS), 1) 21 | OBJECTS_UTIL := $(OBJECTS_UTIL) $(OBJECTS_UTIL_TEST) 22 | endif 23 | 24 | FRAMEWORK_MODULES := $(FRAMEWORK_MODULES) util 25 | 26 | OBJECTS_APP := $(OBJECTS_APP) $(OBJECTS_UTIL) 27 | 28 | util : $(OBJECTS_UTIL) 29 | @echo " Built Utility module" 30 | 31 | $(UTIL_OBJ)Commands.o : \ 32 | $(UTIL_DIR)/$(UTIL_PREFIX)Commands.cpp 33 | $(UTIL_OBJ)TempTimer.o : \ 34 | $(UTIL_DIR)/$(UTIL_PREFIX)TempTimer.cpp 35 | $(UTIL_OBJ)ShutdownListener.o : \ 36 | $(UTIL_DIR)/$(UTIL_PREFIX)ShutdownListener.cpp 37 | $(UTIL_OBJ)ConditionChecker.o : \ 38 | $(UTIL_DIR)/$(UTIL_PREFIX)ConditionChecker.cpp 39 | 40 | $(UTIL_TEST_OBJ)ShutdownListenerTest.o : \ 41 | $(UTIL_TEST_DIR)/$(UTIL_TEST_PREFIX)ShutdownListenerTest.cpp 42 | $(UTIL_TEST_OBJ)ConditionTest.o : \ 43 | $(UTIL_TEST_DIR)/$(UTIL_TEST_PREFIX)ConditionTest.cpp 44 | -------------------------------------------------------------------------------- /Source/GUI/Widgets/Widgets_LayoutContainer.cpp: -------------------------------------------------------------------------------- 1 | #include "Widgets_LayoutContainer.h" 2 | 3 | // Sets the layout of the container component. 4 | void Widgets::LayoutContainer::setLayout 5 | (const Layout::Group::RelativeLayout layout) 6 | { 7 | layoutManager.clearLayout(true); 8 | layoutManager.setLayout(layout, this); 9 | if (!getBounds().isEmpty()) 10 | { 11 | resized(); 12 | } 13 | } 14 | 15 | 16 | // Sets a background image to draw behind all child components. 17 | void Widgets::LayoutContainer::setBackgroundImage(const juce::Image bgImage) 18 | { 19 | backgroundImage = bgImage; 20 | } 21 | 22 | 23 | // Adds all components in the layout to the container and makes them visible. 24 | void Widgets::LayoutContainer::addAndShowLayoutComponents() 25 | { 26 | layoutManager.addComponentsToParent(this); 27 | } 28 | 29 | 30 | // Updates component layout and back button bounds when the container is 31 | // resized. 32 | void Widgets::LayoutContainer::resized() 33 | { 34 | layoutManager.layoutComponents(getLocalBounds()); 35 | containerResized(); 36 | } 37 | 38 | 39 | // Optionally fills the container background with an image. 40 | void Widgets::LayoutContainer::paint(juce::Graphics& graphics) 41 | { 42 | if (backgroundImage.isValid()) 43 | { 44 | graphics.drawImage(backgroundImage, getLocalBounds().toFloat()); 45 | } 46 | else 47 | { 48 | graphics.fillAll(findColour(backgroundColourId)); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Source/System/Wifi/Device/Wifi_Device_UpdateInterface.h: -------------------------------------------------------------------------------- 1 | #ifndef WIFI_IMPLEMENTATION 2 | #error File included directly outside of Wifi module implementation. 3 | #endif 4 | #pragma once 5 | /** 6 | * @file Wifi_Device_UpdateInterface.h 7 | * 8 | * @brief The interface shared by Device::Module and Device::Listener, used to 9 | * notify all Listener objects when wireless networking is enabled or 10 | * disabled. 11 | */ 12 | 13 | namespace Wifi 14 | { 15 | namespace Device 16 | { 17 | class UpdateInterface; 18 | class Module; 19 | } 20 | } 21 | 22 | /** 23 | * @brief An interface used to send updates when wireless networking is 24 | * enabled or disabled. 25 | */ 26 | class Wifi::Device::UpdateInterface 27 | { 28 | public: 29 | UpdateInterface() { } 30 | 31 | virtual ~UpdateInterface() { } 32 | 33 | private: 34 | // Only the Module may send update notifications. 35 | friend class Module; 36 | 37 | /** 38 | * @brief Called whenever wireless networking is enabled. 39 | * 40 | * Implement this to define how the Device::Listener should handle the 41 | * update. 42 | */ 43 | virtual void wirelessEnabled() = 0; 44 | 45 | /** 46 | * @brief Called whenever wireless networking is disabled. 47 | * 48 | * Implement this to define how the Device::Listener should handle the 49 | * update. 50 | */ 51 | virtual void wirelessDisabled() = 0; 52 | }; 53 | -------------------------------------------------------------------------------- /project-scripts/DepClean.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # DepClean.sh 3 | # Removes build files that depend on removed/renamed files 4 | 5 | buildDir=$1 6 | projectDir=$(cd $(dirname $0)/.. && pwd) 7 | 8 | 9 | if [[ ! -d $buildDir ]]; then 10 | echo "$buildDir is not a valid directory!" 11 | exit -1 12 | fi 13 | 14 | if [[ ! $(ls -A $buildDir | grep "d\$") ]]; then 15 | echo "No dependency files to check." 16 | exit 0 17 | fi 18 | 19 | 20 | echo "Removing build files with missing dependencies:" 21 | 22 | numScanned=0 23 | numRemoved=0 24 | for fileName in $buildDir/*.d; do 25 | numDeps=0 26 | for path in $(<$fileName); do 27 | numDeps=$(($numDeps + 1)) 28 | echo -en "\r\033[KChecking $numScanned, dependency $numDeps" 29 | if [[ $path == '\' ]]; then 30 | continue 31 | fi 32 | if [[ ${path: -1} == ':' ]]; then 33 | strlen=${#path} 34 | path=${path:0:$(($strlen - 1))} 35 | fi 36 | if [[ -f $path ]]; then 37 | continue 38 | fi 39 | fullPath="$projectDir/$path" 40 | if [[ ! -f $fullPath ]]; then 41 | oldFile=$(echo $fileName | sed 's/\(.*\)\..*/\1/') 42 | rm "$oldFile.d" 43 | rm "$oldFile.o" 44 | numRemoved=$(($numRemoved + 1)) 45 | break 46 | fi 47 | done 48 | numScanned=$(($numScanned + 1)) 49 | done 50 | echo -e "\r\033[K$numRemoved/$numScanned build files were removed." 51 | 52 | -------------------------------------------------------------------------------- /docs/userGuide/quickSettings.md: -------------------------------------------------------------------------------- 1 | # Quick Settings Page 2 | 3 | ![Quick Settings Guide](../images/screenshots/pages/quickSettings.png?raw=true "Quick settings guide") 4 | 1. The system IP address label. 5 | * [General Configuration](../configuration/config.md): IP label settings are stored under **"Use IP label on home page"**, **"Use IP label on settings page"**, **"IP label prints local IP"**, and **"IP label prints public IP"**. 6 | * [System Command Options](../configuration/commands.md): The command for reading the local IP address is saved under the **"get local IP"** key, and the command for reading the public IP address is saved under the **"get public IP"** key. 7 | 2. The Wifi connection toggle switch. Click this to enable or disable Wifi connections. 8 | 3. The Wifi connection button. This prints the name of the current active Wifi connection. Clicking this while Wifi is enabled will open the [Wifi connection page](./wifi.md). 9 | 4. Closes the page, returning to the [home page](./home.md). 10 | 5. Sets the display brightness. Commands for checking and setting display brightness are stored under the **"get brightness"** and **"set brightness"** keys in the [system command file](../configuration/commands.md). 11 | 6. Sets the system volume level. Commands for checking and setting the system volume level are stored under the **"get volume"** and **"set volume"** keys in the [system command file](../configuration/commands.md). 12 | 7. Opens the [settings list page](./settingsList.md). 13 | -------------------------------------------------------------------------------- /makefiles/Info.mk: -------------------------------------------------------------------------------- 1 | ############################# Info Module #################################### 2 | INFO_DIR = Source/GUI/Info 3 | INFO_TEST_DIR = Tests/GUI/Info 4 | 5 | INFO_PREFIX = Info_ 6 | INFO_OBJ := $(JUCE_OBJDIR)/$(INFO_PREFIX) 7 | 8 | OBJECTS_INFO := \ 9 | $(INFO_OBJ)BatteryIcon.o \ 10 | $(INFO_OBJ)Clock.o \ 11 | $(INFO_OBJ)IPLabel.o 12 | 13 | ifeq ($(WIFI_SUPPORT), 1) 14 | OBJECTS_INFO := \ 15 | $(OBJECTS_INFO) \ 16 | $(INFO_OBJ)SignalIcon.o \ 17 | $(INFO_OBJ)ConnectionIcon.o 18 | endif 19 | 20 | 21 | INFO_TEST_PREFIX := $(INFO_PREFIX)Test_ 22 | INFO_TEST_OBJ := $(INFO_OBJ)Test_ 23 | OBJECTS_INFO_TEST := \ 24 | $(INFO_TEST_OBJ)IPLabelTest.o 25 | 26 | ifeq ($(BUILD_TESTS), 1) 27 | OBJECTS_INFO := $(OBJECTS_INFO) $(OBJECTS_INFO_TEST) 28 | endif 29 | 30 | GUI_MODULES := $(GUI_MODULES) info 31 | 32 | OBJECTS_APP := $(OBJECTS_APP) $(OBJECTS_INFO) 33 | 34 | info : $(OBJECTS_INFO) 35 | @echo " Built Info module" 36 | 37 | $(INFO_OBJ)BatteryIcon.o : \ 38 | $(INFO_DIR)/$(INFO_PREFIX)BatteryIcon.cpp 39 | 40 | $(INFO_OBJ)Clock.o : \ 41 | $(INFO_DIR)/$(INFO_PREFIX)Clock.cpp 42 | 43 | $(INFO_OBJ)IPLabel.o : \ 44 | $(INFO_DIR)/$(INFO_PREFIX)IPLabel.cpp 45 | 46 | $(INFO_OBJ)SignalIcon.o : \ 47 | $(INFO_DIR)/$(INFO_PREFIX)SignalIcon.cpp 48 | 49 | $(INFO_OBJ)ConnectionIcon.o : \ 50 | $(INFO_DIR)/$(INFO_PREFIX)ConnectionIcon.cpp 51 | 52 | $(INFO_TEST_OBJ)IPLabelTest.o : \ 53 | $(INFO_TEST_DIR)/$(INFO_TEST_PREFIX)IPLabelTest.cpp 54 | -------------------------------------------------------------------------------- /Source/Files/Config/Implementation/Config_ListenerInterface.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file Config_ListenerInterface.h 4 | * 5 | * @brief The interface used by Config::FileResource objects to send 6 | * notifications to Config::Listener objects when one of their tracked 7 | * values are updated. 8 | */ 9 | 10 | #include "JuceHeader.h" 11 | 12 | namespace Config { class ListenerInterface; } 13 | 14 | /** 15 | * @brief The interface used to update Listeners that track any number of 16 | * values in a JSON configuration file. 17 | */ 18 | class Config::ListenerInterface 19 | { 20 | public: 21 | // Only FileResource may send updates to Listeners. 22 | friend class FileResource; 23 | 24 | ListenerInterface() { } 25 | 26 | virtual ~ListenerInterface() { } 27 | 28 | protected: 29 | /** 30 | * @brief Checks if a particular value is tracked by this Listener. 31 | * 32 | * @param key The key to a value stored in the Listener's file resource. 33 | * 34 | * @return Whether the value with the given key is tracked by the 35 | * Listener. 36 | */ 37 | virtual bool isKeyTracked(const juce::Identifier& key) const = 0; 38 | 39 | /** 40 | * @brief Notifies the Listener that a value it tracks has been updated. 41 | * 42 | * @param updatedValue The key to the updated value. 43 | */ 44 | virtual void configValueChanged(const juce::Identifier& updatedValue) = 0; 45 | }; 46 | 47 | -------------------------------------------------------------------------------- /makefiles/DesktopEntry.mk: -------------------------------------------------------------------------------- 1 | ####################### DesktopEntry Module #################################### 2 | DESKTOP_ENTRY_DIR = Source/Files/DesktopEntry 3 | DESKTOP_ENTRY_TEST_DIR = Tests/Files/DesktopEntry 4 | 5 | DESKTOP_ENTRY_PREFIX = DesktopEntry_ 6 | DESKTOP_ENTRY_OBJ := $(JUCE_OBJDIR)/$(DESKTOP_ENTRY_PREFIX) 7 | 8 | OBJECTS_DESKTOP_ENTRY := \ 9 | $(DESKTOP_ENTRY_OBJ)FileUtils.o \ 10 | $(DESKTOP_ENTRY_OBJ)EntryFile.o \ 11 | $(DESKTOP_ENTRY_OBJ)LoadingThread.o \ 12 | $(DESKTOP_ENTRY_OBJ)UpdateListener.o \ 13 | $(DESKTOP_ENTRY_OBJ)Loader.o 14 | 15 | OBJECTS_DESKTOP_ENTRY_TEST := 16 | 17 | ifeq ($(BUILD_TESTS), 1) 18 | OBJECTS_DESKTOP_ENTRY := $(OBJECTS_DESKTOP_ENTRY) \ 19 | $(OBJECTS_DESKTOP_ENTRY_TEST) 20 | endif 21 | 22 | FILE_MODULES := $(FILE_MODULES) desktopEntry 23 | 24 | OBJECTS_APP := $(OBJECTS_APP) $(OBJECTS_DESKTOP_ENTRY) 25 | 26 | desktopEntry : $(OBJECTS_DESKTOP_ENTRY) 27 | @echo " Built DesktopEntry module" 28 | 29 | $(DESKTOP_ENTRY_OBJ)FileUtils.o: \ 30 | $(DESKTOP_ENTRY_DIR)/$(DESKTOP_ENTRY_PREFIX)FileUtils.cpp 31 | $(DESKTOP_ENTRY_OBJ)EntryFile.o: \ 32 | $(DESKTOP_ENTRY_DIR)/$(DESKTOP_ENTRY_PREFIX)EntryFile.cpp 33 | $(DESKTOP_ENTRY_OBJ)LoadingThread.o: \ 34 | $(DESKTOP_ENTRY_DIR)/$(DESKTOP_ENTRY_PREFIX)LoadingThread.cpp 35 | $(DESKTOP_ENTRY_OBJ)UpdateListener.o : \ 36 | $(DESKTOP_ENTRY_DIR)/$(DESKTOP_ENTRY_PREFIX)UpdateListener.cpp 37 | $(DESKTOP_ENTRY_OBJ)Loader.o: \ 38 | $(DESKTOP_ENTRY_DIR)/$(DESKTOP_ENTRY_PREFIX)Loader.cpp 39 | -------------------------------------------------------------------------------- /Tests/Files/Config/Config_Test_ObjectData.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file Config_Test_ObjectData.h 4 | * 5 | * @brief An example of a custom object data structure to load from a 6 | * configuration file. 7 | */ 8 | 9 | namespace Config { namespace Test { class ObjectData; } } 10 | 11 | class Config::Test::ObjectData 12 | { 13 | public: 14 | /** 15 | * @brief Constructs the test object, permanently setting its stored 16 | * data. 17 | * 18 | * @param testNum An arbitrary stored int value used for testing. 19 | * 20 | * @param testBool An arbitrary stored boolean value used for testing. 21 | */ 22 | ObjectData(const int testNum, const bool testBool); 23 | 24 | virtual ~ObjectData() { } 25 | 26 | /** 27 | * @brief Gets the custom object's stored integer value. 28 | * 29 | * @return The object's integer value. 30 | */ 31 | int getTestNum() const; 32 | 33 | /** 34 | * @brief Gets the custom object's stored boolean value. 35 | * 36 | * @return The object's boolean value. 37 | */ 38 | bool getTestBool() const; 39 | 40 | /** 41 | * @brief Compares this object with another. 42 | * 43 | * @param rhs The compared object. 44 | * 45 | * @return Whether both objects have the same stored number and bool. 46 | */ 47 | bool operator== (const ObjectData& rhs) const; 48 | 49 | private: 50 | const int testNum; 51 | const bool testBool; 52 | }; 53 | --------------------------------------------------------------------------------