dom/plugins/test/testplugin/nptest_qt.cpp

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/plugins/test/testplugin/nptest_qt.cpp	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,109 @@
     1.4 +/* ***** BEGIN LICENSE BLOCK *****
     1.5 + * 
     1.6 + * Copyright (c) 2008, 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 + *   Josh Aas <josh@mozilla.com>
    1.34 + * 
    1.35 + * ***** END LICENSE BLOCK ***** */
    1.36 +#include "nptest_platform.h"
    1.37 +#include "npapi.h"
    1.38 +
    1.39 +using namespace std;
    1.40 +
    1.41 +bool
    1.42 +pluginSupportsWindowMode()
    1.43 +{
    1.44 +  return false;
    1.45 +}
    1.46 +
    1.47 +bool
    1.48 +pluginSupportsWindowlessMode()
    1.49 +{
    1.50 +  return true;
    1.51 +}
    1.52 +
    1.53 +bool
    1.54 +pluginSupportsAsyncBitmapDrawing()
    1.55 +{
    1.56 +  return false;
    1.57 +}
    1.58 +
    1.59 +NPError
    1.60 +pluginInstanceInit(InstanceData* instanceData)
    1.61 +{
    1.62 +  printf("NPERR_INCOMPATIBLE_VERSION_ERROR\n");
    1.63 +  return NPERR_INCOMPATIBLE_VERSION_ERROR;
    1.64 +}
    1.65 +
    1.66 +void
    1.67 +pluginInstanceShutdown(InstanceData* instanceData)
    1.68 +{
    1.69 +  NPN_MemFree(instanceData->platformData);
    1.70 +  instanceData->platformData = 0;
    1.71 +}
    1.72 +
    1.73 +void
    1.74 +pluginDoSetWindow(InstanceData* instanceData, NPWindow* newWindow)
    1.75 +{
    1.76 +  instanceData->window = *newWindow;
    1.77 +}
    1.78 +
    1.79 +void
    1.80 +pluginWidgetInit(InstanceData* instanceData, void* oldWindow)
    1.81 +{
    1.82 +  // XXX nothing here yet since we don't support windowed plugins
    1.83 +}
    1.84 +
    1.85 +int16_t
    1.86 +pluginHandleEvent(InstanceData* instanceData, void* event)
    1.87 +{
    1.88 +  return 0;
    1.89 +}
    1.90 +
    1.91 +int32_t pluginGetEdge(InstanceData* instanceData, RectEdge edge)
    1.92 +{
    1.93 +  // XXX nothing here yet since we don't support windowed plugins
    1.94 +  return NPTEST_INT32_ERROR;
    1.95 +}
    1.96 +
    1.97 +int32_t pluginGetClipRegionRectCount(InstanceData* instanceData)
    1.98 +{
    1.99 +  // XXX nothing here yet since we don't support windowed plugins
   1.100 +  return NPTEST_INT32_ERROR;
   1.101 +}
   1.102 +
   1.103 +int32_t pluginGetClipRegionRectEdge(InstanceData* instanceData, 
   1.104 +    int32_t rectIndex, RectEdge edge)
   1.105 +{
   1.106 +  // XXX nothing here yet since we don't support windowed plugins
   1.107 +  return NPTEST_INT32_ERROR;
   1.108 +}
   1.109 +
   1.110 +void pluginDoInternalConsistencyCheck(InstanceData* instanceData, string& error)
   1.111 +{
   1.112 +}

mercurial