/* -*- 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.0 (the "NPL"); you may not use this file except in * compliance with the NPL. You may obtain a copy of the NPL at * http://www.mozilla.org/NPL/ * * Software distributed under the NPL is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL * for the specific language governing rights and limitations under the * NPL. * * The Initial Developer of this code under the NPL is Netscape * Communications Corporation. Portions created by Netscape are * Copyright (C) 1998 Netscape Communications Corporation. All Rights * Reserved. */ #ifndef lm_h___ #define lm_h___ /* * JS in the Navigator library-private interface. */ #include "xp.h" /* for uint and PA_Block */ #include "prlong.h" /* for int64 time type used below */ #include "libevent.h" /* until its a stand-alone */ #include "libmocha.h" /* * Shared string constants for common property names. */ extern char lm_argc_err_str[]; /* "incorrect number of arguments" */ extern char lm_unknown_origin_str[]; /* "[unknown origin]" */ extern char lm_onLoad_str[]; /* "onLoad" */ extern char lm_onUnload_str[]; /* "onUnload" */ extern char lm_onAbort_str[]; /* "onAbort" */ extern char lm_onError_str[]; /* "onError" */ extern char lm_onScroll_str[]; /* "onScroll" */ extern char lm_onFocus_str[]; /* "onFocus" */ extern char lm_onBlur_str[]; /* "onBlur" */ extern char lm_onSelect_str[]; /* "onSelect" */ extern char lm_onChange_str[]; /* "onChange" */ extern char lm_onReset_str[]; /* "onReset" */ extern char lm_onSubmit_str[]; /* "onSubmit" */ extern char lm_onClick_str[]; /* "onClick" */ extern char lm_onMouseDown_str[]; /* "onMouseDown" */ extern char lm_onMouseOver_str[]; /* "onMouseOver" */ extern char lm_onMouseOut_str[]; /* "onMouseOut" */ extern char lm_onMouseUp_str[]; /* "onMouseUp" */ extern char lm_onLocate_str[]; /* "onLocate" */ extern char lm_onHelp_str[]; /* "onHelp" [EA] */ extern char lm_focus_str[]; /* "focus" */ extern char lm_blur_str[]; /* "blur" */ extern char lm_select_str[]; /* "select" */ extern char lm_click_str[]; /* "click" */ extern char lm_scroll_str[]; /* "scroll" */ extern char lm_enable_str[]; /* "enable" */ extern char lm_disable_str[]; /* "disable" */ extern char lm_toString_str[]; /* "toString" */ extern char lm_length_str[]; /* "length" */ extern char lm_document_str[]; /* "document" */ extern char lm_forms_str[]; /* "forms" */ extern char lm_links_str[]; /* "links" */ extern char lm_anchors_str[]; /* "anchors" */ extern char lm_applets_str[]; /* "applets" */ extern char lm_embeds_str[]; /* "embeds" */ extern char lm_plugins_str[]; /* "plugins" */ extern char lm_images_str[]; /* "images" */ extern char lm_layers_str[]; /* "layers" */ #ifdef DOM extern char lm_spans_str[]; /* "spans" */ extern char lm_transclusions_str[]; /* "transclusions" */ #endif extern char lm_builtins_str[]; extern char lm_location_str[]; /* "location" */ extern char lm_navigator_str[]; /* "navigator" */ extern char lm_netcaster_str[]; /* "netcaster" */ extern char lm_components_str[]; /* "components" */ extern char lm_parentLayer_str[]; /* "parentLayer" */ extern char lm_opener_str[]; /* "opener" */ extern char lm_closed_str[]; /* "closed" */ extern char lm_assign_str[]; /* "assign" */ extern char lm_reload_str[]; /* "reload" */ extern char lm_replace_str[]; /* "replace" */ extern char lm_event_str[]; /* "event" */ extern char lm_methodPrefix_str[]; /* "#method" */ extern char lm_methodArgc_str[]; /* "#method" */ extern char lm_methodArgv_str[]; /* "#method" */ extern char lm_getPrefix_str[]; /* "#get_" */ extern char lm_setPrefix_str[]; /* "#set_" */ extern char lm_typePrefix_str[]; /* "#type_" */ extern const char *lm_event_argv[]; /* {lm_event_str} */ extern PRThread *lm_InterpretThread; extern PRThread *mozilla_thread; extern PRThread *lm_js_lock_previous_owner; extern JSContext *lm_writing_context; /* * Timeout structure threaded on MochaDecoder.timeouts for cleanup. */ struct JSTimeout { int32 ref_count; /* reference count to shared usage */ char *expr; /* the JS expression to evaluate */ JSObject *funobj; /* or function to call, if !expr */ jsval *argv; /* function actual arguments */ void *toid; /* Identifier, used internally only */ uint32 public_id; /* Returned as value of setTimeout() */ uint16 argc; /* and argument count */ uint16 spare; /* alignment padding */ int32 doc_id; /* document this is for */ int32 interval; /* Non-zero if repetitive timeout */ int64 when; /* nominal time to run this timeout */ JSVersion version; /* Version of JavaScript to execute */ JSPrincipals *principals; /* principals with which to execute */ char *filename; /* filename of setTimeout call */ uint32 lineno; /* line number of setTimeout call */ JSTimeout *next; /* next timeout in list */ }; extern void lm_ClearWindowTimeouts(MochaDecoder *decoder); struct JSNestingUrl { JSNestingUrl *next; char *str; }; /* * Event queue stack madness to handle doc.write("