Generating stubs for nonstandard client types

If the client is not written in one of the languages for which Macromedia provides a client RPC library, the client implementer must create or generate the stubs. For information about how to do this, see The Fireworks Object Model. The application object (with object ID fw) is of the Fireworks class (for other objects with reserved IDs, see Object IDs). All objects returned by the server contain the class name as an attribute. Given an object's class, the client can determine what methods and properties it has based on the Fireworks JavaScript DOM. The DOM document also gives the prototypes of the methods and properties of a class. The client can use the DOM document to determine the number and types of method parameters. The DOM document uses more types in its prototypes than the RPC mechanism defines. So, several of the documented types collapse to one RPC type.

In addition to static properties, objects of certain classes can also have dynamic properties. The Fireworks Object Model documents dynamic properties and specifies whether the dynamic properties are read only. Most dynamic properties are on lists (for example, the BehaviorsList class). The properties take an integer or string as a property name, and return a value based on the element associated with the property name.

The following table shows the mapping between the Fireworks Object Model data types and the RPC data types.

DOM data type RPC data type Example Description

array

array

<array></array>

Types map identically.

Boolean

Boolean

<bool value="true" />

Both types are identical. Both contain only two values: true or false.

color

string

<string value="#7788CCFF" />

A color is a string with nine characters. It has the format #RRGGBBAA.

date

dictionary

<dict>
<int key="year" value="2002" />
<int key="month" value="9" />
<int key="day"
value="3" />
<int key="hour" value="20" />
<int key="minutes" value="15" />
<int key="seconds" value="32" />
</dict>

A date is a dictionary with the following subelement keys: year, month, day, hour, minutes, and seconds. All six elements are integer data types.

dictionary

dictionary

<dict></dict>

Types map identically.

float

float

<double value="5.132" />

Types map identically.

integer

integer

<int value="7" />

Types map identically.

matrix

dictionary

<dict>
<array key="matrix">
<double value="1.0" />
<double value="0.0" />
<double value="0.0" />
<double value="0.0" />
<double value="1.0" />
<double value="0.0" />
<double value="0.0" />
<double value="0.0" />
<double value="1.0" />
</array>
</dict>

A matrix is a dictionary that contains one subelement key: matrix. A matrix is an array of nine float elements. The elements start at the top row and go in row-major order.

null

null

<null />

Types map identically.

object

server object, or dictionary

<obj value="1" />

For an object type, the client can simply specify a server object. However, for certain objects (such as objects of the Effect class) a dictionary can be constructed and then used. If the client creates a dictionary, all properties of the class must be added to the dictionary with the correct type.

point

dictionary

<dict>
<double key="x" value="300.4" />
<double key="y" value="234.0" />
</dict>

A point is a dictionary with two subelement keys: x and y. Both subelements are float data types.

rect

dictionary

<dict>
<double key="top" value="300.4" />
<double key="left" value="234.0" />
<double key="bottom" value="500.6" />
<double key="right" value="564.0" />
</dict>

A rect is a dictionary with four subelement keys: top, left, bottom, and right. All four subelements are float data types.

resolution

dictionary

<dict>
<string key="units" value="inch" />
<double key="pixelsPerUnit" value="72.0" />
</dict>

A resolution is a dictionary with two subelement keys: units and pixelsPerUnit. The units key can be any of these strings: inch, cm, or pixels.The pixelsPerUnit key is a float data type.

string

string

<string value="foo" />

Types map identically.

URL

string

<string
value="file://hd/www" />

A URL is a string. It usually starts with file://.

void

void

<void />

Types map identically.


 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/fireworks/8/fwextending/fw_03_10.htm