Removing obsolete headers. Bug 38061. r/sr=cls.

git-svn-id: svn://10.0.0.236/trunk@84088 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bryner%uiuc.edu 2000-12-27 03:48:18 +00:00
parent 8a49aa69ad
commit a106ac63fb
6 changed files with 0 additions and 1660 deletions

View File

@ -7,7 +7,6 @@ abdefn.h
client.h
csid.h
ctxtfunc.h
cvactive.h
dirprefs.h
edt.h
edttypes.h
@ -16,10 +15,8 @@ glhist.h
gui.h
intl_csi.h
libc_r.h
libevent.h
libi18n.h
libmime.h
libmocha.h
lo_ele.h
merrors.h
mime.h
@ -32,9 +29,7 @@ msgtypes.h
m_cvstrm.h
ncompat.h
net.h
np.h
npapi.h
npassoc.h
npupp.h
ntypes.h
platform.h

View File

@ -1,45 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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):
*/
#ifndef CV_ACTIVE
#define CV_ACTIVE
#include "net.h"
/* define a constant to be passed to CV_MakeMultipleDocumentStream
* as the data_object to signify that it should return
* MK_END_OF_MULTIPART_MESSAGE when it gets to the end
* of the multipart instead of waiting for the complete
* function to be called
*/
#define CVACTIVE_SIGNAL_AT_END_OF_MULTIPART 999
XP_BEGIN_PROTOS
extern NET_StreamClass *
CV_MakeMultipleDocumentStream (int format_out,
void *data_object,
URL_Struct *URL_s,
MWContext *window_id);
XP_END_PROTOS
#endif /* CV_ACTIVE */

View File

