Adobe.com
Contents Suites Classes Class Index Member Index

AIGradient.h

Go to the documentation of this file.
00001 #ifndef __AIGradient__
00002 #define __AIGradient__
00003 
00004 /*
00005  *        Name: AIGradient.h
00006  *   $Revision: 11 $
00007  *      Author:
00008  *        Date:
00009  *     Purpose: Adobe Illustrator Gradient Fill Suite.
00010  *
00011  * ADOBE SYSTEMS INCORPORATED
00012  * Copyright 1986-2007 Adobe Systems Incorporated.
00013  * All rights reserved.
00014  *
00015  * NOTICE:  Adobe permits you to use, modify, and distribute this file 
00016  * in accordance with the terms of the Adobe license agreement 
00017  * accompanying it. If you have received this file from a source other 
00018  * than Adobe, then your use, modification, or distribution of it 
00019  * requires the prior written permission of Adobe.
00020  *
00021  */
00022 
00023 
00024 /*******************************************************************************
00025  **
00026  **     Imports
00027  **
00028  **/
00029 
00030 #ifndef __AITypes__
00031 #include "AITypes.h"
00032 #endif
00033 
00034 #ifndef __AIArt__
00035 #include "AIArt.h"
00036 #endif
00037 
00038 #ifndef __AIColor__
00039 #include "AIColor.h"
00040 #endif
00041 
00042 #ifndef __AIPathStyle__
00043 #include "AIPathStyle.h"
00044 #endif
00045 
00046 
00047 #include "AIHeaderBegin.h"
00048 
00051 /*******************************************************************************
00052  **
00053  ** Constants
00054  **
00055  **/
00057 #define kAIGradientSuite                        "AI Gradient Suite"
00058 
00059 #define kAIGradientSuiteVersion9        AIAPI_VERSION(9)
00060 
00061 #define kAIGradientSuiteVersion         kAIGradientSuiteVersion9
00062 
00063 #define kAIGradientVersion                      kAIGradientSuiteVersion
00064 
00067 #define kAIArtGradientChangedNotifier           "AI Art Gradient Changed Notifier"
00068 
00071 #define kMaxSpotChannelsExceededErr     'xSPT'
00072 
00073 /*******************************************************************************
00074  **
00075  **     Types
00076  **
00077  **/
00078 
00083 typedef void (*AIGradientSetGrayProcPtr)(AIReal g);
00085 typedef AIGradientSetGrayProcPtr AIGradientSetGrayUPP;
00087 #define CallAIGradientSetGrayProc(userRoutine, g)               \
00088                 (*(userRoutine))((g))
00089 
00090 #define NewAIGradientSetGrayProc(userRoutine)           \
00091                 (AIGradientSetGrayUPP)(userRoutine)
00092 
00101 typedef void (*AIGradientSetCMYKProcPtr)(AIReal c, AIReal m, AIReal y, AIReal k);
00103 typedef AIGradientSetCMYKProcPtr AIGradientSetCMYKUPP;
00105 #define CallAIGradientSetCMYKProc(userRoutine, c, m, y, k)              \
00106                 (*(userRoutine))((c), (m), (y), (k))
00107 
00108 #define NewAIGradientSetCMYKProc(userRoutine)           \
00109                 (AIGradientSetCMYKUPP)(userRoutine)
00110 
00116 typedef void (*AIGradientSetColorProcPtr)(AIColor* c);
00118 typedef AIGradientSetColorProcPtr AIGradientSetColorUPP;
00120 #define CallAIGradientSetColorProc(userRoutine, c)              \
00121                 (*(userRoutine))((c))
00122 
00123 #define NewAIGradientSetColorProc(userRoutine)          \
00124                 (AIGradientSetColorUPP)(userRoutine)
00125 
00128 typedef void (*AIGradientBeginFillProcPtr)(void);
00130 typedef AIGradientBeginFillProcPtr AIGradientBeginFillUPP;
00132 #define CallAIGradientBeginFillProc(userRoutine)                \
00133                 (*(userRoutine))()
00134 
00135 #define NewAIGradientBeginFillProc(userRoutine)         \
00136                 (AIGradientBeginFillUPP)(userRoutine)
00137 
00140 typedef void (*AIGradientEndFillProcPtr)(void);
00142 typedef AIGradientEndFillProcPtr AIGradientEndFillUPP;
00144 #define CallAIGradientEndFillProc(userRoutine)          \
00145                 (*(userRoutine))()
00146 
00147 #define NewAIGradientEndFillProc(userRoutine)           \
00148                 (AIGradientEndFillUPP)(userRoutine)
00149 
00156 typedef void (*AIGradientMoveToProcPtr)(AIReal x, AIReal y);
00158 typedef AIGradientMoveToProcPtr AIGradientMoveToUPP;
00160 #define CallAIGradientMoveToProc(userRoutine, x, y)             \
00161                 (*(userRoutine))((x), (y))
00162 
00163 #define NewAIGradientMoveToProc(userRoutine)            \
00164                 (AIGradientMoveToUPP)(userRoutine)
00165 
00172 typedef void (*AIGradientLineToProcPtr)(AIReal x, AIReal y);
00174 typedef AIGradientLineToProcPtr AIGradientLineToUPP;
00176 #define CallAIGradientLineToProc(userRoutine, x, y)             \
00177                 (*(userRoutine))((x), (y))
00178 
00179 #define NewAIGradientLineToProc(userRoutine)            \
00180                 (AIGradientLineToUPP)(userRoutine)
00181 
00192 typedef void (*AIGradientCurveToProcPtr)(AIReal x1, AIReal y1, AIReal x2, AIReal y2, AIReal x3, AIReal y3);
00194 typedef AIGradientCurveToProcPtr AIGradientCurveToUPP;
00196 #define CallAIGradientCurveToProc(userRoutine, x1, y1, x2, y2, x3, y3)          \
00197                 (*(userRoutine))((x1), (y1), (x2), (y2), (x3), (y3))
00198 
00199 #define NewAIGradientCurveToProc(userRoutine)           \
00200                 (AIGradientCurveToUPP)(userRoutine)
00201 
00217 typedef struct {
00220         AIGradientSetGrayUPP setGray;
00223         AIGradientSetCMYKUPP setCMYK;
00226         AIGradientBeginFillUPP beginFill;
00229         AIGradientEndFillUPP endFill;
00232         AIGradientMoveToUPP moveTo;
00235         AIGradientLineToUPP lineTo;
00238         AIGradientCurveToUPP curveTo;
00242         AIGradientSetColorUPP setColor;
00243 
00244 } AIGradientProcs;
00245 
00246 
00247 
00248 /*******************************************************************************
00249  **
00250  **     Suite
00251  **
00252  **/
00253 
00283 typedef struct {
00284 
00290         AIAPI AIErr (*NewGradient) ( AIGradientHandle *gradient );
00291 
00296         AIAPI AIErr (*DeleteGradient) ( AIGradientHandle gradient );
00297 
00304         AIAPI AIErr (*CountGradients) ( ai::int32 *count );
00305 
00311         AIAPI AIErr (*GetNthGradient) ( ai::int32 n, AIGradientHandle *gradient );
00312 
00319         AIAPI AIErr (*GetGradientByName) ( const ai::UnicodeString& name, AIGradientHandle *gradient );
00320 
00325         AIAPI AIErr (*GetGradientName) ( AIGradientHandle gradient, ai::UnicodeString& name );
00326 
00334         AIAPI AIErr (*SetGradientName) ( AIGradientHandle gradient, const ai::UnicodeString& name );
00335 
00341         AIAPI AIErr (*GetGradientType) ( AIGradientHandle gradient, ai::int16 *type );
00342 
00347         AIAPI AIErr (*SetGradientType) ( AIGradientHandle gradient, ai::int16 type );
00348 
00355         AIAPI AIErr (*GetGradientStopCount) ( AIGradientHandle gradient, ai::int16 *count );
00356 
00364         AIAPI AIErr (*GetNthGradientStop) ( AIGradientHandle gradient, ai::int16 n, AIGradientStop *stop );
00365 
00373         AIAPI AIErr (*SetNthGradientStop) ( AIGradientHandle gradient, ai::int16 n, AIGradientStop *stop );
00374 
00383         AIAPI AIErr (*InsertGradientStop) ( AIGradientHandle gradient, ai::int16 n, AIGradientStop *stop );
00384 
00391         AIAPI AIErr (*DeleteGradientStop) ( AIGradientHandle gradient, ai::int16 n, AIGradientStop *stop );
00392 
00416         AIAPI AIErr (*IterateGradient) ( AIArtHandle art, AIPathStyle *style, AIGradientProcs *procs, ai::int16 iterations );
00417 
00424         AIAPI AIErr (*NewGradientName) ( ai::UnicodeString& name );
00425 
00434         AIAPI AIErr (*GradientUsesAIColor) (AIGradientHandle gradient, const AIColor *color,
00435                                                                                 AIBoolean matchTint, AIBoolean *usesColor);
00436 
00442         AIAPI AIBoolean (*ValidateGradient) ( AIGradientHandle gradient );
00443 
00444         /* New in Illustrator 11.0 */
00445 
00453         AIAPI AIErr (*GetGradientColor) ( AIGradientHandle gradient, AIReal percent, AIColor *color );
00454 
00455         /* New in Illustrator 14.0 */
00456 
00463         AIAPI AIErr (*IsGradientAlphaRequired)(AIGradientHandle gradient, AIBoolean *useAlpha);
00464 } AIGradientSuite;
00465 
00466 
00467 
00468 #include "AIHeaderEnd.h"
00469 
00470 
00471 #endif


Contents Suites Classes Class Index Member Index
Adobe Solutions Network
 
Copyright © 2014 Adobe Systems Incorporated. All rights reserved.
Terms of Use Online Privacy Policy Adobe and accessibility Avoid software piracy Permissions and Trademarks