Merge pull request #1493 from theuni/egl-rewrite-master
[vuplus_xbmc] / xbmc / XBApplicationEx.h
1 /*
2  *      Copyright (C) 2005-2012 Team XBMC
3  *      http://www.xbmc.org
4  *
5  *  This program is free software; you can redistribute it and/or modify
6  *  it under the terms of the GNU General Public License as published by
7  *  the Free Software Foundation; either version 2 of the License, or
8  *  (at your option) any later version.
9  *
10  *  This program is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  *  GNU General Public License for more details.
14  *
15  *  You should have received a copy of the GNU General Public License along
16  *  with this program; if not, write to the Free Software Foundation, Inc.,
17  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  *
19  */
20
21 #ifndef XBAPPLICATIONEX_H
22 #define XBAPPLICATIONEX_H
23
24 #include "guilib/IWindowManagerCallback.h"
25
26 // Do not change the numbering, external scripts depend on them
27 enum {
28   EXITCODE_QUIT      = 0,
29   EXITCODE_POWERDOWN = 64,
30   EXITCODE_RESTARTAPP= 65,
31   EXITCODE_REBOOT    = 66,
32 };
33
34 class CXBApplicationEx : public IWindowManagerCallback
35 {
36 public:
37   CXBApplicationEx();
38   ~CXBApplicationEx();
39
40   // Variables for timing
41   bool m_bStop;
42   int  m_ExitCode;
43   bool m_AppActive;
44   bool m_AppFocused;
45   bool m_renderGUI;
46
47   // Overridable functions for the 3D scene created by the app
48   virtual bool Initialize() { return true; }
49   virtual bool Cleanup() { return true; }
50   virtual void SetRenderGUI(bool renderGUI) {};
51
52 public:
53   // Functions to create, run, and clean up the application
54   virtual bool Create();
55   INT Run(bool renderGUI = true);
56   VOID Destroy();
57
58 private:
59 };
60
61 #endif /* XBAPPLICATIONEX_H */