From 3020d06fdb9fd4e539876c9fb1945b50d55cc21d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Sun, 4 Nov 2012 17:19:09 +0100 Subject: iOS: Change member variable style to be consistent with Qt's de facto standard Change-Id: Idd65ad9cbb77114466c5b69a799b98a7fee5068f Reviewed-by: Richard Moe Gustavsen --- src/plugins/platforms/ios/qiosbackingstore.h | 2 +- src/plugins/platforms/ios/qiosbackingstore.mm | 12 +- src/plugins/platforms/ios/qiosintegration.h | 4 +- src/plugins/platforms/ios/qiosintegration.mm | 8 +- .../platforms/ios/qiossoftwareinputhandler.h | 6 +- src/plugins/platforms/ios/qioswindow.h | 26 +-- src/plugins/platforms/ios/qioswindow.mm | 186 ++++++++++----------- 7 files changed, 122 insertions(+), 122 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/ios/qiosbackingstore.h b/src/plugins/platforms/ios/qiosbackingstore.h index cb0e9cbedb..d83a5c21ad 100644 --- a/src/plugins/platforms/ios/qiosbackingstore.h +++ b/src/plugins/platforms/ios/qiosbackingstore.h @@ -57,7 +57,7 @@ public: void resize(const QSize &size, const QRegion &staticContents); private: - QPaintDevice *mPaintDevice; + QPaintDevice *m_paintDevice; }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/ios/qiosbackingstore.mm b/src/plugins/platforms/ios/qiosbackingstore.mm index 32ddce38d2..20f7c1f2d1 100644 --- a/src/plugins/platforms/ios/qiosbackingstore.mm +++ b/src/plugins/platforms/ios/qiosbackingstore.mm @@ -63,7 +63,7 @@ class EAGLPaintDevice : public QGLPaintDevice { public: EAGLPaintDevice(QWindow *window) - :QGLPaintDevice(), mWindow(window) + :QGLPaintDevice(), m_window(window) { #if defined(QT_OPENGL_ES_2) helper = [[PaintDeviceHelper alloc] init]; @@ -83,17 +83,17 @@ public: void setFramebuffer(GLuint buffer) { m_thisFBO = buffer; } int devType() const { return QInternal::OpenGL; } - QSize size() const { return mWindow->geometry().size(); } + QSize size() const { return m_window->geometry().size(); } QGLContext* context() const { // Todo: siplify this: return QGLContext::fromOpenGLContext( - static_cast(mWindow->handle())->glContext()->context()); + static_cast(m_window->handle())->glContext()->context()); } QPaintEngine *paintEngine() const { return qt_qgl_paint_engine(); } private: - QWindow *mWindow; + QWindow *m_window; PaintDeviceHelper *helper; }; @@ -112,13 +112,13 @@ private: QT_BEGIN_NAMESPACE QIOSBackingStore::QIOSBackingStore(QWindow *window) - : QPlatformBackingStore(window), mPaintDevice(new EAGLPaintDevice(window)) + : QPlatformBackingStore(window), m_paintDevice(new EAGLPaintDevice(window)) { } QPaintDevice *QIOSBackingStore::paintDevice() { - return mPaintDevice; + return m_paintDevice; } void QIOSBackingStore::flush(QWindow *window, const QRegion ®ion, const QPoint &offset) diff --git a/src/plugins/platforms/ios/qiosintegration.h b/src/plugins/platforms/ios/qiosintegration.h index b71379e417..f44403fbba 100644 --- a/src/plugins/platforms/ios/qiosintegration.h +++ b/src/plugins/platforms/ios/qiosintegration.h @@ -65,8 +65,8 @@ public: QAbstractEventDispatcher *guiThreadEventDispatcher() const; private: - QList mScreens; - QPlatformFontDatabase *mFontDb; + QList m_screens; + QPlatformFontDatabase *m_fontDb; }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/ios/qiosintegration.mm b/src/plugins/platforms/ios/qiosintegration.mm index bd63384004..98b08ed72a 100644 --- a/src/plugins/platforms/ios/qiosintegration.mm +++ b/src/plugins/platforms/ios/qiosintegration.mm @@ -59,11 +59,11 @@ QIOSIntegration * QIOSIntegration::instance() } QIOSIntegration::QIOSIntegration() - :mFontDb(new QCoreTextFontDatabase) + :m_fontDb(new QCoreTextFontDatabase) { if (!m_instance) m_instance = this; - mScreens << new QIOSScreen(0); + m_screens << new QIOSScreen(0); } QIOSIntegration::~QIOSIntegration() @@ -85,7 +85,7 @@ QPlatformWindow *QIOSIntegration::createPlatformWindow(QWindow *window) const QList QIOSIntegration::screens() const { - return mScreens; + return m_screens; } QPlatformBackingStore *QIOSIntegration::createPlatformBackingStore(QWindow *window) const @@ -100,7 +100,7 @@ QAbstractEventDispatcher *QIOSIntegration::guiThreadEventDispatcher() const QPlatformFontDatabase * QIOSIntegration::fontDatabase() const { - return mFontDb; + return m_fontDb; } QT_END_NAMESPACE diff --git a/src/plugins/platforms/ios/qiossoftwareinputhandler.h b/src/plugins/platforms/ios/qiossoftwareinputhandler.h index bbad656b93..99e8fac61b 100644 --- a/src/plugins/platforms/ios/qiossoftwareinputhandler.h +++ b/src/plugins/platforms/ios/qiossoftwareinputhandler.h @@ -55,7 +55,7 @@ class QIOSSoftwareInputHandler : public QObject Q_OBJECT public: - QIOSSoftwareInputHandler() : mCurrentFocusWidget(0), mCurrentFocusObject(0) {} + QIOSSoftwareInputHandler() : m_CurrentFocusWidget(0), m_CurrentFocusObject(0) {} bool eventFilter(QObject *obj, QEvent *event); private slots: @@ -64,8 +64,8 @@ private slots: private: bool closeSoftwareInputPanel(QWidget *widget); - QPointer mCurrentFocusWidget; - QPointer mCurrentFocusObject; + QPointer m_currentFocusWidget; + QPointer m_currentFocusObject; }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/ios/qioswindow.h b/src/plugins/platforms/ios/qioswindow.h index f43f3db4f9..2d3d5b072f 100644 --- a/src/plugins/platforms/ios/qioswindow.h +++ b/src/plugins/platforms/ios/qioswindow.h @@ -53,13 +53,13 @@ @interface EAGLView : UIView { - QPlatformWindow *mWindow; - EAGLContext *mContext; + QPlatformWindow *m_window; + EAGLContext *m_context; - GLint mFramebufferWidth; - GLint mFramebufferHeight; + GLint m_framebufferWidth; + GLint m_framebufferHeight; - GLuint mFramebuffer, mColorRenderbuffer, mDepthRenderbuffer; + GLuint m_framebuffer, m_colorRenderbuffer, m_depthRenderbuffer; id delegate; // ------- Text Input ---------- @@ -111,23 +111,23 @@ public: explicit QIOSWindow(QWindow *window); ~QIOSWindow(); - UIWindow *nativeWindow() const { return mWindow; } - EAGLView *nativeView() const { return mView; } + UIWindow *nativeWindow() const { return m_window; } + EAGLView *nativeView() const { return m_view; } void setGeometry(const QRect &rect); UIWindow *ensureNativeWindow(); QPlatformOpenGLContext *glContext() const; - QIOSScreen *platformScreen() const { return mScreen; } + QIOSScreen *platformScreen() const { return m_screen; } void updateGeometryAndOrientation(); private: - QIOSScreen *mScreen; - UIWindow *mWindow; - CGRect mFrame; - EAGLView *mView; - mutable EAGLPlatformContext *mContext; + QIOSScreen *m_screen; + UIWindow *m_window; + CGRect m_frame; + EAGLView *m_view; + mutable EAGLPlatformContext *m_context; }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/ios/qioswindow.mm b/src/plugins/platforms/ios/qioswindow.mm index c63c22dbaa..28aaaf2189 100644 --- a/src/plugins/platforms/ios/qioswindow.mm +++ b/src/plugins/platforms/ios/qioswindow.mm @@ -75,7 +75,7 @@ class EAGLPlatformContext : public QPlatformOpenGLContext { public: EAGLPlatformContext(EAGLView *view) - : mView(view) + : m_view(view) { /* mFormat.setWindowApi(QPlatformWindowFormat::OpenGL); @@ -103,7 +103,7 @@ public: #else EAGLContext *aContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES1]; #endif - [mView setContext:aContext]; + [m_view setContext:aContext]; } ~EAGLPlatformContext() { } @@ -113,7 +113,7 @@ public: Q_UNUSED(surface); qDebug() << __FUNCTION__ << "not implemented"; //QPlatformOpenGLContext::makeCurrent(); - //[mView makeCurrent]; + //[m_view makeCurrent]; return false; } @@ -127,7 +127,7 @@ public: { Q_UNUSED(surface); qDebug() << __FUNCTION__ << "not implemented"; - //[mView presentFramebuffer]; + //[m_view presentFramebuffer]; } QFunctionPointer getProcAddress(const QByteArray& ) { return 0; } @@ -138,7 +138,7 @@ public: } private: - EAGLView *mView; + EAGLView *m_view; QSurfaceFormat mFormat; }; @@ -174,97 +174,97 @@ private: - (void)setContext:(EAGLContext *)newContext { - if (mContext != newContext) + if (m_context != newContext) { [self deleteFramebuffer]; - [mContext release]; - mContext = [newContext retain]; + [m_context release]; + m_context = [newContext retain]; [EAGLContext setCurrentContext:nil]; } } - (void)presentFramebuffer { - if (mContext) { - [EAGLContext setCurrentContext:mContext]; - glBindRenderbuffer(GL_RENDERBUFFER, mColorRenderbuffer); - [mContext presentRenderbuffer:GL_RENDERBUFFER]; + if (m_context) { + [EAGLContext setCurrentContext:m_context]; + glBindRenderbuffer(GL_RENDERBUFFER, m_colorRenderbuffer); + [m_context presentRenderbuffer:GL_RENDERBUFFER]; } } - (void)deleteFramebuffer { - if (mContext) + if (m_context) { - [EAGLContext setCurrentContext:mContext]; - if (mFramebuffer) { - glDeleteFramebuffers(1, &mFramebuffer); - mFramebuffer = 0; + [EAGLContext setCurrentContext:m_context]; + if (m_framebuffer) { + glDeleteFramebuffers(1, &m_framebuffer); + m_framebuffer = 0; } - if (mColorRenderbuffer) { - glDeleteRenderbuffers(1, &mColorRenderbuffer); - mColorRenderbuffer = 0; + if (m_colorRenderbuffer) { + glDeleteRenderbuffers(1, &m_colorRenderbuffer); + m_colorRenderbuffer = 0; } - if (mDepthRenderbuffer) { - glDeleteRenderbuffers(1, &mDepthRenderbuffer); - mDepthRenderbuffer = 0; + if (m_depthRenderbuffer) { + glDeleteRenderbuffers(1, &m_depthRenderbuffer); + m_depthRenderbuffer = 0; } } } - (void)createFramebuffer { - if (mContext && !mFramebuffer) + if (m_context && !m_framebuffer) { - [EAGLContext setCurrentContext:mContext]; - glGenFramebuffers(1, &mFramebuffer); - glBindFramebuffer(GL_FRAMEBUFFER, mFramebuffer); - - glGenRenderbuffers(1, &mColorRenderbuffer); - glBindRenderbuffer(GL_RENDERBUFFER, mColorRenderbuffer); - [mContext renderbufferStorage:GL_RENDERBUFFER fromDrawable:(CAEAGLLayer *)self.layer]; - glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, &mFramebufferWidth); - glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_HEIGHT, &mFramebufferHeight); - glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, mColorRenderbuffer); - - glGenRenderbuffers(1, &mDepthRenderbuffer); - glBindRenderbuffer(GL_RENDERBUFFER, mDepthRenderbuffer); + [EAGLContext setCurrentContext:m_context]; + glGenFramebuffers(1, &m_framebuffer); + glBindFramebuffer(GL_FRAMEBUFFER, m_framebuffer); + + glGenRenderbuffers(1, &m_colorRenderbuffer); + glBindRenderbuffer(GL_RENDERBUFFER, m_colorRenderbuffer); + [m_context renderbufferStorage:GL_RENDERBUFFER fromDrawable:(CAEAGLLayer *)self.layer]; + glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, &m_framebufferWidth); + glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_HEIGHT, &m_framebufferHeight); + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, m_colorRenderbuffer); + + glGenRenderbuffers(1, &m_depthRenderbuffer); + glBindRenderbuffer(GL_RENDERBUFFER, m_depthRenderbuffer); if (stencilBits() > 0) { - glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8_OES, mFramebufferWidth, mFramebufferHeight); - glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, mDepthRenderbuffer); + glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8_OES, m_framebufferWidth, m_framebufferHeight); + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, m_depthRenderbuffer); } else { - glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, mFramebufferWidth, mFramebufferHeight); + glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, m_framebufferWidth, m_framebufferHeight); } - glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, mDepthRenderbuffer); + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, m_depthRenderbuffer); if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) NSLog(@"Failed to make complete framebuffer object %x", glCheckFramebufferStatus(GL_FRAMEBUFFER)); if (delegate && [delegate respondsToSelector:@selector(eaglView:usesFramebuffer:)]) { - [delegate eaglView:self usesFramebuffer:mFramebuffer]; + [delegate eaglView:self usesFramebuffer:m_framebuffer]; } } } - (void)makeCurrent { - if (mContext) + if (m_context) { - [EAGLContext setCurrentContext:mContext]; - if (!mFramebuffer) + [EAGLContext setCurrentContext:m_context]; + if (!m_framebuffer) [self createFramebuffer]; - glBindFramebuffer(GL_FRAMEBUFFER, mFramebuffer); - glViewport(0, 0, mFramebufferWidth, mFramebufferHeight); + glBindFramebuffer(GL_FRAMEBUFFER, m_framebuffer); + glViewport(0, 0, m_framebufferWidth, m_framebufferHeight); } } - (GLint)fbo { - return mFramebuffer; + return m_framebuffer; } - (void)setWindow:(QPlatformWindow *)window { - mWindow = window; + m_window = window; } - (void)sendMouseEventForTouches:(NSSet *)touches withEvent:(UIEvent *)event fakeButtons:(Qt::MouseButtons)buttons @@ -274,7 +274,7 @@ private: CGFloat scaleFactor = [self contentScaleFactor]; QPoint p(locationInView.x * scaleFactor, locationInView.y * scaleFactor); // TODO handle global touch point? for status bar? - QWindowSystemInterface::handleMouseEvent(mWindow->window(), (ulong)(event.timestamp*1000), + QWindowSystemInterface::handleMouseEvent(m_window->window(), (ulong)(event.timestamp*1000), p, p, buttons); } @@ -347,18 +347,18 @@ QT_BEGIN_NAMESPACE QIOSWindow::QIOSWindow(QWindow *window) : QPlatformWindow(window), - mWindow(nil), - mContext(0) + m_window(nil), + m_context(0) { - mScreen = static_cast(QPlatformScreen::platformScreenForWindow(window)); - mView = [[EAGLView alloc] init]; + m_screen = static_cast(QPlatformScreen::platformScreenForWindow(window)); + m_view = [[EAGLView alloc] init]; } QIOSWindow::~QIOSWindow() { - delete mContext; mContext = 0; - [mView release]; - [mWindow release]; + delete m_context; m_context = 0; + [m_view release]; + [m_window release]; } void QIOSWindow::setGeometry(const QRect &rect) @@ -369,81 +369,81 @@ void QIOSWindow::setGeometry(const QRect &rect) UIWindow *QIOSWindow::ensureNativeWindow() { - if (!mWindow) { - mWindow = [[UIWindow alloc] init]; + if (!m_window) { + m_window = [[UIWindow alloc] init]; updateGeometryAndOrientation(); // window - mWindow.screen = mScreen->uiScreen(); + m_window.screen = m_screen->uiScreen(); // for some reason setting the screen resets frame.origin, so we need to set the frame afterwards - mWindow.frame = mFrame; + m_window.frame = m_frame; // view - [mView deleteFramebuffer]; - mView.frame = CGRectMake(0, 0, mWindow.bounds.size.width, mWindow.bounds.size.height); // fill - [mView setContentScaleFactor:[mWindow.screen scale]]; - [mView setMultipleTouchEnabled:YES]; - [mView setWindow:this]; - [mWindow addSubview:mView]; - [mWindow setNeedsDisplay]; - [mWindow makeKeyAndVisible]; + [m_view deleteFramebuffer]; + m_view.frame = CGRectMake(0, 0, m_window.bounds.size.width, m_window.bounds.size.height); // fill + [m_view setContentScaleFactor:[m_window.screen scale]]; + [m_view setMultipleTouchEnabled:YES]; + [m_view setWindow:this]; + [m_window addSubview:m_view]; + [m_window setNeedsDisplay]; + [m_window makeKeyAndVisible]; } - return mWindow; + return m_window; } void QIOSWindow::updateGeometryAndOrientation() { - if (!mWindow) + if (!m_window) return; - mFrame = [mScreen->uiScreen() applicationFrame]; - CGRect screen = [mScreen->uiScreen() bounds]; + m_frame = [m_screen->uiScreen() applicationFrame]; + CGRect screen = [m_screen->uiScreen() bounds]; QRect geom; CGFloat angle = 0; switch ([[UIApplication sharedApplication] statusBarOrientation]) { case UIInterfaceOrientationPortrait: - geom = QRect(mFrame.origin.x, mFrame.origin.y, mFrame.size.width, mFrame.size.height); + geom = QRect(m_frame.origin.x, m_frame.origin.y, m_frame.size.width, m_frame.size.height); break; case UIInterfaceOrientationPortraitUpsideDown: - geom = QRect(screen.size.width - mFrame.origin.x - mFrame.size.width, - screen.size.height - mFrame.origin.y - mFrame.size.height, - mFrame.size.width, - mFrame.size.height); + geom = QRect(screen.size.width - m_frame.origin.x - m_frame.size.width, + screen.size.height - m_frame.origin.y - m_frame.size.height, + m_frame.size.width, + m_frame.size.height); angle = M_PI; break; case UIInterfaceOrientationLandscapeLeft: - geom = QRect(screen.size.height - mFrame.origin.y - mFrame.size.height, - mFrame.origin.x, - mFrame.size.height, - mFrame.size.width); + geom = QRect(screen.size.height - m_frame.origin.y - m_frame.size.height, + m_frame.origin.x, + m_frame.size.height, + m_frame.size.width); angle = -M_PI/2.; break; case UIInterfaceOrientationLandscapeRight: - geom = QRect(mFrame.origin.y, - screen.size.width - mFrame.origin.x - mFrame.size.width, - mFrame.size.height, - mFrame.size.width); + geom = QRect(m_frame.origin.y, + screen.size.width - m_frame.origin.x - m_frame.size.width, + m_frame.size.height, + m_frame.size.width); angle = +M_PI/2.; break; } - CGFloat scale = [mScreen->uiScreen() scale]; + CGFloat scale = [m_screen->uiScreen() scale]; geom = QRect(geom.x() * scale, geom.y() * scale, geom.width() * scale, geom.height() * scale); if (angle != 0) { - [mView layer].transform = CATransform3DMakeRotation(angle, 0, 0, 1.); + [m_view layer].transform = CATransform3DMakeRotation(angle, 0, 0, 1.); } else { - [mView layer].transform = CATransform3DIdentity; + [m_view layer].transform = CATransform3DIdentity; } - [mView setNeedsDisplay]; + [m_view setNeedsDisplay]; window()->setGeometry(geom); } QPlatformOpenGLContext *QIOSWindow::glContext() const { - if (!mContext) { - mContext = new EAGLPlatformContext(mView); + if (!m_context) { + m_context = new EAGLPlatformContext(m_view); } - return mContext; + return m_context; } QT_END_NAMESPACE -- cgit v1.2.3