All Classes Functions Typedefs
MyMFDMultipleVessels.hpp
1 // ==============================================================
2 // ORBITER AUX LIBRARY: Multiple Vessels Support
3 // http://sf.net/projects/enjomitchsorbit
4 // Part of the ORBITER SDK
5 //
6 // Copyright (C) 2008 Mohd "Computerex" Ali - original concept
7 // Copyright (C) 2011 Szymon "Enjo" Ender - object oriented design,
8 // simplifications, fixes
9 // All rights reserved
10 //
11 // Multiple Vessels Support is free software: you can redistribute it
12 // and/or modify it under the terms of the GNU Lesser General Public
13 // License as published by the Free Software Foundation, either version
14 // 3 of the License, or (at your option) any later version.
15 //
16 // Multiple Vessels Support is distributed in the hope that it will
17 // be useful, but WITHOUT ANY WARRANTY; without even the implied
18 // warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19 // See the GNU Lesser General Public License for more details.
20 //
21 // You should have received a copy of the GNU Lesser General Public
22 // License along with Multiple Vessels Support. If not, see
23 // <http://www.gnu.org/licenses/>.
24 // ==============================================================
25 
26 #ifndef __MyMFDMultipleVessels_H
27 #define __MyMFDMultipleVessels_H
28 
29 #include <orbitersdk.h>
30 #include "../../MFDHUDDrawer/IMFDDrawsHUD.hpp"
31 
32 // Don't include headers of these classes to speed up compilation.
33 // Class declarations are enough, since we're using pointers and references only.
34 class MyMFDData;
36 class MyMFDButtonsPage;
37 
38 namespace EnjoLib
39 {
40 namespace MFDGoodies
41 {
42  class Sound;
43 }
44 }
45 
46 
48 
55 {
56 public:
58 
65  MyMFDMultipleVessels (DWORD w, DWORD h, VESSEL * vessel, MyPluginMultipleVessels * pluginMultipleVessels );
66 
69 
71 
74 
76 
78  MyMFDData * GetData();
79 
81 
82  char *ButtonLabel (int bt);
83 
85 
86  int ButtonMenu (const MFDBUTTONMENU **menu) const;
87 
89 
90  bool Update ( oapi::Sketchpad * skp );
91 
93 
94  bool ConsumeKeyBuffered(DWORD key);
95 
97 
98  bool ConsumeButton (int bt, int event);
99 
101 
102  static int MsgProc (UINT msg, UINT mfd, WPARAM wparam, LPARAM lparam);
103 
104  bool ShouldDrawHUD() const;
105  void DrawHUD(int mode, const HUDPAINTSPEC *hps, oapi::Sketchpad * skp);
106 
107  // Callbacks for MFDButtonsPage
108  void SwitchButtonsPage();
109  void SelectTarget();
110  void SwitchAutopilotStandard();
111  void SwitchAutopilotSophisticated();
112  void SwitchUseSound();
113  void SwitchHUD();
114 
115 private:
116  static bool clbkTargetDialog(void *id, char *str, void *usrdata);
117 
118  void PrintResults(oapi::Sketchpad * skp) const;
119 
121  MyMFDData * m_data;
122 
124 
125  EnjoLib::MFDGoodies::Sound & m_sound;
126  MyMFDButtonsPage & m_buttons;
127 };
128 
129 #endif // !__MyMFDMultipleVessels_H