AW Developer's Guide | AW Interfaces | AW Methods | AW Types and Misc API


IMoaAwPiece



Interface ID: IID_IMoaAwPiece
Pointer type: PIMoaAwPiece
Inheritance: IMoaUnknown
Header file: awiservc.h

Description

The IMoaAwPiece interface provides the Authorware piece specific MOA services. These include methods which deal with expressions, variables, palettes, file location, and imaging support.

Methods

Media

GetMediaBitmap()
GetMediaImage()

Expressions

EvalExpression()
GetIconId()

Variables

GetVariable()
SetVariable()

Palette

GetPalette()
SetPalette()
ResetPalette()

File Location

ResolveFileName()

Imaging support

GetPresentationWindowGC()

Event sending

SendEvent()
SendEventWithReply()

EvalExpression()

Syntax

EvalExpression(PIMoaAwPiece This,
ConstPMoaChar pExpression,
PMoaMmValue pResult,
MoaAwExprFlags exprAttribs,
MoaLong FAR *pErrStart,
MoaLong FAR *pErrEnd)

Parameters

This
Pointer to the IMoaAwPiece interface

pExpression
Pointer to string containing expression

pResult
Pointer for returning result of texpression

exprAttribs
Flag trepresenting attributes of expression including kMoaAwExprFlag_IsScript

*pErrStart
Pointer to starting location of invalid text in the expression

*pErrEnd
Pointer to ending location of invalid text in the expression

Returns

kMoaErr_NoErr Function call succeeded

Description

Evaluates an expression or script supplied as a string and returns the result.


GetIconId()

Syntax

GetIconId(PIMoaAwPiece This,
ConstPMoaChar pIconTitle,
PMoaAwIconId pIconId)

Parameters

This
Pointer to the IMoaAwPiece interface

pIconTitle
Pointer to string containing icon title

pIconId
Pointer to icon ID

Returns

MoaError

Description

Looks up the unique identificaiton number assigned to the icon whose title is at pIconTitle.


GetMediaBitmap()

Syntax

GetMediaBitmap(PIMoaAwPiece This,
MoaMmWinHandle *bitmap,
MoaMmHpal palette,
MoaAwIconId iconId)

Parameters

This
Pointer to the IMoaAwPiece interface

*bitmap
Handle for returning the bitmap

palette
Handle to the palette for the bitmap (Windows only)

iconId
ID of icon whose media is being accessed

Returns

kMoaErr_NoErr if function call succeeded

Description

Return the media of the given display icon in bitmap format, as a dib on windows or a pict on the mac. The palette parameter is ignored on the Macintosh. On windows if no palette is passed it will use the default palette.


GetMediaImage()

Syntax

GetMediaImage(PIMoaAwPiece This,
MoaMmWinHandle *image,
MoaAwIconId iconId)

Parameters

This
Pointer to the IMoaAwPiece interface

*image
Handle to the image

iconId
ID of icon whose media is being accessed

Returns

MoaError

Description

Return the media of the given display icon in vector format, as a metafile on windows or a pict on the mac


GetPalette()

Syntax

GetPalette(PIMoaAwPiece This,
PMoaMmHpal phPal)

Parameters

This
Pointer to the IMoaAwPiece interface

phPal
Pointer to handle of currently active palette

Returns

MoaError

Description

Gets a handle of the currently active palette.


GetPresentationWindowGC()

Syntax

GetPresentationWindowGC(PIMoaAwPiece This,
PIMoaMmGC FAR * ppWindowGC)

Parameters

This
Pointer to the IMoaAwPiece interface

ppWindowGC
Pointer to graphics context interface of presentation window

Returns

MoaError

Description

Returns the graphic context for the presentation window.


GetVariable()

Syntax

GetVariable(PIMoaAwPiece This,
ConstPMoaChar pVarName,
MoaAwIconId atIconId,
PMoaMmValue pValue)

Parameters

This
Pointer to the IMoaAwPiece interface

pVarName
Pointer to string containing variable name

atIconId
ID of an @-reference icon (optional)

pValue
Pointer to value returned for the variable

Returns

MoaError

Description

