Adobe 65061456 Скачать руководство пользователя страница 7

C

HAPTER

 1: Overview

Anatomy of a plug-in

     7

Illustrator 9.0 in Mac OS stopped loading plug-ins containing Motorola 68K code. While early plug-in APIs 
from Adobe would run 68K plug-ins from a PowerPC application or vice-versa, this mechanism was not 
provided to Illustrator 9 plug-ins. Only plug-ins with the Illustrator 9 version information in the PiPL were 
recognized and included in Illustrator 9’s initial start-up process; however, Illustrator 6 and 5.5 plug-ins 
were supported by adapters.

The Illustrator 10.0 API changed API structures in Mac OS to use PowerPC alignment (four-byte aligned). 
Earlier APIs used 68K alignment (two-byte aligned). Illustrator plug-ins in Mac OS had to be rebuilt with the 
Illustrator 10 SDK, to be compatible with Illustrator 10. Illustrator plug-ins for Windows built with the 
Illustrator 9 SDK or earlier were not affected and remained compatible with Illustrator 10.

N

OTE

Originally, Illustrator was a 68K application. When Apple moved to the PowerPC platform, the 

Illustrator API maintained 68K alignment for backward compatibility. This caused a small performance loss, 
so the alignment was changed; this change broke backward compatibility.

Illustrator CS1 (Illustrator version 11.0) integrated a new text engine, the Adobe Text Engine (ATE). The text 
API was revised completely. The text API from Illustrator 10.0 and earlier was obsoleted (

AIText

AITextFaceStyle

AITextPath

AITextRun

AITextStream

AITextStyle

, etc.). The new ATE API 

provided increased functionality and control over typography to Illustrator plug-ins (see 

IText

 and 

ATESuites

). This change broke backward compatibility. Illustrator plug-ins that used the obsolete text API 

had to be rebuilt with the Illustrator 11 SDK and ported to use the new ATE API.

The Illustrator CS2 API (Illustrator version 12.0) introduced Unicode support. Unicode encoding should be 
used for any strings displayed in the user interface. In Mac OS, the object-file format for Illustrator plug-ins 
changed to Mach-O. The old format was PEF, a preferred executable format. Moving forward, Mach-O is 
Apple’s preferred object-file format for the Mac OS X platform.

The Illustrator CS3 API (Illustrator version 13.0) introduced support for universal binary plug-ins in Mac OS. 
Universal binaries run in Mac OS computers using PowerPC or Intel microprocessors and deliver optimal 
performance for both architectures in one package. The Apple Xcode development tool is the most 
convenient way to produce universal binaries; therefore, Adobe switched to Xcode from CodeWarrior for 
the development of Illustrator CS3 plug-ins.

The Illustrator CS4 API (Illustrator version 14.0) introduced support for multiple artboards and the FXG file 
format, among other things. The multiple-artboards feature has been requested by many Illustrator users. 
The FXG file format improves support for integrated designer-developer workflows and paves the way for 
closer interaction between Illustrator and XML-based applications. 

In Illustrator CS5 API (Illustrator version 15.0) the most significant change is that Adobe Dialog Manager 
(ADM) has been deprecated. It is recommended that you replace any UI based on ADM with one based on 
Adobe Flash® and Flex®-based controls, or another 3rd-party or platform-specific UI framework; see 

Chapter 3, “Creating a Flash UI for Plug-ins

 for more infomation. This release also introduces a new suite for 

working with the new Beautiful Strokes feature, and many existing features, such as perspective grids, 
have been improved or enhanced. For documentation on these changes and other API changes, see the 

Adobe Illustrator CS5 Porting Guide

.

Anatomy of a plug-in

Like most programs, Illustrator plug-ins contain both code and data. The 

Illustrator plug-in manager

 loads 

and executes a plug-in’s code when required, sending various messages to the plug-in. The plug-in 
manager also unloads plug-ins that are no longer needed. See the following figure.

Содержание 65061456

Страница 1: ...ADOBE ILLUSTRATOR CS5 ADOBE ILLUSTRATOR CS5 PROGRAMMER S GUIDE...

Страница 2: ...h Flex and ActionScript are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States and or other countries Microsoft and Windows are either registered trademarks...

Страница 3: ...n types 10 Where plug ins live 10 What defines a plug in 11 PiPL resources 11 Plug in management 11 Plug in entry point and messages 12 Message actions callers and selectors 12 Core message actions 13...

Страница 4: ...elector 24 Caller kSPAccessCaller selector kSPAccessUnloadSelector 25 Plug in type specific messages 25 Filter plug ins 25 Tool plug ins 26 Action plug ins 27 Menu plug ins 29 Next steps 29 3 Creating...

Страница 5: ...ronment and the code samples included in the SDK Provides step by step guides on creating new projects either from scratch or from the templates provided with the SDK X Adobe Illustrator CS5 Porting G...

Страница 6: ...e Illustrator 5 5 to include file formats The 5 x APIs displayed characteristics of many early API design efforts the interface was monolithic incorporating enough function to achieve its intended pur...

Страница 7: ...for any strings displayed in the user interface In Mac OS the object file format for Illustrator plug ins changed to Mach O The old format was PEF a preferred executable format Moving forward Mach O...

Страница 8: ...le and described more fully after the table Adobe Illustrator Plug in manager Required plug ins Additional plug ins Plug in Type What it does Action Playback or register actions Effects Add menu items...

