changed: Improve (fallback) logic for subtitle downloading
[vuplus_xbmc] / xbmc / windowing / osx / WinSystemIOS.h
1 /*
2  *      Copyright (C) 2010-2013 Team XBMC
3  *      http://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, or (at your option)
8  *  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
16  *  along with XBMC; see the file COPYING.  If not, see
17  *  <http://www.gnu.org/licenses/>.
18  *
19  */
20
21 #pragma once
22
23 #ifndef WINDOW_SYSTEM_IOSEGL_H
24 #define WINDOW_SYSTEM_IOSEGL_H
25
26 #if defined(TARGET_DARWIN_IOS)
27 #include "windowing/WinSystem.h"
28 #include "rendering/gles/RenderSystemGLES.h"
29 #include "utils/GlobalsHandling.h"
30
31 class CWinSystemIOS : public CWinSystemBase, public CRenderSystemGLES
32 {
33 public:
34   CWinSystemIOS();
35   virtual ~CWinSystemIOS();
36
37   virtual bool InitWindowSystem();
38   virtual bool DestroyWindowSystem();
39   virtual bool CreateNewWindow(const CStdString& name, bool fullScreen, RESOLUTION_INFO& res, PHANDLE_EVENT_FUNC userFunction);
40   virtual bool DestroyWindow();
41   virtual bool ResizeWindow(int newWidth, int newHeight, int newLeft, int newTop);
42   virtual bool SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool blankOtherDisplays);
43   virtual void UpdateResolutions();
44
45   virtual void ShowOSMouse(bool show);
46   virtual bool HasCursor();
47
48   virtual void NotifyAppActiveChange(bool bActivated);
49
50   virtual bool Minimize();
51   virtual bool Restore() ;
52   virtual bool Hide();
53   virtual bool Show(bool raise = true);
54
55   virtual bool IsExtSupported(const char* extension);
56
57   virtual bool BeginRender();
58   virtual bool EndRender();
59   virtual int GetNumScreens();    
60   
61           void InitDisplayLink(void);
62           void DeinitDisplayLink(void);
63           double GetDisplayLinkFPS(void);
64
65 protected:
66   virtual bool PresentRenderImpl(const CDirtyRegionList &dirty);
67   virtual void SetVSyncImpl(bool enable);
68
69   void        *m_glView; // EAGLView opaque
70   void        *m_WorkingContext; // shared EAGLContext opaque
71   bool         m_bWasFullScreenBeforeMinimize;
72   CStdString   m_eglext;
73   int          m_iVSyncErrors;
74   
75 private:
76   bool GetScreenResolution(int* w, int* h, double* fps, int screenIdx);
77   void FillInVideoModes();
78   bool SwitchToVideoMode(int width, int height, double refreshrate, int screenIdx);
79 };
80
81 XBMC_GLOBAL_REF(CWinSystemIOS,g_Windowing);
82 #define g_Windowing XBMC_GLOBAL_USE(CWinSystemIOS)
83
84 #endif
85
86 #endif // WINDOW_SYSTEM_IOSEGL_H