not part of the build yet, unix plugin sdk
git-svn-id: svn://10.0.0.236/trunk@129492 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
|
||||
DEPTH = ../../../../../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MODULE = npSDKscriptable
|
||||
LIBRARY_NAME = npSDKscriptable
|
||||
|
||||
REQUIRES = java \
|
||||
idl \
|
||||
xpcom \
|
||||
nspr \
|
||||
$(NULL)
|
||||
|
||||
CPPSRCS = plugin.cpp \
|
||||
nsScriptablePeer.cpp
|
||||
|
||||
XPIDLSRCS = nsIScriptablePluginSample.idl
|
||||
|
||||
SHARED_LIBRARY_LIBS = $(DIST)/lib/libplugingate_s.$(LIB_SUFFIX)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
EXTRA_DSO_LDOPTS += -L/usr/lib -L/usr/X11R6/lib -rdynamic -lXi -lXext -lX11 -lm -lXt
|
||||
|
||||
INSTALL_PLUGIN = $(CONFIG_TOOLS)/nsinstall -R
|
||||
INSTALL = true
|
||||
|
||||
ifeq ($(OS_ARCH), UNIX)
|
||||
# This needs to get defined for npapi.h on unix platforms.
|
||||
DEFINES += -DXP_UNIX
|
||||
endif
|
||||
|
||||
LOCAL_INCLUDES += -I$(srcdir)/$(XPIDL_GEN_DIR) -I$(srcdir)/../../include -I$(srcdir)/../../../include
|
||||
|
||||
install-plugin: $(SHARED_LIBRARY)
|
||||
$(INSTALL_PLUGIN) $(IFLAGS1) $(XPIDL_GEN_DIR)/$(XPIDL_MODULE).xpt $(DIST)/bin/plugins
|
||||
ifdef SHARED_LIBRARY
|
||||
$(INSTALL_PLUGIN) $(SHARED_LIBRARY) $(DIST)/bin/plugins
|
||||
endif
|
||||
|
||||
libs:: install-plugin
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
|
||||
# This makefile contains some of our defines for the compiler:
|
||||
#
|
||||
# XP_UNIX This needs to get defined for npapi.h on unix platforms.
|
||||
|
||||
PLUGIN_DEFINES = -DXP_UNIX -I../../../include -I../../include -I../include
|
||||
CCC = gcc
|
||||
OPTIMIZER = -g
|
||||
CFLAGS = $(OPTIMIZER) $(PLUGIN_DEFINES) -I. -I/usr/include
|
||||
|
||||
CPPSRCS = ../../common/npn_gate.cpp \
|
||||
../../common/npp_gate.cpp \
|
||||
../../common/np_entry.cpp \
|
||||
plugin.cpp
|
||||
|
||||
OBJS = $(strip $(CPPSRCS:.cpp=.o))
|
||||
|
||||
%.o: %.cpp makefile
|
||||
$(CCC) -o $@ -c $(CFLAGS) $<
|
||||
|
||||
SHAREDTARGET=npscriptable.so
|
||||
|
||||
default all: $(SHAREDTARGET)
|
||||
|
||||
$(SHAREDTARGET): $(OBJS)
|
||||
$(CC) -shared -o $(SHAREDTARGET) $(OBJS) $(LDFLAGS)
|
||||
|
||||
clean:
|
||||
$(RM) $(OBJS) $(SHAREDTARGET)
|
||||
|
||||
@@ -0,0 +1,132 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
// ==============================
|
||||
// ! Scriptability related code !
|
||||
// ==============================
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//
|
||||
// This file implements the nsScriptablePeer object
|
||||
// The native methods of this class are supposed to
|
||||
// be callable from JavaScript
|
||||
//
|
||||
#include "plugin.h"
|
||||
|
||||
static NS_DEFINE_IID(kIScriptableIID, NS_ISCRIPTABLEPLUGINSAMPLE_IID);
|
||||
static NS_DEFINE_IID(kIClassInfoIID, NS_ICLASSINFO_IID);
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
|
||||
nsScriptablePeer::nsScriptablePeer(nsPluginInstance* aPlugin)
|
||||
{
|
||||
mPlugin = aPlugin;
|
||||
mRefCnt = 0;
|
||||
}
|
||||
|
||||
nsScriptablePeer::~nsScriptablePeer()
|
||||
{
|
||||
}
|
||||
|
||||
// AddRef, Release and QueryInterface are common methods and must
|
||||
// be implemented for any interface
|
||||
NS_IMETHODIMP_(nsrefcnt) nsScriptablePeer::AddRef()
|
||||
{
|
||||
++mRefCnt;
|
||||
return mRefCnt;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP_(nsrefcnt) nsScriptablePeer::Release()
|
||||
{
|
||||
--mRefCnt;
|
||||
if (mRefCnt == 0) {
|
||||
delete this;
|
||||
return 0;
|
||||
}
|
||||
return mRefCnt;
|
||||
}
|
||||
|
||||
// here nsScriptablePeer should return three interfaces it can be asked for by their iid's
|
||||
// static casts are necessary to ensure that correct pointer is returned
|
||||
NS_IMETHODIMP nsScriptablePeer::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
||||
{
|
||||
if(!aInstancePtr)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
if(aIID.Equals(kIScriptableIID)) {
|
||||
*aInstancePtr = static_cast<nsIScriptablePluginSample*>(this);
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if(aIID.Equals(kIClassInfoIID)) {
|
||||
*aInstancePtr = static_cast<nsIClassInfo*>(this);
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if(aIID.Equals(kISupportsIID)) {
|
||||
*aInstancePtr = static_cast<nsISupports*>(static_cast<nsIScriptablePluginSample*>(this));
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
void nsScriptablePeer::SetInstance(nsPluginInstance* plugin)
|
||||
{
|
||||
mPlugin = plugin;
|
||||
}
|
||||
|
||||
//
|
||||
// the following methods will be callable from JavaScript
|
||||
//
|
||||
NS_IMETHODIMP nsScriptablePeer::ShowVersion()
|
||||
{
|
||||
if (mPlugin)
|
||||
mPlugin->showVersion();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsScriptablePeer::Clear()
|
||||
{
|
||||
if (mPlugin)
|
||||
mPlugin->clear();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
// ==============================
|
||||
// ! Scriptability related code !
|
||||
// ==============================
|
||||
//
|
||||
// nsScriptablePeer - xpconnect scriptable peer
|
||||
//
|
||||
|
||||
#ifndef __nsScriptablePeer_h__
|
||||
#define __nsScriptablePeer_h__
|
||||
|
||||
#include "nsIScriptablePluginSample.h"
|
||||
#include "nsIClassInfo.h"
|
||||
|
||||
class nsPluginInstance;
|
||||
|
||||
// We must implement nsIClassInfo because it signals the
|
||||
// Mozilla Security Manager to allow calls from JavaScript.
|
||||
|
||||
class nsClassInfoMixin : public nsIClassInfo
|
||||
{
|
||||
// These flags are used by the DOM and security systems to signal that
|
||||
// JavaScript callers are allowed to call this object's scritable methods.
|
||||
NS_IMETHOD GetFlags(PRUint32 *aFlags)
|
||||
{*aFlags = nsIClassInfo::PLUGIN_OBJECT | nsIClassInfo::DOM_OBJECT;
|
||||
return NS_OK;}
|
||||
NS_IMETHOD GetImplementationLanguage(PRUint32 *aImplementationLanguage)
|
||||
{*aImplementationLanguage = nsIProgrammingLanguage::CPLUSPLUS;
|
||||
return NS_OK;}
|
||||
// The rest of the methods can safely return error codes...
|
||||
NS_IMETHOD GetInterfaces(PRUint32 *count, nsIID * **array)
|
||||
{return NS_ERROR_NOT_IMPLEMENTED;}
|
||||
NS_IMETHOD GetHelperForLanguage(PRUint32 language, nsISupports **_retval)
|
||||
{return NS_ERROR_NOT_IMPLEMENTED;}
|
||||
NS_IMETHOD GetContractID(char * *aContractID)
|
||||
{return NS_ERROR_NOT_IMPLEMENTED;}
|
||||
NS_IMETHOD GetClassDescription(char * *aClassDescription)
|
||||
{return NS_ERROR_NOT_IMPLEMENTED;}
|
||||
NS_IMETHOD GetClassID(nsCID * *aClassID)
|
||||
{return NS_ERROR_NOT_IMPLEMENTED;}
|
||||
NS_IMETHOD GetClassIDNoAlloc(nsCID *aClassIDNoAlloc)
|
||||
{return NS_ERROR_NOT_IMPLEMENTED;}
|
||||
};
|
||||
|
||||
class nsScriptablePeer : public nsIScriptablePluginSample,
|
||||
public nsClassInfoMixin
|
||||
{
|
||||
public:
|
||||
nsScriptablePeer(nsPluginInstance* plugin);
|
||||
virtual ~nsScriptablePeer();
|
||||
|
||||
public:
|
||||
// methods from nsISupports
|
||||
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
|
||||
NS_IMETHOD_(nsrefcnt) AddRef();
|
||||
NS_IMETHOD_(nsrefcnt) Release();
|
||||
|
||||
protected:
|
||||
nsrefcnt mRefCnt;
|
||||
|
||||
public:
|
||||
// native methods callable from JavaScript
|
||||
NS_DECL_NSISCRIPTABLEPLUGINSAMPLE
|
||||
|
||||
void SetInstance(nsPluginInstance* plugin);
|
||||
|
||||
protected:
|
||||
nsPluginInstance* mPlugin;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -45,11 +45,11 @@
|
||||
|
||||
#define MIME_TYPES_HANDLED "application/scriptable-plugin"
|
||||
#define PLUGIN_NAME "Scriptable Example Plugin for Mozilla"
|
||||
#define PLUGIN_DESCRIPTION "Scriptable Example Plugin for Mozilla"
|
||||
#define PLUGIN_DESCRIPTION MIME_TYPES_HANDLED":scr:"PLUGIN_NAME
|
||||
|
||||
char* NPP_GetMIMEDescription(void)
|
||||
{
|
||||
return(MIME_TYPES_HANDLED);
|
||||
return(PLUGIN_DESCRIPTION);
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
@@ -92,6 +92,8 @@ nsPluginInstance::nsPluginInstance(NPP aInstance) : nsPluginInstanceBase(),
|
||||
mInstance(aInstance),
|
||||
mInitialized(FALSE),
|
||||
mWindow(0),
|
||||
mXtwidget(0),
|
||||
mFontInfo(0),
|
||||
mScriptablePeer(NULL)
|
||||
{
|
||||
mString[0] = '\0';
|
||||
@@ -128,15 +130,23 @@ void nsPluginInstance::draw()
|
||||
unsigned int w = 3 * mWidth/4;
|
||||
int x = (mWidth - w)/2; // center
|
||||
int y = h/2;
|
||||
XDrawRectangle(mDisplay, mWindow, mGC, x, y, w, h);
|
||||
|
||||
XClearArea(mDisplay, mWindow, 0, 0, 0, 0, False);
|
||||
if (x >= 0 && y >= 0) {
|
||||
GC gc = XCreateGC(mDisplay, mWindow, 0, NULL);
|
||||
if (!gc)
|
||||
return;
|
||||
XDrawRectangle(mDisplay, mWindow, gc, x, y, w, h);
|
||||
if (mString[0]) {
|
||||
int l = strlen(mString);
|
||||
int fmba = mFontInfo->max_bounds.ascent;
|
||||
int fmbd = mFontInfo->max_bounds.descent;
|
||||
int fh = fmba + fmbd;
|
||||
y += fh;
|
||||
x += 32;
|
||||
XDrawString(mDisplay, mWindow, mGC, x, y, mString, l);
|
||||
XDrawString(mDisplay, mWindow, gc, x, y, mString, l);
|
||||
}
|
||||
XFreeGC(mDisplay, gc);
|
||||
}
|
||||
}
|
||||
|
||||
NPBool nsPluginInstance::init(NPWindow* aWindow)
|
||||
@@ -144,34 +154,47 @@ NPBool nsPluginInstance::init(NPWindow* aWindow)
|
||||
if(aWindow == NULL)
|
||||
return FALSE;
|
||||
|
||||
NPSetWindowCallbackStruct *ws_info = (NPSetWindowCallbackStruct *)aWindow->ws_info;
|
||||
mWindow = (Window) aWindow->window;
|
||||
if (SetWindow(aWindow))
|
||||
mInitialized = TRUE;
|
||||
|
||||
return mInitialized;
|
||||
}
|
||||
|
||||
NPError nsPluginInstance::SetWindow(NPWindow* aWindow)
|
||||
{
|
||||
if(aWindow == NULL)
|
||||
return FALSE;
|
||||
|
||||
mX = aWindow->x;
|
||||
mY = aWindow->y;
|
||||
mWidth = aWindow->width;
|
||||
mHeight = aWindow->height;
|
||||
if (mWindow != (Window) aWindow->window) {
|
||||
mWindow = (Window) aWindow->window;
|
||||
NPSetWindowCallbackStruct *ws_info = (NPSetWindowCallbackStruct *)aWindow->ws_info;
|
||||
mDisplay = ws_info->display;
|
||||
mVisual = ws_info->visual;
|
||||
mDepth = ws_info->depth;
|
||||
mColormap = ws_info->colormap;
|
||||
mFontInfo = XLoadQueryFont(mDisplay, "9x15");
|
||||
if (!mFontInfo) {
|
||||
printf("Cannot open 9X15 font\n");
|
||||
return FALSE;
|
||||
}
|
||||
mGC = XCreateGC(mDisplay, mWindow, 0, NULL);
|
||||
|
||||
if (!mFontInfo) {
|
||||
if (!(mFontInfo = XLoadQueryFont(mDisplay, "9x15")))
|
||||
printf("Cannot open 9X15 font\n");
|
||||
}
|
||||
// add xt event handler
|
||||
Widget xtwidget = XtWindowToWidget(mDisplay, mWindow);
|
||||
if (xtwidget) {
|
||||
if (xtwidget && mXtwidget != xtwidget) {
|
||||
mXtwidget = xtwidget;
|
||||
long event_mask = ExposureMask;
|
||||
XSelectInput(mDisplay, mWindow, event_mask);
|
||||
XtAddEventHandler(xtwidget, event_mask, False, (XtEventHandler)xt_event_handler, this);
|
||||
}
|
||||
mInitialized = TRUE;
|
||||
}
|
||||
draw();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
void nsPluginInstance::shut()
|
||||
{
|
||||
mInitialized = FALSE;
|
||||
@@ -210,37 +233,22 @@ NPError nsPluginInstance::GetValue(NPPVariable aVariable, void *aValue)
|
||||
{
|
||||
NPError rv = NPERR_NO_ERROR;
|
||||
|
||||
switch (aVariable) {
|
||||
case NPPVpluginScriptableInstance: {
|
||||
if (aVariable == NPPVpluginScriptableInstance) {
|
||||
// addref happens in getter, so we don't addref here
|
||||
nsISimplePlugin * scriptablePeer = getScriptablePeer();
|
||||
nsIScriptablePluginSample * scriptablePeer = getScriptablePeer();
|
||||
if (scriptablePeer) {
|
||||
*(nsISupports **)aValue = scriptablePeer;
|
||||
} else
|
||||
rv = NPERR_OUT_OF_MEMORY_ERROR;
|
||||
}
|
||||
break;
|
||||
|
||||
case NPPVpluginScriptableIID: {
|
||||
static nsIID scriptableIID = NS_ISIMPLEPLUGIN_IID;
|
||||
else if (aVariable == NPPVpluginScriptableIID) {
|
||||
static nsIID scriptableIID = NS_ISCRIPTABLEPLUGINSAMPLE_IID;
|
||||
nsIID* ptr = (nsIID *)NPN_MemAlloc(sizeof(nsIID));
|
||||
if (ptr) {
|
||||
*ptr = scriptableIID;
|
||||
*(nsIID **)aValue = ptr;
|
||||
} else
|
||||
rv = NPERR_OUT_OF_MEMORY_ERROR;
|
||||
}
|
||||
break;
|
||||
|
||||
case NPPVpluginNameString:
|
||||
*((char **)aValue) = PLUGIN_NAME;
|
||||
break;
|
||||
case NPPVpluginDescriptionString:
|
||||
*((char **)aValue) = PLUGIN_DESCRIPTION;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return rv;
|
||||
|
||||
@@ -38,6 +38,11 @@
|
||||
#ifndef __PLUGIN_H__
|
||||
#define __PLUGIN_H__
|
||||
|
||||
/* Xlib/Xt stuff */
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Intrinsic.h>
|
||||
#include <X11/cursorfont.h>
|
||||
|
||||
#include "pluginbase.h"
|
||||
#include "nsScriptablePeer.h"
|
||||
|
||||
@@ -45,13 +50,14 @@ class nsPluginInstance : public nsPluginInstanceBase
|
||||
{
|
||||
public:
|
||||
nsPluginInstance(NPP aInstance);
|
||||
~nsPluginInstance();
|
||||
virtual ~nsPluginInstance();
|
||||
|
||||
NPBool init(NPWindow* aWindow);
|
||||
void shut();
|
||||
NPBool isInitialized();
|
||||
|
||||
NPError GetValue(NPPVariable variable, void *value);
|
||||
NPError SetWindow(NPWindow* aWindow);
|
||||
|
||||
// locals
|
||||
void showVersion();
|
||||
@@ -62,16 +68,17 @@ public:
|
||||
|
||||
private:
|
||||
NPP mInstance;
|
||||
NPBool mInitialized;
|
||||
|
||||
Window mWindow;
|
||||
Display *mDisplay;
|
||||
Widget mXtwidget;
|
||||
int mX, mY;
|
||||
int mWidth, mHeight;
|
||||
Visual* mVisual;
|
||||
Colormap mColormap;
|
||||
unsigned int mDepth;
|
||||
XFontStruct *mFontInfo;
|
||||
GC mGC;
|
||||
|
||||
nsScriptablePeer* mScriptablePeer;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user