Gets the value of a variable, passing in its name and optionally the id of an @-reference icon.


ResetPalette()

Syntax

ResetPalette(PIMoaAwPiece This)

Parameters

This
Pointer to the IMoaAwPiece interface

Returns

MoaError

ResolveFileName()

Syntax

ResolveFileName(PIMoaAwPiece This,
ConstPMoaChar pFileName,
PMoaChar pPathName,
MoaLong maxLen)

Parameters

This
Pointer to the IMoaAwPiece interface

pFileName
Pointer to string containing file name

pPathName
Pointer to path name

maxLen
Maximum length of pPathName

Returns

kMoaErr_NoErr Function call succeeded
kMoaErr_FileNotFound File not found
kMoaErr_OutOfMem Out of memory

Description

Tries to find the file specified in pFileName using the active search path and returns it in pPathName up to maxLen bytes.


SendEvent()

Syntax

SendEvent(PIMoaAwPiece This,
MoaMmSymbol eventName,
PIMoaAwEventSender pSender,
MoaLong nArgs,
PMoaMmValue pArgs)

Parameters

This
Pointer to the IMoaAwPiece interface

eventName
Event name symbol; e.g., #mouseClick

pSender
Pointer to interface of event sender

nArgs
Number of arguments provided in the pArgs list

pArgs
Pointer to the first of the list of arguments to be passed to along with the event

Returns

kMoaErr_NoErr Function call succeeded

Description

Sends an event to the piece. The sender icon id of this event will be tagged as coming from the icon associated with this sprite/asset. Authorware queues up the event and processes it asynchronously. The call returns immediately. No reply is expected by the sender and the sender's HandleReply() method will not be called for this event, even if a reply is generated for it from Authorware.


SendEventWithReply()

Syntax

SendEventWithReply(PIMoaAwPiece This,
MoaMmSymbol eventName,
PIMoaAwEventSender pSender,
MoaLong nArgs,
PMoaMmValue pArgs,
PMoaVoid replyRefcon)

Parameters

This
Pointer to the IMoaAwPiece interface

eventName
Event name symbol: e.g., #mouseClick

pSender
Pointer to interface of event sender

nArgs
Number of arguments in the pArgs list

pArgs
Pointer to list of arguments passed with event

replyRefcon
Data passed back to HandleReply method of pSender

Returns

kMoaErr_NoErr Function call succeeded

Description

Sends an event to the piece. The sender icon id of this event will be tagged as coming from the icon associated with this sprite/asset. Authorware queues up the event and processes it asynchronously. The call returns immediately. The reply is returned by calling the pSender interface's IMoaAwEventSender::HandleReply() method.


SetPalette()

Syntax

SetPalette(PIMoaAwPiece This,
MoaMmHpal hPal,
MoaBool raw,
MoaLong sysColors)

Parameters

This
Pointer to the IMoaAwPiece interface

hPal
Handle to the palette

raw
TRUE if the supplied palette is to be used as supplied

sysColors
Value specifying how static system colors are handled: SP_STATIC, SP_NOSTATIC, SP_PIECE, SP_DEFAULT

Returns

MoaError

Description

Sets the current palette for the piece. If raw is TRUE, the palette is used as supplied, otherwise Authorware applies its palette transformation. sysColors specifies how to handle the static system colors; it can have one of the following values: SP_STATIC, SP_NOSTATIC, SP_PIECE, SP_DEFAULT.


SetVariable()

Syntax

SetVariable(PIMoaAwPiece This,
ConstPMoaChar pVarName,
MoaAwIconId atIconId,
MoaBoolParam createVar,
PMoaMmValue pValue)

Parameters

This
Pointer to the IMoaAwPiece interface

pVarName
Pointer to string containing a variable name

atIconId
ID of an @-reference icon (optional)

createVar
TRUE to create a new temporary variable, FALSE otherwise

pValue
Pointer to value to which to set the variable

Returns

MoaError

Description

Sets the value of a variable. Pass in the variable name and optionally the id of an @-reference icon. If you want to create a new temporary variable, pass TRUE as createVar.

Copyright © 1996-2007 Adobe Macromedia Software LLC, Inc.