ReactOS 0.4.16-dev-340-g0540c21
npplugin.c File Reference
#include "mshtml_private.h"
Include dependency graph for npplugin.c:

Go to the source code of this file.

Classes

struct  _NPP
 
struct  _NPStream
 
struct  _NPSavedData
 
struct  _NPRect
 
struct  _NPWindow
 
struct  _NPFullPrint
 
struct  _NPEmbedPrint
 
struct  _NPPrint
 
struct  _NPPluginFuncs
 

Macros

#define NP_VERSION_MAJOR   0
 
#define NP_VERSION_MINOR   25
 
#define NP_ABI_MASK   0
 
#define NPERR_BASE   0
 
#define NPERR_NO_ERROR   (NPERR_BASE + 0)
 
#define NPERR_GENERIC_ERROR   (NPERR_BASE + 1)
 
#define NPERR_INVALID_INSTANCE_ERROR   (NPERR_BASE + 2)
 
#define NPERR_INVALID_FUNCTABLE_ERROR   (NPERR_BASE + 3)
 
#define NPERR_MODULE_LOAD_FAILED_ERROR   (NPERR_BASE + 4)
 
#define NPERR_OUT_OF_MEMORY_ERROR   (NPERR_BASE + 5)
 
#define NPERR_INVALID_PLUGIN_ERROR   (NPERR_BASE + 6)
 
#define NPERR_INVALID_PLUGIN_DIR_ERROR   (NPERR_BASE + 7)
 
#define NPERR_INCOMPATIBLE_VERSION_ERROR   (NPERR_BASE + 8)
 
#define NPERR_INVALID_PARAM   (NPERR_BASE + 9)
 
#define NPERR_INVALID_URL   (NPERR_BASE + 10)
 
#define NPERR_FILE_NOT_FOUND   (NPERR_BASE + 11)
 
#define NPERR_NO_DATA   (NPERR_BASE + 12)
 
#define NPERR_STREAM_NOT_SEEKABLE   (NPERR_BASE + 13)
 

Typedefs

typedef unsigned char NPBool
 
typedef INT16 NPError
 
typedef INT16 NPReason
 
typedef charNPMIMEType
 
typedef struct _NPP NPP_t
 
typedef struct _NPPNPP
 
typedef struct _NPStream NPStream
 
typedef struct _NPSavedData NPSavedData
 
typedef struct _NPRect NPRect
 
typedef struct _NPWindow NPWindow
 
typedef struct _NPFullPrint NPFullPrint
 
typedef struct _NPEmbedPrint NPEmbedPrint
 
typedef struct _NPPrint NPPrint
 
typedef HRGN NPRegion
 
typedef NPError(CDECLNPP_NewProcPtr) (NPMIMEType, NPP, UINT16, INT16, char **, char **, NPSavedData *)
 
typedef NPError(CDECLNPP_DestroyProcPtr) (NPP, NPSavedData **)
 
typedef NPError(CDECLNPP_SetWindowProcPtr) (NPP, NPWindow *)
 
typedef NPError(CDECLNPP_NewStreamProcPtr) (NPP, NPMIMEType, NPStream *, NPBool, UINT16 *)
 
typedef NPError(CDECLNPP_DestroyStreamProcPtr) (NPP, NPStream *, NPReason)
 
typedef INT32(CDECLNPP_WriteReadyProcPtr) (NPP, NPStream *)
 
typedef INT32(CDECLNPP_WriteProcPtr) (NPP, NPStream *, INT32, INT32, void *)
 
typedef void(CDECLNPP_StreamAsFileProcPtr) (NPP, NPStream *, const char *)
 
typedef void(CDECLNPP_PrintProcPtr) (NPP, NPPrint *)
 
typedef INT16(CDECLNPP_HandleEventProcPtr) (NPP, void *)
 
typedef void(CDECLNPP_URLNotifyProcPtr) (NPP, const char *, NPReason, void *)
 
typedef NPError(CDECLNPP_GetValueProcPtr) (NPP, NPPVariable, void *)
 
typedef NPError(CDECLNPP_SetValueProcPtr) (NPP, NPNVariable, void *)
 
typedef NPBool(CDECLNPP_GotFocusPtr) (NPP, NPFocusDirection)
 
typedef void(CDECLNPP_LostFocusPtr) (NPP)
 
typedef struct _NPPluginFuncs NPPluginFuncs
 

