|
21
|
1 |
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
|
2 |
/* ***** BEGIN LICENSE BLOCK ***** |
|
|
3 |
* Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
|
|
4 |
* |
|
|
5 |
* The contents of this file are subject to the Mozilla Public License Version |
|
|
6 |
* 1.1 (the "License"); you may not use this file except in compliance with |
|
|
7 |
* the License. You may obtain a copy of the License at |
|
|
8 |
* http://www.mozilla.org/MPL/ |
|
|
9 |
* |
|
|
10 |
* Software distributed under the License is distributed on an "AS IS" basis, |
|
|
11 |
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License |
|
|
12 |
* for the specific language governing rights and limitations under the |
|
|
13 |
* License. |
|
|
14 |
* |
|
|
15 |
* The Original Code is mozilla.org code. |
|
|
16 |
* |
|
|
17 |
* The Initial Developer of the Original Code is |
|
|
18 |
* Netscape Communications Corporation. |
|
|
19 |
* Portions created by the Initial Developer are Copyright (C) 1998 |
|
|
20 |
* the Initial Developer. All Rights Reserved. |
|
|
21 |
* |
|
|
22 |
* Contributor(s): |
|
|
23 |
* |
|
|
24 |
* Alternatively, the contents of this file may be used under the terms of |
|
|
25 |
* either the GNU General Public License Version 2 or later (the "GPL"), or |
|
|
26 |
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), |
|
|
27 |
* in which case the provisions of the GPL or the LGPL are applicable instead |
|
|
28 |
* of those above. If you wish to allow use of your version of this file only |
|
|
29 |
* under the terms of either the GPL or the LGPL, and not to allow others to |
|
|
30 |
* use your version of this file under the terms of the MPL, indicate your |
|
|
31 |
* decision by deleting the provisions above and replace them with the notice |
|
|
32 |
* and other provisions required by the GPL or the LGPL. If you do not delete |
|
|
33 |
* the provisions above, a recipient may use your version of this file under |
|
|
34 |
* the terms of any one of the MPL, the GPL or the LGPL. |
|
|
35 |
* |
|
|
36 |
* ***** END LICENSE BLOCK ***** */ |
|
|
37 |
|
|
|
38 |
#ifndef _NPPLAT_H_ |
|
|
39 |
#define _NPPLAT_H_ |
|
|
40 |
|
|
|
41 |
#include "npapi.h" |
|
|
42 |
#include "npupp.h" |
|
|
43 |
|
|
|
44 |
/**************************************************/ |
|
|
45 |
/* */ |
|
|
46 |
/* Windows */ |
|
|
47 |
/* */ |
|
|
48 |
/**************************************************/ |
|
|
49 |
#ifdef XP_WIN |
|
|
50 |
#include "windows.h" |
|
|
51 |
#endif //XP_WIN |
|
|
52 |
|
|
|
53 |
/**************************************************/ |
|
|
54 |
/* */ |
|
|
55 |
/* Unix */ |
|
|
56 |
/* */ |
|
|
57 |
/**************************************************/ |
|
|
58 |
#ifdef XP_UNIX |
|
|
59 |
#include <stdio.h> |
|
|
60 |
#endif //XP_UNIX |
|
|
61 |
|
|
|
62 |
/**************************************************/ |
|
|
63 |
/* */ |
|
|
64 |
/* Mac */ |
|
|
65 |
/* */ |
|
|
66 |
/**************************************************/ |
|
|
67 |
#ifdef XP_MAC |
|
|
68 |
|
|
|
69 |
// Wrapper functions for all calls from Netscape to the plugin. |
|
|
70 |
// These functions let the plugin developer just create the APIs |
|
|
71 |
// as documented and defined in npapi.h, without needing to |
|
|
72 |
// install those functions in the function table or worry about |
|
|
73 |
// setting up globals for 68K plugins. |
|
|
74 |
NPError Private_Initialize(void); |
|
|
75 |
void Private_Shutdown(void); |
|
|
76 |
NPError Private_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char* argn[], char* argv[], NPSavedData* saved); |
|
|
77 |
NPError Private_Destroy(NPP instance, NPSavedData** save); |
|
|
78 |
NPError Private_SetWindow(NPP instance, NPWindow* window); |
|
|
79 |
NPError Private_NewStream(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16* stype); |
|
|
80 |
NPError Private_DestroyStream(NPP instance, NPStream* stream, NPError reason); |
|
|
81 |
int32 Private_WriteReady(NPP instance, NPStream* stream); |
|
|
82 |
int32 Private_Write(NPP instance, NPStream* stream, int32 offset, int32 len, void* buffer); |
|
|
83 |
void Private_StreamAsFile(NPP instance, NPStream* stream, const char* fname); |
|
|
84 |
void Private_Print(NPP instance, NPPrint* platformPrint); |
|
|
85 |
int16 Private_HandleEvent(NPP instance, void* event); |
|
|
86 |
void Private_URLNotify(NPP instance, const char* url, NPReason reason, void* notifyData); |
|
|
87 |
jref Private_GetJavaClass(void); |
|
|
88 |
NPError Private_GetValue(NPP instance, NPPVariable variable, void *result); |
|
|
89 |
NPError Private_SetValue(NPP instance, NPNVariable variable, void *value); |
|
|
90 |
|
|
|
91 |
#endif //XP_MAC |
|
|
92 |
|
|
|
93 |
#ifndef HIBYTE |
|
|
94 |
#define HIBYTE(i) (i >> 8) |
|
|
95 |
#endif |
|
|
96 |
|
|
|
97 |
#ifndef LOBYTE |
|
|
98 |
#define LOBYTE(i) (i & 0xff) |
|
|
99 |
#endif |
|
|
100 |
|
|
|
101 |
#endif //_NPPLAT_H_ |