Frame Callbacks Structure
When you create an AWT context associated with a session, you must pass a data structure that provides frame callback information. This data structure is defined by the JMFrameCallbacks data type.
struct JMFrameCallbacks {
UInt32 fVersion;
JMFrameSetupPortProcPtr fSetupPort;
JMFrameRestorePortProcPtr fRestorePort;
JMFrameResizeRequestProcPtr fResizeRequest;
JMFrameInvalRectProcPtr fInvalRect;
JMFrameShowHideProcPtr fShowHide;
JMSetTitleProcPtr fSetTitle;
JMCheckUpdateProcPtr fCheckUpdate;
};
Field Description
fVersion
- The version of JManager. You should set this field to
kJMVersion.
- fSetupPort
- A pointer to a function that sets up a graphics port. The client application must prepare a graphics port for the AWT to draw in or manipulate. This callback function has the following type definition:
typedef void* (*JMFrameSetupPortProcPtr) (
JMFrameRef frame);
-
- For more information, see the description of the application-defined function
MySetUpPort (page 64). The value in fSetUpPort is passed to the MyRestorePort function, so this value cannot be a pointer to a stack-allocated object.
- fRestorePort
- A pointer to a function that restores a graphics port. This callback function has the following type definition:
typedef void (*JMFrameRestorePortProcPtr) (
JMFrameRef frame, void* param);
-
- For more information, see the description of the application-defined function
MyRestorePort (page 65).
- fResizeRequest
- A pointer to a function that handles a frame resize request. This callback function has the following type definition:
typedef Boolean (*JMFrameResizeRequestProcPtr) (
JMFrameRef frame, Rect* desired);
-
- For more information, see the description of the application-defined function
MyResizeRequest (page 65).
- fInvalRect
- A pointer to a function that handles a frame invalidation request. This callback function has the following type definition:
typedef void (*JMFrameInvalRectProcPtr) (
JMFrameRef frame, const Rect* r);
-
- For more information, see the description of the application-defined function
MyInvalRect (page 66)
- fShowHide
- A pointer to a window show/hide function. This callback function has the following type definition:
typedef void (*JMFrameShowHideProcPtr) (
JMFrameRef frame, Boolean showFrameRequested);
-
- For more information, see the description of the application-defined function
MyShowHide (page 66).
fSetTitle
- A pointer to a function that sets the title bar text for a frame. This callback function has the following type definition:
typedef void (*JMSetTitleProcPtr) (
JMFrameRef frame, Str255 title);
-
- For more information, see the description of the application-defined function
MySetTitle (page 67).
fCheckUpdate
- A pointer to a function that gives the frame an opportunity to be updated during an interaction (such as a mouse drag). This callback function has the following type definition:
typedef void (*JMCheckUpdateProcPtr) (
JMFrameRef frame);
-
- For more information, see the description of the application-defined function
MyCheckUpdate (page 67).