|
Mac OS 9
|
Routines that can be used to invoke the Java Virtual Machine in MRJ. More...
#include <ConditionalMacros.h>#include <MacTypes.h>#include <Files.h>#include <Drag.h>#include <Quickdraw.h>#include <Menus.h>#include <TextCommon.h>#include <CodeFragments.h>Go to the source code of this file.
Data Structures | |
| struct | JMSessionCallbacks |
| struct | JMProxyInfo |
| struct | JMFrameCallbacks |
| struct | JMAWTContextCallbacks |
| struct | JMAppletLocatorCallbacks |
| struct | JMLIBOptionalParams |
| struct | JMLocatorInfoBlock |
| struct | JMAppletViewerCallbacks |
| struct | JMAppletSecurity |
Typedefs | |
| typedef void * | JMClientData |
| typedef struct OpaqueJMSessionRef * | JMSessionRef |
| typedef struct OpaqueJMFrameRef * | JMFrameRef |
| typedef struct OpaqueJMTextRef * | JMTextRef |
| typedef struct OpaqueJMAWTContextRef * | JMAWTContextRef |
| typedef struct OpaqueJMAppletLocatorRef * | JMAppletLocatorRef |
| typedef struct OpaqueJMAppletViewerRef * | JMAppletViewerRef |
| typedef struct OpaqueJMAppletPageRef * | JMAppletPageRef |
| typedef TextEncoding | JMTextEncoding |
| typedef const void * | message |
| typedef const void SInt32 | messageLengthInBytes |
| typedef void * | buffer |
| typedef void SInt32 | maxBufferLength |
| typedef SInt32 | status |
| typedef const char * | url |
| typedef const char const char * | realm |
| typedef const char const char char | userName[255] |
| typedef const char const char char char | password[255] |
| typedef struct JMSessionCallbacks | JMSessionCallbacks |
| typedef enum JMVerifierOptions | JMVerifierOptions |
| typedef enum JMRuntimeOptions | JMRuntimeOptions |
| typedef struct JMProxyInfo | JMProxyInfo |
| typedef enum JMProxyType | JMProxyType |
| typedef enum ReorderRequest | ReorderRequest |
| typedef const Rect * | newBounds |
| typedef const Rect * | r |
| typedef Boolean | showFrameRequested |
| typedef JMTextRef | title |
| typedef ReorderRequest | theRequest |
| typedef Boolean | resizeable |
| typedef Rect * | insets |
| typedef Boolean | forward |
| typedef struct JMFrameCallbacks | JMFrameCallbacks |
| typedef enum JMFrameKind | JMFrameKind |
| typedef JMFrameRef | newFrame |
| typedef JMFrameRef JMFrameKind | kind |
| typedef JMFrameRef JMFrameKind const Rect * | initialBounds |
| typedef JMFrameRef JMFrameKind const Rect Boolean JMFrameCallbacks * | callbacks |
| typedef JMFrameRef | oldFrame |
| typedef Boolean | isSubmenu |
| typedef JMTextRef | exceptionName |
| typedef JMTextRef JMTextRef | exceptionMsg |
| typedef JMTextRef JMTextRef JMTextRef | stackTrace |
| typedef struct JMAWTContextCallbacks | JMAWTContextCallbacks |
| typedef enum JMLocatorErrors | JMLocatorErrors |
| typedef struct JMAppletLocatorCallbacks | JMAppletLocatorCallbacks |
| typedef struct JMLIBOptionalParams | JMLIBOptionalParams |
| typedef struct JMLocatorInfoBlock | JMLocatorInfoBlock |
| typedef JMTextRef | urlString |
| typedef JMTextRef JMTextRef | windowName |
| typedef JMTextRef | statusMsg |
| typedef struct JMAppletViewerCallbacks | JMAppletViewerCallbacks |
| typedef enum JMNetworkSecurityOptions | JMNetworkSecurityOptions |
| typedef enum JMFileSystemOptions | JMFileSystemOptions |
| typedef struct JMAppletSecurity | JMAppletSecurity |
Enumerations | |
| enum | { kJMVersion = 0x11800007 , kDefaultJMTime = 0x00000400 } |
| enum | { kJMVersionError = -60000L , kJMExceptionOccurred = -60001L , kJMBadClassPathError = -60002L } |
| enum | { kModifierAsciiChar = 0 , kModifierKeyCode = 0 } |
| enum | JMVerifierOptions { eDontCheckCode = 0 , eCheckRemoteCode = 1 , eCheckAllCode = 2 } |
| enum | JMRuntimeOptions { eJManager2Defaults = 0 , eUseAppHeapOnly = (1 << 0) , eDisableJITC = (1 << 1) , eEnableDebugger = (1 << 2) , eDisableInternetConfig = (1 << 3) , eInhibitClassUnloading = (1 << 4) , eEnableProfiling = (1 << 5) , eJManager1Compatible = (eDisableInternetConfig | eInhibitClassUnloading) } |
| enum | JMProxyType { eHTTPProxy = 0 , eFirewallProxy = 1 , eFTPProxy = 2 } |
| enum | ReorderRequest { eBringToFront = 0 , eSendToBack = 1 , eSendBehindFront = 2 } |
| enum | JMFrameKind { eBorderlessModelessWindowFrame = 0 , eModelessWindowFrame = 1 , eModalWindowFrame = 2 , eModelessDialogFrame = 3 } |
| enum | JMLocatorErrors { eLocatorNoErr = 0 , eHostNotFound = 1 , eFileNotFound = 2 , eLocatorTimeout = 3 , eLocatorKilled } |
| enum | JMNetworkSecurityOptions { eNoNetworkAccess = 0 , eAppletHostAccess = 1 , eUnrestrictedAccess = 2 } |
| enum | JMFileSystemOptions { eNoFSAccess = 0 , eLocalAppletAccess = 1 , eAllFSAccess = 2 } |
Functions | |
| typedef | CALLBACK_API_C (void, JMConsoleProcPtr)(JMSessionRef session |
| typedef | CALLBACK_API_C (SInt32, JMConsoleReadProcPtr)(JMSessionRef session |
| typedef | CALLBACK_API_C (Boolean, JMExitProcPtr)(JMSessionRef session |
| typedef | CALLBACK_API_C (Boolean, JMAuthenticateURLProcPtr)(JMSessionRef session |
| typedef | CALLBACK_API_C (void, JMLowMemoryProcPtr)(JMSessionRef session) |
| unsigned long | JMGetVersion (void) |
| UInt32 | JMGetMRJRuntimeVersion (void) |
| OSStatus | JMOpenSession (JMSessionRef *session, JMRuntimeOptions runtimeOptions, JMVerifierOptions verifyMode, const JMSessionCallbacks *callbacks, JMTextEncoding desiredEncoding, JMClientData data) |
| OSStatus | JMCloseSession (JMSessionRef session) |
| OSStatus | JMGetSessionData (JMSessionRef session, JMClientData *data) |
| OSStatus | JMSetSessionData (JMSessionRef session, JMClientData data) |
| OSStatus | JMAddToClassPath (JMSessionRef session, const FSSpec *spec) |
| Handle | JMFSSToURL (JMSessionRef session, const FSSpec *spec) |
| OSStatus | JMURLToFSS (JMSessionRef session, JMTextRef urlString, FSSpec *spec) |
| OSStatus | JMIdle (JMSessionRef session, UInt32 jmTimeMillis) |
| OSStatus | JMGetSessionProperty (JMSessionRef session, JMTextRef propertyName, JMTextRef *propertyValue) |
| OSStatus | JMPutSessionProperty (JMSessionRef session, JMTextRef propertyName, JMTextRef propertyValue) |
| OSStatus | JMNewTextRef (JMSessionRef session, JMTextRef *textRef, JMTextEncoding encoding, const void *charBuffer, UInt32 bufferLengthInBytes) |
| OSStatus | JMCopyTextRef (JMTextRef textRefSrc, JMTextRef *textRefDst) |
| OSStatus | JMDisposeTextRef (JMTextRef textRef) |
| OSStatus | JMGetTextLength (JMTextRef textRef, UInt32 *textLengthInCharacters) |
| OSStatus | JMGetTextLengthInBytes (JMTextRef textRef, JMTextEncoding dstEncoding, UInt32 *textLengthInBytes) |
| OSStatus | JMGetTextBytes (JMTextRef textRef, JMTextEncoding dstEncoding, void *textBuffer, UInt32 textBufferLength, UInt32 *numCharsCopied) |
| Handle | JMTextToMacOSCStringHandle (JMTextRef textRef) |
| OSStatus | JMGetProxyInfo (JMSessionRef session, JMProxyType proxyType, JMProxyInfo *proxyInfo) |
| OSStatus | JMSetProxyInfo (JMSessionRef session, JMProxyType proxyType, const JMProxyInfo *proxyInfo) |
| OSStatus | JMGetVerifyMode (JMSessionRef session, JMVerifierOptions *verifierOptions) |
| OSStatus | JMSetVerifyMode (JMSessionRef session, JMVerifierOptions verifierOptions) |
| typedef | CALLBACK_API_C (void, JMSetFrameSizeProcPtr)(JMFrameRef frame |
| typedef | CALLBACK_API_C (void, JMFrameInvalRectProcPtr)(JMFrameRef frame |
| typedef | CALLBACK_API_C (void, JMFrameShowHideProcPtr)(JMFrameRef frame |
| typedef | CALLBACK_API_C (void, JMSetTitleProcPtr)(JMFrameRef frame |
| typedef | CALLBACK_API_C (void, JMCheckUpdateProcPtr)(JMFrameRef frame) |
| typedef | CALLBACK_API_C (void, JMReorderFrame)(JMFrameRef frame |
| typedef | CALLBACK_API_C (void, JMSetResizeable)(JMFrameRef frame |
| typedef | CALLBACK_API_C (void, JMGetFrameInsets)(JMFrameRef frame |
| typedef | CALLBACK_API_C (void, JMNextFocus)(JMFrameRef frame |
| typedef | CALLBACK_API_C (void, JMRequestFocus)(JMFrameRef frame) |
| OSStatus | JMSetFrameVisibility (JMFrameRef frame, GrafPtr famePort, Point frameOrigin, RgnHandle frameClip) |
| OSStatus | JMGetFrameData (JMFrameRef frame, JMClientData *data) |
| OSStatus | JMSetFrameData (JMFrameRef frame, JMClientData data) |
| OSStatus | JMGetFrameSize (JMFrameRef frame, Rect *result) |
| OSStatus | JMSetFrameSize (JMFrameRef frame, const Rect *newSize) |
| OSStatus | JMFrameClickWithEventRecord (JMFrameRef frame, Point localPos, const EventRecord *event) |
| OSStatus | JMFrameKey (JMFrameRef frame, char asciiChar, char keyCode, short modifiers) |
| OSStatus | JMFrameKeyRelease (JMFrameRef frame, char asciiChar, char keyCode, short modifiers) |
| OSStatus | JMFrameUpdate (JMFrameRef frame, RgnHandle updateRgn) |
| OSStatus | JMFrameActivate (JMFrameRef frame, Boolean activate) |
| OSStatus | JMFrameResume (JMFrameRef frame, Boolean resume) |
| OSStatus | JMFrameMouseOver (JMFrameRef frame, Point localPos, short modifiers) |
| OSStatus | JMFrameShowHide (JMFrameRef frame, Boolean showFrame) |
| OSStatus | JMFrameGoAway (JMFrameRef frame) |
| JMAWTContextRef | JMGetFrameContext (JMFrameRef frame) |
| OSStatus | JMFrameDragTracking (JMFrameRef frame, DragTrackingMessage message, DragReference theDragRef) |
| OSStatus | JMFrameDragReceive (JMFrameRef frame, DragReference theDragRef) |
| OSStatus | JMFrameClick (JMFrameRef frame, Point localPos, short modifiers) |
| OSStatus | JMFrameFocus (JMFrameRef frame, Boolean gotFocus) |
| OSStatus | JMDrawFrameInPort (JMFrameRef frame, GrafPtr framePort, Point frameOrigin, RgnHandle clipRgn, Boolean callPaintAsOpposedToPrint) |
| OSStatus | JMNewAppletPage (JMAppletPageRef *page, JMSessionRef session) |
| OSStatus | JMDisposeAppletPage (JMAppletPageRef page) |
| typedef | CALLBACK_API_C (OSStatus, JMRequestFrameProcPtr)(JMAWTContextRef context |
| typedef | CALLBACK_API_C (OSStatus, JMReleaseFrameProcPtr)(JMAWTContextRef context |
| typedef | CALLBACK_API_C (SInt16, JMUniqueMenuIDProcPtr)(JMAWTContextRef context |
| typedef | CALLBACK_API_C (void, JMExceptionOccurredProcPtr)(JMAWTContextRef context |
| OSStatus | JMNewAWTContext (JMAWTContextRef *context, JMSessionRef session, const JMAWTContextCallbacks *callbacks, JMClientData data) |
| OSStatus | JMNewAWTContextInPage (JMAWTContextRef *context, JMSessionRef session, JMAppletPageRef page, const JMAWTContextCallbacks *callbacks, JMClientData data) |
| OSStatus | JMDisposeAWTContext (JMAWTContextRef context) |
| OSStatus | JMGetAWTContextData (JMAWTContextRef context, JMClientData *data) |
| OSStatus | JMSetAWTContextData (JMAWTContextRef context, JMClientData data) |
| OSStatus | JMCountAWTContextFrames (JMAWTContextRef context, UInt32 *frameCount) |
| OSStatus | JMGetAWTContextFrame (JMAWTContextRef context, UInt32 frameIndex, JMFrameRef *frame) |
| OSStatus | JMMenuSelected (JMAWTContextRef context, MenuRef hMenu, short menuItem) |
| OSStatus | JMMenuSelectedWithModifiers (JMAWTContextRef context, MenuRef hMenu, short menuItem, short modifiers) |
| typedef | CALLBACK_API_C (void, JMFetchCompleted)(JMAppletLocatorRef ref |
| OSStatus | JMNewAppletLocator (JMAppletLocatorRef *locatorRef, JMSessionRef session, const JMAppletLocatorCallbacks *callbacks, JMTextRef url, JMTextRef htmlText, JMClientData data) |
| OSStatus | JMNewAppletLocatorFromInfo (JMAppletLocatorRef *locatorRef, JMSessionRef session, const JMLocatorInfoBlock *info, JMClientData data) |
| OSStatus | JMDisposeAppletLocator (JMAppletLocatorRef locatorRef) |
| OSStatus | JMGetAppletLocatorData (JMAppletLocatorRef locatorRef, JMClientData *data) |
| OSStatus | JMSetAppletLocatorData (JMAppletLocatorRef locatorRef, JMClientData data) |
| OSStatus | JMCountApplets (JMAppletLocatorRef locatorRef, UInt32 *appletCount) |
| OSStatus | JMGetAppletDimensions (JMAppletLocatorRef locatorRef, UInt32 appletIndex, UInt32 *width, UInt32 *height) |
| OSStatus | JMGetAppletTag (JMAppletLocatorRef locatorRef, UInt32 appletIndex, JMTextRef *tagRef) |
| OSStatus | JMGetAppletName (JMAppletLocatorRef locatorRef, UInt32 appletIndex, JMTextRef *nameRef) |
| typedef | CALLBACK_API_C (void, JMShowDocumentProcPtr)(JMAppletViewerRef viewer |
| typedef | CALLBACK_API_C (void, JMSetStatusMsgProcPtr)(JMAppletViewerRef viewer |
| OSStatus | JMNewAppletViewer (JMAppletViewerRef *viewer, JMAWTContextRef context, JMAppletLocatorRef locatorRef, UInt32 appletIndex, const JMAppletSecurity *security, const JMAppletViewerCallbacks *callbacks, JMClientData data) |
| OSStatus | JMDisposeAppletViewer (JMAppletViewerRef viewer) |
| OSStatus | JMGetAppletViewerData (JMAppletViewerRef viewer, JMClientData *data) |
| OSStatus | JMSetAppletViewerData (JMAppletViewerRef viewer, JMClientData data) |
| OSStatus | JMGetAppletViewerSecurity (JMAppletViewerRef viewer, JMAppletSecurity *data) |
| OSStatus | JMSetAppletViewerSecurity (JMAppletViewerRef viewer, const JMAppletSecurity *data) |
| OSStatus | JMReloadApplet (JMAppletViewerRef viewer) |
| OSStatus | JMRestartApplet (JMAppletViewerRef viewer) |
| OSStatus | JMSuspendApplet (JMAppletViewerRef viewer) |
| OSStatus | JMResumeApplet (JMAppletViewerRef viewer) |
| OSStatus | JMGetFrameViewer (JMFrameRef frame, JMAppletViewerRef *viewer, JMFrameRef *parentFrame) |
| OSStatus | JMGetViewerFrame (JMAppletViewerRef viewer, JMFrameRef *frame) |
| Boolean | JMRegisterLibrary (JMSessionRef session, ConstStr63Param libraryName, CFragConnectionID connID, Boolean javaShouldClose) |
Routines that can be used to invoke the Java Virtual Machine in MRJ.
For bug reports, consult the following page on the World Wide Web:
http://developer.apple.com/bugreporter/
| typedef void* JMClientData |
Private data structures
JMClientData - enough bits to reliably store a pointer to arbitrary, client-specific data. JMSessionRef - references the entire java runtime JMTextRef - a Text string, length, and encoding JMTextEncoding - which encoding to use when converting in and out of Java strings. JMFrameRef - a java frame JMAWTContextRef - a context for the AWT to request frames, process events JMAppletLocatorRef - a device for locating, fetching, and parsing URLs that may contain applets JMAppletViewerRef - an object that displays applets in a Frame JMAppletPageRef - a way to group JMAWTContextRef's so they share the same class loader
| anonymous enum |
Note: If you want to use any JManger routines which use JNI or JRI functionality, you must #include <jni.h> or <jri.h> before this file.
| anonymous enum |
Special codes for JMFrameKey, JMFrameKeyRelease:
When your app notices that a modifiers is pressed (must be done by polling, unless Mac OS changes to support sending modifiers as events) you should notify the runtime using JMFrameKey, JMFrameKeyRelease, using these constants for asciiChar and keyCode. This will allow the AWT to synthesize the appropriate events
| enum JMFrameKind |
returns the java.awt.Frame for this frame returns the com.apple.mrj.JManager.JMFrame for this frame Window types
| enum JMLocatorErrors |
return a com.apple.mrj.JManager.JMAWTContext JMAppletLocator - Since Java applets are always referenced by a Uniform Resource Locator (see RFC 1737, http://www.w3.org/pub/WWW/Addressing/rfc1738.txt), we provide an object that encapsulates the information about a set of applets. A JMAppletLocator is built by providing a base URL, which must point at a valid HTML document containing applet tags. To save a network transaction, the contents of the document may be passed optionally.
You can also use a JMLocatorInfoBlock for a synchronous resolution of the applet, assuming that you already have the info for the tag.
NEW: per-applet security settings Previously, these settings were attached to the session. JManager 2.0 allows them to be attached to each viewer.
| enum JMRuntimeOptions |
JMRuntimeOptions is a mask that allows you to specify certain attributes for the runtime. Bitwise or the fields together, or use one of the "premade" entries. eJManager2Defaults is the factory default, and best bet to use.
| enum ReorderRequest |
The basic unit of AWT interaction is the JMFrame. A JMFrame is bound to top level awt Frame, Window, or Dialog. When a user event occurs for a MacOS window, the event is passed to the corrosponding frame object. Similarly, when an AWT event occurs that requires the Mac OS Window to change, a callback is made. JManager 1.x bound the frame to the window through a callback to set and restore the windows GrafPort. In JManager 2.0, a GrafPort, Offset, and ClipRgn are specified up front - changes in visibility and structure require that these be re-set. This enables support for the JavaSoft DrawingSurface API - and also improves graphics performance. You should reset the graphics attributes anytime the visiblity changes, like when scrolling. You should also set it initially when the AWTContext requests the frame. At various times, JM will call back to the client to register a new JMFrame, indicating the frame type. The client should take the following steps:
o Create a new invisible window of the specified type o Fill in the callbacks parameter with function pointers o Do something to bind the frame to the window (like stuff the WindowPtr in the JMClientData of the frame) o Register the visiblity parameters (GrafPtr, etc) with the frame
| typedef CALLBACK_API_C | ( | void | , |
| JMConsoleProcPtr | |||
| ) |
The runtime requires certain callbacks be used to communicate between session events and the embedding application.
In general, you can pass nil as a callback and a "good" default will be used.
JMConsoleProcPtr - redirect stderr or stdout - the message is delivered in the encoding specified when you created the session, or possibly binary data. JMConsoleReadProcPtr - take input from the user from a console or file. The input is expected to be in the encoding specified when you opened the session. JMExitProcPtr - called via System.exit(int), return "true" to kill the current thread, false, to cause a 'QUIT' AppleEvent to be sent to the current process, or just tear down the runtime and exit to shell immediately JMLowMemoryProcPtr - This callback is available to notify the embedding application that a low memory situation has occurred so it can attempt to recover appropriately. JMAuthenicateURLProcPtr - prompt the user for autentication based on the URL. If you pass nil, JManager will prompt the user. Return false if the user pressed cancel.
| typedef CALLBACK_API_C | ( | void | , |
| JMNextFocus | |||
| ) |
New in JManager 2.1: If the AWT needs to set focus to a frame (in the case of multiple JMFrames within a single Mac OS Frame) it will call back to the embedding application using JMRRequestFocus. The application should then defocus what it thought did have the focus, and set the focus to the new frame. If the user is tabbing within a JMFrame, and the focus reaches the last focusable component (or the first, if focus is traversing backwards) JMNexetFocus will be called. The application should defocus the component that requests this, and focus the next application visible focusable element. (If none, send focus back to the frame.)
| typedef CALLBACK_API_C | ( | void | , |
| JMShowDocumentProcPtr | |||
| ) |
JMAppletViewer - Applets are instantiated, one by one, by specifying a JMAppletLocator and a zero-based index (Macintosh API's usually use one-based indexing, the Java language uses zero, however.). The resulting applet is encapsulated in a JMAppletViewer object. Since applets can have one or more visible areas to draw in, one or more JMFrame objects may be requested while the viewer is being created, or at a later time, thus the client must provide callbacks to satisfy these requests.
The window name for the ShowDocument callback is one of: _self show in current frame _parent show in parent frame _top show in top-most frame _blank show in new unnamed top-level window <other> show in new top-level window named <other>
| OSStatus JMAddToClassPath | ( | JMSessionRef | session, |
| const FSSpec * | spec | ||
| ) |
Prepend the target of the FSSpec to the class path. If a file, .zip or other known archive file - not a .class file JMAddToClassPath()
| OSStatus JMCloseSession | ( | JMSessionRef | session | ) |
| OSStatus JMCopyTextRef | ( | JMTextRef | textRefSrc, |
| JMTextRef * | textRefDst | ||
| ) |
JMCopyTextRef clones a text ref. JMCopyTextRef()
| OSStatus JMCountApplets | ( | JMAppletLocatorRef | locatorRef, |
| UInt32 * | appletCount | ||
| ) |
| OSStatus JMCountAWTContextFrames | ( | JMAWTContextRef | context, |
| UInt32 * | frameCount | ||
| ) |
| OSStatus JMDisposeAppletLocator | ( | JMAppletLocatorRef | locatorRef | ) |
| OSStatus JMDisposeAppletPage | ( | JMAppletPageRef | page | ) |
| OSStatus JMDisposeAppletViewer | ( | JMAppletViewerRef | viewer | ) |
| OSStatus JMDisposeAWTContext | ( | JMAWTContextRef | context | ) |
| OSStatus JMDisposeTextRef | ( | JMTextRef | textRef | ) |
Disposes of a text ref passed back from the runtime, or created explicitly through JMNewTextRef JMDisposeTextRef()
| OSStatus JMDrawFrameInPort | ( | JMFrameRef | frame, |
| GrafPtr | framePort, | ||
| Point | frameOrigin, | ||
| RgnHandle | clipRgn, | ||
| Boolean | callPaintAsOpposedToPrint | ||
| ) |
Cause a Frame and its contents to be rendered in a GrafPort. This is typically going to be used to cause an applet to print itself into a PrGrafPort. If you pass 'true' as the last parameter, the paint(Graphics) method of the frame is called, rather than print(Graphics). JMDrawFrameInPort()
| OSStatus JMFrameActivate | ( | JMFrameRef | frame, |
| Boolean | activate | ||
| ) |
| OSStatus JMFrameClick | ( | JMFrameRef | frame, |
| Point | localPos, | ||
| short | modifiers | ||
| ) |
JMFrameClick is deprecated - please use JMFrameClickWithEventRecord instead. JMFrameClick()
| OSStatus JMFrameClickWithEventRecord | ( | JMFrameRef | frame, |
| Point | localPos, | ||
| const EventRecord * | event | ||
| ) |
Dispatch a particular event to an embedded frame JMFrameClickWithEventRecord()
| OSStatus JMFrameDragReceive | ( | JMFrameRef | frame, |
| DragReference | theDragRef | ||
| ) |
| OSStatus JMFrameDragTracking | ( | JMFrameRef | frame, |
| DragTrackingMessage | message, | ||
| DragReference | theDragRef | ||
| ) |
| OSStatus JMFrameFocus | ( | JMFrameRef | frame, |
| Boolean | gotFocus | ||
| ) |
If you may have multiple JMFrames in a single Mac OS Window (for example, in a browser) then use JMFrameFocus to control when you believe the frame should logically contain the focus. This will allow for the correct appearance of Controls and Text Fields. If you will only have one JMFrame per Mac OS Window, use JMFrameFocus as well as JMFrameActivate to control hiliting. JMFrameFocus()
| OSStatus JMFrameGoAway | ( | JMFrameRef | frame | ) |
| OSStatus JMFrameKey | ( | JMFrameRef | frame, |
| char | asciiChar, | ||
| char | keyCode, | ||
| short | modifiers | ||
| ) |
| OSStatus JMFrameKeyRelease | ( | JMFrameRef | frame, |
| char | asciiChar, | ||
| char | keyCode, | ||
| short | modifiers | ||
| ) |
| OSStatus JMFrameMouseOver | ( | JMFrameRef | frame, |
| Point | localPos, | ||
| short | modifiers | ||
| ) |
| OSStatus JMFrameResume | ( | JMFrameRef | frame, |
| Boolean | resume | ||
| ) |
| OSStatus JMFrameShowHide | ( | JMFrameRef | frame, |
| Boolean | showFrame | ||
| ) |
| OSStatus JMFrameUpdate | ( | JMFrameRef | frame, |
| RgnHandle | updateRgn | ||
| ) |
| Handle JMFSSToURL | ( | JMSessionRef | session, |
| const FSSpec * | spec | ||
| ) |
Utility returns (client owned) null terminated handle containing "\file//xxxx", or nil if fnfErr JMFSSToURL()
| OSStatus JMGetAppletDimensions | ( | JMAppletLocatorRef | locatorRef, |
| UInt32 | appletIndex, | ||
| UInt32 * | width, | ||
| UInt32 * | height | ||
| ) |
| OSStatus JMGetAppletLocatorData | ( | JMAppletLocatorRef | locatorRef, |
| JMClientData * | data | ||
| ) |
| OSStatus JMGetAppletName | ( | JMAppletLocatorRef | locatorRef, |
| UInt32 | appletIndex, | ||
| JMTextRef * | nameRef | ||
| ) |
| OSStatus JMGetAppletTag | ( | JMAppletLocatorRef | locatorRef, |
| UInt32 | appletIndex, | ||
| JMTextRef * | tagRef | ||
| ) |
| OSStatus JMGetAppletViewerData | ( | JMAppletViewerRef | viewer, |
| JMClientData * | data | ||
| ) |
| OSStatus JMGetAppletViewerSecurity | ( | JMAppletViewerRef | viewer, |
| JMAppletSecurity * | data | ||
| ) |
You can change the applet security on the fly JMGetAppletViewerSecurity()
| OSStatus JMGetAWTContextData | ( | JMAWTContextRef | context, |
| JMClientData * | data | ||
| ) |
| OSStatus JMGetAWTContextFrame | ( | JMAWTContextRef | context, |
| UInt32 | frameIndex, | ||
| JMFrameRef * | frame | ||
| ) |
| JMAWTContextRef JMGetFrameContext | ( | JMFrameRef | frame | ) |
| OSStatus JMGetFrameData | ( | JMFrameRef | frame, |
| JMClientData * | data | ||
| ) |
| OSStatus JMGetFrameSize | ( | JMFrameRef | frame, |
| Rect * | result | ||
| ) |
| OSStatus JMGetFrameViewer | ( | JMFrameRef | frame, |
| JMAppletViewerRef * | viewer, | ||
| JMFrameRef * | parentFrame | ||
| ) |
To get back to the JMAppletViewerRef instance from whence a frame came, as well as the ultimate frame parent (the one created for the applet viewer) JMGetFrameViewer()
| UInt32 JMGetMRJRuntimeVersion | ( | void | ) |
Returns the version number of the MRJ installation. This is an official version number that will change for each official release of MRJ, whereas for an incremental MRJ release, the version number returned by JMGetVersion may not change. JMGetMRJRuntimeVersion()
| OSStatus JMGetProxyInfo | ( | JMSessionRef | session, |
| JMProxyType | proxyType, | ||
| JMProxyInfo * | proxyInfo | ||
| ) |
| OSStatus JMGetSessionData | ( | JMSessionRef | session, |
| JMClientData * | data | ||
| ) |
Client data getter/setter functions. JMGetSessionData()
| OSStatus JMGetSessionProperty | ( | JMSessionRef | session, |
| JMTextRef | propertyName, | ||
| JMTextRef * | propertyValue | ||
| ) |
JMGetCurrenvEnv gives access to the underlying JRI interface, if available. This gives the client more control over the underlying Java runtime, without exposing the implementation too much. NOTE: JRI is deprecated; please upgrade your code to work with JNI instead. JNI is to be preferred. Since JManager calls reutrn jref (JRI Java references) you need to convert between them and JNI references (jobjects) if you're using JNI. These routines facilitate that conversion. Java defines system-wide properties that applets can use to make queries about the host system. Many of these properties correspond to defaults provided by "Internet Config." JMPutSessionProperty can be used by a client program to modify various system-wide properties. JMGetSessionProperty()
| OSStatus JMGetTextBytes | ( | JMTextRef | textRef, |
| JMTextEncoding | dstEncoding, | ||
| void * | textBuffer, | ||
| UInt32 | textBufferLength, | ||
| UInt32 * | numCharsCopied | ||
| ) |
Copies the specified number of characters to the destination buffer with the appropriate destination encoding. JMGetTextBytes()
| OSStatus JMGetTextLength | ( | JMTextRef | textRef, |
| UInt32 * | textLengthInCharacters | ||
| ) |
Returns the text length, in characters JMGetTextLength()
| OSStatus JMGetTextLengthInBytes | ( | JMTextRef | textRef, |
| JMTextEncoding | dstEncoding, | ||
| UInt32 * | textLengthInBytes | ||
| ) |
Returns the text length, in number of bytes taken in the destination encoding JMGetTextLengthInBytes()
| OSStatus JMGetVerifyMode | ( | JMSessionRef | session, |
| JMVerifierOptions * | verifierOptions | ||
| ) |
Security - JManager 2.0 security is handled on a per-applet basis. There are some security settings that are inherited from InternetConfig (Proxy Servers) but the verifier can now be enabled and disabled. JMGetVerifyMode()
| unsigned long JMGetVersion | ( | void | ) |
Returns the version of the currently installed JManager library. Compare to kJMVersion. This is the only call that doesn't require a session, or a reference to something that references a session. JMGetVersion()
| OSStatus JMGetViewerFrame | ( | JMAppletViewerRef | viewer, |
| JMFrameRef * | frame | ||
| ) |
To get a ref back to the Frame that was created for this JMAppletViewerRef JMGetViewerFrame()
| OSStatus JMIdle | ( | JMSessionRef | session, |
| UInt32 | jmTimeMillis | ||
| ) |
JMIdle gives time to all Java threads. Giving more time makes Java programs run faster, but can reduce overall system responsiveness. JMIdle will return sooner if low-level (user) events appear in the event queue. JMIdle()
| OSStatus JMMenuSelected | ( | JMAWTContextRef | context, |
| MenuRef | hMenu, | ||
| short | menuItem | ||
| ) |
Starting in MRJ 2.1, JMMenuSelected is deprecated. Please use JMMenuSelectedWithModifiers instead. JMMenuSelected()
| OSStatus JMMenuSelectedWithModifiers | ( | JMAWTContextRef | context, |
| MenuRef | hMenu, | ||
| short | menuItem, | ||
| short | modifiers | ||
| ) |
Starting in MRJ 2.1, this call takes an additional 'modifiers' parameter that you can get from your event record. JMMenuSelectedWithModifiers()
| OSStatus JMNewAppletLocator | ( | JMAppletLocatorRef * | locatorRef, |
| JMSessionRef | session, | ||
| const JMAppletLocatorCallbacks * | callbacks, | ||
| JMTextRef | url, | ||
| JMTextRef | htmlText, | ||
| JMClientData | data | ||
| ) |
| OSStatus JMNewAppletLocatorFromInfo | ( | JMAppletLocatorRef * | locatorRef, |
| JMSessionRef | session, | ||
| const JMLocatorInfoBlock * | info, | ||
| JMClientData | data | ||
| ) |
| OSStatus JMNewAppletPage | ( | JMAppletPageRef * | page, |
| JMSessionRef | session | ||
| ) |
| OSStatus JMNewAppletViewer | ( | JMAppletViewerRef * | viewer, |
| JMAWTContextRef | context, | ||
| JMAppletLocatorRef | locatorRef, | ||
| UInt32 | appletIndex, | ||
| const JMAppletSecurity * | security, | ||
| const JMAppletViewerCallbacks * | callbacks, | ||
| JMClientData | data | ||
| ) |
AppletViewer methods JMNewAppletViewer()
| OSStatus JMNewAWTContext | ( | JMAWTContextRef * | context, |
| JMSessionRef | session, | ||
| const JMAWTContextCallbacks * | callbacks, | ||
| JMClientData | data | ||
| ) |
| OSStatus JMNewAWTContextInPage | ( | JMAWTContextRef * | context, |
| JMSessionRef | session, | ||
| JMAppletPageRef | page, | ||
| const JMAWTContextCallbacks * | callbacks, | ||
| JMClientData | data | ||
| ) |
| OSStatus JMNewTextRef | ( | JMSessionRef | session, |
| JMTextRef * | textRef, | ||
| JMTextEncoding | encoding, | ||
| const void * | charBuffer, | ||
| UInt32 | bufferLengthInBytes | ||
| ) |
Returns a com.apple.mrj.JManager.JMSession object JMText: opaque object that encapsulates a string, length, and character encoding. Strings passed between JManager and the embedding application goes through this interface. Only the most rudimentary conversion routines are supplied - it is expected that the embedding application will most of its work in the System Script.
These APIs present some questions about who actually owns the JMText. The rule is, if you created a JMTextRef, you are responsible for deleting it after passing it into the runtime. If the runtime passes one to you, it will be deleted after the callback.
If a pointer to an uninitialised JMTextRef is passed in to a routine (eg JMGetSessionProperty), it is assumed to have been created for the caller, and it is the callers responsibility to dispose of it.
The encoding types are taken verbatim from the Text Encoding Converter, which handles the ugly backside of script conversion. JMNewTextRef can create from a buffer of data in the specified encoding JMNewTextRef()
| OSStatus JMOpenSession | ( | JMSessionRef * | session, |
| JMRuntimeOptions | runtimeOptions, | ||
| JMVerifierOptions | verifyMode, | ||
| const JMSessionCallbacks * | callbacks, | ||
| JMTextEncoding | desiredEncoding, | ||
| JMClientData | data | ||
| ) |
JMOpenSession creates a new Java Runtime. Note that JManger 2.0 doesn't set security options at the time of runtime instantiation. AppletViewer Objecs have seperate security attributes bound to them, and the verifier is availiable elsewhere as well. The client data parameter lets a client associate an arbitgrary tagged pointer with the seession. When you create the session, you must specify the desired Text Encoding to use for console IO. Usually, its OK to use "kTextEncodingMacRoman". See TextCommon.h for the list. JMOpenSession()
| OSStatus JMPutSessionProperty | ( | JMSessionRef | session, |
| JMTextRef | propertyName, | ||
| JMTextRef | propertyValue | ||
| ) |
| Boolean JMRegisterLibrary | ( | JMSessionRef | session, |
| ConstStr63Param | libraryName, | ||
| CFragConnectionID | connID, | ||
| Boolean | javaShouldClose | ||
| ) |
To get the ref of the com.apple.mrj.JManager.JMAppletViewer java object To get the ref of the java.applet.Applet itself Tell MRJ to add connID to its list of shared libraries used when searching for JNI (and JRI) native methods. This is useful for overriding or redirecting a java call to System.loadLibrary(). In particular System.loadLibrary() does not reuse CFM connections to libraries already open by someone outside of the java session. It always forces its own private copy of a shared library to be opened. This can result in multiple instances of the data/TOC section of a shared library. Note: This function has no effect on JDirect based native methods. If connID exports a function named "JNI_OnLoad", it is immediately called. If javaShouldClose is true, MRJ will close the connection when the session is closed. Returns false and does nothing if a library with that name is already registered. JMRegisterLibrary()
| OSStatus JMReloadApplet | ( | JMAppletViewerRef | viewer | ) |
JMReloadApplet reloads viewer's applet from the source. JMRestartApplet reinstantiates the applet without reloading. JMReloadApplet()
| OSStatus JMRestartApplet | ( | JMAppletViewerRef | viewer | ) |
| OSStatus JMResumeApplet | ( | JMAppletViewerRef | viewer | ) |
| OSStatus JMSetAppletLocatorData | ( | JMAppletLocatorRef | locatorRef, |
| JMClientData | data | ||
| ) |
| OSStatus JMSetAppletViewerData | ( | JMAppletViewerRef | viewer, |
| JMClientData | data | ||
| ) |
| OSStatus JMSetAppletViewerSecurity | ( | JMAppletViewerRef | viewer, |
| const JMAppletSecurity * | data | ||
| ) |
| OSStatus JMSetAWTContextData | ( | JMAWTContextRef | context, |
| JMClientData | data | ||
| ) |
| OSStatus JMSetFrameData | ( | JMFrameRef | frame, |
| JMClientData | data | ||
| ) |
| OSStatus JMSetFrameSize | ( | JMFrameRef | frame, |
| const Rect * | newSize | ||
| ) |
| OSStatus JMSetFrameVisibility | ( | JMFrameRef | frame, |
| GrafPtr | famePort, | ||
| Point | frameOrigin, | ||
| RgnHandle | frameClip | ||
| ) |
| OSStatus JMSetProxyInfo | ( | JMSessionRef | session, |
| JMProxyType | proxyType, | ||
| const JMProxyInfo * | proxyInfo | ||
| ) |
| OSStatus JMSetSessionData | ( | JMSessionRef | session, |
| JMClientData | data | ||
| ) |
| OSStatus JMSetVerifyMode | ( | JMSessionRef | session, |
| JMVerifierOptions | verifierOptions | ||
| ) |
| OSStatus JMSuspendApplet | ( | JMAppletViewerRef | viewer | ) |
JMSuspendApplet tells the Java thread scheduler to stop executing the viewer's applet. JMResumeApplet resumes execution of the viewer's applet. JMSuspendApplet()
| Handle JMTextToMacOSCStringHandle | ( | JMTextRef | textRef | ) |
Return the JMText as a reference to a Java String. Note that this is the only reference to the string - it will be collected if you don't hang on to it. Returns a Handle to a null terminated, "C" string in the System Script. Note that using this routine could result in data loss, if the characters are not availiable in the System Script. JMTextToMacOSCStringHandle()
| OSStatus JMURLToFSS | ( | JMSessionRef | session, |
| JMTextRef | urlString, | ||
| FSSpec * | spec | ||
| ) |
Turns "\file///disk/file" into an FSSpec. other handlers return paramErr JMURLToFSS()