InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IXPAttributeSuite.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: SusanCL
6 //
7 // $Author$
8 //
9 // $DateTime$
10 //
11 // $Revision$
12 //
13 // $Change$
14 //
15 // Copyright 1997-2010 Adobe Systems Incorporated. All rights reserved.
16 //
17 // NOTICE: Adobe permits you to use, modify, and distribute this file in accordance
18 // with the terms of the Adobe license agreement accompanying it. If you have received
19 // this file from a source other than Adobe, then your use, modification, or
20 // distribution of it requires the prior written permission of Adobe.
21 //
22 //========================================================================================
23 
24 #ifndef __IXPAttributeSuite__
25 #define __IXPAttributeSuite__
26 
27 #include "ISelectionMessages.h"
28 #include "IXPSetVignetteCmdData.h"
29 #include "IXPSetBasicAttributesCmdData.h"
30 #include "IXPSetDropShadowCmdData.h"
31 #include "IOpacityGradientStops.h"
32 #include "GraphicTypes.h"
33 #include "K2Vector.h"
34 #include "PMPoint.h"
35 
36 #include "XPID.h"
37 
59 const PMReal kDefaultRealNumberValue = 0.0;
60 const int32 kDefaultInt32Value = 0;
61 
62 const PMBlendingMode kDefaultBasicBlendMode = kPMBlendNormal;
63 const PMReal kDefaultBasicOpacity = 100.0;
64 const bool32 kDefaultBasicKnockoutGroup = kFalse;
65 const bool32 kDefaultBasicIsolationGroup = kFalse;
66 const PMDropShadowMode kDefaultDSMode = kDSMNone;
67 const PMBlendingMode kDefaultDSBlendMode = kPMBlendMultiply;
68 const PMReal kDefaultDSOpacity = 75.;
69 const PMReal kDefaultDSOffsetX = 7.;
70 const PMReal kDefaultDSOffsetY = 7.;
71 const PMReal kDefaultDSBlurRadius = 5.;
72 const PMReal kDefaultDSSpread = 0.;
73 const PMReal kDefaultDSNoise = 0.;
74 const UID kDefaultDSColorUID = kInvalidUID;
75 const PMVignetteMode kDefaultVignetteMode = kVTMNone;
76 const PMReal kDefaultVignetteWidth = 9.;
77 const PMReal kDefaultVignetteOuterOpacity = 0.;
78 const PMReal kDefaultVignetteInnerOpacity = 100.;
79 const PMVignetteCorners kDefaultVignetteCorners = kVTCDiffusion;
80 const PMReal kDefaultVignetteNoise = 0.;
81 
82 const PMReal kXPInvalidRealNumberValue = -1.0;
83 const int32 kXPInvalidInt32Value = -1;
84 
86 
101 {
102 public:
103  enum { kDefaultIID = IID_IXPATTRIBUTESUITE };
104 
105  //________________________________________________________________________________________
106  // Data Types
107  //________________________________________________________________________________________
108 
113  {
114  kTargetInvalid,
115 
116  kTargetPageItem,
117  kTargetStroke,
118  kTargetFill,
119  kTargetContent,
120 
121  kMaxTarget
122  };
123 
128  {
129  kGroupInvalid = -1,
130 
131  kGroupBlending,
132  kGroupDropShadow,
133  kGroupFeather,
134  kGroupInnerShadow,
135  kGroupOuterGlow,
136  kGroupInnerGlow,
137  kGroupBevelEmboss,
138  kGroupSatin,
139  kGroupDirectionalFeather,
140  kGroupGradientFeather,
141 
142  kMaxGroup
143  };
144 
148  { // Class Attribute Type
149  kDataTypeInvalid = -1, // ------------------------ ---------------
150  kDataTypeColor, // UID (of swatch) PersistUID
151  kDataTypeBoolean, // bool16 Boolean
152  kDataTypeReal, // PMReal RealNumber
153  kDataTypePMBlendingMode, // PMBlendingMode int32
154  kDataTypePMDropShadowMode, // PMDropShadowMode int32
155  kDataTypePMVignetteMode, // PMVignetteMode int32
156  kDataTypePMVignetteCorners, // PMVignetteCorners int32
157  kDataTypePMGlowTechnique, // PMGlowTechnique int32
158  kDataTypePMInnerGlowSource, // PMInnerGlowSource int32
159  kDataTypePMBevelEmbossStyle, // PMBevelEmbossStyle int32
160  kDataTypePMBevelEmbossTechnique, // PMBevelEmbossTechnique int32
161  kDataTypePMBevelEmbossDirection, // PMBevelEmbossDirection int32
162  kDataTypePMFollowShapeMode, // PMFollowShapeMode int32
163  kDataTypeGradientType, // GradientType int32
164  kDataTypeOpacityGradientStops, // OpacityGradientStops OpacityGradientStops
165  kDataTypePoint // PMPoint PMPoint
166  };
167 
171  typedef enum
172  {
173  kRealKindInvalid,
174 
175  kRealKindXOffset,
176  kRealKindYOffset,
177  kRealKindDistance,
178  kRealKindPercentage,
179  kRealKindBlurWidth,
180  kRealKindAngle,
181  kRealKindAltitude,
182  kRealKindEmbossDepth,
183  kRealKindSoftenAmount,
184  kRealKindFeatherWidth
185 
187 
193  {
194  public:
195  typedef object_type data_type;
196 
197  private:
198  AttributeDataType fDataType;
199  int32 fInt32Value;
200  PMReal fRealValue;
201  UID fUIDValue;
202  bool16 fBoolValue;
203  IOpacityGradientStops* fGradientValue;
204  PMPoint fPointValue;
205 
206  public:
207  AttributeValue() : fDataType(kDataTypeInvalid), fInt32Value(0), fRealValue(0), fUIDValue(kInvalidUID), fBoolValue(kFalse), fGradientValue(nil) {}
208  AttributeValue(const AttributeValue& x) : fGradientValue(nil) { *this = x; }
209  AttributeValue(UID x) : fDataType(kDataTypeColor), fUIDValue(x), fInt32Value(0), fRealValue(0), fBoolValue(kFalse), fGradientValue(nil) {}
210  AttributeValue(bool16 x) : fDataType(kDataTypeBoolean), fBoolValue(x), fInt32Value(0), fRealValue(0), fUIDValue(kInvalidUID), fGradientValue(nil) {}
211  AttributeValue(PMReal x) : fDataType(kDataTypeReal), fRealValue(x), fInt32Value(0), fUIDValue(kInvalidUID), fBoolValue(kFalse), fGradientValue(nil) {}
212  AttributeValue(PMBlendingMode x) : fDataType(kDataTypePMBlendingMode), fInt32Value((int32)x), fRealValue(0), fUIDValue(kInvalidUID), fBoolValue(kFalse), fGradientValue(nil) {}
213  AttributeValue(PMDropShadowMode x) : fDataType(kDataTypePMDropShadowMode), fInt32Value((int32)x), fRealValue(0), fUIDValue(kInvalidUID), fBoolValue(kFalse), fGradientValue(nil) {}
214  AttributeValue(PMVignetteMode x) : fDataType(kDataTypePMVignetteMode), fInt32Value((int32)x), fRealValue(0), fUIDValue(kInvalidUID), fBoolValue(kFalse), fGradientValue(nil) {}
215  AttributeValue(PMVignetteCorners x) : fDataType(kDataTypePMVignetteCorners), fInt32Value((int32)x), fRealValue(0), fUIDValue(kInvalidUID), fBoolValue(kFalse), fGradientValue(nil) {}
216  AttributeValue(PMGlowTechnique x) : fDataType(kDataTypePMGlowTechnique), fInt32Value((int32)x), fRealValue(0), fUIDValue(kInvalidUID), fBoolValue(kFalse), fGradientValue(nil) {}
217  AttributeValue(PMInnerGlowSource x) : fDataType(kDataTypePMInnerGlowSource), fInt32Value((int32)x), fRealValue(0), fUIDValue(kInvalidUID), fBoolValue(kFalse), fGradientValue(nil) {}
218  AttributeValue(PMBevelEmbossStyle x) : fDataType(kDataTypePMBevelEmbossStyle), fInt32Value((int32)x), fRealValue(0), fUIDValue(kInvalidUID), fBoolValue(kFalse), fGradientValue(nil) {}
219  AttributeValue(PMBevelEmbossTechnique x) : fDataType(kDataTypePMBevelEmbossTechnique), fInt32Value((int32)x), fRealValue(0), fUIDValue(kInvalidUID), fBoolValue(kFalse), fGradientValue(nil) {}
220  AttributeValue(PMBevelEmbossDirection x) : fDataType(kDataTypePMBevelEmbossDirection), fInt32Value((int32)x), fRealValue(0), fUIDValue(kInvalidUID), fBoolValue(kFalse), fGradientValue(nil) {}
221  AttributeValue(PMFollowShapeMode x) : fDataType(kDataTypePMFollowShapeMode), fInt32Value((int32)x), fRealValue(0), fUIDValue(kInvalidUID), fBoolValue(kFalse), fGradientValue(nil) {}
222  AttributeValue(GradientType x) : fDataType(kDataTypeGradientType), fInt32Value((int32)x), fRealValue(0), fUIDValue(kInvalidUID), fBoolValue(kFalse), fGradientValue(nil) {}
223  AttributeValue(IOpacityGradientStops* x) : fDataType(kDataTypeOpacityGradientStops), fInt32Value(0), fRealValue(0), fUIDValue(kInvalidUID), fBoolValue(kFalse), fGradientValue(x) { if (x) x->AddRef(); }
224  AttributeValue(const PMPoint& x) : fDataType(kDataTypePoint), fPointValue(x), fRealValue(0), fInt32Value(0), fUIDValue(kInvalidUID), fBoolValue(kFalse), fGradientValue(nil) {}
225 
226  ~AttributeValue() { if (fGradientValue) fGradientValue->Release(); }
227 
228  public:
234  void SetDataType(AttributeDataType t) { fDataType = t; }
235  void SetInt32Data(int32 x) { fInt32Value = x; }
236  void SetRealData(PMReal x) { fRealValue = x; }
237  void SetBooleanData(bool16 x) { fBoolValue = x; }
238  void SetUIDData(UID x) { fUIDValue = x; }
239  void SetOpacityGradientStopsData(IOpacityGradientStops* x) { if (fGradientValue) fGradientValue->Release(); fGradientValue = x; if (x) x->AddRef(); }
240  void SetPointData(const PMPoint& x) { fPointValue = x; }
241 
242  public:
243  AttributeDataType GetDataType() const { return fDataType; }
244  int32 GetInt32Data() const { return fInt32Value; }
245  PMReal GetRealData() const { return fRealValue; }
246  bool16 GetBooleanData() const { return fBoolValue; }
247  UID GetUIDData() const { return fUIDValue; }
248  const PMPoint& GetPointData() const { return fPointValue; }
249 
250  public:
251  UID GetColor() const { if (fDataType == kDataTypeColor) return fUIDValue; ASSERT_FAIL("Wrong type."); return kInvalidUID; }
252  bool16 GetBoolean() const { if (fDataType == kDataTypeBoolean) return fBoolValue; ASSERT_FAIL("Wrong type."); return kFalse; }
253  PMReal GetReal() const { if (fDataType == kDataTypeReal) return fRealValue; ASSERT_FAIL("Wrong type."); return 0; }
254  PMBlendingMode GetPMBlendingMode() const { if (fDataType == kDataTypePMBlendingMode) return (PMBlendingMode)fInt32Value; ASSERT_FAIL("Wrong type."); return (PMBlendingMode)-1; }
255  PMDropShadowMode GetPMDropShadowMode() const { if (fDataType == kDataTypePMDropShadowMode) return (PMDropShadowMode)fInt32Value; ASSERT_FAIL("Wrong type."); return (PMDropShadowMode)-1; }
256  PMVignetteMode GetPMVignetteMode() const { if (fDataType == kDataTypePMVignetteMode) return (PMVignetteMode)fInt32Value; ASSERT_FAIL("Wrong type."); return (PMVignetteMode)-1; }
257  PMVignetteCorners GetPMVignetteCorners() const { if (fDataType == kDataTypePMVignetteCorners) return (PMVignetteCorners)fInt32Value; ASSERT_FAIL("Wrong type."); return (PMVignetteCorners)-1; }
258  PMGlowTechnique GetPMGlowTechnique() const { if (fDataType == kDataTypePMGlowTechnique) return (PMGlowTechnique)fInt32Value; ASSERT_FAIL("Wrong type."); return (PMGlowTechnique)-1; }
259  PMInnerGlowSource GetPMInnerGlowSource() const { if (fDataType == kDataTypePMInnerGlowSource) return (PMInnerGlowSource)fInt32Value; ASSERT_FAIL("Wrong type."); return (PMInnerGlowSource)-1; }
260  PMBevelEmbossStyle GetPMBevelEmbossStyle() const { if (fDataType == kDataTypePMBevelEmbossStyle) return (PMBevelEmbossStyle)fInt32Value; ASSERT_FAIL("Wrong type."); return (PMBevelEmbossStyle)-1; }
261  PMBevelEmbossTechnique GetPMBevelEmbossTechnique() const { if (fDataType == kDataTypePMBevelEmbossTechnique) return (PMBevelEmbossTechnique)fInt32Value; ASSERT_FAIL("Wrong type."); return (PMBevelEmbossTechnique)-1; }
262  PMBevelEmbossDirection GetPMBevelEmbossDirection() const { if (fDataType == kDataTypePMBevelEmbossDirection) return (PMBevelEmbossDirection)fInt32Value; ASSERT_FAIL("Wrong type."); return (PMBevelEmbossDirection)-1; }
263  PMFollowShapeMode GetPMFollowShapeMode() const { if (fDataType == kDataTypePMFollowShapeMode) return (PMFollowShapeMode)fInt32Value; ASSERT_FAIL("Wrong type."); return (PMFollowShapeMode)-1; }
264  GradientType GetGradientType() const { if (fDataType == kDataTypeGradientType) return (GradientType)fInt32Value; ASSERT_FAIL("Wrong type."); return (GradientType)-1; }
265  IOpacityGradientStops* GetOpacityGradientStops() const { return fGradientValue; }
266  IOpacityGradientStops* QueryOpacityGradientStops() const { if (fGradientValue) fGradientValue->AddRef(); return fGradientValue; }
267  const PMPoint& GetPMPoint() const { ASSERT(fDataType == kDataTypePoint); return fPointValue; }
268 
269  public:
270  AttributeValue& operator=(const AttributeValue& rhs)
271  {
272  fDataType = rhs.fDataType;
273  fInt32Value = rhs.fInt32Value;
274  fRealValue = rhs.fRealValue;
275  fUIDValue = rhs.fUIDValue;
276  fBoolValue = rhs.fBoolValue;
277  fPointValue = rhs.fPointValue;
278 
279  if (fGradientValue) fGradientValue->Release();
280  fGradientValue = rhs.fGradientValue;
281  if (fGradientValue) fGradientValue->AddRef();
282 
283  return *this;
284  };
285 
286  bool operator==(const AttributeValue& rhs) const
287  {
288  if (fDataType != rhs.fDataType) return kFalse;
289  switch(fDataType)
290  {
291  case kDataTypeColor:
292  return fUIDValue == rhs.fUIDValue;
293  case kDataTypeBoolean:
294  return fBoolValue == rhs.fBoolValue;
295  case kDataTypeReal:
296  return fRealValue == rhs.fRealValue;
297  case kDataTypePMBlendingMode:
298  case kDataTypePMDropShadowMode:
299  case kDataTypePMVignetteMode:
300  case kDataTypePMVignetteCorners:
301  case kDataTypePMGlowTechnique:
302  case kDataTypePMInnerGlowSource:
303  case kDataTypePMBevelEmbossStyle:
304  case kDataTypePMBevelEmbossTechnique:
305  case kDataTypePMBevelEmbossDirection:
306  case kDataTypePMFollowShapeMode:
307  case kDataTypeGradientType:
308  return fInt32Value == rhs.fInt32Value;
309  case kDataTypeOpacityGradientStops:
310  return ((fGradientValue == rhs.fGradientValue)
311  || (fGradientValue && rhs.fGradientValue && fGradientValue->Equals(rhs.fGradientValue))
312  || (fGradientValue && fGradientValue->Equals(rhs.fGradientValue))
313  || (rhs.fGradientValue && rhs.fGradientValue->Equals(fGradientValue)));
314  case kDataTypePoint:
315  return fPointValue == rhs.fPointValue;
316  case kDataTypeInvalid:
317  return kTrue;
318  }
319  return kTrue;
320  };
321 
322  bool operator!=(const AttributeValue& rhs) const
323  { return !(*this == rhs); }
324 
325  };
326 
327 #define XP_MAX_ATTRS 100 // maximum number of attributes (per group)
328 #define XP_MAX_GROUPS 100 // maximum number of groups (per target)
329 #define BASE_XP_ATTR(t,x) ((int32)(x) * XP_MAX_ATTRS + (int32)(t) * XP_MAX_ATTRS * XP_MAX_GROUPS )
330 
331  enum AttributeType
332  {
333  kUnknownAttrType = -1,
334 
335  // Basic attributes, drop shadow attributes, vignette attributes:
336  // Note: In principle these should all be rearranged and ordered
337  // to put them in the correct group, but since this is a public
338  // header and they've had these values for a long time, I don't
339  // want to change them. The remaining attributes are all clustered
340  // so it's easy to determine which group they're in, plus we can add
341  // new group-specific attributes without having to put them at the
342  // end of the whole list.
343 
344  // AttributeDataType
345  // --------------------------------
346  kBSOpacity = 0, // kDataTypeReal
347  kBSBlendMode, // kDataTypePMBlendingMode
348  kBSKnockoutGroup, // kDataTypeBoolean
349  kBSIsolationGroup, // kDataTypeBoolean
350  kDSMode, // kDataTypePMDropShadowMode
351  kDSOffsetX, // kDataTypeReal
352  kDSOffsetY, // kDataTypeReal
353  kDSGray_Obsolete, // obsolete; don't use
354  kDSOpacity, // kDataTypeReal
355  kDSBlendMode, // kDataTypePMBlendingMode
356  kDSBlurRadius, // kDataTypeReal
357  kVTMode, // kDataTypeVignetteMode
358  kVTWidth, // kDataTypeReal
359  kVTOuterOpacity, // obsolete; don't use
360  kVTInnerOpacity, // obsolete; don't use
361  kVTCorners, // kDataTypePMVignetteCorners
362  kDSColor, // kDataTypeColor
363  kDSSpread, // kDataTypeReal
364  kDSNoise, // kDataTypeReal
365  kVTNoise, // kDataTypeReal
366 
367  kDropShadowBaseID = BASE_XP_ATTR(kTargetPageItem, kGroupDropShadow),
368 
369  kDropShadowUseGlobalLight, // kDataTypeBoolean
370  kDropShadowKO, // kDataTypeBoolean
371  kDropShadowHonorFX, // kDataTypeBoolean
372 
373  kFeatherBaseID = BASE_XP_ATTR(kTargetPageItem, kGroupFeather),
374 
375  kFeatherChoke,
376 
377  kInnerShadowBaseID = BASE_XP_ATTR(kTargetPageItem, kGroupInnerShadow),
378 
379  kInnerShadowApply, // kDataTypeBoolean
380  kInnerShadowColor, // kDataTypeColor
381  kInnerShadowBlendMode, // kDataTypePMBlendingMode
382  kInnerShadowOpacity, // kDataTypeReal
383  kInnerShadowAngle, // kDataTypeReal
384  kInnerShadowDistance, // kDataTypeReal
385  kInnerShadowUseGlobalLight, // kDataTypeBoolean
386  kInnerShadowChoke, // kDataTypeReal
387  kInnerShadowSize, // kDataTypeReal
388  kInnerShadowNoise, // kDataTypeReal
389 
390  kOuterGlowBaseID = BASE_XP_ATTR(kTargetPageItem, kGroupOuterGlow),
391 
392  kOuterGlowApply, // kDataTypeBoolean
393  kOuterGlowBlendMode, // kDataTypePMBlendingMode
394  kOuterGlowOpacity, // kDataTypeReal
395  kOuterGlowNoise, // kDataTypeReal
396  kOuterGlowColor, // kDataTypeColor
397  kOuterGlowTechnique, // kDataTypePMGlowTechnique
398  kOuterGlowSpread, // kDataTypeReal
399  kOuterGlowSize, // kDataTypeReal
400 
401  kInnerGlowBaseID = BASE_XP_ATTR(kTargetPageItem, kGroupInnerGlow),
402 
403  kInnerGlowApply, // kDataTypeBoolean
404  kInnerGlowBlendMode, // kDataTypePMBlendingMode
405  kInnerGlowOpacity, // kDataTypeReal
406  kInnerGlowNoise, // kDataTypeReal
407  kInnerGlowColor, // kDataTypeColor
408  kInnerGlowTechnique, // kDataTypePMGlowTechnique
409  kInnerGlowSpread, // kDataTypeReal
410  kInnerGlowSize, // kDataTypeReal
411  kInnerGlowSource, // kDataTypePMInnerGlowSource
412 
413  kBevelEmbossBaseID = BASE_XP_ATTR(kTargetPageItem, kGroupBevelEmboss),
414 
415  kBevelEmbossApply, // kDataTypeBoolean
416  kBevelEmbossStyle, // kDataTypePMBevelEmbossStyle
417  kBevelEmbossTechnique, // kDataTypePMBevelEmbossTechnique
418  kBevelEmbossDepth, // kDataTypeReal
419  kBevelEmbossDirection, // kDataTypePMBevelEmbossDirection
420  kBevelEmbossSize, // kDataTypeReal
421  kBevelEmbossSoften, // kDataTypeReal
422  kBevelEmbossAngle, // kDataTypeReal
423  kBevelEmbossAltitude, // kDataTypeReal
424  kBevelEmbossUseGlobalLight, // kDataTypeBoolean
425  kBevelEmbossHighlightColor, // kDataTypeColor
426  kBevelEmbossHighlightBlendMode, // kDataTypePMBlendingMode
427  kBevelEmbossHighlightOpacity, // kDataTypeReal
428  kBevelEmbossShadowColor, // kDataTypeColor
429  kBevelEmbossShadowBlendMode, // kDataTypePMBlendingMode
430  kBevelEmbossShadowOpacity, // kDataTypeReal
431 
432  kSatinBaseID = BASE_XP_ATTR(kTargetPageItem, kGroupSatin),
433 
434  kSatinApply, // kDataTypeBoolean
435  kSatinColor, // kDataTypeColor
436  kSatinBlendMode, // kDataTypePMBlendingMode
437  kSatinOpacity, // kDataTypeReal
438  kSatinAngle, // kDataTypeReal
439  kSatinDistance, // kDataTypeReal
440  kSatinSize, // kDataTypeReal
441  kSatinInvert, // kDataTypeBoolean
442 
443  kDirectionalFeatherBaseID = BASE_XP_ATTR(kTargetPageItem, kGroupDirectionalFeather),
444 
445  kDirectionalFeatherApply, // kDataTypeBoolean
446  kDirectionalFeatherWidthLeft, // kDataTypeReal
447  kDirectionalFeatherWidthRight, // kDataTypeReal
448  kDirectionalFeatherWidthTop, // kDataTypeReal
449  kDirectionalFeatherWidthBottom, // kDataTypeReal
450  kDirectionalFeatherAngle, // kDataTypeReal
451  kDirectionalFeatherFollowShape, // kDataTypeBoolean
452  kDirectionalFeatherNoise, // kDataTypeReal
453  kDirectionalFeatherChoke, // kDataTypeReal
454 
455  kGradientFeatherBaseID = BASE_XP_ATTR(kTargetPageItem, kGroupGradientFeather),
456 
457  kGradientFeatherApply, // kDataTypeBoolean
458  kGradientFeatherType, // kDataTypeGradientType
459  kGradientFeatherOpacityStops, // kDataTypeOpacityGradientStops
460  kGradientFeatherAngle, // kDataTypeReal
461  kGradientFeatherLength, // kDataTypeReal
462  kGradientFeatherCenter, // kDataTypePoint
463  kGradientFeatherRadius, // kDataTypeReal
464  kGradientFeatherHiliteAngle, // kDataTypeReal
465  kGradientFeatherHiliteLength, // kDataTypeReal
466 
467  kStrokeBlendingBaseID = BASE_XP_ATTR(kTargetStroke, kGroupBlending),
468 
469  kStrokeBlendingOpacity,
470  kStrokeBlendingBlendMode,
471  kStrokeBlendingKnockoutGroup,
472  kStrokeBlendingIsolationGroup,
473 
474  kStrokeDropShadowBaseID = BASE_XP_ATTR(kTargetStroke, kGroupDropShadow),
475 
476  kStrokeDropShadowMode,
477  kStrokeDropShadowOffsetX,
478  kStrokeDropShadowOffsetY,
479  kStrokeDropShadowOpacity,
480  kStrokeDropShadowBlendMode,
481  kStrokeDropShadowBlurRadius,
482  kStrokeDropShadowSpread,
483  kStrokeDropShadowNoise,
484  kStrokeDropShadowColor,
485  kStrokeDropShadowUseGlobalLight,
486  kStrokeDropShadowKO,
487  kStrokeDropShadowHonorFX,
488 
489  kStrokeFeatherBaseID = BASE_XP_ATTR(kTargetStroke, kGroupFeather),
490 
491  kStrokeFeatherMode,
492  kStrokeFeatherWidth,
493  kStrokeFeatherCorners,
494  kStrokeFeatherNoise,
495  kStrokeFeatherChoke,
496 
497  kStrokeInnerShadowBaseID = BASE_XP_ATTR(kTargetStroke, kGroupInnerShadow),
498 
499  kStrokeInnerShadowApply, // kDataTypeBoolean
500  kStrokeInnerShadowColor, // kDataTypeColor
501  kStrokeInnerShadowBlendMode, // kDataTypePMBlendingMode
502  kStrokeInnerShadowOpacity, // kDataTypeReal
503  kStrokeInnerShadowAngle, // kDataTypeReal
504  kStrokeInnerShadowDistance, // kDataTypeReal
505  kStrokeInnerShadowUseGlobalLight, // kDataTypeBoolean
506  kStrokeInnerShadowChoke, // kDataTypeReal
507  kStrokeInnerShadowSize, // kDataTypeReal
508  kStrokeInnerShadowNoise, // kDataTypeReal
509 
510  kStrokeOuterGlowBaseID = BASE_XP_ATTR(kTargetStroke, kGroupOuterGlow),
511 
512  kStrokeOuterGlowApply, // kDataTypeBoolean
513  kStrokeOuterGlowBlendMode, // kDataTypePMBlendingMode
514  kStrokeOuterGlowOpacity, // kDataTypeReal
515  kStrokeOuterGlowNoise, // kDataTypeReal
516  kStrokeOuterGlowColor, // kDataTypeColor
517  kStrokeOuterGlowTechnique, // kDataTypePMGlowTechnique
518  kStrokeOuterGlowSpread, // kDataTypeReal
519  kStrokeOuterGlowSize, // kDataTypeReal
520 
521  kStrokeInnerGlowBaseID = BASE_XP_ATTR(kTargetStroke, kGroupInnerGlow),
522 
523  kStrokeInnerGlowApply, // kDataTypeBoolean
524  kStrokeInnerGlowBlendMode, // kDataTypePMBlendingMode
525  kStrokeInnerGlowOpacity, // kDataTypeReal
526  kStrokeInnerGlowNoise, // kDataTypeReal
527  kStrokeInnerGlowColor, // kDataTypeColor
528  kStrokeInnerGlowTechnique, // kDataTypePMGlowTechnique
529  kStrokeInnerGlowSpread, // kDataTypeReal
530  kStrokeInnerGlowSize, // kDataTypeReal
531  kStrokeInnerGlowSource, // kDataTypePMInnerGlowSource
532 
533  kStrokeBevelEmbossBaseID = BASE_XP_ATTR(kTargetStroke, kGroupBevelEmboss),
534 
535  kStrokeBevelEmbossApply, // kDataTypeBoolean
536  kStrokeBevelEmbossStyle, // kDataTypePMBevelEmbossStyle
537  kStrokeBevelEmbossTechnique, // kDataTypePMBevelEmbossTechnique
538  kStrokeBevelEmbossDepth, // kDataTypeReal
539  kStrokeBevelEmbossDirection, // kDataTypePMBevelEmbossDirection
540  kStrokeBevelEmbossSize, // kDataTypeReal
541  kStrokeBevelEmbossSoften, // kDataTypeReal
542  kStrokeBevelEmbossAngle, // kDataTypeReal
543  kStrokeBevelEmbossAltitude, // kDataTypeReal
544  kStrokeBevelEmbossUseGlobalLight, // kDataTypeBoolean
545  kStrokeBevelEmbossHighlightColor, // kDataTypeColor
546  kStrokeBevelEmbossHighlightBlendMode, // kDataTypePMBlendingMode
547  kStrokeBevelEmbossHighlightOpacity, // kDataTypeReal
548  kStrokeBevelEmbossShadowColor, // kDataTypeColor
549  kStrokeBevelEmbossShadowBlendMode, // kDataTypePMBlendingMode
550  kStrokeBevelEmbossShadowOpacity, // kDataTypeReal
551 
552  kStrokeSatinBaseID = BASE_XP_ATTR(kTargetStroke, kGroupSatin),
553 
554  kStrokeSatinApply, // kDataTypeBoolean
555  kStrokeSatinColor, // kDataTypeColor
556  kStrokeSatinBlendMode, // kDataTypePMBlendingMode
557  kStrokeSatinOpacity, // kDataTypeReal
558  kStrokeSatinAngle, // kDataTypeReal
559  kStrokeSatinDistance, // kDataTypeReal
560  kStrokeSatinSize, // kDataTypeReal
561  kStrokeSatinInvert, // kDataTypeBoolean
562 
563  kStrokeDirectionalFeatherBaseID = BASE_XP_ATTR(kTargetStroke, kGroupDirectionalFeather),
564 
565  kStrokeDirectionalFeatherApply, // kDataTypeBoolean
566  kStrokeDirectionalFeatherWidthLeft, // kDataTypeReal
567  kStrokeDirectionalFeatherWidthRight, // kDataTypeReal
568  kStrokeDirectionalFeatherWidthTop, // kDataTypeReal
569  kStrokeDirectionalFeatherWidthBottom, // kDataTypeReal
570  kStrokeDirectionalFeatherAngle, // kDataTypeReal
571  kStrokeDirectionalFeatherFollowShape, // kDataTypeBoolean
572  kStrokeDirectionalFeatherNoise, // kDataTypeReal
573  kStrokeDirectionalFeatherChoke, // kDataTypeReal
574 
575  kStrokeGradientFeatherBaseID = BASE_XP_ATTR(kTargetStroke, kGroupGradientFeather),
576 
577  kStrokeGradientFeatherApply, // kDataTypeBoolean
578  kStrokeGradientFeatherType, // kDataTypeGradientType
579  kStrokeGradientFeatherOpacityStops, // kDataTypeOpacityGradientStops
580  kStrokeGradientFeatherAngle, // kDataTypeReal
581  kStrokeGradientFeatherLength, // kDataTypeReal
582  kStrokeGradientFeatherCenter, // kDataTypePoint
583  kStrokeGradientFeatherRadius, // kDataTypeReal
584  kStrokeGradientFeatherHiliteAngle, // kDataTypeReal
585  kStrokeGradientFeatherHiliteLength, // kDataTypeReal
586 
587  kFillBlendingBaseID = BASE_XP_ATTR(kTargetFill, kGroupBlending),
588 
589  kFillBlendingOpacity,
590  kFillBlendingBlendMode,
591  kFillBlendingKnockoutGroup,
592  kFillBlendingIsolationGroup,
593 
594  kFillDropShadowBaseID = BASE_XP_ATTR(kTargetFill, kGroupDropShadow),
595 
596  kFillDropShadowMode,
597  kFillDropShadowOffsetX,
598  kFillDropShadowOffsetY,
599  kFillDropShadowOpacity,
600  kFillDropShadowBlendMode,
601  kFillDropShadowBlurRadius,
602  kFillDropShadowSpread,
603  kFillDropShadowNoise,
604  kFillDropShadowColor,
605  kFillDropShadowUseGlobalLight,
606  kFillDropShadowKO,
607  kFillDropShadowHonorFX,
608 
609  kFillFeatherBaseID = BASE_XP_ATTR(kTargetFill, kGroupFeather),
610 
611  kFillFeatherMode,
612  kFillFeatherWidth,
613  kFillFeatherCorners,
614  kFillFeatherNoise,
615  kFillFeatherChoke,
616 
617  kFillInnerShadowBaseID = BASE_XP_ATTR(kTargetFill, kGroupInnerShadow),
618 
619  kFillInnerShadowApply, // kDataTypeBoolean
620  kFillInnerShadowColor, // kDataTypeColor
621  kFillInnerShadowBlendMode, // kDataTypePMBlendingMode
622  kFillInnerShadowOpacity, // kDataTypeReal
623  kFillInnerShadowAngle, // kDataTypeReal
624  kFillInnerShadowDistance, // kDataTypeReal
625  kFillInnerShadowUseGlobalLight, // kDataTypeBoolean
626  kFillInnerShadowChoke, // kDataTypeReal
627  kFillInnerShadowSize, // kDataTypeReal
628  kFillInnerShadowNoise, // kDataTypeReal
629 
630  kFillOuterGlowBaseID = BASE_XP_ATTR(kTargetFill, kGroupOuterGlow),
631 
632  kFillOuterGlowApply, // kDataTypeBoolean
633  kFillOuterGlowBlendMode, // kDataTypePMBlendingMode
634  kFillOuterGlowOpacity, // kDataTypeReal
635  kFillOuterGlowNoise, // kDataTypeReal
636  kFillOuterGlowColor, // kDataTypeColor
637  kFillOuterGlowTechnique, // kDataTypePMGlowTechnique
638  kFillOuterGlowSpread, // kDataTypeReal
639  kFillOuterGlowSize, // kDataTypeReal
640 
641  kFillInnerGlowBaseID = BASE_XP_ATTR(kTargetFill, kGroupInnerGlow),
642 
643  kFillInnerGlowApply, // kDataTypeBoolean
644  kFillInnerGlowBlendMode, // kDataTypePMBlendingMode
645  kFillInnerGlowOpacity, // kDataTypeReal
646  kFillInnerGlowNoise, // kDataTypeReal
647  kFillInnerGlowColor, // kDataTypeColor
648  kFillInnerGlowTechnique, // kDataTypePMGlowTechnique
649  kFillInnerGlowSpread, // kDataTypeReal
650  kFillInnerGlowSize, // kDataTypeReal
651  kFillInnerGlowSource, // kDataTypePMInnerGlowSource
652 
653  kFillBevelEmbossBaseID = BASE_XP_ATTR(kTargetFill, kGroupBevelEmboss),
654 
655  kFillBevelEmbossApply, // kDataTypeBoolean
656  kFillBevelEmbossStyle, // kDataTypePMBevelEmbossStyle
657  kFillBevelEmbossTechnique, // kDataTypePMBevelEmbossTechnique
658  kFillBevelEmbossDepth, // kDataTypeReal
659  kFillBevelEmbossDirection, // kDataTypePMBevelEmbossDirection
660  kFillBevelEmbossSize, // kDataTypeReal
661  kFillBevelEmbossSoften, // kDataTypeReal
662  kFillBevelEmbossAngle, // kDataTypeReal
663  kFillBevelEmbossAltitude, // kDataTypeReal
664  kFillBevelEmbossUseGlobalLight, // kDataTypeBoolean
665  kFillBevelEmbossHighlightColor, // kDataTypeColor
666  kFillBevelEmbossHighlightBlendMode, // kDataTypePMBlendingMode
667  kFillBevelEmbossHighlightOpacity, // kDataTypeReal
668  kFillBevelEmbossShadowColor, // kDataTypeColor
669  kFillBevelEmbossShadowBlendMode, // kDataTypePMBlendingMode
670  kFillBevelEmbossShadowOpacity, // kDataTypeReal
671 
672  kFillSatinBaseID = BASE_XP_ATTR(kTargetFill, kGroupSatin),
673 
674  kFillSatinApply, // kDataTypeBoolean
675  kFillSatinColor, // kDataTypeColor
676  kFillSatinBlendMode, // kDataTypePMBlendingMode
677  kFillSatinOpacity, // kDataTypeReal
678  kFillSatinAngle, // kDataTypeReal
679  kFillSatinDistance, // kDataTypeReal
680  kFillSatinSize, // kDataTypeReal
681  kFillSatinInvert, // kDataTypeBoolean
682 
683  kFillDirectionalFeatherBaseID = BASE_XP_ATTR(kTargetFill, kGroupDirectionalFeather),
684 
685  kFillDirectionalFeatherApply, // kDataTypeBoolean
686  kFillDirectionalFeatherWidthLeft, // kDataTypeReal
687  kFillDirectionalFeatherWidthRight, // kDataTypeReal
688  kFillDirectionalFeatherWidthTop, // kDataTypeReal
689  kFillDirectionalFeatherWidthBottom, // kDataTypeReal
690  kFillDirectionalFeatherAngle, // kDataTypeReal
691  kFillDirectionalFeatherFollowShape, // kDataTypeBoolean
692  kFillDirectionalFeatherNoise, // kDataTypeReal
693  kFillDirectionalFeatherChoke, // kDataTypeReal
694 
695  kFillGradientFeatherBaseID = BASE_XP_ATTR(kTargetFill, kGroupGradientFeather),
696 
697  kFillGradientFeatherApply, // kDataTypeBoolean
698  kFillGradientFeatherType, // kDataTypeGradientType
699  kFillGradientFeatherOpacityStops, // kDataTypeOpacityGradientStops
700  kFillGradientFeatherAngle, // kDataTypeReal
701  kFillGradientFeatherLength, // kDataTypeReal
702  kFillGradientFeatherCenter, // kDataTypePoint
703  kFillGradientFeatherRadius, // kDataTypeReal
704  kFillGradientFeatherHiliteAngle, // kDataTypeReal
705  kFillGradientFeatherHiliteLength, // kDataTypeReal
706 
707  kContentBlendingBaseID = BASE_XP_ATTR(kTargetContent, kGroupBlending),
708 
709  kContentBlendingOpacity,
710  kContentBlendingBlendMode,
711  kContentBlendingKnockoutGroup,
712  kContentBlendingIsolationGroup,
713 
714  kContentDropShadowBaseID = BASE_XP_ATTR(kTargetContent, kGroupDropShadow),
715 
716  kContentDropShadowMode,
717  kContentDropShadowOffsetX,
718  kContentDropShadowOffsetY,
719  kContentDropShadowOpacity,
720  kContentDropShadowBlendMode,
721  kContentDropShadowBlurRadius,
722  kContentDropShadowSpread,
723  kContentDropShadowNoise,
724  kContentDropShadowColor,
725  kContentDropShadowUseGlobalLight,
726  kContentDropShadowKO,
727  kContentDropShadowHonorFX,
728 
729  kContentFeatherBaseID = BASE_XP_ATTR(kTargetContent, kGroupFeather),
730 
731  kContentFeatherMode,
732  kContentFeatherWidth,
733  kContentFeatherCorners,
734  kContentFeatherNoise,
735  kContentFeatherChoke,
736 
737  kContentInnerShadowBaseID = BASE_XP_ATTR(kTargetContent, kGroupInnerShadow),
738 
739  kContentInnerShadowApply, // kDataTypeBoolean
740  kContentInnerShadowColor, // kDataTypeColor
741  kContentInnerShadowBlendMode, // kDataTypePMBlendingMode
742  kContentInnerShadowOpacity, // kDataTypeReal
743  kContentInnerShadowAngle, // kDataTypeReal
744  kContentInnerShadowDistance, // kDataTypeReal
745  kContentInnerShadowUseGlobalLight, // kDataTypeBoolean
746  kContentInnerShadowChoke, // kDataTypeReal
747  kContentInnerShadowSize, // kDataTypeReal
748  kContentInnerShadowNoise, // kDataTypeReal
749 
750  kContentOuterGlowBaseID = BASE_XP_ATTR(kTargetContent, kGroupOuterGlow),
751 
752  kContentOuterGlowApply, // kDataTypeBoolean
753  kContentOuterGlowBlendMode, // kDataTypePMBlendingMode
754  kContentOuterGlowOpacity, // kDataTypeReal
755  kContentOuterGlowNoise, // kDataTypeReal
756  kContentOuterGlowColor, // kDataTypeColor
757  kContentOuterGlowTechnique, // kDataTypePMGlowTechnique
758  kContentOuterGlowSpread, // kDataTypeReal
759  kContentOuterGlowSize, // kDataTypeReal
760 
761  kContentInnerGlowBaseID = BASE_XP_ATTR(kTargetContent, kGroupInnerGlow),
762 
763  kContentInnerGlowApply, // kDataTypeBoolean
764  kContentInnerGlowBlendMode, // kDataTypePMBlendingMode
765  kContentInnerGlowOpacity, // kDataTypeReal
766  kContentInnerGlowNoise, // kDataTypeReal
767  kContentInnerGlowColor, // kDataTypeColor
768  kContentInnerGlowTechnique, // kDataTypePMGlowTechnique
769  kContentInnerGlowSpread, // kDataTypeReal
770  kContentInnerGlowSize, // kDataTypeReal
771  kContentInnerGlowSource, // kDataTypePMInnerGlowSource
772 
773  kContentBevelEmbossBaseID = BASE_XP_ATTR(kTargetContent, kGroupBevelEmboss),
774 
775  kContentBevelEmbossApply, // kDataTypeBoolean
776  kContentBevelEmbossStyle, // kDataTypePMBevelEmbossStyle
777  kContentBevelEmbossTechnique, // kDataTypePMBevelEmbossTechnique
778  kContentBevelEmbossDepth, // kDataTypeReal
779  kContentBevelEmbossDirection, // kDataTypePMBevelEmbossDirection
780  kContentBevelEmbossSize, // kDataTypeReal
781  kContentBevelEmbossSoften, // kDataTypeReal
782  kContentBevelEmbossAngle, // kDataTypeReal
783  kContentBevelEmbossAltitude, // kDataTypeReal
784  kContentBevelEmbossUseGlobalLight, // kDataTypeBoolean
785  kContentBevelEmbossHighlightColor, // kDataTypeColor
786  kContentBevelEmbossHighlightBlendMode, // kDataTypePMBlendingMode
787  kContentBevelEmbossHighlightOpacity, // kDataTypeReal
788  kContentBevelEmbossShadowColor, // kDataTypeColor
789  kContentBevelEmbossShadowBlendMode, // kDataTypePMBlendingMode
790  kContentBevelEmbossShadowOpacity, // kDataTypeReal
791 
792  kContentSatinBaseID = BASE_XP_ATTR(kTargetContent, kGroupSatin),
793 
794  kContentSatinApply, // kDataTypeBoolean
795  kContentSatinColor, // kDataTypeColor
796  kContentSatinBlendMode, // kDataTypePMBlendingMode
797  kContentSatinOpacity, // kDataTypeReal
798  kContentSatinAngle, // kDataTypeReal
799  kContentSatinDistance, // kDataTypeReal
800  kContentSatinSize, // kDataTypeReal
801  kContentSatinInvert, // kDataTypeBoolean
802 
803  kContentDirectionalFeatherBaseID = BASE_XP_ATTR(kTargetContent, kGroupDirectionalFeather),
804 
805  kContentDirectionalFeatherApply, // kDataTypeBoolean
806  kContentDirectionalFeatherWidthLeft, // kDataTypeReal
807  kContentDirectionalFeatherWidthRight, // kDataTypeReal
808  kContentDirectionalFeatherWidthTop, // kDataTypeReal
809  kContentDirectionalFeatherWidthBottom, // kDataTypeReal
810  kContentDirectionalFeatherAngle, // kDataTypeReal
811  kContentDirectionalFeatherFollowShape, // kDataTypeBoolean
812  kContentDirectionalFeatherNoise, // kDataTypeReal
813  kContentDirectionalFeatherChoke, // kDataTypeReal
814 
815  kContentGradientFeatherBaseID = BASE_XP_ATTR(kTargetContent, kGroupGradientFeather),
816 
817  kContentGradientFeatherApply, // kDataTypeBoolean
818  kContentGradientFeatherType, // kDataTypeGradientType
819  kContentGradientFeatherOpacityStops, // kDataTypeOpacityGradientStops
820  kContentGradientFeatherAngle, // kDataTypeReal
821  kContentGradientFeatherLength, // kDataTypeReal
822  kContentGradientFeatherCenter, // kDataTypePoint
823  kContentGradientFeatherRadius, // kDataTypeReal
824  kContentGradientFeatherHiliteAngle, // kDataTypeReal
825  kContentGradientFeatherHiliteLength, // kDataTypeReal
826 
827  kMaxNumberAttrTypes
828  };
829 
834  {
835  public:
836  typedef object_type data_type;
837 
839  : fType(kUnknownAttrType) {}
840  AttributeTypeAndValue(AttributeType type, const AttributeValue& x)
841  : fType(type), fValue(x) {}
842  AttributeTypeAndValue(AttributeType type, UID x)
843  : fType(type), fValue(x) {}
844  AttributeTypeAndValue(AttributeType type, bool16 x)
845  : fType(type), fValue(x) {}
846  AttributeTypeAndValue(AttributeType type, PMReal x)
847  : fType(type), fValue(x) {}
848  AttributeTypeAndValue(AttributeType type, PMBlendingMode x)
849  : fType(type), fValue(x) {}
850  AttributeTypeAndValue(AttributeType type, PMDropShadowMode x)
851  : fType(type), fValue(x) {}
852  AttributeTypeAndValue(AttributeType type, PMVignetteMode x)
853  : fType(type), fValue(x) {}
854  AttributeTypeAndValue(AttributeType type, PMVignetteCorners x)
855  : fType(type), fValue(x) {}
856  AttributeTypeAndValue(AttributeType type, PMGlowTechnique x)
857  : fType(type), fValue(x) {}
858  AttributeTypeAndValue(AttributeType type, PMInnerGlowSource x)
859  : fType(type), fValue(x) {}
860  AttributeTypeAndValue(AttributeType type, PMBevelEmbossStyle x)
861  : fType(type), fValue(x) {}
862  AttributeTypeAndValue(AttributeType type, PMBevelEmbossTechnique x)
863  : fType(type), fValue(x) {}
864  AttributeTypeAndValue(AttributeType type, PMBevelEmbossDirection x)
865  : fType(type), fValue(x) {}
866  AttributeTypeAndValue(AttributeType type, PMFollowShapeMode x)
867  : fType(type), fValue(x) {}
868  AttributeTypeAndValue(AttributeType type, GradientType x)
869  : fType(type), fValue(x) {}
870  AttributeTypeAndValue(AttributeType type, IOpacityGradientStops* x)
871  : fType(type), fValue(x) {}
872 
873  public:
874  AttributeType GetType() const { return fType; }
875  const AttributeValue& GetValue() const { return fValue; }
876 
877  public:
878  AttributeTypeAndValue& operator=(const AttributeTypeAndValue& rhs)
879  { fType = rhs.GetType(); fValue = rhs.GetValue(); return *this; }
880  int32 operator==(const AttributeTypeAndValue& rhs)
881  { return fType == rhs.fType && fValue == rhs.fValue; }
882  int32 operator!=(const AttributeTypeAndValue& rhs)
883  { return !(*this == rhs); }
884  private:
885  AttributeType fType;
886  AttributeValue fValue;
887  };
888 
890 
902  {
903  public:
904  typedef object_type data_type;
905  typedef enum { kInvalid, kAngle, kDistance, kXOffset, kYOffset } WhichParameter;
906 
919  (
922  WhichParameter param1,
923  const PMReal& value1,
924  WhichParameter param2 = kInvalid,
925  const PMReal& value2 = 0
926  ) :
927  fTarget(target),
928  fGroup(group)
929  {
930  if (param1 == kInvalid)
931  {
932  ASSERT_FAIL("IXPSetAttributesCmdData::Sorry, param1 has to be valid.");
933  }
934  else if (param1 == kXOffset || param1 == kYOffset)
935  {
936  fParamXY = param1;
937  fValueXY = value1;
938  ASSERT(param2 == kAngle || param2 == kDistance || param2 == kInvalid);
939  fParamAD = param2;
940  fValueAD = value2;
941  }
942  else
943  {
944  fParamAD = param1;
945  fValueAD = value1;
946  ASSERT(param2 == kXOffset || param2 == kYOffset || param2 == kInvalid);
947  fParamXY = param2;
948  fValueXY = value2;
949  }
950 
951  Validate();
952  }
953 
955  (
958  ) :
959  fTarget(target),
960  fGroup(group),
961  fParamXY(kInvalid),
962  fValueXY(0),
963  fParamAD(kInvalid),
964  fValueAD(0)
965  {
966  }
967 
972  {
973  *this = rhs;
974  }
975 
980  bool32 Validate(bool32 assert = kFalse)
981  {
982  bool32 ok = kTrue;
983 
984  if (fGroup != IXPAttributeSuite::kGroupDropShadow
985  && fGroup != IXPAttributeSuite::kGroupInnerShadow)
986  {
987  if (assert)
988  {
989  ASSERT_FAIL("PartialADXY::Validate: Only drop shadows and inner shadows are supported groups.");
990  }
991  ok = kFalse;
992  }
993 
994  if ((fGroup == IXPAttributeSuite::kGroupDropShadow && fParamAD == kInvalid)
995  || (fGroup == IXPAttributeSuite::kGroupInnerShadow && fParamXY == kInvalid))
996  {
997  if (assert)
998  {
999  ASSERT_FAIL("PartialADXY::Validate: Drop shadows must specify at least angle or distance "
1000  "(since they're XY based), and inner shadows must specify at least x or y "
1001  "(since they're AD based).");
1002  }
1003  ok = kFalse;
1004  }
1005 
1006  if (!(IsSingleParameter()
1007  || fParamAD != kAngle
1008  || ((fValueAD == 0 || fValueAD == 180) && fParamXY == kYOffset && fValueXY == 0)
1009  || ((fValueAD == 90 || fValueAD == -90 || fValueAD == 270) && fParamXY == kXOffset && fValueXY == 0)))
1010  {
1011  if (assert)
1012  {
1013  ASSERT_FAIL("PartialADXY::Validate: Multiple-parameter combinations involving angle require "
1014  "an orthogonal angle and corresponding zero in the applied X/Y field.");
1015  }
1016  ok = kFalse;
1017  }
1018 
1019  if(!(IsSingleParameter()
1020  || fParamAD != kDistance
1021  || abs(fValueAD) >= abs(fValueXY)))
1022  {
1023  if (assert)
1024  {
1025  ASSERT_FAIL("PartialADXY::Validate: Multiparameter combos involving distance require that the "
1026  "abs of the distance be greater than the abs of the x/y parameter (can't have a "
1027  "hypotenuse greater than a leg of a right triangle).");
1028  }
1029  ok = kFalse;
1030  }
1031 
1032  return ok;
1033  }
1034 
1040  {
1041  fTarget = rhs.fTarget;
1042  fGroup = rhs.fGroup;
1043  fParamXY = rhs.fParamXY;
1044  fValueXY = rhs.fValueXY;
1045  fParamAD = rhs.fParamAD;
1046  fValueAD = rhs.fValueAD;
1047  return *this;
1048  }
1049 
1050  bool32 IsSingleParameter() const
1051  {
1052  return fParamXY == kInvalid || fParamAD == kInvalid;
1053  }
1054 
1055  public:
1058  WhichParameter fParamXY, fParamAD;
1059  PMReal fValueXY, fValueAD;
1060  };
1061 
1062  typedef K2Vector<PartialADXY> PartialADXYVector;
1063 
1064 public:
1065 
1066  //________________________________________________________________________________
1067  //________________________________________________________________________________
1068 
1073  virtual uint16 GetAttributeCount (ClassID attrClass) = 0;
1078  virtual uint16 GetAttributeCount (AttributeType attrType) = 0;
1079 
1080  // Attribute value accessors
1081  //________________________________________________________________________________
1086  virtual bool16 IsAttributeEnabled (ClassID attrClass) = 0;
1091  virtual bool16 IsAttributeEnabled (AttributeType attrType) = 0;
1092 
1101  virtual const IPMUnknown* QueryAttribute (uint32 whichAttribute, ClassID attrClass, const PMIID& interfaceID = IID_IUNKNOWN) = 0;
1102 
1111  virtual IPMUnknown* CreateAttributeCopy (uint32 whichAttribute, ClassID attrClass, const PMIID& interfaceID = IID_IUNKNOWN) = 0;
1112 
1118  virtual ErrorCode CopyIntoAttribute (uint32 whichAttribute, IPMUnknown* iAttribute) = 0;
1119 
1120  //________________________________________________________________________________
1121  // Returns the nth specific attribute value
1122  //________________________________________________________________________________
1128  virtual PMReal GetRealNumberAttributeValue (uint32 whichAttribute, AttributeType attrType) = 0;
1134  virtual bool16 GetBooleanAttributeValue (uint32 whichAttribute, AttributeType attrType) = 0;
1140  virtual int32 GetInt32AttributeValue (uint32 whichAttribute, AttributeType attrType) = 0;
1146  virtual UID GetUIDAttributeValue (uint32 whichAttribute, AttributeType attrType) = 0;
1147 
1153  virtual void GetAttributeValue (uint32 whichAttribute, AttributeType attrType, AttributeValue& value) = 0;
1154 
1179  virtual void GetAttributeValueLists (uint32 attrCount, const AttributeType* attrTypeArray, AttributeList** attrListArray) = 0;
1180 
1181  //________________________________________________________________________________
1182  //________________________________________________________________________________
1187  virtual bool16 IsAttributeUnique (ClassID attrClass) = 0;
1191  virtual bool16 IsAttributeUnique (AttributeType attrType) = 0;
1192 
1204  virtual ErrorCode ApplyAttributes (IGraphicStyleAttributeBossList* iAttrList,
1205  const PartialADXYVector* partialADXYs = nil,
1206  bool32 autoInitializeGradientFeatherGeometry = kFalse) = 0;
1207 
1219  virtual ErrorCode ApplyAttributes (const AttributeList& attrList,
1220  const PartialADXYVector* partialADXYs = nil,
1221  bool32 autoInitializeGradientFeatherGeometry = kFalse) = 0;
1222 
1229  virtual ErrorCode ApplyBasicAttributes (BasicAttributesData* basicData, const K2Vector<AttributeType>& attrTypeList) = 0;
1236  virtual ErrorCode ApplyDropShadowAttributes (DropShadowData* dropshadowData, const K2Vector<AttributeType>& attrTypeList) = 0;
1243  virtual ErrorCode ApplyVignetteAttributes (VignetteData* featherData, const K2Vector<AttributeType>& attrTypeList) = 0;
1244 
1255  virtual PMRect GetImageTrueBBox (void) = 0;
1256 
1260  virtual bool16 CanApplyAttributes (void) = 0;
1264  virtual bool16 CanApplyAttributes (const AttributeList& attrList) = 0;
1270  virtual bool16 CanApplyAttributes (AttributeGroup grp) = 0;
1274  virtual bool16 CanApplyBasicAttributes (void) = 0;
1278  virtual bool16 CanApplyDropShadowAttributes (void) = 0;
1282  virtual bool16 CanApplyVignetteAttributes (void) = 0;
1283 
1284 };
1285 
1286 DECLARE_BASE_TYPE(IXPAttributeSuite::AttributeType);
1287 
1288 
1289 #endif // __IXPAttributeSuite__
1290