Enumerations

enum  NPFocusDirection { NPFocusNext = 0 , NPFocusPrevious = 1 }
 
enum  NPPVariable {
  NPPVpluginNameString = 1 , NPPVpluginDescriptionString , NPPVpluginWindowBool , NPPVpluginTransparentBool ,
  NPPVjavaClass , NPPVpluginWindowSize , NPPVpluginTimerInterval , NPPVpluginScriptableInstance = (10 | NP_ABI_MASK) ,
  NPPVpluginScriptableIID = 11 , NPPVjavascriptPushCallerBool = 12 , NPPVpluginKeepLibraryInMemory = 13 , NPPVpluginNeedsXEmbed = 14 ,
  NPPVpluginScriptableNPObject = 15 , NPPVformValue = 16 , NPPVpluginUrlRequestsDisplayedBool = 17 , NPPVpluginWantsAllNetworkStreams = 18 ,
  NPPVpluginNativeAccessibleAtkPlugId = 19 , NPPVpluginCancelSrcStream = 20 , NPPVSupportsAdvancedKeyHandling = 21
}
 
enum  NPNVariable {
  NPNVxDisplay = 1 , NPNVxtAppContext , NPNVnetscapeWindow , NPNVjavascriptEnabledBool ,
  NPNVasdEnabledBool , NPNVisOfflineBool , NPNVserviceManager = (10 | NP_ABI_MASK) , NPNVDOMElement = (11 | NP_ABI_MASK) ,
  NPNVDOMWindow = (12 | NP_ABI_MASK) , NPNVToolkit = (13 | NP_ABI_MASK) , NPNVSupportsXEmbedBool = 14 , NPNVWindowNPObject = 15 ,
  NPNVPluginElementNPObject = 16 , NPNVSupportsWindowless = 17 , NPNVprivateModeBool = 18 , NPNVsupportsAdvancedKeyHandling = 21
}
 
enum  NPWindowType { NPWindowTypeWindow = 1 , NPWindowTypeDrawable }
 

Functions

static nsIDOMHTMLElementget_dom_element (NPP instance)
 
static HTMLInnerWindowget_elem_window (nsIDOMHTMLElement *elem)
 
static NPError CDECL NPP_New (NPMIMEType pluginType, NPP instance, UINT16 mode, INT16 argc, char **argn, char **argv, NPSavedData *saved)
 
static NPError CDECL NPP_Destroy (NPP instance, NPSavedData **save)
 
static NPError CDECL NPP_SetWindow (NPP instance, NPWindow *window)
 
static NPError CDECL NPP_NewStream (NPP instance, NPMIMEType type, NPStream *stream, NPBool seekable, UINT16 *stype)
 
static NPError CDECL NPP_DestroyStream (NPP instance, NPStream *stream, NPReason reason)
 
static INT32 CDECL NPP_WriteReady (NPP instance, NPStream *stream)
 
static INT32 CDECL NPP_Write (NPP instance, NPStream *stream, INT32 offset, INT32 len, void *buffer)
 
static void CDECL NPP_StreamAsFile (NPP instance, NPStream *stream, const char *fname)
 
static void CDECL NPP_Print (NPP instance, NPPrint *platformPrint)
 
static INT16 CDECL NPP_HandleEvent (NPP instance, void *event)
 
static void CDECL NPP_URLNotify (NPP instance, const char *url, NPReason reason, void *notifyData)
 
static NPError CDECL NPP_GetValue (NPP instance, NPPVariable variable, void *ret_value)
 
static NPError CDECL NPP_SetValue (NPP instance, NPNVariable variable, void *value)
 
static NPBool CDECL NPP_GotFocus (NPP instance, NPFocusDirection direction)
 
static void CDECL NPP_LostFocus (NPP instance)
 
NPError WINAPI NP_GetEntryPoints (NPPluginFuncs *funcs)
 

Macro Definition Documentation

◆ NP_ABI_MASK

#define NP_ABI_MASK   0

Definition at line 63 of file npplugin.c.

◆ NP_VERSION_MAJOR

#define NP_VERSION_MAJOR   0

Definition at line 23 of file npplugin.c.

◆ NP_VERSION_MINOR

#define NP_VERSION_MINOR   25

Definition at line 24 of file npplugin.c.

◆ NPERR_BASE

#define NPERR_BASE   0

