2 * Copyright (C) 2010-2013 Team XBMC
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)
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.
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/>.
21 #import <UIKit/UIKit.h>
22 #import <OpenGLES/EAGL.h>
23 #import <OpenGLES/ES2/gl.h>
24 #import <AudioToolbox/AudioToolbox.h>
26 #import "XBMC_events.h"
27 #include "XBMC_keysym.h"
38 @interface XBMCController : UIViewController <UIGestureRecognizerDelegate, UIKeyInput>
41 IOSEAGLView *m_glView;
42 int m_screensaverTimeout;
46 CGPoint lastGesturePoint;
48 bool touchBeginSignaled;
51 UIInterfaceOrientation orientation;
53 bool m_isPlayingBeforeInactive;
54 UIBackgroundTaskIdentifier m_bgTask;
55 NSTimer *m_networkAutoSuspendTimer;
56 IOSPlaybackState m_playbackState;
57 NSDictionary *nowPlayingInfo;
59 @property (readonly, nonatomic, getter=isAnimating) BOOL animating;
60 @property CGPoint lastGesturePoint;
61 @property CGFloat screenScale;
62 @property bool touchBeginSignaled;
63 @property int m_screenIdx;
64 @property CGSize screensize;
65 @property (nonatomic, retain) NSTimer *m_networkAutoSuspendTimer;
66 @property (nonatomic, retain) NSDictionary *nowPlayingInfo;
68 // message from which our instance is obtained
69 - (void) pauseAnimation;
70 - (void) resumeAnimation;
71 - (void) startAnimation;
72 - (void) stopAnimation;
73 - (void) enterBackground;
74 - (void) enterForeground;
75 - (void) becomeInactive;
76 - (void) setIOSNowPlayingInfo:(NSDictionary *)info;
77 - (void) sendKey: (XBMCKey) key;
78 - (void) observeDefaultCenterStuff: (NSNotification *) notification;
79 - (void) initDisplayLink;
80 - (void) deinitDisplayLink;
81 - (double) getDisplayLinkFPS;
82 - (void) setFramebuffer;
83 - (bool) presentFramebuffer;
84 - (CGSize) getScreenSize;
85 - (CGFloat) getScreenScale:(UIScreen *)screen;
86 - (UIInterfaceOrientation) getOrientation;
87 - (void) createGestureRecognizers;
88 - (void) activateKeyboard:(UIView *)view;
89 - (void) deactivateKeyboard:(UIView *)view;
91 - (void) disableNetworkAutoSuspend;
92 - (void) enableNetworkAutoSuspend:(id)obj;
93 - (void) disableSystemSleep;
94 - (void) enableSystemSleep;
95 - (void) disableScreenSaver;
96 - (void) enableScreenSaver;
97 - (bool) changeScreen: (unsigned int)screenIdx withMode:(UIScreenMode *)mode;
98 - (void) activateScreen: (UIScreen *)screen withOrientation:(UIInterfaceOrientation)newOrientation;
99 - (id) initWithFrame:(CGRect)frame withScreen:(UIScreen *)screen;
102 extern XBMCController *g_xbmcController;