@ -1,789 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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):
*/
/*
* Header file for event passing between the mozilla thread and
* the mocha thread
*/
#ifndef libevent_h___
#define libevent_h___
#include "libmocha.h"
#include "prtypes.h"
#include "plevent.h"
#include "shist.h"
#include "fe_proto.h"
#include "lo_ele.h"
NSPR_BEGIN_EXTERN_C
extern PREventQueue * mozilla_event_queue;
typedef struct WindowGroup LMWindowGroup;
/*
* XXX - should we use the same event values as layer events?
*/
/* Event bits stored in the low end of decoder->event_mask. */
#define EVENT_MOUSEDOWN 0x00000001
#define EVENT_MOUSEUP 0x00000002
#define EVENT_MOUSEOVER 0x00000004 /* user is mousing over a link */
#define EVENT_MOUSEOUT 0x00000008 /* user is mousing out of a link */
#define EVENT_MOUSEMOVE 0x00000010
#define EVENT_MOUSEDRAG 0x00000020
#define EVENT_CLICK 0x00000040 /* input element click in progress */
#define EVENT_DBLCLICK 0x00000080
#define EVENT_KEYDOWN 0x00000100
#define EVENT_KEYUP 0x00000200
#define EVENT_KEYPRESS 0x00000400
#define EVENT_DRAGDROP 0x00000800 /* not yet implemented */
#define EVENT_FOCUS 0x00001000 /* input focus event in progress */
#define EVENT_BLUR 0x00002000 /* loss of focus event in progress */
#define EVENT_SELECT 0x00004000 /* input field selection in progress */
#define EVENT_CHANGE 0x00008000 /* field value change in progress */
#define EVENT_RESET 0x00010000 /* form submit in progress */
#define EVENT_SUBMIT 0x00020000 /* form submit in progress */
#define EVENT_SCROLL 0x00040000 /* window is being scrolled */
#define EVENT_LOAD 0x00080000 /* layout parsed a loaded document */
#define EVENT_UNLOAD 0x00100000
#define EVENT_XFER_DONE 0x00200000 /* document has loaded */
#define EVENT_ABORT 0x00400000
#define EVENT_ERROR 0x00800000
#define EVENT_LOCATE 0x01000000
#define EVENT_MOVE 0x02000000
#define EVENT_RESIZE 0x04000000
#define EVENT_FORWARD 0x08000000
#define EVENT_HELP 0x10000000 /* for handling of help events */
#define EVENT_BACK 0x20000000
/* #define EVENT_PRINT 0x20000000 *//* To be removed per joki */
#define STATUS_STOP 0x00000001 /* stop processing */
#define STATUS_IGNORE 0x00000002 /* no new messages */
#define EVENT_ALT_MASK 0x00000001
#define EVENT_CONTROL_MASK 0x00000002
#define EVENT_SHIFT_MASK 0x00000004
#define EVENT_META_MASK 0x00000008
#define ARGTYPE_NULL 0x00000001
#define ARGTYPE_INT32 0x00000002
#define ARGTYPE_BOOL 0x00000004
#define ARGTYPE_STRING 0x00000008
/*
* When the event has been processed by the backend, there will be
* a front-end callback that gets called. If the event processed
* successfully, the callback will be passed EVENT_OK. If the
* event wasn't successful (i.e. the user canceled it) the return
* status will be EVENT_CANCEL. If something radical happened
* and the front-end should do nothing (i.e. mocha changed the
* underlying context) the status will be EVENT_PANIC and the
* front end should treat the context and element passed to the
* exit routine as bogus
*/
typedef enum {
EVENT_OK,
EVENT_CANCEL,
EVENT_PANIC
} ETEventStatus;
/*
* When a given event gets processed we may need to tell the front
* end about it so that they can update the UI / continue the
* operation. The context, lo_element, lType and whatever
* field are all supplied by the original ET_SendEvent() call.
* See ET_SendEvent() for a description of the values for
* the status parameter
*/
typedef void
(*ETClosureFunc)(MWContext * pContext, LO_Element * lo_element,
int32 lType, void * whatever, ETEventStatus status);
/*
* Someone has initiated a call to LM_EvaluateBuffer(). This function
* gets called back with the result
*/
typedef void
(*ETEvalAckFunc)(void * data, char * result_string, size_t result_length,
char * wysiwyg_url, char * base_href, Bool valid);
/*
* This function is called back after a layer's state has been restored
* in a resize_relayout.
*/
typedef void
(*ETRestoreAckFunc)(void * data, void *param);
/*
* Typedef for a function taking a void pointer and
* returning nothing
*/
typedef void
(*ETVoidPtrFunc)(void * data);
/*
* Typedef for a function taking a void pointer and
* returning a bool
*/
typedef PRBool
(*ETBoolPtrFunc)(void * data);
/*
* Typedef for a function taking a void pointer and
* returning a int32
*/
typedef int32
(*ETIntPtrFunc)(void * data);
/*
* Typedef for a function taking a void pointer and
* returning a char *
*/
typedef char *
(*ETStringPtrFunc)(void * data);
/*
* Struct for passing JS typed variable info through C interface calls
*/
typedef union ArgVal {
int32 intArg;
XP_Bool boolArg;
char * stringArg;
} ArgVal;
typedef struct {
uint8 type; /* arg type as defined at top of file */
ArgVal value;
} JSCompArg;
/*
* Typedef for a function used to verify installed components and
* get back components utility functions.
*/
typedef PRBool
(*ETVerifyComponentFunc)(void **active_callback, void **startup_callback);
/*
* Generic function for JS setting values with native calls.
*/
typedef void
(*ETCompPropSetterFunc)(char *name, void *value);
/*
* Generic function for JS getting values from native calls.
*/
typedef void*
(*ETCompPropGetterFunc)(char *name);
/*
* Generic function for JS calling native methods.
*/
typedef void*
(*ETCompMethodFunc)(int32 argc, JSCompArg *argv);
/* --------------------------------------------------------------------------
* Common prologue for talking between the mocha thread and the mozilla
* thread
*/
typedef struct {
PREvent event; /* the PREvent structure */
MWContext* context; /* context */
int32 doc_id; /* doc id of context when event launched */
PRPackedBool handle_eagerly;
} ETEvent;
/*
* Struct to send back from front end in order to get additional
* event information without having to initialize event object
* until necessary. Yow, there is a lot of junk in here now
* can we make a union out of some of these or are they always
* needed?
*/
typedef struct {
ETEvent ce;
MochaDecoder * decoder;
JSObject * object;
int32 type;
int32 layer_id;
int32 id;
LO_Element * lo_element;
ETClosureFunc fnClosure; /* event sender closure */
void * whatever; /* anything other state */
int32 x,y;
int32 docx,docy;
int32 screenx,screeny;
uint32 which;
uint32 modifiers;
void * data;
uint32 dataSize;
PRPackedBool saved;
PRPackedBool event_handled;
} JSEvent;
/*
* Tell the backend about a new event.
* The event is placed onto an event queue, it is not processed
* immediately. If the event is the type that can be cancelled
* by the backend (i.e. a button click or a submit) the front
* end must wait until the callback routine gets called before
* continuing with the operation. The ETEventStatus will be
* EVENT_OK if the operation is to continue or EVENT_CANCEL
* if it got cancelled.
*
* The processing of the event may cause the document to change
* or even the whole window to close. In those cases the callback
* will still get called in case there is any front-end cleanup
* to do but the ETEventStatus will be set to EVENT_PANIC
*
*/
extern JSBool
ET_SendEvent(MWContext * pContext, LO_Element *pElement, JSEvent *pEvent,
ETClosureFunc fnClosure, void * whatever);
/*
* Tell the backend about a new document load event. We need a
* closure so that libparse/layout knows when its safe to discard
* the old document when they were waiting for onunload events to
* finish processing
*/
extern void
ET_SendLoadEvent(MWContext * pContext, int32 type, ETVoidPtrFunc fnClosure,
NET_StreamClass *stream, int32 layer_id, Bool resize_reload);
/*
* Tell the backend about a new image event. Async. No closure
*/
extern void
ET_SendImageEvent(MWContext * pContext, LO_ImageStruct *image_data,
LM_ImageEvent event);
/*
* Send an interrupt event to the current context
* Remove all pending events for the event queue of the given context.
*/
extern void
ET_InterruptContext(MWContext * pContext);
extern JSBool
ET_ContinueProcessing(MWContext * pContext);
/*
* Tell mocha to destroy the given context's data. The callback
* function gets called when mocha is done with all of its data
* that was associated with the context
*/
extern void
ET_RemoveWindowContext(MWContext * context, ETVoidPtrFunc fn,
void * data);
typedef struct {
uint len, line_no;
char * scope_to;
void * data;
JSVersion version;
JSPrincipals * principals;
JSBool want_result;
JSBool unicode;
} ETEvalStuff;
/*
* Evaluate the mocha code in the given buffer
*/
extern void
ET_EvaluateBuffer(MWContext * context, char * buffer, uint buflen,
uint line_no, char * scope_to, JSBool want_result,
ETEvalAckFunc fn, void * data,
JSVersion ver, struct JSPrincipals *);
extern void
ET_EvaluateScript(MWContext * context, char * buffer, ETEvalStuff * stuff,
ETEvalAckFunc fn);
/*
* Ask Mocha to reflect the given object into JavaScript
*/
extern void
ET_ReflectObject(MWContext * pContext, void * lo_ele, void * tag,
int32 layer_id, uint index, ReflectedObject type);
void
ET_ReflectFormElement(MWContext * pContext, void * form,
LO_FormElementStruct * form_element, PA_Tag * tag);
extern void
ET_ReflectWindow(MWContext * pContext,
PA_Block onLoad, PA_Block onUnload,
PA_Block onFocus, PA_Block onBlur, PA_Block onHelp,
PA_Block onMouseOver, PA_Block onMouseOut, PA_Block onDragDrop,
PA_Block onMove, PA_Block onResize,
PA_Block id, char *all,
Bool bDelete, int newline_count);
/*
* Tell mocha we are processing a form
*/
extern void
ET_SetActiveForm(MWContext * pContext, struct lo_FormData_struct * loElement);
/*
* Tell mocha which layer we are processing
*/
void
ET_SetActiveLayer(MWContext * pContext, int32 layer_id);
/*
** Tell mocha where to send its output
*/
extern void
ET_ClearDecoderStream(MWContext * context, NET_StreamClass * old_stream);
extern void
ET_SetDecoderStream(MWContext * context, NET_StreamClass *stream,
URL_Struct *url_struct, JSBool free_stream_on_close);
/*
** Remember the current nesting URL in the MochaDecoder
*/
extern void
ET_SetNestingUrl(MWContext * context, char * szUrl);
/*
** Set up the principals for an upcoming softupdate script.
*/
extern void
ET_StartSoftUpdate(MWContext * pContext, char *codebase);
/*
** Remember the current language version in the MochaDecoder
*/
extern void
ET_SetVersion(MWContext * context, JSVersion version);
/*
* Tell mocha to trash the current document. around and around...
*/
extern void
ET_ReleaseDocument(MWContext * pContext, JSBool resize_reload);
/*
* Tell mocha to trash the layer's document.
*/
extern void
ET_DestroyLayer(MWContext * pContext, JSObject *layer_obj);
extern void
ET_MochaStreamComplete(MWContext * context, void * buf, int len,
char * content_type, Bool isUnicode);
extern void
ET_MochaStreamAbort(MWContext * context, int status);
/*
* Called when a layer's contents are changing and we want to create
* a new layer document.
*/
extern void
ET_NewLayerDocument(MWContext *pContext, int32 layer_id);
extern void
ET_DocWriteAck(MWContext *pContext, int status);
extern void
ET_RegisterComponent(char *name, void *active_callback, void *startup_callback);
extern void
ET_RegisterComponentProp(char *comp, char *name, uint8 retType, void *setter,
void *getter);
extern void
ET_RegisterComponentMethod(char *comp, char *name, uint8 retType, void *method,
int32 argc);
/* =============================================================== */
/*
* This event can be sent to both the mozilla thread and the moacha thread
*/
typedef struct {
ETEvent ce;
TimeoutCallbackFunction fnCallback;
void* pClosure;
uint32 ulTime;
void* pTimerId;
} MozillaEvent_Timeout;
/* =============================================================== */
/*
* Busy loop waiting for events to come along
*/
extern void PR_CALLBACK
lm_wait_for_events(void *);
/*
* global mocha event queues. It would be nice to not have these
* exported this globally
*/
extern PREventQueue *lm_InterpretQueue;
extern PREventQueue *lm_PriorityQueue;
/*
* Ways to send events to the front end
*/
extern JSBool
ET_PostMessageBox(MWContext* context, char* szMessage,
JSBool bConfirm);
JSBool
ET_PostCheckConfirmBox(MWContext* context,
char* szMainMessage, char* szCheckMessage,
char* szOKMessage, char* szCancelMessage,
XP_Bool *bChecked);
extern void
ET_PostProgress(MWContext* context, const char* szMessage);
/* --- timeout routines --- */
/*
* Set (or clear) a timeout to go off. The timeout will go off in the
* mozilla thread so we will use the routine ET_FireTimeoutCallBack()
* to get back into our thread to actually run the closure
*/
extern void *
ET_PostSetTimeout(TimeoutCallbackFunction fnCallback,
void * pClosure, uint32 ulTime, int32 doc_id);
extern void
ET_PostClearTimeout(void * stuff);
extern void
ET_FireTimeoutCallBack(void *);
/* --- end of timeout routines --- */
extern void
ET_PostDestroyWindow(MWContext * context);
extern void
ET_PostManipulateForm(MWContext * context, LO_Element * pForm, int32 action);
extern void
ET_PostClearView(MWContext * context);
extern void
ET_PostFreeImageElement(MWContext * context, void * stuff);
extern void
ET_PostFreeImageContext(MWContext *context, IL_GroupContext *img_cx);
extern void
ET_PostFreeAnonImages(MWContext *context, IL_GroupContext *img_cx);
extern void
ET_PostDisplayImage(MWContext *, int, LO_ImageStruct *);
extern void
ET_PostGetUrl(MWContext *, URL_Struct * pUrl);
extern char *
ET_PostPrompt(MWContext* context, const char* szMessage,
const char * szDefault);
extern MWContext *
ET_PostNewWindow(MWContext* context, URL_Struct * pUrl,
char * szName, Chrome * pChrome, LMWindowGroup *grp);
extern void
ET_PostUpdateChrome(MWContext* context, Chrome * pChrome);
extern void
ET_PostQueryChrome(MWContext* context, Chrome * pChrome);
extern void
ET_PostGetScreenSize(MWContext* context, int32 *pX, int32 *pY);
extern void
ET_PostGetAvailScreenRect(MWContext* context, int32 *pX, int32 *pY,
int32 *pLeft, int32 *pTop);
extern void
ET_PostGetColorDepth(MWContext* context, int32 *pPixel, int32 *pPallette);
extern char *
ET_PostGetSelectedText(MWContext* context);
extern void
ET_PostScrollDocTo(MWContext* context, int loc, int32 x, int32 y);
extern void
ET_PostScrollDocBy(MWContext* context, int loc, int32 x, int32 y);
extern void
ET_PostBackCommand(MWContext* context);
extern void
ET_PostForwardCommand(MWContext* context);
extern void
ET_PostHomeCommand(MWContext* context);
extern JSBool
ET_PostFindCommand(MWContext* context, char * szName, JSBool matchCase,
JSBool searchBackward);
extern void
ET_PostPrintCommand(MWContext* context);
extern void
ET_PostOpenFileCommand(MWContext* context);
extern void
ET_MakeHTMLAlert(MWContext * context, const char * szString);
/* respond to events sent to the mocha thread by the mozilla thread */
extern void
ET_PostJsEventAck(MWContext* context, LO_Element * pEle, int type,
ETClosureFunc fnClosure, void * pStuff,
ETEventStatus status);
extern void
ET_PostEvalAck(MWContext * context, int doc_id, void * data,
char * str, size_t len, char * wysiwyg_url,
char * base_href, Bool valid, ETEvalAckFunc fn);
extern void
ET_PostRestoreAck(void *data, void *param,
ETRestoreAckFunc fn);
/* netlib events */
extern char *
ET_net_GetCookie(MWContext* context, int32 doc_id);
extern char *
ET_net_SetCookieString(MWContext* context, char * szCookie, int32 doc_id);
extern NET_StreamClass *
ET_net_CacheConverter(FO_Present_Types format, void * obj,
URL_Struct *pUrl, MWContext * pContext);
extern void
ET_net_FindURLInCache(URL_Struct * pUrl, MWContext * pContext);
extern NET_StreamClass *
ET_net_StreamBuilder(FO_Present_Types format, URL_Struct *pUrl,
MWContext * pContext);
/* layout events */
extern void
ET_lo_ResetForm(MWContext * pContext, LO_Element * ele);
void
ET_fe_SubmitInputElement(MWContext * pContext, LO_Element * ele);
/*
* Synchronously shove the given text down the parser's processing
* queue. If the currently loaded document is not equal to
* doc_id, this message should be ignored since it arrived too
* late for the intended document
*/
extern int
ET_lo_DoDocWrite(JSContext *cx, MWContext * context, NET_StreamClass * stream,
char * str, size_t len, int32 doc_id);
extern void
ET_il_GetImage(const char * str, MWContext * pContext, IL_GroupContext *img_cx,
LO_ImageStruct * image_data, NET_ReloadMethod how);
extern void
ET_il_SetGroupObserver(MWContext * pContext, IL_GroupContext *pImgCX, void *pDpyCX,
JSBool bAddObserver);
extern void
ET_InterruptImgCX(MWContext * pContext);
/*
* Tell layout to trash the current document.
*/
extern void
ET_lo_DiscardDocument(MWContext * pContext);
/*
* Tell layout to prepare a layer for writing.
*/
extern Bool
ET_lo_PrepareLayerForWriting(MWContext *context, int32 layer_id,
const char *referer);
/*
* Return a copy of the current history element. Caller must free
*/
extern History_entry *
ET_shist_GetCurrent(MWContext * pContext);
/*
* Return the current security status.
*/
extern int
ET_GetSecurityStatus(MWContext * pContext);
/*
* Make sure Mocha/Java glue is ready. Returns the same return code as
* LM_InitMoja.
*/
extern int
ET_InitMoja(MWContext * pContext);
/*
* Pack up toys and go home
*/
extern void
ET_FinishMocha(void);
/*
* Used to call a stream completion function in the mozilla
* thread
*/
extern void
ET_moz_CallFunction(ETVoidPtrFunc fn, void * data);
extern void
ET_moz_CallFunctionAsync(ETVoidPtrFunc fn, void * data);
extern PRBool
ET_moz_CallFunctionBool(ETBoolPtrFunc fn, void * data);
extern int32
ET_moz_CallFunctionInt(ETIntPtrFunc fn, void * data);
extern char *
ET_moz_CallFunctionString(ETStringPtrFunc fn, void * data);
extern void
ET_moz_CallAsyncAndSubEventLoop(ETVoidPtrFunc fn, void *data,
MWContext *context);
extern void
ET_moz_Abort(MKStreamAbortFunc fn, void * data, int status);
extern void
ET_moz_SetMochaWriteStream(MochaDecoder * decoder);
extern NET_StreamClass *
ET_moz_DocCacheConverter(MWContext * context, URL_Struct * pUrl,
char * wysiwyg_url, int32 layer_id);
extern PRBool
ET_moz_VerifyComponentFunction(ETVerifyComponentFunc fn, ETBoolPtrFunc *pActive_callback,
ETVoidPtrFunc *pStartup_callback);
extern void
ET_moz_CompSetterFunction(ETCompPropSetterFunc fn, char *name, void *data);
extern void *
ET_moz_CompGetterFunction(ETCompPropGetterFunc fn, char *name);
extern void *
ET_moz_CompMethodFunction(ETCompMethodFunc fn, int32 argc, JSCompArg *argv);
typedef enum {
CL_Move,
CL_MoveX,
CL_MoveY,
CL_Offset,
CL_Resize,
CL_SetBboxWidth,
CL_SetBboxHeight,
CL_SetBboxTop,
CL_SetBboxLeft,
CL_SetBboxBottom,
CL_SetBboxRight,
CL_SetHidden,
CL_MoveInZ,
CL_SetSrc,
CL_SetSrcWidth,
CL_SetZ,
CL_SetBgColor,
CL_SetBackdrop
} ETLayerOp;
extern int
ET_TweakLayer(MWContext * context, void * layer, int32 x, int32 y,
void *param_ptr, int32 param_val, ETLayerOp op,
const char *referer, int32 doc_id);
extern void
ET_RestoreLayerState(MWContext *context, int32 layer_id,
void *param, ETRestoreAckFunc fn,
void *data);
extern int32
ET_npl_RefreshPluginList(MWContext* context, XP_Bool refreshInstances);
extern JSCFResult
ET_JSCFExecute(MWContext *context, const char *script_name,
JSCFCookieData *data, Bool *data_changed);
extern JSBool
ET_HandlePref(JSContext * cx, uint argc, jsval * argv, jsval * rval);
extern void
ET_SetPluginWindow(MWContext * pContext, void * app);
#ifdef DOM
typedef enum {
SP_SetColor,
SP_SetBackground,
SP_SetFontWeight,
SP_SetFontFamily,
SP_SetFontSize,
SP_SetFontSlant
} ETSpanOp;
extern int
ET_TweakSpan(MWContext * context, void *name_rec, void *param_ptr,
int32 param_val, ETSpanOp op, int32 doc_id);
typedef enum {
TR_SetHref,
TR_SetVisibility,
TR_SetData
} ETTransclusionOp;
extern int
ET_TweakTransclusion(MWContext * context, void *xmlFile, void *param_ptr,
int32 param_val, ETTransclusionOp op, int32 doc_id);
#endif
NSPR_END_EXTERN_C
#endif /* libevent_h___ */