Definition at line 142 of file npplugin.c.

◆ NPERR_FILE_NOT_FOUND

#define NPERR_FILE_NOT_FOUND   (NPERR_BASE + 11)

Definition at line 154 of file npplugin.c.

◆ NPERR_GENERIC_ERROR

#define NPERR_GENERIC_ERROR   (NPERR_BASE + 1)

Definition at line 144 of file npplugin.c.

◆ NPERR_INCOMPATIBLE_VERSION_ERROR

#define NPERR_INCOMPATIBLE_VERSION_ERROR   (NPERR_BASE + 8)

Definition at line 151 of file npplugin.c.

◆ NPERR_INVALID_FUNCTABLE_ERROR

#define NPERR_INVALID_FUNCTABLE_ERROR   (NPERR_BASE + 3)

Definition at line 146 of file npplugin.c.

◆ NPERR_INVALID_INSTANCE_ERROR

#define NPERR_INVALID_INSTANCE_ERROR   (NPERR_BASE + 2)

Definition at line 145 of file npplugin.c.

◆ NPERR_INVALID_PARAM

#define NPERR_INVALID_PARAM   (NPERR_BASE + 9)

Definition at line 152 of file npplugin.c.

◆ NPERR_INVALID_PLUGIN_DIR_ERROR

#define NPERR_INVALID_PLUGIN_DIR_ERROR   (NPERR_BASE + 7)

Definition at line 150 of file npplugin.c.

◆ NPERR_INVALID_PLUGIN_ERROR

#define NPERR_INVALID_PLUGIN_ERROR   (NPERR_BASE + 6)

Definition at line 149 of file npplugin.c.

◆ NPERR_INVALID_URL

#define NPERR_INVALID_URL   (NPERR_BASE + 10)

Definition at line 153 of file npplugin.c.

◆ NPERR_MODULE_LOAD_FAILED_ERROR

#define NPERR_MODULE_LOAD_FAILED_ERROR   (NPERR_BASE + 4)

Definition at line 147 of file npplugin.c.

◆ NPERR_NO_DATA

#define NPERR_NO_DATA   (NPERR_BASE + 12)

Definition at line 155 of file npplugin.c.

◆ NPERR_NO_ERROR

#define NPERR_NO_ERROR   (NPERR_BASE + 0)

Definition at line 143 of file npplugin.c.

◆ NPERR_OUT_OF_MEMORY_ERROR

#define NPERR_OUT_OF_MEMORY_ERROR   (NPERR_BASE + 5)

Definition at line 148 of file npplugin.c.

◆ NPERR_STREAM_NOT_SEEKABLE

#define NPERR_STREAM_NOT_SEEKABLE   (NPERR_BASE + 13)

Definition at line 156 of file npplugin.c.

Typedef Documentation

◆ NPBool

typedef unsigned char NPBool

Definition at line 26 of file npplugin.c.

◆ NPEmbedPrint

◆ NPError

typedef INT16 NPError

Definition at line 27 of file npplugin.c.

◆ NPFullPrint

◆ NPMIMEType

typedef char* NPMIMEType

Definition at line 29 of file npplugin.c.

◆ NPP

typedef struct _NPP * NPP

◆ NPP_DestroyProcPtr

typedef NPError(CDECL * NPP_DestroyProcPtr) (NPP, NPSavedData **)

Definition at line 161 of file npplugin.c.

◆ NPP_DestroyStreamProcPtr

typedef NPError(CDECL * NPP_DestroyStreamProcPtr) (NPP, NPStream *, NPReason)

Definition at line 164 of file npplugin.c.

◆ NPP_GetValueProcPtr

typedef NPError(CDECL * NPP_GetValueProcPtr) (NPP, NPPVariable, void *)

Definition at line 171 of file npplugin.c.

◆ NPP_GotFocusPtr

typedef NPBool(CDECL * NPP_GotFocusPtr) (NPP, NPFocusDirection)

Definition at line 173 of file npplugin.c.

◆ NPP_HandleEventProcPtr

typedef INT16(CDECL * NPP_HandleEventProcPtr) (NPP, void *)

Definition at line 169 of file npplugin.c.

◆ NPP_LostFocusPtr

typedef void(CDECL * NPP_LostFocusPtr) (NPP)

Definition at line 174 of file npplugin.c.

◆ NPP_NewProcPtr

