Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Environment and Utilities /
Chapter 7 - QuickDraw GX Stream Format / Using QuickDraw GX Stream Format


Flattening Shapes With GraphicsBug

GraphicsBug is not just a QuickDraw GX debugging tool. It also allows you to evaluate the data at specific memory locations. You can use GraphicsBug to look at the data describing a QuickDraw GX shape both before and after you invoke the GXFlattenShape function. This allows you to compare the original data and the stream format after the GXFlattenShape function has been called.

For more information concerning GraphicsBug, see the chapter "QuickDraw GX Debugging " in this book.

You can use GraphicsBug to analyze a data stream by using the following procedure:

  1. Create a QuickDraw GX shape.
  2. Use the GraphicsBug heap dump HD command to determine the memory location of the QuickDraw GX shape to be flattened.
  3. Copy the memory location of the shape to the clipboard.
  4. Type FL and paste the memory address. The command line should look like this:

fl <memory address>
For example: fl 41d788
  1. The command FL applies the GXFlattenShape function to the shape located at the specified memory address. This results in a flattened shape. An annotated version of the QuickDraw GX data stream appears in the GraphicsBug window. GraphicsBug does not alter the graphics memory in any way.

To create a flattened file, you can use the command

fl <memory address> "filename"
To view the contents of a file, such as a print file generated by printing a document, you can use the command

uf "filename"
To view the stream associated with a particular page of a document, you can use the command

uf <page number> "filename" 
Here are some guidelines for using GraphicsBug to analyze data streams:

Listing 7-2 shows an example of the information provided by GraphicsBug for a flattened line.

Listing 7-2 A GraphicsBug annotation of the data stream of a flattened shape

fl 0c79090
owners            1) 
newObject; size: #2 (03) 
headerType; byte compression (80) 
version == 1.0; flags == fontListFlatten | fontGlyphsFlatten 
(01 03) 
newObject; size: #6 (07) [1] 
fontNameType; no compression (2f) 
(04 02 01 01 00 00) 
Listing 7-2 shows only the beginning of a data stream. For more examples of GraphicsBug annotation of flattened shape data streams, see the next section.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996