Macintosh developers need:
PageMaker for the Macintosh requires that a plug-in:
The ResEdit template, ADNI Template.rsrc, simplifies the creation of the ADNI resource.
To use this template
Information | Description |
---|---|
Menu Name Index | The index number of the plug-in menu name as found in the string resource. You store the menu name in an indexed string resource (STR#). Note: The IDs of ADNI and STR# must match. |
No Pub Open | Whether or not the plug-in is active when no publications are open in PageMaker: 1 for active, 0 for disabled. |
Story Editor | Whether or not the plug-in is active in story editor: 1 for active, 0 for disabled. |
Layout View | Whether or not the plug-in is active in layout view of PageMaker: 1 for active, 0 for disabled. |
Appear in Menu | Whether or not the plug-in appears in the PageMaker plug-ins submenu: 1 to appear in menu, 0 to not display in menu. |
Plug-in Version | The version and revision number of the plug-in. Do not include a decimal point; PageMaker assumes a decimal point separates the numbers. For example, enter $0101 for version 1.01. (PageMaker lists all the installed plug-ins and their version numbers when you hold down either the Command or Control key while selecting "About PageMaker" from the Apple menu.) |
Plug-in ID | The identifier PageMaker should use when calling the plug-in (e.g., for invocation or shutdown). The plug-in assigns the ID number. |
FAT binary: One executable, two platforms
PageMaker plug-ins for the Macintosh are fat-binary shared libraries that can run in both PageMaker for the Macintosh and PageMaker for the Power Macintosh in native mode. While a fat plug-in can be larger than a single platform plug-in, it lets you distribute and maintain one file for all Macintosh customers.
Use the sample code in the Frame folder on disk as the framework for your plug-in. As illustrated at the beginning of this chapter, a fat plug-in consists of three basic parts. The Frame sample divides the plug-in code into three projects, which correspond to the three parts of a plug-in:
· Main.µ , which creates RAG1, a 68K code resource. RAG1 contains only the main function and serves as the entry point to the plug-in from PageMaker. (Main.µ is in the RAG1 Main folder.)
· Frame.68k.µ, which creates RAG2, a 68K code resource. RAG2 contains the 68K executable code for the plug-in.
· Frame.PPC.µ, which creates a code fragment container in the data fork of the file. The code fragment container holds the native Power Macintosh executable code of the plug-in.
To build the final plug-in:
1 Make the 68k project. This creates a resource file containing the RAG1 and RAG2 resources as well as any plug-in specific resources.
2 Make the PPC project. This builds the fat plug-in.
When PageMaker loads the plug-in, it uses main as its entry point. The loading section of main determines the version, 680x0 or PowerPC, of both PageMaker and the computer. The invocation section of main jumps to either the 680x0 code in RAG2 (if PageMaker for the Macintosh is running), or the Power Macintosh code in the data fork (if PageMaker for the Power Macintosh is running).
Because a plug-in is loaded by PageMaker, it need not make most Macintosh Toolbox initialization calls and should not make the following calls: InitDialogs, InitResources, SetApplLimit, InitFonts, InitWindows, SetGrowZone, InitGraf, MaxApplZone, TEInit, InitMenus, or RsrcZoneInit.
We also recommend you do not patch any traps, especially _LoadSeg, _UnloadSeg, or the Memory-Manager routines.
Do not call the C routine atexit( ) or use routines such as the file calls fopen, __open, and freopen that call atexit( ) indirectly. Although you can link the code segments, PageMaker will crash upon exiting if the plug-in has been loaded anytime during the session. The atexit( ) routine installs an exit-handler, but since the plug-in code has already been unloaded when PageMaker exits, the routine no longer exists.
Refer to the documentation included with Metrowerks CodeWarrior for information on debugging shared libraries.
We strongly recommend that all plug-in libraries include a 'vers' resource
that contains the library version and copyright information. This information
is displayed when you select the plug-in file at the desktop and choose
"Get Info..." from the Apple menu.
![]() |
Comments or suggestions? Contact Adobe
Developer Support Copyright © 1997 - 2001 Adobe Systems Incorporated. All rights reserved. Legal notices and trademark attributions |