diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 92fcc9fa..7ed4d114 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -66,7 +66,7 @@ add_library(appleii SHARED linux/duplicates/Joystick.cpp linux/duplicates/WinFrame.cpp linux/duplicates/SerialComms.cpp - linux/duplicates/IPropertySheet.cpp + linux/duplicates/PropertySheet.cpp linux/duplicates/Tfe.cpp linux/duplicates/AppleWin.cpp diff --git a/source/Utilities.cpp b/source/Utilities.cpp index ea2017dc..a114e262 100644 --- a/source/Utilities.cpp +++ b/source/Utilities.cpp @@ -215,11 +215,11 @@ void LoadConfiguration(void) dwTmp = 70; REGLOAD(TEXT(REGVALUE_SPKR_VOLUME), &dwTmp); - SpkrSetVolume(dwTmp, sg_PropertySheet.GetVolumeMax()); + SpkrSetVolume(dwTmp, GetPropertySheet().GetVolumeMax()); dwTmp = 70; REGLOAD(TEXT(REGVALUE_MB_VOLUME), &dwTmp); - MB_SetVolume(dwTmp, sg_PropertySheet.GetVolumeMax()); + MB_SetVolume(dwTmp, GetPropertySheet().GetVolumeMax()); if(REGLOAD(TEXT(REGVALUE_SAVE_STATE_ON_EXIT), &dwTmp)) g_bSaveStateOnExit = dwTmp ? true : false; diff --git a/source/frontends/qapple/options.cpp b/source/frontends/qapple/options.cpp index 9f2e539a..66f15c39 100644 --- a/source/frontends/qapple/options.cpp +++ b/source/frontends/qapple/options.cpp @@ -2,6 +2,7 @@ #include "StdAfx.h" #include "Common.h" +#include "Interface.h" #include "CardManager.h" #include "Core.h" #include "Disk.h" @@ -236,13 +237,13 @@ void setAppleWinPreferences(const PreferenceData & currentData, const Preference if (currentData.speakerVolume != newData.speakerVolume) { - SpkrSetVolume(newData.speakerVolume, sg_PropertySheet.GetVolumeMax()); + SpkrSetVolume(newData.speakerVolume, GetPropertySheet().GetVolumeMax()); REGSAVE(TEXT(REGVALUE_SPKR_VOLUME), SpkrGetVolume()); } if (currentData.mockingboardVolume != newData.mockingboardVolume) { - MB_SetVolume(newData.mockingboardVolume, sg_PropertySheet.GetVolumeMax()); + MB_SetVolume(newData.mockingboardVolume, GetPropertySheet().GetVolumeMax()); REGSAVE(TEXT(REGVALUE_MB_VOLUME), MB_GetVolume()); } diff --git a/source/frontends/qapple/qapple.cpp b/source/frontends/qapple/qapple.cpp index 68514fec..0e2016d5 100644 --- a/source/frontends/qapple/qapple.cpp +++ b/source/frontends/qapple/qapple.cpp @@ -3,6 +3,7 @@ #include "StdAfx.h" #include "Common.h" +#include "Interface.h" #include "CardManager.h" #include "Core.h" #include "Disk.h" diff --git a/source/frontends/sa2/emulator.cpp b/source/frontends/sa2/emulator.cpp index e518bebf..d155a07e 100644 --- a/source/frontends/sa2/emulator.cpp +++ b/source/frontends/sa2/emulator.cpp @@ -10,6 +10,7 @@ #include "StdAfx.h" #include "Common.h" +#include "Interface.h" #include "CardManager.h" #include "Core.h" #include "Disk.h" diff --git a/source/linux/duplicates/AppleWin.cpp b/source/linux/duplicates/AppleWin.cpp index a9cac29b..7b0e425f 100644 --- a/source/linux/duplicates/AppleWin.cpp +++ b/source/linux/duplicates/AppleWin.cpp @@ -1,9 +1,16 @@ #include "StdAfx.h" -#include "Windows/AppleWin.h" +#include "Interface.h" +#include "linux/duplicates/PropertySheet.h" HINSTANCE g_hInstance = (HINSTANCE)0; void SetLoadedSaveStateFlag(bool) { } + +IPropertySheet& GetPropertySheet() +{ + static CPropertySheet sg_PropertySheet; + return sg_PropertySheet; +} diff --git a/source/linux/duplicates/IPropertySheet.cpp b/source/linux/duplicates/IPropertySheet.cpp deleted file mode 100644 index e04e0935..00000000 --- a/source/linux/duplicates/IPropertySheet.cpp +++ /dev/null @@ -1,57 +0,0 @@ -#include "StdAfx.h" - -#include "Common.h" -#include "Configuration/IPropertySheet.h" -#include "Configuration/PropertySheetHelper.h" - -void IPropertySheet::ApplyNewConfig(CConfigNeedingRestart const & newConfig, CConfigNeedingRestart const & oldConfig) -{ - CPropertySheetHelper helper; - helper.ApplyNewConfig(newConfig, oldConfig); -} - -UINT IPropertySheet::GetTheFreezesF8Rom(void) -{ - return 0; -} - -void IPropertySheet::ConfigSaveApple2Type(eApple2Type apple2Type) -{ -} - -void IPropertySheet::SetTheFreezesF8Rom(UINT uValue) -{ -} - -void IPropertySheet::SetJoystickCursorControl(UINT uValue) -{ -} - -void IPropertySheet::SetMouseRestrictToWindow(UINT uValue) -{ -} - -void IPropertySheet::SetScrollLockToggle(UINT uValue) -{ -} - -void IPropertySheet::SetJoystickCenteringControl(UINT uValue) -{ -} - -DWORD IPropertySheet::GetVolumeMax(void) -{ - return 99; -} - -void IPropertySheet::SetButtonsSwapState(bool value) -{ -} - -void IPropertySheet::SetAutofire(UINT uValue) -{ -} - -void IPropertySheet::SetMouseShowCrosshair(UINT uValue) -{ -} diff --git a/source/linux/duplicates/PropertySheet.cpp b/source/linux/duplicates/PropertySheet.cpp new file mode 100644 index 00000000..2da86bd1 --- /dev/null +++ b/source/linux/duplicates/PropertySheet.cpp @@ -0,0 +1,98 @@ +#include "StdAfx.h" + +#include "linux/duplicates/PropertySheet.h" +#include "Configuration/PropertySheetHelper.h" + +void CPropertySheet::Init(void) +{ +} + +DWORD CPropertySheet::GetVolumeMax(void) +{ + return 99; +} + +bool CPropertySheet::SaveStateSelectImage(HWND hWindow, bool bSave) +{ + return false; +} + +void CPropertySheet::ApplyNewConfig(const CConfigNeedingRestart& ConfigNew, const CConfigNeedingRestart& ConfigOld) +{ +} + +void CPropertySheet::ConfigSaveApple2Type(eApple2Type apple2Type) +{ +} + +UINT CPropertySheet::GetScrollLockToggle(void) +{ + return 0; +} + +void CPropertySheet::SetScrollLockToggle(UINT uValue) +{ +} + +UINT CPropertySheet::GetJoystickCursorControl(void) +{ + return 0; +} + +void CPropertySheet::SetJoystickCursorControl(UINT uValue) +{ +} + +UINT CPropertySheet::GetJoystickCenteringControl(void) +{ + return 0; +} + +void CPropertySheet::SetJoystickCenteringControl(UINT uValue) +{ +} + +UINT CPropertySheet::GetAutofire(UINT uButton) +{ + return 0; +} + +void CPropertySheet::SetAutofire(UINT uValue) +{ +} + +bool CPropertySheet::GetButtonsSwapState(void) +{ + return false; +} + +void CPropertySheet::SetButtonsSwapState(bool value) +{ +} + +UINT CPropertySheet::GetMouseShowCrosshair(void) +{ + return 0; +} + +void CPropertySheet::SetMouseShowCrosshair(UINT uValue) +{ +} + +UINT CPropertySheet::GetMouseRestrictToWindow(void) +{ + return 0; +} + +void CPropertySheet::SetMouseRestrictToWindow(UINT uValue) +{ +} + +UINT CPropertySheet::GetTheFreezesF8Rom(void) +{ + return 0; +} + +void CPropertySheet::SetTheFreezesF8Rom(UINT uValue) +{ +} diff --git a/source/linux/duplicates/PropertySheet.h b/source/linux/duplicates/PropertySheet.h new file mode 100644 index 00000000..22f8cf53 --- /dev/null +++ b/source/linux/duplicates/PropertySheet.h @@ -0,0 +1,32 @@ +#pragma once + +#include "Common.h" +#include "Configuration/IPropertySheet.h" + +class CConfigNeedingRestart; + +class CPropertySheet : public IPropertySheet +{ +public: + virtual void Init(void); + virtual DWORD GetVolumeMax(void); + virtual bool SaveStateSelectImage(HWND hWindow, bool bSave); + virtual void ApplyNewConfig(const CConfigNeedingRestart& ConfigNew, const CConfigNeedingRestart& ConfigOld); + virtual void ConfigSaveApple2Type(eApple2Type apple2Type); + virtual UINT GetScrollLockToggle(void); + virtual void SetScrollLockToggle(UINT uValue); + virtual UINT GetJoystickCursorControl(void); + virtual void SetJoystickCursorControl(UINT uValue); + virtual UINT GetJoystickCenteringControl(void); + virtual void SetJoystickCenteringControl(UINT uValue); + virtual UINT GetAutofire(UINT uButton); + virtual void SetAutofire(UINT uValue); + virtual bool GetButtonsSwapState(void); + virtual void SetButtonsSwapState(bool value); + virtual UINT GetMouseShowCrosshair(void); + virtual void SetMouseShowCrosshair(UINT uValue); + virtual UINT GetMouseRestrictToWindow(void); + virtual void SetMouseRestrictToWindow(UINT uValue); + virtual UINT GetTheFreezesF8Rom(void); + virtual void SetTheFreezesF8Rom(UINT uValue); +};