1/* 2 * Copyright (C) 2011 Research In Motion Limited. All rights reserved. 3 * 4 * This library is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU Lesser General Public 6 * License as published by the Free Software Foundation; either 7 * version 2 of the License, or (at your option) any later version. 8 * 9 * This library is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * Lesser General Public License for more details. 13 * 14 * You should have received a copy of the GNU Lesser General Public 15 * License along with this library; if not, write to the Free Software 16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 */ 18 19#ifndef PluginViewPrivateBlackBerry_h 20#define PluginViewPrivateBlackBerry_h 21 22#include "PluginView.h" 23 24#include <BlackBerryPlatformGraphics.h> 25#include <BlackBerryPlatformIntRectRegion.h> 26#include <pthread.h> 27 28#define PLUGIN_BUFFERS 2 29 30namespace WebCore { 31 32class PluginViewPrivate { 33 34public: 35 PluginViewPrivate(PluginView*); 36 ~PluginViewPrivate(); 37 38 BlackBerry::Platform::Graphics::BufferType toBufferType(NPSurfaceFormat); 39 void setZoomFactor(float); 40 void setVisibleRects(const NPRect rects[], int32_t count); 41 void clearVisibleRects(); 42 void showKeyboard(bool value); 43 void requestFullScreen(); 44 void exitFullScreen(); 45 void requestCenterFitZoom(); 46 void lockOrientation(bool landscape); 47 void unlockOrientation(); 48 void preventIdle(bool preventIdle); 49 void setHolePunch(int x, int y, int width, int height); 50 NPSurface lockBackBuffer(); 51 void unlockBackBuffer(); 52 BlackBerry::Platform::Graphics::Buffer* lockReadFrontBufferInternal(); 53 NPSurface lockReadFrontBuffer(); 54 void unlockReadFrontBuffer(); 55 void swapBuffers(); 56 bool createBuffers(NPSurfaceFormat, int width, int height); 57 bool resizeBuffers(NPSurfaceFormat, int width, int height); 58 bool destroyBuffers(); 59 60private: 61 PluginView* m_view; 62 pthread_mutex_t m_backBufferMutex; 63 pthread_rwlock_t m_frontBufferRwLock; 64 65 BlackBerry::Platform::Graphics::Buffer* m_pluginBuffers[PLUGIN_BUFFERS]; 66 IntSize m_pluginBufferSize; 67 BlackBerry::Platform::Graphics::BufferType m_pluginBufferType; 68 int m_pluginFrontBuffer; 69 70 IntRect m_holePunchRect; 71 IntRect m_keepVisibleRect; 72 73#if USE(ACCELERATED_COMPOSITING) 74 RefPtr<PlatformLayer> m_platformLayer; 75#endif 76 77 bool m_idlePrevented; 78 bool m_hasPendingGeometryChange; 79 bool m_sentOnLoad; 80 bool m_isFullScreen; 81 bool m_isFocused; 82 bool m_orientationLocked; 83 bool m_isBackgroundPlaying; 84 85 std::string m_pluginUniquePrefix; 86 87 BlackBerry::Platform::IntRectRegion m_invalidateRegion; 88 friend class PluginView; 89}; 90 91} // namespace WebCore 92 93#endif 94