home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / lib / plugin / nppriv.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  3.7 KB  |  143 lines

  1. /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19.  
  20. #ifndef _NPPRIV_H_
  21. #define _NPPRIV_H_
  22.  
  23. #include "xp_core.h"
  24. #include "xp_mem.h"
  25. #include "xp_trace.h"
  26. #include "xp_mcom.h"
  27. #include "lo_ele.h"
  28. #include "npupp.h"
  29. #include "npassoc.h"
  30. #include "npapi.h"
  31.  
  32. #define ISFUNCPTR(x) (x != NULL)
  33.  
  34. typedef struct _np_handle np_handle;
  35. typedef struct _np_mimetype np_mimetype;
  36. typedef struct _np_instance np_instance;
  37. typedef struct _np_stream np_stream;
  38. typedef struct _np_data np_data;
  39. typedef struct _np_urlsnode np_urlsnode;
  40. typedef struct _np_reconnect np_reconnect;
  41. struct NPIPlugin;
  42.  
  43. typedef enum {
  44.     NPDataNormal = 0,        /* URL_Struct.fe_data -> NPEmbeddedApp.np_data -> np_data */
  45.     NPDataCache = 1,        /* LO_EmbedStruct.session_data -> np_data */
  46.     NPDataCached = 2,        /* LO_EmbedStruct.session_data -> np_data */
  47.     NPDataSaved = 3            /* LO_EmbedStruct.session_data -> np_data */
  48. } NPDataState;
  49.  
  50. struct _np_data {  
  51.     NPDataState state;  
  52.     np_handle *handle;
  53.     NPEmbeddedApp *app;
  54.     NPSavedData *sdata;
  55.     /* Not valid in state NPDataSaved! */
  56.     np_instance *instance;
  57.     LO_EmbedStruct *lo_struct;
  58.     int32 refs;
  59.     XP_Bool streamStarted;
  60. };
  61.  
  62. struct _np_handle {
  63.     np_handle *next;
  64.     NPPluginFuncs *f;
  65.     void *pdesc;                /* pd glue description */
  66.     int32 refs;
  67.     np_instance *instances;
  68.     np_mimetype *mimetypes;
  69.     char *name;
  70.     char *filename;
  71.     char *description;
  72.     XP_Bool usesNewAPI;
  73.     struct NPIPlugin* userPlugin;
  74. };
  75.  
  76. struct _np_mimetype {
  77.     np_mimetype* next;
  78.     NPMIMEType type;
  79.     NPFileTypeAssoc *fassoc;
  80.     np_handle* handle;
  81.     XP_Bool enabled;
  82. };
  83.  
  84. struct _np_instance {
  85.     np_handle *handle;
  86.     np_mimetype *mimetype;
  87.     char *typeString;
  88.     np_instance *next;
  89.     NPEmbeddedApp *app;
  90.     NPP npp;
  91.     MWContext *cx;
  92.     np_stream *streams;
  93.     uint16 type;
  94.     int reentrant;
  95.     URL_Struct *delayedload;
  96.     XP_List *url_list;
  97.     JRIEnv* javaEnv;
  98.     JRIGlobalRef javaInstance;
  99.     XP_Bool windowed;           /* TRUE = has its own window, FALSE = windowless */
  100.     XP_Bool transparent;        /* TRUE = transparent, FALSE = opaque */
  101.     XP_Bool calling_netlib_all_the_time;
  102.     JRIGlobalRef mochaWindow;
  103. #ifdef LAYERS
  104.     CL_Layer *layer;
  105. #endif /* LAYERS */
  106. };
  107.  
  108. struct _np_stream {
  109.     np_instance *instance;
  110.     np_handle *handle;
  111.     np_stream *next;
  112.     NPStream *pstream;
  113.     char *url;                  /* convenience */
  114.     URL_Struct *initial_urls;
  115.     NET_StreamClass *nstream;
  116.     int32 len;
  117.     int init;
  118.     int seek;                   /* 0 normal, -1 turn, 1 seek, 2 discard */
  119.     int seekable;
  120.     int dontclose;
  121.     int asfile;
  122.     int islocked;
  123.     int32 offset;
  124.     NPByteRange *deferred;
  125.     NET_StreamClass *prev_stream;
  126. };
  127.  
  128. struct _np_urlsnode {
  129.     URL_Struct *urls;
  130.     void* notifyData;
  131.     XP_Bool cached;
  132.     XP_Bool notify;
  133. };
  134.  
  135. /* MWContext.pluginReconnect -> np_reconnect */
  136. struct _np_reconnect {
  137.     np_mimetype* mimetype;
  138.     char* requestedtype;
  139.     NPEmbeddedApp* app;
  140. };
  141.  
  142. #endif /* _NPPRIV_H_ */
  143.