X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3373d6bfafe9f537f30865de9d02a55b91bc848f..68888eeaa8d84ed54ff8854110f488ad1c5054e9:/utils/emulator/src/emulator.h diff --git a/utils/emulator/src/emulator.h b/utils/emulator/src/emulator.h index 34f5d7a868..5fdf0f98be 100644 --- a/utils/emulator/src/emulator.h +++ b/utils/emulator/src/emulator.h @@ -5,16 +5,14 @@ // Modified by: // Created: 2002-03-10 // RCS-ID: $Id$ -// Copyright: (c) wxWindows team +// Copyright: (c) wxWidgets team // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_EMULATOR_H_ #define _WX_EMULATOR_H_ -#ifdef __GNUG__ - #pragma interface "emulator.h" -#endif +#define wxEMULATOR_VERSION 0.1 // Information about the emulator decorations class wxEmulatorInfo: public wxObject @@ -22,7 +20,7 @@ class wxEmulatorInfo: public wxObject public: wxEmulatorInfo() { Init(); } - wxEmulatorInfo(const wxEmulatorInfo& info) { Init(); Copy(info); } + wxEmulatorInfo(const wxEmulatorInfo& info) : wxObject() { Init(); Copy(info); } void operator= (const wxEmulatorInfo& info) { Copy(info); } void Copy(const wxEmulatorInfo& info); @@ -31,7 +29,10 @@ public: void Init(); // Loads bitmaps - bool Load(); + bool Load(const wxString& appDir); + + // Emulator config filename + wxString m_emulatorFilename; // Emulator title wxString m_emulatorTitle; @@ -47,6 +48,10 @@ public: // The emulated screen size, e.g. 320x240 wxSize m_emulatorScreenSize; + // The emulated device size. This is ignored + // if there is a background bitmap + wxSize m_emulatorDeviceSize; + // The bitmap used for drawing the main emulator // decorations wxBitmap m_emulatorBackgroundBitmap; @@ -68,9 +73,16 @@ public: virtual bool OnInit(); // Load the specified emulator - bool LoadEmulator(); + bool LoadEmulator(const wxString& appDir); + + // Get app dir + wxString GetAppDir() const { return m_appDir; } + + // Prepend the current app program directory to the name + wxString GetFullAppPath(const wxString& filename) const; public: + wxEmulatorInfo m_emulatorInfo; #ifdef __WXX11__ wxAdoptedWindow* m_xnestWindow; @@ -78,6 +90,9 @@ public: wxWindow* m_xnestWindow; #endif wxEmulatorContainer* m_containerWindow; + wxString m_appDir; + wxString m_displayNumber; + long m_xnestPID; }; // The container for the Xnest window. The decorations @@ -88,6 +103,8 @@ public: wxEmulatorContainer(wxWindow* parent, wxWindowID id); + void DoResize(); + void OnSize(wxSizeEvent& event); void OnPaint(wxPaintEvent& event); void OnEraseBackground(wxEraseEvent& event); @@ -104,12 +121,13 @@ public: // ctor(s) wxEmulatorFrame(const wxString& title, const wxPoint& pos, const wxSize& size); - // event handlers (these functions should _not_ be virtual) + // event handlers void OnQuit(wxCommandEvent& event); void OnAbout(wxCommandEvent& event); + void OnCloseWindow(wxCloseEvent& event); private: - // any class wishing to process wxWindows events must use this macro + // any class wishing to process wxWidgets events must use this macro DECLARE_EVENT_TABLE() }; @@ -130,7 +148,16 @@ enum }; // Returns the image type, or -1, determined from the extension. -int wxDetermineImageType(const wxString& filename); +wxBitmapType wxDetermineImageType(const wxString& filename); + +// Convert a colour to a 6-digit hex string +wxString wxColourToHexString(const wxColour& col); + +// Convert 6-digit hex string to a colour +wxColour wxHexStringToColour(const wxString& hex); + +// Find the absolute path where this application has been run from. +wxString wxFindAppPath(const wxString& argv0, const wxString& cwd, const wxString& appVariableName); #endif // _WX_EMULATOR_H_