home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / nav-java / stubs / include / java.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  4.4 KB  |  175 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. #ifndef _NAVJAVA_H_
  19. #define _NAVJAVA_H_
  20.  
  21. #include "lo_ele.h"
  22. #ifndef NSPR20
  23. #include "prevent.h"
  24. #else
  25. #include "plevent.h"
  26. #endif
  27. #include "jri.h"
  28. #include "prthread.h"
  29.  
  30. /* for Mocha glue */
  31. #include "jsapi.h"
  32. #include "jsjava.h"
  33.  
  34. XP_BEGIN_PROTOS
  35.  
  36. struct java_applet_Applet;
  37. struct netscape_applet_EmbeddedAppletFrame;
  38. struct netscape_javascript_JSObject;
  39. struct netscape_security_Zig;
  40. struct Hjava_lang_Object;
  41.  
  42. /* Type of data that hangs off of LO_JavaStruct->FE_Data */
  43. typedef struct LJAppletData LJAppletData;
  44. struct LJAppletData {
  45.     int16 generation;
  46. };
  47.  
  48. typedef enum LJJavaStatus
  49. {
  50.   LJJavaStatus_Enabled,     /* but not Running */
  51.   LJJavaStatus_Disabled,    /* explicitly disabled */
  52.   LJJavaStatus_Running,     /* enabled and started */
  53.   LJJavaStatus_Failed       /* enabled but failed to start */
  54. } LJJavaStatus;
  55.  
  56. /*******************************************************************************
  57.  * Mozilla Events
  58.  ******************************************************************************/
  59.  
  60. /* Generic event struct for events coming from layer */
  61. typedef struct _tagNAppletEvent {
  62.     int id;
  63.     void* data;
  64. } NAppletEvent;
  65.  
  66.  
  67. JRI_PUBLIC_API(void) 
  68. LJ_AddToClassPath(char* dirPath);
  69.  
  70. JRI_PUBLIC_API(char *) 
  71. LJ_Applet_GetText(LJAppletData* ad);
  72.  
  73. JRI_PUBLIC_API(void) 
  74. LJ_Applet_print(LJAppletData *ad, void* printInfo);
  75.  
  76. JRI_PUBLIC_API(void)
  77. LJ_CreateApplet(LO_JavaAppStruct *java, MWContext *cx,
  78.         NET_ReloadMethod reloadMethod);
  79.  
  80. JRI_PUBLIC_API(void) 
  81. LJ_DeleteSessionData(MWContext* cx, void* sdata);
  82.  
  83. JRI_PUBLIC_API(void)
  84. LJ_DiscardEventsForContext(MWContext* context);
  85.  
  86. JRI_PUBLIC_API(void)
  87. LJ_DisplayJavaApp(MWContext *context, ...);
  88.  
  89. JRI_PUBLIC_API(JRIEnv *)
  90. LJ_EnsureJavaEnv(PRThread *thread);
  91.  
  92. JRI_PUBLIC_API(void)
  93. LJ_FreeJavaAppElement(MWContext *context, ...);
  94.  
  95. JRI_PUBLIC_API(char *)
  96. LJ_GetAppletScriptOrigin(JRIEnv *env);
  97.  
  98. JRI_PUBLIC_API(void)
  99. LJ_GetJavaAppSize(MWContext *context, LO_JavaAppStruct *java_struct,
  100.           NET_ReloadMethod reloadMethod);
  101.  
  102. JRI_PUBLIC_API(PRBool)
  103. LJ_GetJavaEnabled(void);
  104.  
  105. JRI_PUBLIC_API(struct netscape_javascript_JSObject*)
  106. LJ_GetMochaWindow(MWContext *cx);
  107.  
  108. JRI_PUBLIC_API(PRBool) 
  109. LJ_HandleEvent(MWContext* context, LO_JavaAppStruct *pJava, void *event);
  110.  
  111. JRI_PUBLIC_API(void)
  112. LJ_HideConsole(void);
  113.  
  114. JRI_PUBLIC_API(void)
  115. LJ_HideJavaAppElement(MWContext *context, ...);
  116.  
  117. JRI_PUBLIC_API(void) 
  118. LJ_IconifyApplets(MWContext* context);
  119.  
  120. PR_PUBLIC_API(void *)
  121. LJ_InitializeZig(void *zipPtr);
  122.  
  123. jref
  124. LJ_InvokeMethod(jglobal clazzGlobal, ...);
  125.  
  126. JRI_PUBLIC_API(JRIEnv *)
  127. LJ_JSJ_CurrentEnv(JSContext *cx);
  128.  
  129. JRI_PUBLIC_API(void)
  130. LJ_JSJ_Init();
  131.  
  132. PR_PUBLIC_API(char *)
  133. LJ_LoadFromZipFile(void *zip, char *fn);
  134.  
  135. PR_PUBLIC_API(int)
  136. LJ_PrintZigError(int status, void *zigPtr, const char *metafile, char *pathname, 
  137.          char *errortext);
  138.  
  139. JRI_PUBLIC_API(void)
  140. LJ_SetConsoleShowCallback(void (*func)(int on, void* a), void *arg);
  141.  
  142. void
  143. LJ_SetProgramName(const char *name);
  144.  
  145. JRI_PUBLIC_API(void)
  146. LJ_ShowConsole(void);
  147.  
  148. JRI_PUBLIC_API(LJJavaStatus)
  149. LJ_ShutdownJava(void);
  150.  
  151. JRI_PUBLIC_API(void)
  152. LJ_UniconifyApplets(MWContext* context);
  153.  
  154. /* ??? Is it needed for windows ??? */
  155. /* LJ_StartupJava used in ./cmd/winfe/woohoo.cpp */
  156. /* ns/modules/applet/include/java.h */
  157. /* ns/modules/applet/src/lj_init.c */
  158. JRI_PUBLIC_API(LJJavaStatus)
  159. LJ_StartupJava(void);
  160.  
  161. JRI_PUBLIC_API(MWContext *)
  162. NSN_JavaContextToRealContext(MWContext *javaContext);
  163.  
  164. JRI_PUBLIC_API(void) 
  165. NSN_RegisterJavaConverter(void);
  166.  
  167. JRI_PUBLIC_API(void)
  168. PrintToConsole(const char* bytes);
  169.  
  170. /******************************************************************************/
  171.  
  172. XP_END_PROTOS
  173.  
  174. #endif /* _NAVJAVA_H_ */
  175.