1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/plugins/test/testplugin/nptest_droid.cpp Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,111 @@ 1.4 +/* ***** BEGIN LICENSE BLOCK ***** 1.5 + * 1.6 + * Copyright (c) 2010, Mozilla Corporation 1.7 + * All rights reserved. 1.8 + * 1.9 + * Redistribution and use in source and binary forms, with or without 1.10 + * modification, are permitted provided that the following conditions are met: 1.11 + * 1.12 + * * Redistributions of source code must retain the above copyright notice, this 1.13 + * list of conditions and the following disclaimer. 1.14 + * * Redistributions in binary form must reproduce the above copyright notice, 1.15 + * this list of conditions and the following disclaimer in the documentation 1.16 + * and/or other materials provided with the distribution. 1.17 + * * Neither the name of the Mozilla Corporation nor the names of its 1.18 + * contributors may be used to endorse or promote products derived from this 1.19 + * software without specific prior written permission. 1.20 + * 1.21 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 1.22 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 1.23 + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 1.24 + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 1.25 + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 1.26 + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 1.27 + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 1.28 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 1.29 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 1.30 + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 1.31 + * 1.32 + * Contributor(s): 1.33 + * Brad Lassey <blassey@mozilla.com> 1.34 + * 1.35 + * ***** END LICENSE BLOCK ***** */ 1.36 +#include "nptest_platform.h" 1.37 +#include "npapi.h" 1.38 + 1.39 +struct _PlatformData { 1.40 +}; 1.41 + using namespace std; 1.42 + 1.43 +bool 1.44 +pluginSupportsWindowMode() 1.45 +{ 1.46 + return false; 1.47 +} 1.48 + 1.49 +bool 1.50 +pluginSupportsWindowlessMode() 1.51 +{ 1.52 + return true; 1.53 +} 1.54 + 1.55 +bool 1.56 +pluginSupportsAsyncBitmapDrawing() 1.57 +{ 1.58 + return false; 1.59 +} 1.60 + 1.61 +NPError 1.62 +pluginInstanceInit(InstanceData* instanceData) 1.63 +{ 1.64 + printf("NPERR_INCOMPATIBLE_VERSION_ERROR\n"); 1.65 + return NPERR_INCOMPATIBLE_VERSION_ERROR; 1.66 +} 1.67 + 1.68 +void 1.69 +pluginInstanceShutdown(InstanceData* instanceData) 1.70 +{ 1.71 + NPN_MemFree(instanceData->platformData); 1.72 + instanceData->platformData = 0; 1.73 +} 1.74 + 1.75 +void 1.76 +pluginDoSetWindow(InstanceData* instanceData, NPWindow* newWindow) 1.77 +{ 1.78 + instanceData->window = *newWindow; 1.79 +} 1.80 + 1.81 +void 1.82 +pluginWidgetInit(InstanceData* instanceData, void* oldWindow) 1.83 +{ 1.84 + // XXX nothing here yet since we don't support windowed plugins 1.85 +} 1.86 + 1.87 +int16_t 1.88 +pluginHandleEvent(InstanceData* instanceData, void* event) 1.89 +{ 1.90 + return 0; 1.91 +} 1.92 + 1.93 +int32_t pluginGetEdge(InstanceData* instanceData, RectEdge edge) 1.94 +{ 1.95 + // XXX nothing here yet since we don't support windowed plugins 1.96 + return NPTEST_INT32_ERROR; 1.97 +} 1.98 + 1.99 +int32_t pluginGetClipRegionRectCount(InstanceData* instanceData) 1.100 +{ 1.101 + // XXX nothing here yet since we don't support windowed plugins 1.102 + return NPTEST_INT32_ERROR; 1.103 +} 1.104 + 1.105 +int32_t pluginGetClipRegionRectEdge(InstanceData* instanceData, 1.106 + int32_t rectIndex, RectEdge edge) 1.107 +{ 1.108 + // XXX nothing here yet since we don't support windowed plugins 1.109 + return NPTEST_INT32_ERROR; 1.110 +} 1.111 + 1.112 +void pluginDoInternalConsistencyCheck(InstanceData* instanceData, string& error) 1.113 +{ 1.114 +}