Tutorial; Pipl Resource And Plug-In Entry Point; Handling Callers And Selectors; Using Suites And Callback Functions - Adobe 65061456 Programmer's Manual

Programming guide
Table of Contents

Advertisement

2

Tutorial

This chapter describes the fundamentals of Illustrator plug-in programming, using as an example a plug-in
called Tutorial that is provided on the SDK. Look for the sample project in the sample code folder on the
SDK, and browse the source code while reading this chapter.
The core characteristics of an Illustrator plug-in were introduced in
read that chapter already, do so before proceeding through this chapter.

PiPL resource and plug-in entry point

Illustrator plug-ins must have a valid PiPL resource and an entry point Illustrator can call.
The Tutorial plug-in's PiPL resource declaration is in the following source files:
Windows:
Mac OS:
For more information on PiPLs, see
The Tutorial plug-in's entry point is the
Only plug-ins with the Illustrator version information in the PiPL are recognized and included in
Illustrator's initial start-up process. A plug-in is loaded into and unloaded from memory as needed by
Illustrator. Your plug-in should be written assuming it is not always in memory. This is why your plug-in
should save and restore state information during 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 unloaded. Each time the plug-in is called, it is given enough
information to accomplish the action to be performed.

Handling callers and selectors

Your plug-in's organization is based largely on the messages received by its
main routine of your plug-in basically becomes a switch implemented as a series of string comparisons
that call functions appropriate for the message action caller and selector. See
selectors" on page

Using suites and callback functions

The Illustrator API provides the core functionality used by a plug-in. Illustrator's API comprises callback
functions organized into suites. Before your plug-in can use a function that is part of a suite, the suite
containing it must first be acquired. A suite is a structure filled with function pointers; when your plug-in
acquires a suite, a pointer to this structure is returned.
When the suite is no longer needed, the acquired suite is released. It is important to do this, so the
Illustrator plug-in manager can run optimally. For instance, Illustrator keeps track of how many times a
suite was acquired. If a suite added by plug-in is no longer in use (its reference count is 0), the plug-in may
be unloaded to free memory.
Tutorial.rc
Tutorial.r
"Plug–in Property Lists" on page
PluginMain
14.
Chapter 1,
35.
function in
Tutorial.cpp
"Overview. If you have not
.
function. The
PluginMain
"Handling callers and
21

Advertisement

Table of Contents
loading

This manual is also suitable for:

Illustrator cs5

Table of Contents