Qt 4.8
quikitwindow.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the plugins of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #ifndef QUIKITWINDOW_H
43 #define QUIKITWINDOW_H
44 
45 #include <QPlatformWindow>
46 
47 #import <UIKit/UIKit.h>
48 #import <OpenGLES/ES1/gl.h>
49 #import <OpenGLES/ES1/glext.h>
50 #import <OpenGLES/ES2/gl.h>
51 #import <OpenGLES/ES2/glext.h>
52 #import <OpenGLES/EAGL.h>
53 
54 @interface EAGLView : UIView <UIKeyInput>
55 {
57  EAGLContext *mContext;
58 
61 
63 
64  id delegate;
65  // ------- Text Input ----------
66  UITextAutocapitalizationType autocapitalizationType;
67  UITextAutocorrectionType autocorrectionType;
69  UIKeyboardAppearance keyboardAppearance;
70  UIKeyboardType keyboardType;
71  UIReturnKeyType returnKeyType;
73 }
74 
75 - (void)setContext:(EAGLContext *)newContext;
76 - (void)presentFramebuffer;
77 - (void)deleteFramebuffer;
78 - (void)createFramebuffer;
79 - (void)makeCurrent;
80 - (void)setWindow:(QPlatformWindow *)window;
81 - (void)sendMouseEventForTouches:(NSSet *)touches withEvent:(UIEvent *)event fakeButtons:(Qt::MouseButtons)buttons;
82 
83 @property (readonly,getter=fbo) GLint fbo;
84 @property (nonatomic, assign) id delegate;
85 
86 // ------- Text Input ----------
87 
88 @property(nonatomic) UITextAutocapitalizationType autocapitalizationType;
89 @property(nonatomic) UITextAutocorrectionType autocorrectionType;
90 @property(nonatomic) BOOL enablesReturnKeyAutomatically;
91 @property(nonatomic) UIKeyboardAppearance keyboardAppearance;
92 @property(nonatomic) UIKeyboardType keyboardType;
93 @property(nonatomic) UIReturnKeyType returnKeyType;
94 @property(nonatomic, getter=isSecureTextEntry) BOOL secureTextEntry;
95 
96 @end
97 
98 @protocol EAGLViewDelegate
99 - (void)eaglView:(EAGLView *)view usesFramebuffer:(GLuint)buffer;
100 @end
101 
102 class EAGLPlatformContext;
103 
105 
106 class QUIKitScreen;
107 
108 class QUIKitWindow : public QPlatformWindow
109 {
110 public:
111  explicit QUIKitWindow(QWidget *tlw);
112  ~QUIKitWindow();
113 
114  UIWindow *nativeWindow() const { return mWindow; }
115  EAGLView *nativeView() const { return mView; }
116  void setGeometry(const QRect &rect);
117 
118  UIWindow *ensureNativeWindow();
119 
120  QPlatformGLContext *glContext() const;
121 
122  QUIKitScreen *platformScreen() const { return mScreen; }
124  void updateGeometryAndOrientation();
125 private:
126  QUIKitScreen *mScreen;
127  UIWindow *mWindow;
128  CGRect mFrame;
129  EAGLView *mView;
131 };
132 
134 
135 #endif // QUIKITWINDOW_H
BOOL secureTextEntry
Definition: quikitwindow.h:73
GLint fbo
Definition: quikitwindow.h:84
GLuint mDepthRenderbuffer
Definition: quikitwindow.h:63
QPlatformWindow * mWindow
Definition: quikitwindow.h:57
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
GLuint mFramebuffer
Definition: quikitwindow.h:63
BOOL enablesReturnKeyAutomatically
Definition: quikitwindow.h:69
void makeCurrent()
The QPlatformWindow class provides an abstraction for top-level windows.
GLint mFramebufferWidth
Definition: quikitwindow.h:60
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
UIKeyboardType keyboardType
Definition: quikitwindow.h:71
EAGLContext * mContext
Definition: quikitwindow.h:58
GLuint mColorRenderbuffer
Definition: quikitwindow.h:63
void createFramebuffer()
GLint mFramebufferHeight
Definition: quikitwindow.h:61
struct CGRect CGRect
UIKeyboardAppearance keyboardAppearance
Definition: quikitwindow.h:70
The QPlatformGLContext class provides an abstraction for native GL contexts.
UIReturnKeyType returnKeyType
Definition: quikitwindow.h:72
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
Definition: qnamespace.h:54
typedef GLint
Definition: glfunctions.h:67
void presentFramebuffer()
UITextAutocapitalizationType autocapitalizationType
Definition: quikitwindow.h:67
void deleteFramebuffer()
UITextAutocorrectionType autocorrectionType
Definition: quikitwindow.h:68
Q_GUI_EXPORT EGLNativeWindowType nativeWindow(QWidget *)
Definition: qegl_qpa.cpp:60