Страница 9: ...reads and writes non native files e g TIFF or JPEG files In Illustrator these are called file format plug ins Illustrator uses the term filter plug in in a way similar to Adobe Photoshop a filter plug...

Страница 10: ...determine which artwork was selected and act on it For example a tool might create or distort objects Some things are handled automatically for plug in tools like scrolling the window For more informa...

Страница 11: ...f the plug in given by a code descriptor property Illustrator considers only files with a valid PiPL to be potential plug ins PiPL properties are defined using native platform resources For more infor...

Страница 12: ...lug in to perform an action The message action passed to your plug in consists of two identifiers X The caller identifies the sender of the message PICA the host application or a plug in and a general...

Страница 13: ...r Startup define kSPInterfaceShutdownSelector Shutdown When Illustrator is launched it sends a startup message to each plug in it finds This allows your plug in to allocate global memory add user inte...

Страница 14: ...and Unload if strcmp selector kSPAccessReloadSelector 0 error MyRestoreGlobals message else if strcmp selector kSPAccessUnloadSelector 0 error MySaveGlobals message else if strcmp caller kSPInterfaceC...

Страница 15: ...suite see SPBasicSuite which allows your plug in to acquire other suites and provides basic memory management See Suites on page 15 When Illustrator or a plug in wants to send a message to your plug...

Страница 16: ...or detailed descriptions of suites and their associated functions see Adobe Illustrator API Reference Acquiring and releasing suites Before you can use a function in a suite you must first acquire the...

Страница 17: ...echanism of the Illustrator API Plug ins also can publish suites of their own for use by other plug ins This feature where plug ins may be both clients of suites and publishers of suites is extremely...

Страница 18: ...he Illustrator specific code can be run with little modification often only a few lines of code within an ifdef For example the Tutorial sample in the SDK uses identical source code only the resources...

Страница 19: ...sSPBlocks nil If you add a helper class to your plug in and you do not declare the global suite pointers it requires you will get linker errors when you build your project If you do not acquire the su...

Страница 20: ...quest further information about a specific plug in As of Illustrator CS3 the About Plug ins dialog was removed Next steps In this chapter we introduced plug ins for Adobe Illustrator and defined sever...

Страница 21: ...unload and reload Your plug in can expect certain services from the application Because your plug in may be unloaded Illustrator provides a means of storing important data when the plug in is unloade...

Страница 22: ...be called through this pointer long count 0 sAIMenu CountMenuItems count After the function is used the suite is released sSPBasic ReleaseSuite kAIMenuSuite kAIMenuSuiteVersion Since they are used th...

Страница 23: ...field Usually it is a pointer to a block of memory If you do not have any global data you can leave the globals field empty During the start up message you need to inform Illustrator of the filters to...

Страница 24: ...kSPInterfaceShutdownSelector message Only one such message is received per Illustrator session Actions that should happen when the user is completely finished using the plug in like saving preference...

Страница 25: ...ect menu To add a filter your plug in must do the following X Call AIFilterSuite AddFilter on start up to add the filter to Illustrator X Handle messages relating to filter events There are two caller...

Страница 26: ...he user by the GetFilterParameters function in Tutorial cpp The return result from GetFilterParameters should be kNoErr if the user hit OK or if you do not have any parameters or kCanceledErr if the u...

Страница 27: ...must register one or more action events An action event is a single operation your plug in executes An Action event is shown in Illustrator s Actions panel if the user chooses to record it 2 Record ac...

Страница 28: ...nt X Call AIActionManagerSuite AIDeleteActionParamValue to dispose of your reference to the VPB For sample code see the GoFilter and RecordFilterAction functions in Tutorial cpp Responding to the DoAc...

Страница 29: ...IGoMenuItem The Tutorial plug in adds an About plug in menu on start up see About Plug ins menu on page 19 For sample code see the AddMenu function in Tutorial cpp A helper class SDKAboutBoxHelper is...

Страница 30: ...you are using an extension only to provide a UI for an Illustrator C plug in you typically put the program logic in the C plug in where you can use Illustrator s native C API rather than the scriptin...

Страница 31: ...CSXS library SWC is an ActionScript component that provides the API that the extension uses to interact with C plug ins To dispatch events from an extension to a plug in call the ActionScript library...

Страница 32: ...nto data items useful to the plug in X Before unloading the extension you must use SDKPlugPlug RemoveEventListener to remove any event listeners you have registered For example RemoveEventListener com...

Страница 33: ...m adobe csxs events updatePanel updatePanel X To dispatch events from your extension to your C plug in use dispatchEvent You can pass related data as a string To encapsulate complex values in data you...

Страница 34: ...s used by the extension and a signature that ensures the files have not changed The Adobe Creative Suite SDK allows you to debug your extension during development before you actually package and insta...

Страница 35: ...L are documented in the Illustrator API Reference and listed in the following table Required PiPL properties Your plug in s PiPL resource must include the required properties listed in the following t...

Страница 36: ...riptor containing entry point of Intel code for plug ins on Mac OS platforms PIPowerPCMachOCodeProperty mach PIMachCodeDesc code descriptor containing entry point of PowerPC code in Mach O format for...

Страница 37: ...ore information Adobe Illustrator API Reference describes the property names and associated data structures such as PIPropertyList The sample plug ins on the SDK show how to define a PiPL using native...

Страница 38: ...nu plug ins 29 message action defined 12 messages 12 core actions 13 passing data 14 persistent data 15 reload and unload 13 startup and shutdown 13 N notifiers 14 P PICA Plug in Component Architectur...

Отзывы: