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 NPCallbacksBlackBerry_h 20#define NPCallbacksBlackBerry_h 21 22#include "PluginView.h" 23#include <pthread.h> 24 25namespace WebCore { 26 27struct PthreadMutexLocker { 28 PthreadMutexLocker(pthread_mutex_t*); 29 ~PthreadMutexLocker(); 30 31 pthread_mutex_t* m_mutex; 32}; 33 34struct PthreadReadLocker { 35 PthreadReadLocker(pthread_rwlock_t*); 36 ~PthreadReadLocker(); 37 38 pthread_rwlock_t* m_rwlock; 39}; 40 41struct PthreadWriteLocker { 42 PthreadWriteLocker(pthread_rwlock_t*); 43 ~PthreadWriteLocker(); 44 45 pthread_rwlock_t* m_rwlock; 46}; 47 48#if USE(ACCELERATED_COMPOSITING) 49struct HolePunchData { 50 int x, y; 51 int w, h; 52 RefPtr<PlatformLayer> layer; 53}; 54 55void npSetHolePunchHandler(void* holePunchData); 56#endif 57 58// Static NPAPI Callbacks 59 60void setVisibleRects(NPP, const NPRect rects[], int32_t count); 61void clearVisibleRects(NPP); 62void showKeyboard(NPP, bool value); 63void requestFullScreen(NPP); 64void exitFullScreen(NPP); 65void requestCenterFitZoom(NPP); 66void lockOrientation(NPP, bool landscape); 67void unlockOrientation(NPP); 68void preventIdle(NPP, bool preventIdle); 69NPSurface lockBackBuffer(NPP); 70void unlockBackBuffer(NPP); 71NPSurface lockReadFrontBuffer(NPP); 72void unlockReadFrontBuffer(NPP); 73void swapBuffers(NPP); 74bool createBuffers(NPP, NPSurfaceFormat, int width, int height); 75bool destroyBuffers(NPP); 76bool resizeBuffers(NPP, NPSurfaceFormat, int width, int height); 77void setHolePunch(NPP, int x, int y, int width, int height); 78 79extern NPCallbacks s_NpCallbacks; 80 81} // Namespace WebCore 82 83#endif 84