24 #ifndef __IXPAttributeSuite__ 25 #define __IXPAttributeSuite__ 27 #include "ISelectionMessages.h" 28 #include "IXPSetVignetteCmdData.h" 29 #include "IXPSetBasicAttributesCmdData.h" 30 #include "IXPSetDropShadowCmdData.h" 31 #include "IOpacityGradientStops.h" 32 #include "GraphicTypes.h" 59 const PMReal kDefaultRealNumberValue = 0.0;
60 const int32 kDefaultInt32Value = 0;
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.;
82 const PMReal kXPInvalidRealNumberValue = -1.0;
83 const int32 kXPInvalidInt32Value = -1;
103 enum { kDefaultIID = IID_IXPATTRIBUTESUITE };
139 kGroupDirectionalFeather,
140 kGroupGradientFeather,
149 kDataTypeInvalid = -1,
153 kDataTypePMBlendingMode,
154 kDataTypePMDropShadowMode,
155 kDataTypePMVignetteMode,
156 kDataTypePMVignetteCorners,
157 kDataTypePMGlowTechnique,
158 kDataTypePMInnerGlowSource,
159 kDataTypePMBevelEmbossStyle,
160 kDataTypePMBevelEmbossTechnique,
161 kDataTypePMBevelEmbossDirection,
162 kDataTypePMFollowShapeMode,
163 kDataTypeGradientType,
164 kDataTypeOpacityGradientStops,
182 kRealKindEmbossDepth,
183 kRealKindSoftenAmount,
184 kRealKindFeatherWidth
207 AttributeValue() : fDataType(kDataTypeInvalid), fInt32Value(0), fRealValue(0), fUIDValue(kInvalidUID), fBoolValue(kFalse), fGradientValue(nil) {}
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) {}
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; }
240 void SetPointData(
const PMPoint& x) { fPointValue = x; }
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; }
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; }
267 const PMPoint& GetPMPoint()
const { ASSERT(fDataType == kDataTypePoint);
return fPointValue; }
270 AttributeValue& operator=(
const AttributeValue& rhs)
272 fDataType = rhs.fDataType;
273 fInt32Value = rhs.fInt32Value;
274 fRealValue = rhs.fRealValue;
275 fUIDValue = rhs.fUIDValue;
276 fBoolValue = rhs.fBoolValue;
277 fPointValue = rhs.fPointValue;
279 if (fGradientValue) fGradientValue->
Release();
280 fGradientValue = rhs.fGradientValue;
281 if (fGradientValue) fGradientValue->
AddRef();
286 bool operator==(
const AttributeValue& rhs)
const 288 if (fDataType != rhs.fDataType)
return kFalse;
292 return fUIDValue == rhs.fUIDValue;
293 case kDataTypeBoolean:
294 return fBoolValue == rhs.fBoolValue;
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)));
315 return fPointValue == rhs.fPointValue;
316 case kDataTypeInvalid:
322 bool operator!=(
const AttributeValue& rhs)
const 323 {
return !(*
this == rhs); }
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 ) 333 kUnknownAttrType = -1,
367 kDropShadowBaseID = BASE_XP_ATTR(kTargetPageItem, kGroupDropShadow),
369 kDropShadowUseGlobalLight,
373 kFeatherBaseID = BASE_XP_ATTR(kTargetPageItem, kGroupFeather),
377 kInnerShadowBaseID = BASE_XP_ATTR(kTargetPageItem, kGroupInnerShadow),
381 kInnerShadowBlendMode,
384 kInnerShadowDistance,
385 kInnerShadowUseGlobalLight,
390 kOuterGlowBaseID = BASE_XP_ATTR(kTargetPageItem, kGroupOuterGlow),
401 kInnerGlowBaseID = BASE_XP_ATTR(kTargetPageItem, kGroupInnerGlow),
413 kBevelEmbossBaseID = BASE_XP_ATTR(kTargetPageItem, kGroupBevelEmboss),
417 kBevelEmbossTechnique,
419 kBevelEmbossDirection,
423 kBevelEmbossAltitude,
424 kBevelEmbossUseGlobalLight,
425 kBevelEmbossHighlightColor,
426 kBevelEmbossHighlightBlendMode,
427 kBevelEmbossHighlightOpacity,
428 kBevelEmbossShadowColor,
429 kBevelEmbossShadowBlendMode,
430 kBevelEmbossShadowOpacity,
432 kSatinBaseID = BASE_XP_ATTR(kTargetPageItem, kGroupSatin),
443 kDirectionalFeatherBaseID = BASE_XP_ATTR(kTargetPageItem, kGroupDirectionalFeather),
445 kDirectionalFeatherApply,
446 kDirectionalFeatherWidthLeft,
447 kDirectionalFeatherWidthRight,
448 kDirectionalFeatherWidthTop,
449 kDirectionalFeatherWidthBottom,
450 kDirectionalFeatherAngle,
451 kDirectionalFeatherFollowShape,
452 kDirectionalFeatherNoise,
453 kDirectionalFeatherChoke,
455 kGradientFeatherBaseID = BASE_XP_ATTR(kTargetPageItem, kGroupGradientFeather),
457 kGradientFeatherApply,
458 kGradientFeatherType,
459 kGradientFeatherOpacityStops,
460 kGradientFeatherAngle,
461 kGradientFeatherLength,
462 kGradientFeatherCenter,
463 kGradientFeatherRadius,
464 kGradientFeatherHiliteAngle,
465 kGradientFeatherHiliteLength,
467 kStrokeBlendingBaseID = BASE_XP_ATTR(kTargetStroke, kGroupBlending),
469 kStrokeBlendingOpacity,
470 kStrokeBlendingBlendMode,
471 kStrokeBlendingKnockoutGroup,
472 kStrokeBlendingIsolationGroup,
474 kStrokeDropShadowBaseID = BASE_XP_ATTR(kTargetStroke, kGroupDropShadow),
476 kStrokeDropShadowMode,
477 kStrokeDropShadowOffsetX,
478 kStrokeDropShadowOffsetY,
479 kStrokeDropShadowOpacity,
480 kStrokeDropShadowBlendMode,
481 kStrokeDropShadowBlurRadius,
482 kStrokeDropShadowSpread,
483 kStrokeDropShadowNoise,
484 kStrokeDropShadowColor,
485 kStrokeDropShadowUseGlobalLight,
487 kStrokeDropShadowHonorFX,
489 kStrokeFeatherBaseID = BASE_XP_ATTR(kTargetStroke, kGroupFeather),
493 kStrokeFeatherCorners,
497 kStrokeInnerShadowBaseID = BASE_XP_ATTR(kTargetStroke, kGroupInnerShadow),
499 kStrokeInnerShadowApply,
500 kStrokeInnerShadowColor,
501 kStrokeInnerShadowBlendMode,
502 kStrokeInnerShadowOpacity,
503 kStrokeInnerShadowAngle,
504 kStrokeInnerShadowDistance,
505 kStrokeInnerShadowUseGlobalLight,
506 kStrokeInnerShadowChoke,
507 kStrokeInnerShadowSize,
508 kStrokeInnerShadowNoise,
510 kStrokeOuterGlowBaseID = BASE_XP_ATTR(kTargetStroke, kGroupOuterGlow),
512 kStrokeOuterGlowApply,
513 kStrokeOuterGlowBlendMode,
514 kStrokeOuterGlowOpacity,
515 kStrokeOuterGlowNoise,
516 kStrokeOuterGlowColor,
517 kStrokeOuterGlowTechnique,
518 kStrokeOuterGlowSpread,
519 kStrokeOuterGlowSize,
521 kStrokeInnerGlowBaseID = BASE_XP_ATTR(kTargetStroke, kGroupInnerGlow),
523 kStrokeInnerGlowApply,
524 kStrokeInnerGlowBlendMode,
525 kStrokeInnerGlowOpacity,
526 kStrokeInnerGlowNoise,
527 kStrokeInnerGlowColor,
528 kStrokeInnerGlowTechnique,
529 kStrokeInnerGlowSpread,
530 kStrokeInnerGlowSize,
531 kStrokeInnerGlowSource,
533 kStrokeBevelEmbossBaseID = BASE_XP_ATTR(kTargetStroke, kGroupBevelEmboss),
535 kStrokeBevelEmbossApply,
536 kStrokeBevelEmbossStyle,
537 kStrokeBevelEmbossTechnique,
538 kStrokeBevelEmbossDepth,
539 kStrokeBevelEmbossDirection,
540 kStrokeBevelEmbossSize,
541 kStrokeBevelEmbossSoften,
542 kStrokeBevelEmbossAngle,
543 kStrokeBevelEmbossAltitude,
544 kStrokeBevelEmbossUseGlobalLight,
545 kStrokeBevelEmbossHighlightColor,
546 kStrokeBevelEmbossHighlightBlendMode,
547 kStrokeBevelEmbossHighlightOpacity,
548 kStrokeBevelEmbossShadowColor,
549 kStrokeBevelEmbossShadowBlendMode,
550 kStrokeBevelEmbossShadowOpacity,
552 kStrokeSatinBaseID = BASE_XP_ATTR(kTargetStroke, kGroupSatin),
556 kStrokeSatinBlendMode,
559 kStrokeSatinDistance,
563 kStrokeDirectionalFeatherBaseID = BASE_XP_ATTR(kTargetStroke, kGroupDirectionalFeather),
565 kStrokeDirectionalFeatherApply,
566 kStrokeDirectionalFeatherWidthLeft,
567 kStrokeDirectionalFeatherWidthRight,
568 kStrokeDirectionalFeatherWidthTop,
569 kStrokeDirectionalFeatherWidthBottom,
570 kStrokeDirectionalFeatherAngle,
571 kStrokeDirectionalFeatherFollowShape,
572 kStrokeDirectionalFeatherNoise,
573 kStrokeDirectionalFeatherChoke,
575 kStrokeGradientFeatherBaseID = BASE_XP_ATTR(kTargetStroke, kGroupGradientFeather),
577 kStrokeGradientFeatherApply,
578 kStrokeGradientFeatherType,
579 kStrokeGradientFeatherOpacityStops,
580 kStrokeGradientFeatherAngle,
581 kStrokeGradientFeatherLength,
582 kStrokeGradientFeatherCenter,
583 kStrokeGradientFeatherRadius,
584 kStrokeGradientFeatherHiliteAngle,
585 kStrokeGradientFeatherHiliteLength,
587 kFillBlendingBaseID = BASE_XP_ATTR(kTargetFill, kGroupBlending),
589 kFillBlendingOpacity,
590 kFillBlendingBlendMode,
591 kFillBlendingKnockoutGroup,
592 kFillBlendingIsolationGroup,
594 kFillDropShadowBaseID = BASE_XP_ATTR(kTargetFill, kGroupDropShadow),
597 kFillDropShadowOffsetX,
598 kFillDropShadowOffsetY,
599 kFillDropShadowOpacity,
600 kFillDropShadowBlendMode,
601 kFillDropShadowBlurRadius,
602 kFillDropShadowSpread,
603 kFillDropShadowNoise,
604 kFillDropShadowColor,
605 kFillDropShadowUseGlobalLight,
607 kFillDropShadowHonorFX,
609 kFillFeatherBaseID = BASE_XP_ATTR(kTargetFill, kGroupFeather),
617 kFillInnerShadowBaseID = BASE_XP_ATTR(kTargetFill, kGroupInnerShadow),
619 kFillInnerShadowApply,
620 kFillInnerShadowColor,
621 kFillInnerShadowBlendMode,
622 kFillInnerShadowOpacity,
623 kFillInnerShadowAngle,
624 kFillInnerShadowDistance,
625 kFillInnerShadowUseGlobalLight,
626 kFillInnerShadowChoke,
627 kFillInnerShadowSize,
628 kFillInnerShadowNoise,
630 kFillOuterGlowBaseID = BASE_XP_ATTR(kTargetFill, kGroupOuterGlow),
633 kFillOuterGlowBlendMode,
634 kFillOuterGlowOpacity,
637 kFillOuterGlowTechnique,
638 kFillOuterGlowSpread,
641 kFillInnerGlowBaseID = BASE_XP_ATTR(kTargetFill, kGroupInnerGlow),
644 kFillInnerGlowBlendMode,
645 kFillInnerGlowOpacity,
648 kFillInnerGlowTechnique,
649 kFillInnerGlowSpread,
651 kFillInnerGlowSource,
653 kFillBevelEmbossBaseID = BASE_XP_ATTR(kTargetFill, kGroupBevelEmboss),
655 kFillBevelEmbossApply,
656 kFillBevelEmbossStyle,
657 kFillBevelEmbossTechnique,
658 kFillBevelEmbossDepth,
659 kFillBevelEmbossDirection,
660 kFillBevelEmbossSize,
661 kFillBevelEmbossSoften,
662 kFillBevelEmbossAngle,
663 kFillBevelEmbossAltitude,
664 kFillBevelEmbossUseGlobalLight,
665 kFillBevelEmbossHighlightColor,
666 kFillBevelEmbossHighlightBlendMode,
667 kFillBevelEmbossHighlightOpacity,
668 kFillBevelEmbossShadowColor,
669 kFillBevelEmbossShadowBlendMode,
670 kFillBevelEmbossShadowOpacity,
672 kFillSatinBaseID = BASE_XP_ATTR(kTargetFill, kGroupSatin),
683 kFillDirectionalFeatherBaseID = BASE_XP_ATTR(kTargetFill, kGroupDirectionalFeather),
685 kFillDirectionalFeatherApply,
686 kFillDirectionalFeatherWidthLeft,
687 kFillDirectionalFeatherWidthRight,
688 kFillDirectionalFeatherWidthTop,
689 kFillDirectionalFeatherWidthBottom,
690 kFillDirectionalFeatherAngle,
691 kFillDirectionalFeatherFollowShape,
692 kFillDirectionalFeatherNoise,
693 kFillDirectionalFeatherChoke,
695 kFillGradientFeatherBaseID = BASE_XP_ATTR(kTargetFill, kGroupGradientFeather),
697 kFillGradientFeatherApply,
698 kFillGradientFeatherType,
699 kFillGradientFeatherOpacityStops,
700 kFillGradientFeatherAngle,
701 kFillGradientFeatherLength,
702 kFillGradientFeatherCenter,
703 kFillGradientFeatherRadius,
704 kFillGradientFeatherHiliteAngle,
705 kFillGradientFeatherHiliteLength,
707 kContentBlendingBaseID = BASE_XP_ATTR(kTargetContent, kGroupBlending),
709 kContentBlendingOpacity,
710 kContentBlendingBlendMode,
711 kContentBlendingKnockoutGroup,
712 kContentBlendingIsolationGroup,
714 kContentDropShadowBaseID = BASE_XP_ATTR(kTargetContent, kGroupDropShadow),
716 kContentDropShadowMode,
717 kContentDropShadowOffsetX,
718 kContentDropShadowOffsetY,
719 kContentDropShadowOpacity,
720 kContentDropShadowBlendMode,
721 kContentDropShadowBlurRadius,
722 kContentDropShadowSpread,
723 kContentDropShadowNoise,
724 kContentDropShadowColor,
725 kContentDropShadowUseGlobalLight,
726 kContentDropShadowKO,
727 kContentDropShadowHonorFX,
729 kContentFeatherBaseID = BASE_XP_ATTR(kTargetContent, kGroupFeather),
732 kContentFeatherWidth,
733 kContentFeatherCorners,
734 kContentFeatherNoise,
735 kContentFeatherChoke,
737 kContentInnerShadowBaseID = BASE_XP_ATTR(kTargetContent, kGroupInnerShadow),
739 kContentInnerShadowApply,
740 kContentInnerShadowColor,
741 kContentInnerShadowBlendMode,
742 kContentInnerShadowOpacity,
743 kContentInnerShadowAngle,
744 kContentInnerShadowDistance,
745 kContentInnerShadowUseGlobalLight,
746 kContentInnerShadowChoke,
747 kContentInnerShadowSize,
748 kContentInnerShadowNoise,
750 kContentOuterGlowBaseID = BASE_XP_ATTR(kTargetContent, kGroupOuterGlow),
752 kContentOuterGlowApply,
753 kContentOuterGlowBlendMode,
754 kContentOuterGlowOpacity,
755 kContentOuterGlowNoise,
756 kContentOuterGlowColor,
757 kContentOuterGlowTechnique,
758 kContentOuterGlowSpread,
759 kContentOuterGlowSize,
761 kContentInnerGlowBaseID = BASE_XP_ATTR(kTargetContent, kGroupInnerGlow),
763 kContentInnerGlowApply,
764 kContentInnerGlowBlendMode,
765 kContentInnerGlowOpacity,
766 kContentInnerGlowNoise,
767 kContentInnerGlowColor,
768 kContentInnerGlowTechnique,
769 kContentInnerGlowSpread,
770 kContentInnerGlowSize,
771 kContentInnerGlowSource,
773 kContentBevelEmbossBaseID = BASE_XP_ATTR(kTargetContent, kGroupBevelEmboss),
775 kContentBevelEmbossApply,
776 kContentBevelEmbossStyle,
777 kContentBevelEmbossTechnique,
778 kContentBevelEmbossDepth,
779 kContentBevelEmbossDirection,
780 kContentBevelEmbossSize,
781 kContentBevelEmbossSoften,
782 kContentBevelEmbossAngle,
783 kContentBevelEmbossAltitude,
784 kContentBevelEmbossUseGlobalLight,
785 kContentBevelEmbossHighlightColor,
786 kContentBevelEmbossHighlightBlendMode,
787 kContentBevelEmbossHighlightOpacity,
788 kContentBevelEmbossShadowColor,
789 kContentBevelEmbossShadowBlendMode,
790 kContentBevelEmbossShadowOpacity,
792 kContentSatinBaseID = BASE_XP_ATTR(kTargetContent, kGroupSatin),
796 kContentSatinBlendMode,
797 kContentSatinOpacity,
799 kContentSatinDistance,
803 kContentDirectionalFeatherBaseID = BASE_XP_ATTR(kTargetContent, kGroupDirectionalFeather),
805 kContentDirectionalFeatherApply,
806 kContentDirectionalFeatherWidthLeft,
807 kContentDirectionalFeatherWidthRight,
808 kContentDirectionalFeatherWidthTop,
809 kContentDirectionalFeatherWidthBottom,
810 kContentDirectionalFeatherAngle,
811 kContentDirectionalFeatherFollowShape,
812 kContentDirectionalFeatherNoise,
813 kContentDirectionalFeatherChoke,
815 kContentGradientFeatherBaseID = BASE_XP_ATTR(kTargetContent, kGroupGradientFeather),
817 kContentGradientFeatherApply,
818 kContentGradientFeatherType,
819 kContentGradientFeatherOpacityStops,
820 kContentGradientFeatherAngle,
821 kContentGradientFeatherLength,
822 kContentGradientFeatherCenter,
823 kContentGradientFeatherRadius,
824 kContentGradientFeatherHiliteAngle,
825 kContentGradientFeatherHiliteLength,
839 : fType(kUnknownAttrType) {}
841 : fType(type), fValue(x) {}
843 : fType(type), fValue(x) {}
845 : fType(type), fValue(x) {}
847 : fType(type), fValue(x) {}
849 : fType(type), fValue(x) {}
851 : fType(type), fValue(x) {}
853 : fType(type), fValue(x) {}
855 : fType(type), fValue(x) {}
857 : fType(type), fValue(x) {}
859 : fType(type), fValue(x) {}
861 : fType(type), fValue(x) {}
863 : fType(type), fValue(x) {}
865 : fType(type), fValue(x) {}
867 : fType(type), fValue(x) {}
869 : fType(type), fValue(x) {}
871 : fType(type), fValue(x) {}
874 AttributeType GetType()
const {
return fType; }
879 { fType = rhs.GetType(); fValue = rhs.GetValue();
return *
this; }
881 {
return fType == rhs.fType && fValue == rhs.fValue; }
883 {
return !(*
this == rhs); }
905 typedef enum { kInvalid, kAngle, kDistance, kXOffset, kYOffset } WhichParameter;
922 WhichParameter param1,
924 WhichParameter param2 = kInvalid,
930 if (param1 == kInvalid)
932 ASSERT_FAIL(
"IXPSetAttributesCmdData::Sorry, param1 has to be valid.");
934 else if (param1 == kXOffset || param1 == kYOffset)
938 ASSERT(param2 == kAngle || param2 == kDistance || param2 == kInvalid);
946 ASSERT(param2 == kXOffset || param2 == kYOffset || param2 == kInvalid);
984 if (fGroup != IXPAttributeSuite::kGroupDropShadow
985 && fGroup != IXPAttributeSuite::kGroupInnerShadow)
989 ASSERT_FAIL(
"PartialADXY::Validate: Only drop shadows and inner shadows are supported groups.");
994 if ((fGroup == IXPAttributeSuite::kGroupDropShadow && fParamAD == kInvalid)
995 || (fGroup == IXPAttributeSuite::kGroupInnerShadow && fParamXY == kInvalid))
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).");
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)))
1013 ASSERT_FAIL(
"PartialADXY::Validate: Multiple-parameter combinations involving angle require " 1014 "an orthogonal angle and corresponding zero in the applied X/Y field.");
1019 if(!(IsSingleParameter()
1020 || fParamAD != kDistance
1021 || abs(fValueAD) >= abs(fValueXY)))
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).");
1041 fTarget = rhs.fTarget;
1042 fGroup = rhs.fGroup;
1043 fParamXY = rhs.fParamXY;
1044 fValueXY = rhs.fValueXY;
1045 fParamAD = rhs.fParamAD;
1046 fValueAD = rhs.fValueAD;
1050 bool32 IsSingleParameter()
const 1052 return fParamXY == kInvalid || fParamAD == kInvalid;
1058 WhichParameter fParamXY, fParamAD;
1059 PMReal fValueXY, fValueAD;
1153 virtual void GetAttributeValue (uint32 whichAttribute, AttributeType attrType, AttributeValue& value) = 0;
1179 virtual void GetAttributeValueLists (uint32 attrCount,
const AttributeType* attrTypeArray, AttributeList** attrListArray) = 0;
1205 const PartialADXYVector* partialADXYs = nil,
1206 bool32 autoInitializeGradientFeatherGeometry = kFalse) = 0;
1220 const PartialADXYVector* partialADXYs = nil,
1221 bool32 autoInitializeGradientFeatherGeometry = kFalse) = 0;
1286 DECLARE_BASE_TYPE(IXPAttributeSuite::AttributeType);
1289 #endif // __IXPAttributeSuite__