1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/plugins/base/nsPluginNativeWindow.cpp Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,53 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +/** 1.10 + * This file is the default implementation of plugin native window 1.11 + * empty stubs, it should be replaced with real platform implementation 1.12 + * for every platform 1.13 + */ 1.14 + 1.15 +#include "nsDebug.h" 1.16 +#include "nsPluginNativeWindow.h" 1.17 + 1.18 +class nsPluginNativeWindowPLATFORM : public nsPluginNativeWindow { 1.19 +public: 1.20 + nsPluginNativeWindowPLATFORM(); 1.21 + virtual ~nsPluginNativeWindowPLATFORM(); 1.22 +}; 1.23 + 1.24 +nsPluginNativeWindowPLATFORM::nsPluginNativeWindowPLATFORM() : nsPluginNativeWindow() 1.25 +{ 1.26 + // initialize the struct fields 1.27 + window = nullptr; 1.28 + x = 0; 1.29 + y = 0; 1.30 + width = 0; 1.31 + height = 0; 1.32 + memset(&clipRect, 0, sizeof(clipRect)); 1.33 +#if defined(XP_UNIX) && !defined(XP_MACOSX) 1.34 + ws_info = nullptr; 1.35 +#endif 1.36 + type = NPWindowTypeWindow; 1.37 +} 1.38 + 1.39 +nsPluginNativeWindowPLATFORM::~nsPluginNativeWindowPLATFORM() 1.40 +{ 1.41 +} 1.42 + 1.43 +nsresult PLUG_NewPluginNativeWindow(nsPluginNativeWindow ** aPluginNativeWindow) 1.44 +{ 1.45 + NS_ENSURE_ARG_POINTER(aPluginNativeWindow); 1.46 + *aPluginNativeWindow = new nsPluginNativeWindowPLATFORM(); 1.47 + return *aPluginNativeWindow ? NS_OK : NS_ERROR_OUT_OF_MEMORY; 1.48 +} 1.49 + 1.50 +nsresult PLUG_DeletePluginNativeWindow(nsPluginNativeWindow * aPluginNativeWindow) 1.51 +{ 1.52 + NS_ENSURE_ARG_POINTER(aPluginNativeWindow); 1.53 + nsPluginNativeWindowPLATFORM *p = (nsPluginNativeWindowPLATFORM *)aPluginNativeWindow; 1.54 + delete p; 1.55 + return NS_OK; 1.56 +}