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

IMoaMmXValue

Interface ID: IID_IMoaMmXValue
Pointer type: PIMoaMmXValue
Inheritance: IMoaUnknown
Header file: mmixval.h
Description
The IMoaMmXValue methods provide a way for an Xtra to implement its own extended values that can support indexed referencing and their own properties. For example, this interface is implemented by the Shockwave 3D Asset to provide some of the attributes of a 3D member. Also, the Flash Asset Xtra implements this interface to define wrapper values for flash objects so that lingo or javascript can use flash objects directly. You can use the IMoaMmXValueUtils interface to create a MoaMmValue for one these wrapper objects.

Methods

Basic Property Access Methods
The following methods provide basic property access such as getting and setting properties and index properties. Support is provided for calling custom methods for the xvalue. Also, some basic conversion routines are defined.
GetProp()
SetProp()
CallHandler()
Ilk()
StringRep()
SymbolRep()
SetData()
Methods Reserved for Future Use
The following methods are part of this interface for historical reasons, but are not called at this time.
GetCount()
AccessPropRef()
GetContents()
SetContents()
SetContentsBefore()
SetContentsAfter()
IntegerRep()
StreamOut()
StreamIn()
GetPropCount()
GetPropDescriptionByIndex()
Constants and Structures Reserved for Future Use
enum
{
  kMoaMmValueRange_None = 0,
  kMoaMmValueRange_Min,
  kMoaMmValueRange_Max,
  kMoaMmValueRange_MinMax,
  kMoaMmValueRange_List
};

typedef MoaLong MoaMmValueRangeType;
#define kMaxPropDescription 128

typedef struct MoaMmValueDesc
{
  MoaMmSymbol          name;
  MoaMmValueType       type;
  MoaMmValue           defaultVal;
  MoaChar              pDescription[ kMaxPropDescription ];
  MoaMmValueRangeType  range;
  MoaMmValue           rangeValue1;
  MoaMmValue           rangeValue2;
} MoaMmValueDescription, *PMoaMmValueDescription;

GetProp()

Syntax
GetProp(ConstPMoaMmValue selfRef, MoaMmSymbol propName, MoaLong indexCount,
ConstPMoaMmValue pIndexValues, PMoaMmValue pResult)
Parameters
selfRef
The property reference object, as a lingo value. Assign to pResult and AddRef to return the same property reference. Use to support properties that are further references as opposed to final values.
propName
Symbol specifying which property should be looked up.
indexCount
Number of indices - zero, one or two
pIndexValues
Array of indices.
pResult
Return value.
Returns
MoaError

