michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: /** michael@0: * This file is the default implementation of plugin native window michael@0: * empty stubs, it should be replaced with real platform implementation michael@0: * for every platform michael@0: */ michael@0: michael@0: #include "nsDebug.h" michael@0: #include "nsPluginNativeWindow.h" michael@0: michael@0: class nsPluginNativeWindowPLATFORM : public nsPluginNativeWindow { michael@0: public: michael@0: nsPluginNativeWindowPLATFORM(); michael@0: virtual ~nsPluginNativeWindowPLATFORM(); michael@0: }; michael@0: michael@0: nsPluginNativeWindowPLATFORM::nsPluginNativeWindowPLATFORM() : nsPluginNativeWindow() michael@0: { michael@0: // initialize the struct fields michael@0: window = nullptr; michael@0: x = 0; michael@0: y = 0; michael@0: width = 0; michael@0: height = 0; michael@0: memset(&clipRect, 0, sizeof(clipRect)); michael@0: #if defined(XP_UNIX) && !defined(XP_MACOSX) michael@0: ws_info = nullptr; michael@0: #endif michael@0: type = NPWindowTypeWindow; michael@0: } michael@0: michael@0: nsPluginNativeWindowPLATFORM::~nsPluginNativeWindowPLATFORM() michael@0: { michael@0: } michael@0: michael@0: nsresult PLUG_NewPluginNativeWindow(nsPluginNativeWindow ** aPluginNativeWindow) michael@0: { michael@0: NS_ENSURE_ARG_POINTER(aPluginNativeWindow); michael@0: *aPluginNativeWindow = new nsPluginNativeWindowPLATFORM(); michael@0: return *aPluginNativeWindow ? NS_OK : NS_ERROR_OUT_OF_MEMORY; michael@0: } michael@0: michael@0: nsresult PLUG_DeletePluginNativeWindow(nsPluginNativeWindow * aPluginNativeWindow) michael@0: { michael@0: NS_ENSURE_ARG_POINTER(aPluginNativeWindow); michael@0: nsPluginNativeWindowPLATFORM *p = (nsPluginNativeWindowPLATFORM *)aPluginNativeWindow; michael@0: delete p; michael@0: return NS_OK; michael@0: }