typedef NPError(CDECL * NPP_NewProcPtr) (NPMIMEType, NPP, UINT16, INT16, char **, char **, NPSavedData *)

Definition at line 160 of file npplugin.c.

◆ NPP_NewStreamProcPtr

typedef NPError(CDECL * NPP_NewStreamProcPtr) (NPP, NPMIMEType, NPStream *, NPBool, UINT16 *)

Definition at line 163 of file npplugin.c.

◆ NPP_PrintProcPtr

typedef void(CDECL * NPP_PrintProcPtr) (NPP, NPPrint *)

Definition at line 168 of file npplugin.c.

◆ NPP_SetValueProcPtr

typedef NPError(CDECL * NPP_SetValueProcPtr) (NPP, NPNVariable, void *)

Definition at line 172 of file npplugin.c.

◆ NPP_SetWindowProcPtr

typedef NPError(CDECL * NPP_SetWindowProcPtr) (NPP, NPWindow *)

Definition at line 162 of file npplugin.c.

◆ NPP_StreamAsFileProcPtr

typedef void(CDECL * NPP_StreamAsFileProcPtr) (NPP, NPStream *, const char *)

Definition at line 167 of file npplugin.c.

◆ NPP_t

typedef struct _NPP NPP_t

◆ NPP_URLNotifyProcPtr

typedef void(CDECL * NPP_URLNotifyProcPtr) (NPP, const char *, NPReason, void *)

Definition at line 170 of file npplugin.c.

◆ NPP_WriteProcPtr

typedef INT32(CDECL * NPP_WriteProcPtr) (NPP, NPStream *, INT32, INT32, void *)

Definition at line 166 of file npplugin.c.

◆ NPP_WriteReadyProcPtr

typedef INT32(CDECL * NPP_WriteReadyProcPtr) (NPP, NPStream *)

Definition at line 165 of file npplugin.c.

◆ NPPluginFuncs

◆ NPPrint

◆ NPReason

typedef INT16 NPReason

Definition at line 28 of file npplugin.c.

◆ NPRect

◆ NPRegion

typedef HRGN NPRegion

Definition at line 140 of file npplugin.c.

◆ NPSavedData

◆ NPStream

◆ NPWindow

Enumeration Type Documentation

◆ NPFocusDirection

Enumerator
NPFocusNext 
NPFocusPrevious 

Definition at line 58 of file npplugin.c.