View File

@ -1,614 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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):
*/
/*
* Header file for Mocha in the Navigator (libmocha).
*/
#ifndef libmocha_h___
#define libmocha_h___
#include "ntypes.h"
#include "il_types.h"
#include "prtypes.h"
#include "plhash.h"
#include "prthread.h"
#include "jsapi.h"
/* enable JavaScript Debugger support */
#if defined (_WIN32) || defined(XP_UNIX) || defined(powerc) || defined(__powerc) || defined(XP_OS2) || defined(XP_BEOS)
#ifdef JAVA
#define JSDEBUGGER 1
#endif
#endif
NSPR_BEGIN_EXTERN_C
typedef struct JSTimeout JSTimeout;
typedef struct JSPrincipalsList JSPrincipalsList;
typedef struct JSNestingUrl JSNestingUrl;
/*
* There exists one MochaDecoder per top-level MWContext that decodes Mocha,
* either from an HTML page or from a "mocha:[expr]" URL.
*/
typedef struct MochaDecoder {
int32 forw_count; /* forward reference count */
int32 back_count; /* back (up the tree) count */
JSContext *js_context;
MWContext *window_context;
JSObject *window_object;
NET_StreamClass *stream;
int32 stream_owner; /* id of layer that's loading the stream */
URL_Struct *url_struct;
JSTimeout *timeouts;
JSTimeout *saved_timeouts;
uint16 signature_ordinal;
PRPackedBool replace_location;
PRPackedBool resize_reload;
PRPackedBool load_event_sent;
PRPackedBool visited;
PRPackedBool writing_input;
PRPackedBool free_stream_on_close;
PRPackedBool in_window_quota;
PRPackedBool called_win_close;
PRPackedBool principals_compromised;
const char *source_url;
JSNestingUrl *nesting_url;
uint32 error_count;
uint32 event_mask;
int32 active_layer_id;
uint32 active_form_id;
uint32 event_bit;
int32 doc_id;
/*
* Class prototype objects, in alphabetical order. Must be CLEARed (set
* to null) in LM_PutMochaDecoder, HELD (GC roots added) in lm_NewWindow,
* and DROPped (removed as GC roots) in lm_DestroyWindow.
* XXXbe clean up, clear via bzero, using a sub-structure.
*/
JSObject *anchor_prototype;
JSObject *bar_prototype;
JSObject *document_prototype;
JSObject *event_prototype;
JSObject *event_capturer_prototype;
JSObject *event_receiver_prototype;
JSObject *form_prototype;
JSObject *image_prototype;
JSObject *input_prototype;
JSObject *layer_prototype;
JSObject *option_prototype;
JSObject *rect_prototype;
JSObject *url_prototype;
#ifdef DOM
JSObject *span_prototype;
JSObject *transclusion_prototype;
#endif
JSObject *builtin_prototype;
JSObject *builtin_element_prototype;
JSObject *builtin_node_prototype;
/*
* Window sub-objects. These must also follow the CLEAR/HOLD/DROP
* protocol mentioned above.
*/
JSObject *document;
JSObject *history;
JSObject *location;
JSObject *navigator;
JSObject *components;
JSObject *screen;
#ifdef NAV_HARDWARE
JSObject *hardware;
#endif
JSObject *environment;
JSObject *crypto;
JSObject *pkcs11;
JSObject *background_update;
/*
* Ad-hoc GC roots.
*/
JSObject *event_receiver;
JSObject *opener;
JSVersion firstVersion; /* First JS script tag version. */
/*
* Security info for all of this decoder's scripts, except those
* contained in layers.
*/
JSPrincipals *principals;
JSPrincipalsList*early_access_list;
IL_GroupContext *image_context; /* Image context for anonymous images */
/*
* Table that maintains an id to JS object mapping for reflected
* elements. This is used during resize to reestablish the connection
* between layout elements and their corresponding JS object.
* Form elements are special, since they can't use the same keying
*/
PRHashTable *id_to_object_map;
} MochaDecoder;
/*
* Number of buckets for the id-to-object hash table.
*/
#define LM_ID_TO_OBJ_MAP_SIZE 20
#define LM_FORM_ELEMENT_MAP_SIZE 10
/*
* Types of objects reflected into Mocha
*/
typedef enum {
LM_APPLETS = 0,
LM_FORMS,
LM_LINKS,
LM_NAMEDANCHORS,
LM_EMBEDS,
LM_IMAGES,
LM_FORMELEMENTS,
LM_LAYERS
#ifdef DOM
, LM_SPANS
, LM_TRANSCLUSIONS
#endif
} ReflectedObject;
#ifdef DOM
/*
* Construct a DOM_Node for the given tag and add it to the tree.
*/
void /* DOM_Node */ *
LM_ReflectTagNode(PA_Tag *tag, void /*lo_TopState*/ *top_state,
MWContext *context);
#endif
/*
* Generates an id-to-object mapping key from the ReflectedObject
* type, the containing layer id and the id of the object itself.
* The key is 4 bits type, 14 bits layer_id and 14 bits id.
*/
#define LM_GET_MAPPING_KEY(obj_type, layer_id, id) \
(void *)(((((uint32)obj_type) << 28) & 0xF0000000UL) | \
((((uint32)layer_id) << 14) & 0x0FFFC000UL) | \
(((uint32)id) & 0x00003FFFUL))
/*
* Public, well-known string constants.
*/
extern char js_language_name[]; /* "JavaScript" */
extern char js_content_type[]; /* "application/x-javascript" */
/*
* Initialize and finalize Mocha-in-the-client.
*/
extern void LM_InitMocha(void);
extern void LM_FinishMocha(void);
/*
* Force mocha on in the given context, even if the user pref is set to
* disable mocha.
*/
extern void LM_ForceJSEnabled(MWContext *cx);
/*
* Initialize and finalize Mocha-Java connection
*/
#define LM_MOJA_UNINITIALIZED 0
#define LM_MOJA_OK 1
#define LM_MOJA_JAVA_FAILED 2
#define LM_MOJA_OUT_OF_MEMORY 3
extern int LM_InitMoja(void);
extern void LM_FinishMoja(void);
extern int LM_IsMojaInitialized(void);
/*
* Enter or leave the big mocha lock. Any thread which wants to
* preserve JavaScript run-to-completion semantics must bracket
* JavaScript evaluation with these calls.
*/
typedef void
(PR_CALLBACK *JSLockReleaseFunc)(void * data);
extern JSBool PR_CALLBACK LM_LockJS(MWContext *mwc, char **errp);
extern void PR_CALLBACK LM_UnlockJS(MWContext *mwc);
extern JSBool PR_CALLBACK LM_AttemptLockJS(MWContext *mwc,
JSLockReleaseFunc fn, void * data);
extern JSBool PR_CALLBACK LM_ClearAttemptLockJS(MWContext *mwc,
JSLockReleaseFunc fn,
void * data);
extern PRBool PR_CALLBACK
LM_HandOffJSLock(PRThread * oldOwner, PRThread *newOwner);
/*
* For interruption purposes we will sometimes need to know the
* context who is holding the JS lock
*/
extern void LM_JSLockSetContext(MWContext * context);
extern MWContext * LM_JSLockGetContext(MWContext *mwc);
/*
* Enable/disable for Mocha-in-the-client.
*/
#define LM_SwitchMocha(toggle) LM_SetMochaEnabled(toggle)
extern JSBool
LM_GetMochaEnabled(void);
/*
* Get (create if necessary) a MochaDecoder for context, adding a reference
* to its window_object. Put drops the reference, destroying window_object
* when the count reaches zero. These functions should only be called in
* the mocha thread or while holding the JS-lock
*/
extern MochaDecoder *
LM_GetMochaDecoder(MWContext *context);
extern void
LM_PutMochaDecoder(MochaDecoder *decoder);
/*
* Get the source URL for script being loaded by document. This URL will be
* the document's URL for inline script, or the SRC= URL for included script.
* The returned pointer is safe only within the extent of the function that
* calls LM_GetSourceURL().
*/
extern const char *
LM_GetSourceURL(MochaDecoder *decoder);
/*
* Set the current layer and hence the current scope for script evaluation.
*/
extern void
LM_SetActiveLayer(MWContext * context, int32 layer_id);
/*
* Get the current layer and hence the current scope for script evaluation.
*/
extern int32
LM_GetActiveLayer(MWContext * context);
/*
* Evaluate the contents of a SCRIPT tag. You can specify the JSObject
* to use as the base scope. Pass NULL to use the default window_object
*/
extern JSBool
LM_EvaluateBuffer(MochaDecoder *decoder, void *base, size_t length,
uint lineno, char * scope_to, struct JSPrincipals *principals,
JSBool unicode, jsval *result);
/*
* Evaluate an expression entity in an HTML attribute (WIDTH="&{height/2};").
* Returns null on error, otherwise a pointer to the malloc'd string result.
* The caller is responsible for freeing the string result.
*/
extern char *
LM_EvaluateAttribute(MWContext *context, char *expr, uint lineno);
/*
* Remove any MochaDecoder window_context pointer to an MWContext that's
* being destroyed.
*/
extern void
LM_RemoveWindowContext(MWContext *context, History_entry * he);
extern void
LM_DropSavedWindow(MWContext *context, void *window);
/*
* Set and clear the HTML stream and URL for the MochaDecoder
* associated with the given context
*/
extern JSBool
LM_SetDecoderStream(MWContext * context, NET_StreamClass *stream,
URL_Struct *url_struct, JSBool free_stream_on_close);
/*
* Start caching HTML or plain text generated by document.write() where the
* script is running on mc, the document is being generated into decoder's
* window, and url_struct tells about the generator.
*/
extern NET_StreamClass *
LM_WysiwygCacheConverter(MWContext *context, URL_Struct *url_struct,
const char * wysiwyg_url, const char * base_href);
/*
* Skip over the "wysiwyg://docid/" in url_string and return a pointer to the
* real URL hidden after the prefix. If url_string is not of "wysiwyg:" type,
* just return url_string. Never returns null.
*/
extern const char *
LM_StripWysiwygURLPrefix(const char *url_string);
/*
* This function works only on "wysiwyg:" type URLs -- don't call it unless
* you know that NET_URL_Type(url_string) is WYSIWYG_TYPE_URL. It'll return
* null if url_string seems too short, or if it can't find the third slash.
*/
extern const char *
LM_SkipWysiwygURLPrefix(const char *url_string);
/*
* Return a pointer to a malloc'd string of the form "<BASE HREF=...>" where
* the "..." URL is the directory of cx's origin URL. Such a base URL is the
* default base for relative URLs in generated HTML.
*/
extern char *
LM_GetBaseHrefTag(JSContext *cx, JSPrincipals *principals);
/*
* XXX Make these public LO_... typedefs in lo_ele.h/ntypes.h?
*/
struct lo_FormData_struct;
struct lo_NameList_struct;
extern struct lo_FormData_struct *
LO_GetFormDataByID(MWContext *context, int32 layer_id, intn form_id);
extern uint
LO_EnumerateForms(MWContext *context, int32 layer_id);
extern struct LO_ImageStruct_struct *
LO_GetImageByIndex(MWContext *context, int32 layer_id, intn image_id);
extern uint
LO_EnumerateImages(MWContext *context, int32 layer_id);
/*
* Reflect display layers into Mocha.
*/
extern JSObject *
LM_ReflectLayer(MWContext *context, int32 layer_id, int32 parent_layer_id,
PA_Tag *tag);
extern LO_FormElementStruct *
LO_GetFormElementByIndex(struct lo_FormData_struct *form_data, int32 index);
extern uint
LO_EnumerateFormElements(MWContext *context,
struct lo_FormData_struct *form_data);
/*
* Layout helper function to find a named anchor by its index in the
* document.anchors[] array.
*/
extern struct lo_NameList_struct *
LO_GetNamedAnchorByIndex(MWContext *context, int32 layer_id, uint index);
extern uint
LO_EnumerateNamedAnchors(MWContext *context, int32 layer_id);
#ifdef DOM
/*
* Layout helper function to find a span by its index in the
* document.spans[] array.
*/
extern struct lo_NameList_struct *
LO_GetSpanByIndex(MWContext *context, int32 layer_id, uint index);
extern uint
LO_EnumerateSpans(MWContext *context, int32 layer_id);
extern JSObject *
LO_GetMochaObjectOfParentSpan( LO_Element *ele);
#endif
/*
* Layout Mocha helper function to find an HREF Anchor by its index in the
* document.links[] array.
*/
extern LO_AnchorData *
LO_GetLinkByIndex(MWContext *context, int32 layer_id, uint index);
extern uint
LO_EnumerateLinks(MWContext *context, int32 layer_id);
extern LO_JavaAppStruct *
LO_GetAppletByIndex(MWContext *context, int32 layer_id, uint index);
extern uint
LO_EnumerateApplets(MWContext *context, int32 layer_id);
extern LO_EmbedStruct *
LO_GetEmbedByIndex(MWContext *context, int32 layer_id, uint index);
extern LO_BuiltinStruct *
LO_GetBuiltinByIndex(MWContext *context, int32 layer_id, uint index);
extern uint
LO_EnumerateEmbeds(MWContext *context, int32 layer_id);
/*
* Get and set a color attribute in the current document state.
*/
extern void
LO_GetDocumentColor(MWContext *context, int type, LO_Color *color);
extern void
LO_SetDocumentColor(MWContext *context, int type, LO_Color *color);
/*
* Layout function to reallocate the lo_FormElementOptionData array pointed at
* by lo_FormElementSelectData's options member to include space for the number
* of options given by selectData->option_cnt.
*/
extern XP_Bool
LO_ResizeSelectOptions(lo_FormElementSelectData *selectData);
/*
* Discard the current document and all its subsidiary objects.
*/
extern void
LM_ReleaseDocument(MWContext *context, JSBool resize_reload);
/*
* Search if a the event is being captured in the frame hierarchy.
*/
extern XP_Bool
LM_EventCaptureCheck(MWContext *context, uint32 current_event);
/*
* Scroll a window to the given point.
*/
extern void LM_SendOnScroll(MWContext *context, int32 x, int32 y);
/*
* Display a help topic.
*/
extern void LM_SendOnHelp(MWContext *context);
/*
* Send a load or abort event for an image to a callback.
*/
typedef enum LM_ImageEvent {
LM_IMGUNBLOCK = 0,
LM_IMGLOAD = 1,
LM_IMGABORT = 2,
LM_IMGERROR = 3,
LM_LASTEVENT = 3
} LM_ImageEvent;
extern void
LM_ProcessImageEvent(MWContext *context, LO_ImageStruct *image_data,
LM_ImageEvent event);
/* This should be called when a named anchor is located. */
extern JSBool
LM_SendOnLocate(MWContext *context, struct lo_NameList_struct *name_rec);
extern JSObject *
LM_ReflectApplet(MWContext *context, LO_JavaAppStruct *applet_data,
PA_Tag * tag, int32 layer_id, uint index);
extern JSObject *
LM_ReflectEmbed(MWContext *context, LO_EmbedStruct *lo_embed,
PA_Tag * tag, int32 layer_id, uint index);
extern JSObject *
LM_ReflectBuiltin(MWContext *context, LO_BuiltinStruct *lo_embed,
PA_Tag * tag, int32 layer_id, uint index);
struct lo_FormData_struct;
struct lo_NameList_struct;
extern JSObject *
LM_ReflectForm(MWContext *context, struct lo_FormData_struct *form_data,
PA_Tag * tag, int32 layer_id, uint index);
extern JSObject *
LM_ReflectFormElement(MWContext *context, int32 layer_id, int32 form_id,
int32 element_id, PA_Tag * tag);
extern JSObject *
LM_ReflectLink(MWContext *context, LO_AnchorData *anchor_data, PA_Tag * tag,
int32 layer_id, uint index);
extern JSObject *
LM_ReflectNamedAnchor(MWContext *context, struct lo_NameList_struct *name_rec,
PA_Tag * tag, int32 layer_id, uint index);
extern JSObject *
LM_ReflectImage(MWContext *context, LO_ImageStruct *image_data,
PA_Tag * tag, int32 layer_id, uint index);
#ifdef DOM
/* Function prototype to make JS know about <SPAN> elements */
extern JSObject *
LM_ReflectSpan(MWContext *context, struct lo_NameList_struct *name_rec,
PA_Tag *tag, int32 layer_id, uint index);
extern JSObject *
LM_ReflectTransclusion(MWContext *context, void *ele, int32 layer_id, uint index);
#endif
extern JSBool
LM_CanDoJS(MWContext *context);
extern JSBool
LM_IsActive(MWContext *context);
/*
* Security.
*/
extern JSPrincipals *
LM_NewJSPrincipals(URL_Struct *archive, char *name, const char *codebase);
extern char *
LM_ExtractFromPrincipalsArchive(JSPrincipals *principals, char *name,
uint *length);
extern JSBool
LM_SetUntransformedSource(JSPrincipals *principals, char *original,
char *transformed);
extern JSPrincipals * PR_CALLBACK
LM_GetJSPrincipalsFromJavaCaller(JSContext *cx, void *principalsArray, void *pNSISecurityContext);
extern JSBool
LM_CanAccessTargetStr(JSContext *cx, const char *target);
/*
* LM_RegisterPrincipals will verify and register a set of principals
* in the decoder, modifying decoder->principals in the process. It
* returns the modified decoder.
*
* The "name" parameter may be NULL if "principals" was created with a name.
*/
extern JSPrincipals *
LM_RegisterPrincipals(MochaDecoder *decoder, JSPrincipals *principals,
char *name, char *src);
extern JSContext *LM_GetCrippledContext(void);
/*
* JavaScript Debugger support
*/
#ifdef JSDEBUGGER
extern NET_StreamClass*
LM_StreamBuilder( int format_out,
void *data_obj,
URL_Struct *URL_s,
MWContext *mwcontext );
extern JSBool
LM_GetJSDebugActive(void);
extern void
LM_JamSourceIntoJSDebug( const char *filename,
const char *str,
int32 len,
MWContext *mwcontext );
#endif
NSPR_END_EXTERN_C
#endif /* libmocha_h___ */