kMoaMmErr_PropertyNotFound The property is not found.
kMoaMmErr_AccessNotSupported The specified style of property access not support.
Description
This method retrieves the value of a property. A property name, and optionally, index values may be specified.
Example
Example Calling Sequence:
put x.foo
--> i.GetProp( propName=foo, indexCount=0 )
put x.foo[10]
--> i.GetProp( propName=#foo, indexCount=1, pIndexValues={10} )
put x.foo[9..11]
--> i.GetProp( propName=#foo, indexCount=2, pIndexValues={9,11} )

SetProp()

Syntax
SetProp(MoaMmSymbol propName, MoaLong indexCount, ConstPMoaMmValue pIndexValues,
ConstPMoaMmValue pNewValue)
Parameters
propName
Symbol specifying which property should be looked up.
indexCount
Number of indices - zero, one or two
pIndexValues
Array of indices.
pNewValue
New value to assign.
Returns
MoaError

kMoaMmErr_PropertyNotFound The property is not found.
kMoaMmErr_AccessNotSupported The specified style of property access is not supported. for example, return this if you don't support indexCount > 0.
kMoaMmErr_CannotSetProperty Set not allowed on specified property.
Description
SetProp assigns a value to a property, or range with in a property. A property name, and optionally, index values may be specified.
Example
Example Calling Sequence:
x.foo = 99
--> i.SetProp( propName=foo, indexCount=0, pNewValue=99 )
x.foo[10] = 99
--> i.GetProp( propName=#foo, indexCount=1, pIndexValues={10}, pNewValue=99 )
x.foo[9..11] = 123
--> i.GetProp( propName=#foo, indexCount=2, pIndexValues={9,11}, pNewValue=123 )

CallHandler()

Syntax
CallHandler(PMoaMmCallInfo callPtr)
Parameters
callPtr
Pointer to a MoaMmCallInfo structure.
Returns
MoaError

kMoaMmErr_FunctionNotFound If do not support the method call.
Description
This method lets you implement what your Xtra does when it is used as a Lingo handler. The callPtr parameter references the same structure used for scripting xtra method calls. The specific handler being called is indicated by the callPtr->methodSelector value.
Examples
x.goDown(99)
--> CallHandler( callPtr->nargs=2, args={instance, 99} )

Ilk()

Syntax
Ilk(PMoaMmValue pArgument, PMoaMmValue pResult)
Parameters
pArgument
This is NULL in all cases i have been able to find so .
pResult
Place to store a symbol value that indicates what type of XValue this object is.
Returns
MoaError
Description
This method is used by the lingo and Javascript runtime engines to differentiate between different types of XValue objects. You need to choose a unique symbol value to represent your type of XValue.

StringRep()

Syntax
StringRep(PMoaMmValue pStringVal)
Parameters
pStringVal
Place to store a string value that describes this type of XValue object.
Returns
MoaError
Description
This method is used to get a string representation of the XValue object. This method can provide a full, detailed conversion to a string, or just return a basic string that indicates what type the XValue object is.

SymbolRep()

Syntax
SymbolRep(PMoaMmSymbol pSymbol)
Parameters
pSymbol
Place to store a symbol value that indicates what type of XValue this object is.
Returns
MoaError
Description
This method normally returns the same symbol that is used in figuring the result of the Ilk method.

SetData()

Syntax
SetData(PMoaVoid pDatum)
Parameters
pDatum
A pointer to any type of memory structure that is needed.
Returns
MoaError

kMoaMmErr_FunctionNotFound If you do not support this method.
  Any other errors as appropriate
Description
This method is not called by Director. It provides a convenient for you to initialize the XValue object with what ever data is needed. For example, if your XValue object is created by a sprite, the sprite code can use this method to pass in appropriate initialization data to a newly created XValue object.

Methods listed below are reserved for future use.


GetContents()

Syntax
GetContents(ConstPMoaMmValue selfRef, PMoaMmValue pResult)
Parameters
selfRef
--
pResult
--
Returns
MoaError

kMoaMmErr_AccessNotSupported  
Description
Reserved for future use.

SetContents()

Syntax
SetContents(PMoaMmValue pNewValue)
Parameters
pNewValue
--
Returns
MoaError

kMoaMmErr_AccessNotSupported  
Description
Reserved for future use.

GetPropCount()

Syntax
GetPropCount(PMoaLong pCount)
Parameters
pCount
Pointer to a MoaLong that will receive the number of properties.
Returns
MoaError

kMoaMmErr_AccessNotSupported  
Description
Reserved for future use.

GetPropDescriptionByIndex()

Syntax
GetPropDescriptionByIndex(MoaLong index, PMoaMmValueDescription pDescription)
Parameters
index
Index specifying which property the caller wants to know about.
pDescription
Pointer to a structure you fill out with information about the property.
Returns
MoaError

kMoaMmErr_AccessNotSupported  
Description
Reserved for future use.

GetCount()

Syntax
GetCount(MoaMmSymbol propName, PMoaLong pCount)
Parameters
propName
Symbol specifying which property should be looked up.
pCount
Pointer to a MoaLong that will receive the number of "chunks" associated with this property.
Returns
MoaError

kMoaMmErr_AccessNotSupported  
Description
Reserved for future use.

AccessPropRef()

Syntax
AccessPropRef(ConstPMoaMmValue selfRef, MoaMmSymbol propName, MoaLong indexCount,
ConstPMoaMmValue pIndexValues, PMoaMmValue pResult)
Parameters
selfRef
The property reference object, as a Lingo value. Assign to pResult and AddRef to return self.
propName
The property name to look up.
indexCount
The number of indices. Specify 0, 1, or 2.
pIndexValues
An array of indices
pResult
Optional return value. To return a new property reference Lingo object, use IMoaMmPropReferenceValue::PropReferenceToValue.
Returns
MoaError

kMoaMmErr_PropertyNotFound The property is not found.
kMoaMmErr_AccessNotSupported If your Xtra does not support cascaded property access, return this.
Description
This method sets up a reference to a set of hierarchical properties. A property name and (optionally) index values may be specified. A cascaded index property reference series will begin and continue with AccessPropRef calls, up to the last access which will be any of GetProp, SetProp, SetContents, SetBefore, or SetAfter.
Examples
put x.sel[33].foo
--> i.AccessProp(propName=#sel, indexCount=1, pIndexValues={33} )
--> i.GetProp( propName=foo, indexCount=0 )
put x.sel[33].foo[10]
--> i.AccessProp(propName=#sel, indexCount=1, pIndexValues={33} )
--> i.GetProp( propName=#foo, indexCount=1, pIndexValues={10} )
set x.sel[33].foo[9..11] = "Done!"
--> i.AccessProp(propName=#sel, indexCount=1, pIndexValues={33} )
--> i.SetProp( propName=#foo, indexCount=2, pIndexValues={9,11}, pNewValue="Done!" )

SetContentsBefore()

Syntax
SetContentsBefore(PMoaMmValue pNewValue)
Parameters
pNewValue
--
Returns
MoaError

kMoaMmErr_AccessNotSupported  
Description
Reserved for future use.

SetContentsAfter()

Syntax
SetContentsAfter(PMoaMmValue pNewValue)
Parameters
pNewValue
--
Returns
MoaError

kMoaMmErr_AccessNotSupported  
Description
Reserved for future use.

IntegerRep()

Syntax
IntegerRep(PMoaLong pIntVal)
Parameters
pIntVal
--
Returns
MoaError

kMoaMmErr_AccessNotSupported  
Description
Reserved for future use.

StreamOut()

Syntax
StreamOut(PIMoaStream2 pStream)
Parameters
pStream
--
Returns
MoaError

kMoaMmErr_AccessNotSupported  
Description
Reserved for future use.

StreamIn()

Syntax
StreamIn(PIMoaStream2 pStream)
Parameters
pStream
--
Returns
MoaError

kMoaMmErr_AccessNotSupported  
Description
Reserved for future use.

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