1 ///////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxX11-based PDA emulator classes
4 // Author: Julian Smart
8 // Copyright: (c) wxWindows team
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_EMULATOR_H_
13 #define _WX_EMULATOR_H_
16 #pragma interface "emulator.h"
19 // Information about the emulator decorations
20 class wxEmulatorInfo
: public wxObject
24 wxEmulatorInfo() { Init(); }
25 wxEmulatorInfo(const wxEmulatorInfo
& info
) { Init(); Copy(info
); }
27 void operator= (const wxEmulatorInfo
& info
) { Copy(info
); }
28 void Copy(const wxEmulatorInfo
& info
);
37 wxString m_emulatorTitle
;
39 // Emulator description
40 wxString m_emulatorDescription
;
42 // The offset from the top-left of the main emulator
43 // bitmap and the virtual screen (where Xnest is
45 wxPoint m_emulatorScreenPosition
;
47 // The emulated screen size, e.g. 320x240
48 wxSize m_emulatorScreenSize
;
50 // The bitmap used for drawing the main emulator
52 wxBitmap m_emulatorBackgroundBitmap
;
53 wxString m_emulatorBackgroundBitmapName
;
55 // The intended background colour (for filling in
56 // areas of the window not covered by the bitmap)
57 wxColour m_emulatorBackgroundColour
;
59 // TODO: an array of bitmaps and ids for custom buttons
63 class wxEmulatorContainer
;
64 class wxEmulatorApp
: public wxApp
68 virtual bool OnInit();
70 // Load the specified emulator
74 wxEmulatorInfo m_emulatorInfo
;
76 wxAdoptedWindow
* m_xnestWindow
;
78 wxWindow
* m_xnestWindow
;
80 wxEmulatorContainer
* m_containerWindow
;
83 // The container for the Xnest window. The decorations
84 // will be drawn on this window.
85 class wxEmulatorContainer
: public wxWindow
89 wxEmulatorContainer(wxWindow
* parent
, wxWindowID id
);
91 void OnSize(wxSizeEvent
& event
);
92 void OnPaint(wxPaintEvent
& event
);
93 void OnEraseBackground(wxEraseEvent
& event
);
95 DECLARE_CLASS(wxEmulatorContainer
)
101 class wxEmulatorFrame
: public wxFrame
105 wxEmulatorFrame(const wxString
& title
, const wxPoint
& pos
, const wxSize
& size
);
107 // event handlers (these functions should _not_ be virtual)
108 void OnQuit(wxCommandEvent
& event
);
109 void OnAbout(wxCommandEvent
& event
);
112 // any class wishing to process wxWindows events must use this macro
113 DECLARE_EVENT_TABLE()
116 // ----------------------------------------------------------------------------
118 // ----------------------------------------------------------------------------
120 // IDs for the controls and the menu commands
126 // it is important for the id corresponding to the "About" command to have
127 // this standard value as otherwise it won't be handled properly under Mac
128 // (where it is special and put into the "Apple" menu)
129 Emulator_About
= wxID_ABOUT
132 // Returns the image type, or -1, determined from the extension.
133 int wxDetermineImageType(const wxString
& filename
);