View File

@ -1,151 +0,0 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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):
*/
/*
* Prototypes for functions exported by libplugin and called by the FEs or other XP libs.
* Prototypes for functions exported by the FEs and called by libplugin are in nppg.h.
*/
#ifndef _NP_H
#define _NP_H
#include "lo_ele.h"
#include "npapi.h"
#include "net.h"
#ifdef XP_UNIX
/* Aaagh. npapi.h include Xlib.h. Bool is being #defined by Xlib and
we are typedeffing it in the navigator. */
#ifdef Bool
#undef Bool
#endif /* Bool */
#endif
typedef enum { NP_Untyped = 0, NP_OLE, NP_Plugin } NPAppType;
typedef enum { NP_FullPage = 1, NP_Embedded } NPPageType;
typedef void* NPReference;
#define NPRefFromStart ((NPReference)NULL)
/* it's lame that this is supposed to support more than plugins but
it has plugin specific junk (wdata) in it -jg */
struct _NPEmbeddedApp {
struct _NPEmbeddedApp *next;
NPAppType type;
void *fe_data;
void *np_data;
NPWindow *wdata;
NPPageType pagePluginType;
};
/* Uncomment this to enable ANTHRAX. .c files affected: npglue.c, layembed.c, layobj.c */
/* amusil 1.8.98 */
/* #define ANTHRAX */
XP_BEGIN_PROTOS
extern void NPL_Init(void);
extern void NPL_Shutdown(void);
extern void NPL_RegisterDefaultConverters(void);
extern NPError NPL_RegisterPluginFile(const char* pluginname, const char* filename,
const char* description, void* pd);
extern NPError NPL_RegisterPluginType(NPMIMEType type, const char *extentstring,
const char* description, void* fileType, void* pd, XP_Bool enabled);
extern NPError NPL_RefreshPluginList(XP_Bool reloadPages);
extern NPBool NPL_IteratePluginFiles(NPReference* ref, char** name, char** filename, char** description);
extern NPBool NPL_IteratePluginTypes(NPReference* ref, NPReference plugin, NPMIMEType* type,
char*** extents, char** description, void** fileType);
PR_EXTERN(char**) NPL_FindPluginsForType(const char* typeToFind);
extern char* NPL_FindPluginEnabledForType(const char* typeToFind);
extern NPError NPL_EnablePlugin(NPMIMEType type,
const char* pluginname,
XP_Bool enabled);
extern NPError NPL_EnablePluginType(NPMIMEType type, void* pdesc, XP_Bool enabled);
extern NPError NPL_DisablePlugin(NPMIMEType type);
extern NPEmbeddedApp* NPL_EmbedCreate(MWContext *context, LO_EmbedStruct *embed_struct);
extern NPError NPL_EmbedStart(MWContext* cx, LO_EmbedStruct* embed_struct, NPEmbeddedApp* app);
extern void NPL_EmbedSize(NPEmbeddedApp *app);
/* ~~av the following is used in CGenericDoc::FreeEmbedElement */
extern int32 NPL_GetEmbedReferenceCount(NPEmbeddedApp *app);
extern void NPL_EmbedDelete(MWContext *context, LO_EmbedStruct *embed_struct);
extern XP_Bool NPL_IsLiveConnected(LO_EmbedStruct *embed);
extern int NPL_HandleEvent(NPEmbeddedApp *app, void *event, void* window); /* window may be NULL */
extern void NPL_Print(NPEmbeddedApp *app, void *printData);
extern void NPL_SamePage(MWContext *context);
extern void NPL_SameElement(LO_EmbedStruct *embed);
extern void NPL_DeleteSessionData(MWContext* context, void* sessionData);
extern XP_Bool NPL_HandleURL(MWContext *pContext, FO_Present_Types iFormatOut, URL_Struct *pURL,
Net_GetUrlExitFunc *pExitFunc);
#ifndef XP_MAC
extern void NPL_DisplayPluginsAsHTML(FO_Present_Types format_out, URL_Struct *urls, MWContext *cx);
#endif
extern void NPL_PreparePrint(MWContext* context, SHIST_SavedData* savedData);
extern NET_StreamClass* NPL_NewEmbedStream(FO_Present_Types format_out, void *type, URL_Struct *urls, MWContext *cx);
extern NET_StreamClass* NPL_NewPresentStream(FO_Present_Types format_out, void *type, URL_Struct *urls, MWContext *cx);
extern unsigned int NPL_WriteReady(NET_StreamClass *stream);
extern int NPL_Write(NET_StreamClass *stream, const unsigned char *str, int32 len);
extern void NPL_Complete(NET_StreamClass *stream);
extern void NPL_Abort(NET_StreamClass *stream, int status);
extern XP_Bool NPL_IsEmbedWindowed(NPEmbeddedApp *app);
extern void NPL_URLExit(URL_Struct *urls, int status, MWContext *cx);
#ifdef XP_MAC
extern XP_Bool NPL_IsForcingRedraw();
#endif
#ifdef ANTHRAX
extern char** NPL_FindAppletsForType(const char* typeToFind);
extern char* NPL_FindAppletEnabledForMimetype(const char* mimetype);
extern NPError NPL_RegisterAppletType(NPMIMEType type, char* filename);
extern void NPL_InstallAppletHandler(char* appletName, char* mimetype, char* extension);
#endif /* ANTHRAX */
PR_EXTERN(void) NPL_SetPluginWindow(void *data);
PR_EXTERN(struct nsIPlugin*) NPL_LoadPluginByType(const char* typeAttribute);
/*
* This callback is installed by the FE to handle the nsIPluginManager2::ProcessNextEvent
* operation. The result parameter should return PR_TRUE if called on the mozilla thread
* (unlike the old nsn_TickleHookProcPtr which returned false (I think)).
*/
typedef PRBool (PR_CALLBACK* NPL_ProcessNextEventProc)(void* data);
PR_EXTERN(void)
NPL_InstallProcessNextEventProc(NPL_ProcessNextEventProc proc, void* data);
XP_END_PROTOS
#endif /* _NP_H */

View File

@ -1,56 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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):
*/
/*
* npassoc.h $Revision: 3.2 $
* xp filetype associations
*/
#ifndef _NPASSOC_H
#define _NPASSOC_H
#include "xp_core.h"
typedef struct _NPFileTypeAssoc {
char* type; /* a MIME type */
char* description; /* Intelligible description */
char** extentlist; /* a NULL-terminated list of file extensions */
char* extentstring; /* the same extensions, as a single string */
void* fileType; /* platform-specific file selector magic */
struct _NPFileTypeAssoc* pNext;
} NPFileTypeAssoc;
XP_BEGIN_PROTOS
extern NPFileTypeAssoc* NPL_NewFileAssociation(const char *type, const char *extensions,
const char *description, void *fileType);
extern void* NPL_DeleteFileAssociation(NPFileTypeAssoc *fassoc);
extern void NPL_RegisterFileAssociation(NPFileTypeAssoc *fassoc);
extern NPFileTypeAssoc* NPL_RemoveFileAssociation(NPFileTypeAssoc *fassoc);
extern NPFileTypeAssoc* NPL_GetFileAssociation(const char *type);
XP_END_PROTOS
#endif /* _NPASSOC_H */