58 {
59 NPFocusNext = 0,
NPFocusDirection
Definition: npplugin.c:58
@ NPFocusPrevious
Definition: npplugin.c:60
@ NPFocusNext
Definition: npplugin.c:59

◆ NPNVariable

Enumerator
NPNVxDisplay 
NPNVxtAppContext 
NPNVnetscapeWindow 
NPNVjavascriptEnabledBool 
NPNVasdEnabledBool 
NPNVisOfflineBool 
NPNVserviceManager 
NPNVDOMElement 
NPNVDOMWindow 
NPNVToolkit 
NPNVSupportsXEmbedBool 
NPNVWindowNPObject 
NPNVPluginElementNPObject 
NPNVSupportsWindowless 
NPNVprivateModeBool 
NPNVsupportsAdvancedKeyHandling 

Definition at line 87 of file npplugin.c.

87 {
88 NPNVxDisplay = 1,
97 NPNVToolkit = (13 | NP_ABI_MASK),
#define NP_ABI_MASK
Definition: npplugin.c:63
NPNVariable
Definition: npplugin.c:87
@ NPNVWindowNPObject
Definition: npplugin.c:99
@ NPNVsupportsAdvancedKeyHandling
Definition: npplugin.c:103
@ NPNVSupportsWindowless
Definition: npplugin.c:101
@ NPNVxtAppContext
Definition: npplugin.c:89
@ NPNVDOMElement
Definition: npplugin.c:95
@ NPNVToolkit
Definition: npplugin.c:97
@ NPNVnetscapeWindow
Definition: npplugin.c:90
@ NPNVPluginElementNPObject
Definition: npplugin.c:100
@ NPNVjavascriptEnabledBool
Definition: npplugin.c:91
@ NPNVisOfflineBool
Definition: npplugin.c:93
@ NPNVprivateModeBool
Definition: npplugin.c:102
@ NPNVasdEnabledBool
Definition: npplugin.c:92
@ NPNVSupportsXEmbedBool
Definition: npplugin.c:98
@ NPNVDOMWindow
Definition: npplugin.c:96
@ NPNVserviceManager
Definition: npplugin.c:94
@ NPNVxDisplay
Definition: npplugin.c:88

◆ NPPVariable

Enumerator
NPPVpluginNameString 
NPPVpluginDescriptionString 
NPPVpluginWindowBool 
NPPVpluginTransparentBool 
NPPVjavaClass 
NPPVpluginWindowSize 
NPPVpluginTimerInterval 
NPPVpluginScriptableInstance 
NPPVpluginScriptableIID 
NPPVjavascriptPushCallerBool 
NPPVpluginKeepLibraryInMemory 
NPPVpluginNeedsXEmbed 
NPPVpluginScriptableNPObject 
NPPVformValue 
NPPVpluginUrlRequestsDisplayedBool 
NPPVpluginWantsAllNetworkStreams 
NPPVpluginNativeAccessibleAtkPlugId 
NPPVpluginCancelSrcStream 
NPPVSupportsAdvancedKeyHandling 

Definition at line 65 of file npplugin.c.

65 {
79 NPPVformValue = 16,
NPPVariable
Definition: npplugin.c:65
@ NPPVpluginNeedsXEmbed
Definition: npplugin.c:77
@ NPPVpluginTimerInterval
Definition: npplugin.c:72
@ NPPVjavascriptPushCallerBool
Definition: npplugin.c:75
@ NPPVpluginScriptableNPObject
Definition: npplugin.c:78
@ NPPVformValue
Definition: npplugin.c:79
@ NPPVpluginWindowSize
Definition: npplugin.c:71
@ NPPVpluginDescriptionString
Definition: npplugin.c:67
@ NPPVpluginScriptableInstance
Definition: npplugin.c:73
@ NPPVSupportsAdvancedKeyHandling
Definition: npplugin.c:84
@ NPPVpluginNativeAccessibleAtkPlugId
Definition: npplugin.c:82
@ NPPVpluginKeepLibraryInMemory
Definition: npplugin.c:76
@ NPPVpluginWantsAllNetworkStreams
Definition: npplugin.c:81
@ NPPVpluginUrlRequestsDisplayedBool
Definition: npplugin.c:80
@ NPPVpluginCancelSrcStream
Definition: npplugin.c:83
@ NPPVpluginScriptableIID
Definition: npplugin.c:74
@ NPPVpluginWindowBool
Definition: npplugin.c:68
@ NPPVpluginTransparentBool
Definition: npplugin.c:69
@ NPPVpluginNameString
Definition: npplugin.c:66
@ NPPVjavaClass
Definition: npplugin.c:70

◆ NPWindowType

Enumerator
NPWindowTypeWindow 
NPWindowTypeDrawable 

Definition at line 106 of file npplugin.c.

106 {
NPWindowType
Definition: npplugin.c:106
@ NPWindowTypeWindow
Definition: npplugin.c:107
@ NPWindowTypeDrawable
Definition: npplugin.c:108

Function Documentation

◆ get_dom_element()

static nsIDOMHTMLElement * get_dom_element ( NPP  instance)
static

Definition at line 197 of file npplugin.c.

198{
199 nsISupports *instance_unk = (nsISupports*)instance->ndata;
200 nsIPluginInstance *plugin_instance;
201 nsIDOMHTMLElement *html_elem;
203 nsresult nsres;
204
205 nsres = nsISupports_QueryInterface(instance_unk, &IID_nsIPluginInstance, (void**)&plugin_instance);
206 if(NS_FAILED(nsres)) {
207 ERR("Could not get nsIPluginInstance interface: %08x\n", nsres);
208 return NULL;
209 }
210
211 nsres = nsIPluginInstance_GetDOMElement(plugin_instance, &elem);
212 nsIPluginInstance_Release(plugin_instance);
213 if(NS_FAILED(nsres)) {
214 ERR("GetDOMElement failed: %08x\n", nsres);
215 return NULL;
216 }
217
218 nsres = nsIDOMElement_QueryInterface(elem, &IID_nsIDOMHTMLElement, (void**)&html_elem);
219 nsIDOMElement_Release(elem);
220 if(NS_FAILED(nsres)) {
221 ERR("Could not get nsIDOMHTMLElement iface: %08x\n", nsres);
222 return NULL;
223 }
224
225 return html_elem;
226}
#define ERR(fmt,...)
Definition: precomp.h:57
#define NULL
Definition: types.h:112
static HINSTANCE instance
Definition: main.c:40
static size_t elem
Definition: string.c:68
#define NS_FAILED(res)

Referenced by NPP_New().

◆ get_elem_window()

static HTMLInnerWindow * get_elem_window ( nsIDOMHTMLElement elem)
static

Definition at line 228 of file npplugin.c.

229{
230 nsIDOMWindow *nswindow;
231 nsIDOMDocument *nsdoc;
233 nsresult nsres;
234
235 nsres = nsIDOMHTMLElement_GetOwnerDocument(elem, &nsdoc);
236 if(NS_FAILED(nsres))
237 return NULL;
238
239 nsres = nsIDOMDocument_GetDefaultView(nsdoc, &nswindow);
240 nsIDOMDocument_Release(nsdoc);
241 if(NS_FAILED(nsres) || !nswindow)
242 return NULL;
243
244 window = nswindow_to_window(nswindow);
245 nsIDOMWindow_Release(nswindow);
246
247 return window->base.inner_window;
248}
HTMLOuterWindow * nswindow_to_window(const nsIDOMWindow *nswindow)
Definition: htmlwindow.c:3099
static IHTMLWindow2 * window
Definition: events.c:77

Referenced by NPP_New().

◆ NP_GetEntryPoints()

NPError WINAPI NP_GetEntryPoints ( NPPluginFuncs funcs)

Definition at line 402 of file npplugin.c.

403{
404 TRACE("(%p)\n", funcs);
405
406 funcs->version = (NP_VERSION_MAJOR << 8) | NP_VERSION_MINOR;
407 funcs->newp = NPP_New;
408 funcs->destroy = NPP_Destroy;
409 funcs->setwindow = NPP_SetWindow;
410 funcs->newstream = NPP_NewStream;
411 funcs->destroystream = NPP_DestroyStream;
412 funcs->asfile = NPP_StreamAsFile;
413 funcs->writeready = NPP_WriteReady;
414 funcs->write = NPP_Write;
415 funcs->print = NPP_Print;
416 funcs->event = NPP_HandleEvent;
417 funcs->urlnotify = NPP_URLNotify;
418 funcs->javaClass = NULL;
419 funcs->getvalue = NPP_GetValue;
420 funcs->setvalue = NPP_SetValue;
421 funcs->gotfocus = NPP_GotFocus;
422 funcs->lostfocus = NPP_LostFocus;
423
424 return NPERR_NO_ERROR;
425}
static NPError CDECL NPP_NewStream(NPP instance, NPMIMEType type, NPStream *stream, NPBool seekable, UINT16 *stype)
Definition: npplugin.c:331
static NPError CDECL NPP_DestroyStream(NPP instance, NPStream *stream, NPReason reason)
Definition: npplugin.c:337
static NPError CDECL NPP_SetValue(NPP instance, NPNVariable variable, void *value)
Definition: npplugin.c:382
static NPError CDECL NPP_New(NPMIMEType pluginType, NPP instance, UINT16 mode, INT16 argc, char **argn, char **argv, NPSavedData *saved)
Definition: npplugin.c:250
static NPError CDECL NPP_GetValue(NPP instance, NPPVariable variable, void *ret_value)
Definition: npplugin.c:376
static void CDECL NPP_Print(NPP instance, NPPrint *platformPrint)
Definition: npplugin.c:360
static NPError CDECL NPP_Destroy(NPP instance, NPSavedData **save)
Definition: npplugin.c:302
#define NPERR_NO_ERROR
Definition: npplugin.c:143
#define NP_VERSION_MINOR
Definition: npplugin.c:24
static INT32 CDECL NPP_WriteReady(NPP instance, NPStream *stream)
Definition: npplugin.c:343
static INT32 CDECL NPP_Write(NPP instance, NPStream *stream, INT32 offset, INT32 len, void *buffer)
Definition: npplugin.c:349
static void CDECL NPP_URLNotify(NPP instance, const char *url, NPReason reason, void *notifyData)
Definition: npplugin.c:371
static INT16 CDECL NPP_HandleEvent(NPP instance, void *event)
Definition: npplugin.c:365
static NPBool CDECL NPP_GotFocus(NPP instance, NPFocusDirection direction)
Definition: npplugin.c:388
static NPError CDECL NPP_SetWindow(NPP instance, NPWindow *window)
Definition: npplugin.c:317
#define NP_VERSION_MAJOR
Definition: npplugin.c:23
static void CDECL NPP_StreamAsFile(NPP instance, NPStream *stream, const char *fname)
Definition: npplugin.c:355
static void CDECL NPP_LostFocus(NPP instance)
Definition: npplugin.c:394
static struct __wine_debug_functions funcs
Definition: debug.c:59
#define TRACE(s)
Definition: solgame.cpp:4

◆ NPP_Destroy()

static NPError CDECL NPP_Destroy ( NPP  instance,
NPSavedData **  save 
)
static

Definition at line 302 of file npplugin.c.

303{
304 PluginHost *host = instance->pdata;
305
306 TRACE("(%p %p)\n", instance, save);
307
308 if(!host)
309 return NPERR_GENERIC_ERROR;
310
312 IOleClientSite_Release(&host->IOleClientSite_iface);
313 instance->pdata = NULL;
314 return NPERR_NO_ERROR;
315}
#define NPERR_GENERIC_ERROR
Definition: npplugin.c:144
void detach_plugin_host(PluginHost *host)
Definition: pluginhost.c:1988
char * host
Definition: whois.c:55

Referenced by NP_GetEntryPoints().

◆ NPP_DestroyStream()

static NPError CDECL NPP_DestroyStream ( NPP  instance,
NPStream stream,
NPReason  reason 
)
static

Definition at line 337 of file npplugin.c.

338{
339 TRACE("\n");
340 return NPERR_GENERIC_ERROR;
341}

Referenced by NP_GetEntryPoints().

◆ NPP_GetValue()

static NPError CDECL NPP_GetValue ( NPP  instance,
NPPVariable  variable,
void ret_value 
)
static

Definition at line 376 of file npplugin.c.

377{
378 TRACE("\n");
379 return NPERR_GENERIC_ERROR;
380}

Referenced by NP_GetEntryPoints().

◆ NPP_GotFocus()

static NPBool CDECL NPP_GotFocus ( NPP  instance,
NPFocusDirection  direction 
)
static

Definition at line 388 of file npplugin.c.

389{
390 FIXME("\n");
391 return NPERR_GENERIC_ERROR;
392}
#define FIXME(fmt,...)
Definition: precomp.h:53

Referenced by NP_GetEntryPoints().

◆ NPP_HandleEvent()

static INT16 CDECL NPP_HandleEvent ( NPP  instance,
void event 
)
static

Definition at line 365 of file npplugin.c.

366{
367 TRACE("\n");
368 return NPERR_GENERIC_ERROR;
369}

Referenced by NP_GetEntryPoints().

◆ NPP_LostFocus()

static void CDECL NPP_LostFocus ( NPP  instance)
static

Definition at line 394 of file npplugin.c.

395{
396 FIXME("\n");
397}

Referenced by NP_GetEntryPoints().

◆ NPP_New()

static NPError CDECL NPP_New ( NPMIMEType  pluginType,
NPP  instance,
UINT16  mode,
INT16  argc,
char **  argn,
char **  argv,
NPSavedData saved 
)
static

Definition at line 250 of file npplugin.c.

252{
254 nsIDOMHTMLElement *nselem;
259
260 TRACE("(%s %p %x %d %p %p %p)\n", debugstr_a(pluginType), instance, mode, argc, argn, argv, saved);
261
262 nselem = get_dom_element(instance);
263 if(!nselem) {
264 ERR("Could not get DOM element\n");
265 return NPERR_GENERIC_ERROR;
266 }
267
268 window = get_elem_window(nselem);
269 if(!window) {
270 ERR("Could not get element's window object\n");
271 nsIDOMHTMLElement_Release(nselem);
272 return NPERR_GENERIC_ERROR;
273 }
274
275 hres = get_node(window->doc, (nsIDOMNode*)nselem, TRUE, &node);
276 nsIDOMHTMLElement_Release(nselem);
277 if(FAILED(hres))
278 return NPERR_GENERIC_ERROR;
279
280 hres = IHTMLDOMNode_QueryInterface(&node->IHTMLDOMNode_iface, &IID_HTMLPluginContainer,
281 (void**)&container);
283 if(FAILED(hres)) {
284 ERR("Not an object element\n");
285 return NPERR_GENERIC_ERROR;
286 }
287
288 if(!container->plugin_host) {
290 if(FAILED(hres))
292 }else {
293 TRACE("plugin host already associated.\n");
294 }
295
296 instance->pdata = container->plugin_host;
297
298 node_release(&container->element.node);
299 return err;
300}
static int argc
Definition: ServiceArgs.c:12
#define TRUE
Definition: types.h:120
GLenum mode
Definition: glext.h:6217
HRESULT get_node(HTMLDocumentNode *This, nsIDOMNode *nsnode, BOOL create, HTMLDOMNode **ret)
Definition: htmlnode.c:1339
#define FAILED(hr)
Definition: intsafe.h:51
#define debugstr_a
Definition: kernel32.h:31
HRESULT hres
Definition: protocol.c:465
#define argv
Definition: mplay32.c:18
static void node_release(HTMLDOMNode *node)
static HTMLInnerWindow * get_elem_window(nsIDOMHTMLElement *elem)
Definition: npplugin.c:228
INT16 NPError
Definition: npplugin.c:27
static nsIDOMHTMLElement * get_dom_element(NPP instance)
Definition: npplugin.c:197
HRESULT create_plugin_host(HTMLDocumentNode *doc, HTMLPluginContainer *container)
Definition: pluginhost.c:2048
#define err(...)
Definition: dlist.c:348

Referenced by NP_GetEntryPoints().

◆ NPP_NewStream()

static NPError CDECL NPP_NewStream ( NPP  instance,
NPMIMEType  type,
NPStream stream,
NPBool  seekable,
UINT16 stype 
)
static

Definition at line 331 of file npplugin.c.

332{
333 TRACE("\n");
334 return NPERR_GENERIC_ERROR;
335}

Referenced by NP_GetEntryPoints().

◆ NPP_Print()

static void CDECL NPP_Print ( NPP  instance,
NPPrint platformPrint 
)
static

Definition at line 360 of file npplugin.c.

361{
362 FIXME("\n");
363}

Referenced by NP_GetEntryPoints().

◆ NPP_SetValue()

static NPError CDECL NPP_SetValue ( NPP  instance,
NPNVariable  variable,
void value 
)
static

Definition at line 382 of file npplugin.c.

383{
384 TRACE("\n");
385 return NPERR_GENERIC_ERROR;
386}

Referenced by NP_GetEntryPoints().

◆ NPP_SetWindow()

static NPError CDECL NPP_SetWindow ( NPP  instance,
NPWindow window 
)
static

Definition at line 317 of file npplugin.c.

318{
319 PluginHost *host = instance->pdata;
320 RECT pos_rect = {0, 0, window->width, window->height};
321
322 TRACE("(%p %p)\n", instance, window);
323
324 if(!host)
325 return NPERR_GENERIC_ERROR;
326
327 update_plugin_window(host, window->window, &pos_rect);
328 return NPERR_NO_ERROR;
329}
void update_plugin_window(PluginHost *host, HWND hwnd, const RECT *rect)
Definition: pluginhost.c:287

Referenced by NP_GetEntryPoints().

◆ NPP_StreamAsFile()

static void CDECL NPP_StreamAsFile ( NPP  instance,
NPStream stream,
const char fname 
)
static

Definition at line 355 of file npplugin.c.

356{
357 TRACE("\n");
358}

Referenced by NP_GetEntryPoints().

◆ NPP_URLNotify()

static void CDECL NPP_URLNotify ( NPP  instance,
const char url,
NPReason  reason,
void notifyData 
)
static

Definition at line 371 of file npplugin.c.

372{
373 TRACE("\n");
374}

Referenced by NP_GetEntryPoints().

◆ NPP_Write()

static INT32 CDECL NPP_Write ( NPP  instance,
NPStream stream,
INT32  offset,
INT32  len,
void buffer 
)
static

Definition at line 349 of file npplugin.c.

350{
351 TRACE("\n");
352 return NPERR_GENERIC_ERROR;
353}

Referenced by NP_GetEntryPoints().

◆ NPP_WriteReady()

static INT32 CDECL NPP_WriteReady ( NPP  instance,
NPStream stream 
)
static

Definition at line 343 of file npplugin.c.

344{
345 TRACE("\n");
346 return NPERR_GENERIC_ERROR;
347}

Referenced by NP_GetEntryPoints().