mirror of
https://github.com/AppleWin/AppleWin.git
synced 2026-10-25 14:03:18 +00:00
1. Registry functions The set of functions are changed to consistently use bool arguments. The macros are changed to inline functions to improve type checking. RegSaveValue() are overloaded with help of templates to reduce typecasting at call sites. For instance, bool value would be converted consistently instead of relying on call sites to convert bool to int values. 2. Memory functions BOOL usages were unnecessary. Mostly internal usages which can simply be bool. 3. FrameBase Some member variables are changed to bool. BOOL was used because of those Registry functions. Additional changes: - Some expressions are forced to be bool when assigning to bool variables.
95 lines
3.6 KiB
C++
95 lines
3.6 KiB
C++
#pragma once
|
|
|
|
#include "Video.h"
|
|
|
|
constexpr bool kConfirmReboot_Default = true;
|
|
|
|
class NetworkBackend;
|
|
class SoundBuffer;
|
|
|
|
class FrameBase
|
|
{
|
|
public:
|
|
FrameBase();
|
|
|
|
virtual ~FrameBase();
|
|
|
|
HINSTANCE g_hInstance;
|
|
HWND g_hFrameWindow;
|
|
bool g_bConfirmReboot; // saved PageConfig REGSAVE
|
|
bool g_bMultiMon;
|
|
bool g_bFreshReset;
|
|
|
|
virtual void Initialize(bool resetVideoState) = 0;
|
|
virtual void Destroy(void) = 0;
|
|
|
|
virtual void FrameDrawDiskLEDS() = 0;
|
|
virtual void FrameDrawDiskStatus() = 0;
|
|
|
|
virtual void FrameRefreshStatus(int drawflags) = 0;
|
|
virtual void FrameUpdateApple2Type() = 0;
|
|
virtual void FrameSetCursorPosByMousePos() = 0;
|
|
|
|
virtual bool GetFullScreenShowSubunitStatus() = 0;
|
|
virtual void SetFullScreenShowSubunitStatus(bool bShow) = 0;
|
|
virtual void SetWindowedModeShowDiskiiStatus(bool bShow) = 0;
|
|
virtual bool GetBestDisplayResolutionForFullScreen(UINT& bestWidth, UINT& bestHeight, UINT userSpecifiedWidth=0, UINT userSpecifiedHeight=0) = 0;
|
|
virtual int SetViewportScale(int nNewScale, bool bForce = false) = 0;
|
|
virtual void SetAltEnterToggleFullScreen(bool mode) = 0;
|
|
|
|
virtual void SetLoadedSaveStateFlag(const bool bFlag) = 0;
|
|
|
|
virtual void VideoPresentScreen(void) = 0;
|
|
virtual void ResizeWindow(void) = 0;
|
|
|
|
// this function has the same interface as MessageBox in windows.h
|
|
virtual int FrameMessageBox(LPCSTR lpText, LPCSTR lpCaption, UINT uType) = 0;
|
|
|
|
// this function merges LoadBitmap and GetBitmapBits from windows.h
|
|
virtual void GetBitmap(WORD id, LONG cb, LPVOID lpvBits) = 0;
|
|
|
|
// create the network backed for Uthernet 1 and 2
|
|
// useful to use libslirp in Linux
|
|
virtual std::shared_ptr<NetworkBackend> CreateNetworkBackend(const std::string & interfaceName) = 0;
|
|
|
|
// create an object to write sound output to
|
|
virtual std::shared_ptr<SoundBuffer> CreateSoundBuffer(uint32_t dwBufferSize, uint32_t nSampleRate, int nChannels, const char* pszVoiceName) = 0;
|
|
|
|
// FindResource, MAKEINTRESOURCE, SizeofResource, LoadResource, LockResource
|
|
// Return pointer to resource if size is correct.
|
|
// NULL if resource is invalid or size check fails
|
|
// The pointer is only valid until the next call to GetResource
|
|
// (in Windows, the pointer is valid forever, but it would be very restrictive to force this on other FrameBase implementations)
|
|
virtual BYTE* GetResource(WORD id, LPCSTR lpType, uint32_t expectedSize) = 0;
|
|
|
|
virtual void Restart() = 0;
|
|
|
|
void VideoRefreshScreen(uint32_t uRedrawWholeScreenVideoMode, bool bRedrawWholeScreen);
|
|
void VideoRedrawScreen(void);
|
|
void VideoRedrawScreenDuringFullSpeed(uint32_t dwCyclesThisFrame, bool bInit = false);
|
|
void VideoRedrawScreenAfterFullSpeed(uint32_t dwCyclesThisFrame);
|
|
void Video_RedrawAndTakeScreenShot(const char* pScreenshotFilename);
|
|
|
|
virtual std::string Video_GetScreenShotFolder() const = 0;
|
|
void Video_TakeScreenShot(const Video::VideoScreenShot_e ScreenShotType);
|
|
void Video_SaveScreenShot(const Video::VideoScreenShot_e ScreenShotType, const char* pScreenShotFileName);
|
|
void SetDisplayPrintScreenFileName(bool state) { g_bDisplayPrintScreenFileName = state; }
|
|
void Video_ResetScreenshotCounter(const std::string& pDiskImageFileName);
|
|
|
|
bool GetShowPrintScreenWarningDialog(void) { return g_bShowPrintScreenWarningDialog; }
|
|
void SetShowPrintScreenWarningDialog(bool state) { g_bShowPrintScreenWarningDialog = state; }
|
|
|
|
private:
|
|
std::string Util_MakeScreenShotFileName() const;
|
|
bool Util_TestScreenShotFileName(const char* pFileName);
|
|
|
|
bool g_bShowPrintScreenWarningDialog;
|
|
|
|
uint32_t dwFullSpeedStartTime;
|
|
bool g_bDisplayPrintScreenFileName;
|
|
|
|
int g_nLastScreenShot;
|
|
std::string g_pLastDiskImageName;
|
|
static const int nMaxScreenShot = 999999999;
|
|
};
|