Adobe.com
Contents Suites Classes Class Index Member Index

AICursorSnap.h

Go to the documentation of this file.
00001 #ifndef __AICursorSnap__
00002 #define __AICursorSnap__
00003 
00004 /*
00005  *        Name: AICursorSnap.h
00006  *      Author:
00007  *        Date:
00008  *     Purpose: Adobe Illustrator Cursor Snapping Suite.
00009  *
00010  * ADOBE SYSTEMS INCORPORATED
00011  * Copyright 1986-2007 Adobe Systems Incorporated.
00012  * All rights reserved.
00013  *
00014  * NOTICE:  Adobe permits you to use, modify, and distribute this file
00015  * in accordance with the terms of the Adobe license agreement
00016  * accompanying it. If you have received this file from a source other
00017  * than Adobe, then your use, modification, or distribution of it
00018  * requires the prior written permission of Adobe.
00019  *
00020  */
00021 
00022 /*******************************************************************************
00023  **
00024  **     Imports
00025  **
00026  **/
00027 
00028 #ifndef __AITypes__
00029 #include "AITypes.h"
00030 #endif
00031 #ifndef __AIDocumentView__
00032 #include "AIDocumentView.h"
00033 #endif
00034 #ifndef __AITool__
00035 #include "AITool.h"
00036 #endif
00037 
00038 #include "AIHeaderBegin.h"
00039 
00042 /*******************************************************************************
00043  **
00044  ** Constants
00045  **
00046  **/
00047 
00048 #define kAICursorSnapSuite                              "AI Cursor Snap Suite"
00049 #define kAICursorSnapSuiteVersion16             AIAPI_VERSION(16)
00050 #define kAICursorSnapSuiteVersion               kAICursorSnapSuiteVersion16
00051 #define kAICursorSnapVersion                    kAICursorSnapSuiteVersion
00052 
00053 
00057 enum {
00059         kPointConstraint = 1,
00061         kLinearConstraintAbs,
00063         kLinearConstraintRel
00064 };
00065 
00066 
00069 /* Snap to constraint when shift key is down. */
00070 #define kShiftConstraint                        (1<<0L)
00071 /* Override drawing the default annotation when a custom constraint is hit,
00072  * and draw custom constraints based on the callback
00073  */
00074 #define kDrawCustomAnnotations          (1<<1L)
00075 
00076 
00079 enum {
00080         kTranslateBoundaryEditor = 1
00081 };
00082 
00083 
00084 /*******************************************************************************
00085  **
00086  ** Types
00087  **
00088  **/
00089 /*
00090  * AICustomAnnotationLine 
00091  * represents a line segment by a start and end point which 
00092 */
00093 struct AICustomAnnotationLine
00094 {
00095         AIRealPoint startPoint;
00096         AIRealPoint endPoint;
00097 };
00098 
00099 typedef AICustomAnnotationLine* AICustomAnnotationLinePtr;
00100 
00111 typedef AIErr(*CustomAnnotationsCallback)(ai::uint32 inId, const AIRealPoint& inSnappedPt, size_t* outNumberOfLines, AICustomAnnotationLine** outAnnotationLines);
00112 
00116 struct AICursorConstraint {
00124         ai::int32                                       kind;
00127         ai::int32                                       flags;
00129         AIRealPoint                                     point;
00131         AIReal                                          angle;
00133         ai::UnicodeString                       label;
00135         CustomAnnotationsCallback       getCustomAnnotationDetails;
00136 
00137         /* Constructors */
00138         AICursorConstraint(const ai::int32 inKind,
00139                 const ai::int32 inFlags,
00140                 const AIRealPoint& inPoint,
00141                 const AIReal inAngle,
00142                 const ai::UnicodeString& inLabel,
00143                 const CustomAnnotationsCallback inCustomAnnotationsCallback) :
00144                         kind(inKind),
00145                         flags(inFlags),
00146                         point(inPoint),
00147                         angle(inAngle),
00148                         label(inLabel),
00149                         getCustomAnnotationDetails(inCustomAnnotationsCallback)
00150         {}
00151 
00152         AICursorConstraint() :
00153                 kind(0),
00154                 flags(0),
00155                 angle(kAIRealZero),
00156                 getCustomAnnotationDetails(NULL)
00157         {
00158                 point.h = kAIRealZero;
00159                 point.v = kAIRealZero;
00160         }
00161 
00162         /* Destructor */
00163         ~AICursorConstraint() 
00164         {}
00165 };
00166 
00167 /*******************************************************************************
00168  **
00169  **     Suite
00170  **
00171  **/
00172 
00227 struct AICursorSnapSuite {
00228 
00235         AIAPI AIBoolean         (*UseSmartGuides)               (AIDocumentViewHandle view);
00236 
00240         AIAPI AIErr                     (*Reset)                                (void);
00241 
00245         AIAPI AIErr                     (*ClearCustom)                  (void);
00246 
00252         AIAPI AIErr(*SetCustom)                 (const ai::AutoBuffer<AICursorConstraint>& constraints);
00253 
00292         AIAPI AIErr                     (*Track)                                (AIDocumentViewHandle view, const AIRealPoint& srcpoint,
00293                                                                                                 const AIEvent* event, const char* control,
00294                                                                                                 AIRealPoint* dstpoint);
00295 
00332         AIAPI AIErr                     (*HitTrack)                             (AIDocumentViewHandle view, const AIRealPoint &srcpoint,
00333                                                                                                 const AIEvent* event, const char* control,
00334                                                                                                 AIRealPoint* dstpoint, AIBoolean magnifyAnchorPoint);
00335 
00336 
00380         AIAPI AIErr                     (*TrackInRect)                          (AIDocumentViewHandle view, const AIRealPoint& srcpoint,
00381                                                                                                         const AIEvent* event, const char* control,
00382                                                                                                         AIRealPoint* dstpoint, const AIRealRect* srcrect,
00383                                                                                                         AIRealRect* dstrect);
00384 };
00385 
00386 
00387 #include "AIHeaderEnd.h"
00388 
00389 
00390 #endif


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