isetattr.cpp

Go to the documentation of this file.
00001 // $Id: isetattr.cpp 1361 2006-06-25 16:43:38Z alex $
00002 /* @@tag:xara-cn@@ DO NOT MODIFY THIS LINE
00003 ================================XARAHEADERSTART===========================
00004  
00005                Xara LX, a vector drawing and manipulation program.
00006                     Copyright (C) 1993-2006 Xara Group Ltd.
00007        Copyright on certain contributions may be held in joint with their
00008               respective authors. See AUTHORS file for details.
00009 
00010 LICENSE TO USE AND MODIFY SOFTWARE
00011 ----------------------------------
00012 
00013 This file is part of Xara LX.
00014 
00015 Xara LX is free software; you can redistribute it and/or modify it
00016 under the terms of the GNU General Public License version 2 as published
00017 by the Free Software Foundation.
00018 
00019 Xara LX and its component source files are distributed in the hope
00020 that it will be useful, but WITHOUT ANY WARRANTY; without even the
00021 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00022 See the GNU General Public License for more details.
00023 
00024 You should have received a copy of the GNU General Public License along
00025 with Xara LX (see the file GPL in the root directory of the
00026 distribution); if not, write to the Free Software Foundation, Inc., 51
00027 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
00028 
00029 
00030 ADDITIONAL RIGHTS
00031 -----------------
00032 
00033 Conditional upon your continuing compliance with the GNU General Public
00034 License described above, Xara Group Ltd grants to you certain additional
00035 rights. 
00036 
00037 The additional rights are to use, modify, and distribute the software
00038 together with the wxWidgets library, the wxXtra library, and the "CDraw"
00039 library and any other such library that any version of Xara LX relased
00040 by Xara Group Ltd requires in order to compile and execute, including
00041 the static linking of that library to XaraLX. In the case of the
00042 "CDraw" library, you may satisfy obligation under the GNU General Public
00043 License to provide source code by providing a binary copy of the library
00044 concerned and a copy of the license accompanying it.
00045 
00046 Nothing in this section restricts any of the rights you have under
00047 the GNU General Public License.
00048 
00049 
00050 SCOPE OF LICENSE
00051 ----------------
00052 
00053 This license applies to this program (XaraLX) and its constituent source
00054 files only, and does not necessarily apply to other Xara products which may
00055 in part share the same code base, and are subject to their own licensing
00056 terms.
00057 
00058 This license does not apply to files in the wxXtra directory, which
00059 are built into a separate library, and are subject to the wxWindows
00060 license contained within that directory in the file "WXXTRA-LICENSE".
00061 
00062 This license does not apply to the binary libraries (if any) within
00063 the "libs" directory, which are subject to a separate license contained
00064 within that directory in the file "LIBS-LICENSE".
00065 
00066 
00067 ARRANGEMENTS FOR CONTRIBUTION OF MODIFICATIONS
00068 ----------------------------------------------
00069 
00070 Subject to the terms of the GNU Public License (see above), you are
00071 free to do whatever you like with your modifications. However, you may
00072 (at your option) wish contribute them to Xara's source tree. You can
00073 find details of how to do this at:
00074   http://www.xaraxtreme.org/developers/
00075 
00076 Prior to contributing your modifications, you will need to complete our
00077 contributor agreement. This can be found at:
00078   http://www.xaraxtreme.org/developers/contribute/
00079 
00080 Please note that Xara will not accept modifications which modify any of
00081 the text between the start and end of this header (marked
00082 XARAHEADERSTART and XARAHEADEREND).
00083 
00084 
00085 MARKS
00086 -----
00087 
00088 Xara, Xara LX, Xara X, Xara X/Xtreme, Xara Xtreme, the Xtreme and Xara
00089 designs are registered or unregistered trademarks, design-marks, and/or
00090 service marks of Xara Group Ltd. All rights in these marks are reserved.
00091 
00092 
00093       Xara Group Ltd, Gaddesden Place, Hemel Hempstead, HP2 6EX, UK.
00094                         http://www.xara.com/
00095 
00096 =================================XARAHEADEREND============================
00097  */
00098 // isetattr.cpp - Imagesetting attributes (Overprint line/fill, Print on all plates)
00099 
00100 #include "camtypes.h"
00101 
00102 //#include "attrmgr.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00103 #include "isetattr.h"
00104 //#include "isetres.h"
00105 //#include "rndrgn.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00106 
00107 // Native file load/save includes
00108 //#include "camfiltr.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00109 //#include "cxfdefs.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00110 //#include "cxfrec.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00111 #include "cxftags.h"
00112 //#include "tim.h"          // For _R(IDE_FILE_WRITE_ERROR)
00113 
00114 
00115 // Base classes
00116 CC_IMPLEMENT_DYNAMIC(ImagesettingAttrValue, AttributeValue)
00117 CC_IMPLEMENT_DYNCREATE(AttrImagesetting, NodeAttribute)
00118 
00119 // Overprint line
00120 CC_IMPLEMENT_DYNCREATE(OverprintLineAttrValue, ImagesettingAttrValue)
00121 CC_IMPLEMENT_DYNCREATE(AttrOverprintLine, AttrImagesetting)
00122 
00123 // Overprint fill
00124 CC_IMPLEMENT_DYNCREATE(OverprintFillAttrValue, ImagesettingAttrValue)
00125 CC_IMPLEMENT_DYNCREATE(AttrOverprintFill, AttrImagesetting)
00126 
00127 // Print on all plates
00128 CC_IMPLEMENT_DYNCREATE(PrintOnAllPlatesAttrValue, ImagesettingAttrValue)
00129 CC_IMPLEMENT_DYNCREATE(AttrPrintOnAllPlates, AttrImagesetting)
00130 
00131 // Version 2 file format loading handler for all Imagesetting attributes
00132 CC_IMPLEMENT_DYNAMIC(ImagesettingAttrRecordHandler, CamelotRecordHandler);
00133 
00134 
00135 
00136 // Declare smart memory handling in Debug builds
00137 #define new CAM_DEBUG_NEW
00138 
00139 
00140 
00141 /********************************************************************************************
00142 
00143 >   AttrImagesetting::AttrImagesetting()
00144 
00145     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
00146     Created:    23/7/96
00147 
00148     Purpose:    Default constructor for AttrImagesetting
00149 
00150 ********************************************************************************************/
00151 
00152 AttrImagesetting::AttrImagesetting()
00153 {
00154 }
00155 
00156 
00157 
00158 /********************************************************************************************
00159 
00160 >   AttrImagesetting::AttrImagesetting(Node *ContextNode,
00161                                         AttachNodeDirection Direction,
00162                                         BOOL Locked,
00163                                         BOOL Mangled,
00164                                         BOOL Marked,
00165                                         BOOL Selected)
00166     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
00167     Created:    23/7/96
00168 
00169     Purpose:    Constructs an AttrImagesetting Attribute
00170 
00171 ********************************************************************************************/
00172 
00173 AttrImagesetting::AttrImagesetting(Node *ContextNode,
00174                                     AttachNodeDirection Direction,
00175                                     BOOL Locked,
00176                                     BOOL Mangled,
00177                                     BOOL Marked,
00178                                     BOOL Selected)
00179                 : NodeAttribute(ContextNode, Direction, Locked, Mangled, Marked, Selected)
00180 {
00181 }
00182 
00183 
00184 
00185 /********************************************************************************************
00186 
00187 >   virtual void AttrImagesetting::Render(RenderRegion *pRender)
00188 
00189     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
00190     Created:    23/7/96
00191 
00192     Purpose:    Renders this attribute (by simply calling the Render function of
00193                 its contained AttributeValue)
00194 
00195 ********************************************************************************************/
00196 
00197 void AttrImagesetting::Render(RenderRegion *pRender)
00198 {
00199     GetAttributeValue()->Render(pRender);
00200 }
00201 
00202 
00203 
00204 /***********************************************************************************************
00205 
00206 >   virtual void AttrImagesetting::CopyNodeContents(AttrImagesetting *NodeCopy)
00207 
00208     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
00209     Created:    23/7/96
00210 
00211     Outputs:    NodeCopy - returned containing a copy of this node
00212          
00213     Purpose:    Copies the node's contents to the node pointed to by NodeCopy
00214 
00215 ***********************************************************************************************/
00216 
00217 void AttrImagesetting::CopyNodeContents(AttrImagesetting *NodeCopy)
00218 {
00219     // Let the base class do its bit
00220     NodeAttribute::CopyNodeContents(NodeCopy);
00221 
00222     // And then copy our Value
00223     *(NodeCopy->GetAttributeValue()) = *(GetAttributeValue());
00224 }
00225 
00226 
00227 
00228 /***********************************************************************************************
00229 >   void AttrImagesetting::PolyCopyNodeContents(NodeRenderable* pNodeCopy)
00230 
00231     Author:     Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
00232     Created:    18/12/2003
00233     Outputs:    -
00234     Purpose:    Polymorphically copies the contents of this node to another
00235     Errors:     An assertion failure will occur if NodeCopy is NULL
00236     Scope:      protected
00237                                      
00238 ***********************************************************************************************/
00239 
00240 void AttrImagesetting::PolyCopyNodeContents(NodeRenderable* pNodeCopy)
00241 {
00242     ENSURE(pNodeCopy, "Trying to copy a node's contents into a NULL node");
00243     ENSURE(IS_A(pNodeCopy, AttrImagesetting), "PolyCopyNodeContents given wrong dest node type");
00244 
00245     if (IS_A(pNodeCopy, AttrImagesetting))
00246         CopyNodeContents((AttrImagesetting*)pNodeCopy);
00247 }
00248 
00249 
00250 
00251 
00252 
00253 
00254 
00255 
00256 
00257 
00258 
00259 
00260 
00261 
00262 
00263 /********************************************************************************************
00264 
00265 >   OverprintLineAttrValue::OverprintLineAttrValue()
00266 
00267     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
00268     Created:    23/7/96
00269 
00270     Purpose:    Default Constuctor for OverprintLineAttrValue
00271                 The Overprint state is set to FALSE
00272 
00273 ********************************************************************************************/
00274 
00275 OverprintLineAttrValue::OverprintLineAttrValue()
00276 {
00277     OverprintOn = FALSE;
00278 } 
00279 
00280 
00281 
00282 /********************************************************************************************
00283 
00284 >   OverprintLineAttrValue::OverprintLineAttrValue(BOOL OverprintIsOn)
00285 
00286     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
00287     Created:    23/7/96
00288 
00289     Inputs:     OverprintIsOn - Initial state of line overprint for this attribute
00290 
00291     Purpose:    OverprintLineAttrValue constructor
00292 
00293 ********************************************************************************************/
00294 
00295 OverprintLineAttrValue::OverprintLineAttrValue(BOOL OverprintIsOn)
00296 { 
00297     OverprintOn = OverprintIsOn;
00298 }
00299 
00300 
00301 
00302 /********************************************************************************************
00303 
00304 >   BOOL OverprintLineAttrValue::Init(void)
00305 
00306     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
00307     Created:    23/7/96
00308 
00309     Returns:    TRUE if it initilised successfully
00310 
00311     Purpose:    Registers a default attribute of this type with the attribute manager
00312 
00313 ********************************************************************************************/
00314 
00315 BOOL OverprintLineAttrValue::Init(void)
00316 {
00317     OverprintLineAttrValue *pAttr = new OverprintLineAttrValue;
00318     if (pAttr == NULL)
00319         return FALSE;
00320 
00321     UINT32 ID = AttributeManager::RegisterDefaultAttribute(CC_RUNTIME_CLASS(OverprintLineAttrValue),
00322                                                             pAttr);
00323 
00324     ERROR2IF(ID == ATTR_BAD_ID, FALSE, "Bad ID when Initialising OverprintLineAttrValue");
00325 
00326     return(TRUE);
00327 }
00328 
00329 
00330 
00331 /********************************************************************************************
00332 
00333 >   virtual void OverprintLineAttrValue::Render(RenderRegion *pRegion, BOOL Temp)
00334 
00335     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
00336     Created:    23/7/96
00337 
00338     Inputs:     pRegion - the render region to render this attribute into.
00339 
00340     Purpose:    Sets the OverprintLineAttrValue attribute for the given render region.
00341 
00342     Notes:      This attribute is so simple that its state can be read directly off
00343                 the render region's stack. Thus, there is minimal special render region
00344                 support for this attribute - we just stack and unstack it directly here.
00345 
00346 ********************************************************************************************/
00347 
00348 void OverprintLineAttrValue::Render(RenderRegion *pRegion, BOOL Temp)
00349 {
00350     // Stack the current overprint attribute and set ourselves up as the new one
00351     pRegion->SetLineOverprint(this, Temp);
00352 }
00353 
00354 
00355 
00356 /********************************************************************************************
00357 
00358 >   virtual void OverprintLineAttrValue::Restore(RenderRegion *pRegion, BOOL Temp)
00359 
00360     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
00361     Created:    23/7/96
00362 
00363     Inputs:     pRegion - the render region to restore the attribute into.
00364                 Temp    - TRUE if this is a temporary attribute, FALSE if it is
00365                           permanent (e.g. it's in a document tree).
00366 
00367     Purpose:    Restores the OverprintLineAttrValue attribute for the given render region. 
00368 
00369     Notes:      This attribute is so simple that its state can be read directly off
00370                 the render region's stack. Thus, there is minimal special render region
00371                 support for this attribute - we just stack and unstack it directly here.
00372 
00373 ********************************************************************************************/
00374 
00375 void OverprintLineAttrValue::Restore(RenderRegion *pRegion, BOOL Temp)
00376 {
00377     pRegion->RestoreLineOverprint(this, Temp);
00378 }
00379 
00380 
00381 
00382 /********************************************************************************************
00383 
00384 >   virtual void OverprintLineAttrValue::SimpleCopy(AttributeValue *pValue)
00385 
00386     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
00387     Created:    23/7/96
00388 
00389     Inputs:     pValue - pointer to the AttributeValue to copy
00390 
00391     Purpose:    See AttributeValue::SimpleCopy
00392 
00393 ********************************************************************************************/
00394 
00395 void OverprintLineAttrValue::SimpleCopy(AttributeValue *pValue)
00396 {
00397     ERROR3IF(!IS_A(pValue, OverprintLineAttrValue),
00398                 "Invalid Attribute value passed to OverprintLineAttrValue::SimpleCopy");
00399 
00400     // Just uses the assignment operator
00401     *this = *((OverprintLineAttrValue *) pValue);
00402 }
00403 
00404 
00405 
00406 /********************************************************************************************
00407 
00408 >   virtual NodeAttribute *OverprintLineAttrValue::MakeNode()
00409 
00410     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
00411     Created:    23/7/96
00412 
00413     Returns:    Pointer to the new node, or NULL if out of memory.
00414 
00415     Purpose:    Make a new attribute node for this type of attr value - see base class
00416 
00417     SeeAlso:    AttributeValue::MakeNode
00418 
00419 ********************************************************************************************/
00420 
00421 NodeAttribute *OverprintLineAttrValue::MakeNode()
00422 {
00423     // Create new attribute node
00424     AttrOverprintLine *pAttr = new AttrOverprintLine();
00425     if (pAttr == NULL)
00426         return NULL;
00427 
00428     // Copy attribute value into the new node.
00429     pAttr->Value.SimpleCopy(this);
00430 
00431     return(pAttr);
00432 }
00433 
00434 
00435 
00436 /********************************************************************************************
00437 
00438 >   virtual BOOL OverprintLineAttrValue::IsDifferent(AttributeValue *pAttr)
00439 
00440     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
00441     Created:    23/7/96
00442 
00443     Purpose:    Determines if this AttrValue is different from the given one
00444 
00445     Errors:     ERROR3 if the two attributes are not of the same type
00446 
00447     SeeAlso:    AttributeValue::IsDifferent
00448 
00449 ********************************************************************************************/
00450 
00451 BOOL OverprintLineAttrValue::IsDifferent(AttributeValue *pAttr)
00452 {
00453     ERROR3IF(!pAttr->IsKindOf(CC_RUNTIME_CLASS(OverprintLineAttrValue)),
00454                 "Different attribute types in OverprintLineAttrValue::IsDifferent()");
00455 
00456     // Check they are NOT the same using the == operator
00457     return ( !(*((OverprintLineAttrValue *)pAttr) == *this) );
00458 }
00459 
00460 
00461 
00462 /********************************************************************************************
00463 
00464 >   virtual OverprintLineAttrValue &OverprintLineAttrValue::operator=(OverprintLineAttrValue &Attrib)
00465 
00466     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
00467     Created:    23/7/96
00468 
00469     Inputs:     Attrib - the attribute to copy
00470 
00471     Purpose:    Assignment operator
00472 
00473 ********************************************************************************************/
00474 
00475 OverprintLineAttrValue &OverprintLineAttrValue::operator=(OverprintLineAttrValue &Attrib)
00476 {
00477     OverprintOn = Attrib.OverprintOn;
00478 
00479     return(*this);
00480 }
00481 
00482 
00483 
00484 /********************************************************************************************
00485 
00486 >   virtual INT32 OverprintLineAttrValue::operator==(const ImagesettingAttrValue &Attrib)
00487 
00488     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
00489     Created:    23/7/96
00490 
00491     Inputs:     Attrib - the attribute to compare this attribute with
00492 
00493     Returns:    TRUE if the attributes are considered equal
00494 
00495     Purpose:    Comparison operator
00496 
00497 ********************************************************************************************/
00498 
00499 INT32 OverprintLineAttrValue::operator==(const ImagesettingAttrValue &Attrib)
00500 {
00501     ERROR3IF(!Attrib.IsKindOf(CC_RUNTIME_CLASS(OverprintLineAttrValue)),
00502                 "Other attribute value isn't an OverprintLineAttrValue");
00503 
00504     OverprintLineAttrValue *Other = (OverprintLineAttrValue *) &Attrib;
00505     return(Other->OverprintOn == OverprintOn);
00506 }
00507 
00508 
00509 
00510 
00511 
00512 
00513 
00514 
00515 
00516 
00517 
00518 
00519 
00520 /********************************************************************************************
00521 
00522 >   AttrOverprintLine::AttrOverprintLine()
00523 
00524     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
00525     Created:    23/7/96
00526 
00527     Purpose:    Default constructor for AttrOverprintLine
00528 
00529 ********************************************************************************************/
00530 
00531 AttrOverprintLine::AttrOverprintLine()
00532 {
00533 }
00534 
00535 
00536 
00537 /********************************************************************************************
00538 
00539 >   AttrOverprintLine::AttrOverprintLine(Node *ContextNode,
00540                                         AttachNodeDirection Direction,
00541                                         BOOL Locked,
00542                                         BOOL Mangled,
00543                                         BOOL Marked,
00544                                         BOOL Selected)
00545     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
00546     Created:    23/7/96
00547 
00548     Purpose:    Constructs an AttrOverprintLine Attribute
00549 
00550 ********************************************************************************************/
00551 
00552 AttrOverprintLine::AttrOverprintLine(Node *ContextNode,
00553                                     AttachNodeDirection Direction,
00554                                     BOOL Locked,
00555                                     BOOL Mangled,
00556                                     BOOL Marked,
00557                                     BOOL Selected)
00558                 : AttrImagesetting(ContextNode, Direction, Locked, Mangled, Marked, Selected)
00559 {
00560 }
00561 
00562 
00563 
00564 /********************************************************************************************
00565 
00566 >   virtual Node *AttrOverprintLine::SimpleCopy()
00567 
00568     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
00569     Created:    24/7/96
00570 
00571     Returns:    A copy of the node, or NULL if memory runs out 
00572 
00573     Purpose:    This method returns a shallow copy of the node with all Node pointers NULL. 
00574                 The function is virtual, and must be defined for all derived classes.  
00575 
00576 ********************************************************************************************/
00577 
00578 Node *AttrOverprintLine::SimpleCopy()
00579 {
00580     AttrOverprintLine* NodeCopy = new AttrOverprintLine;
00581     if (NodeCopy == NULL)
00582         return(NULL);
00583 
00584     // Call the base class
00585     NodeAttribute::CopyNodeContents(NodeCopy);
00586 
00587     // And call our AttributeValue to copy itself too
00588     NodeCopy->GetAttributeValue()->SimpleCopy(GetAttributeValue());
00589     
00590     return(NodeCopy);
00591 }
00592 
00593 
00594 
00595 /********************************************************************************************
00596 
00597 >   virtual UINT32 AttrOverprintLine::GetAttrNameID(void)
00598 
00599     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
00600     Created:    23/7/96
00601 
00602     Returns:    Attribute description string-resource ID
00603 
00604     Purpose:    Retrieves a string resource ID describing this attribute
00605 
00606 ********************************************************************************************/
00607 
00608 UINT32 AttrOverprintLine::GetAttrNameID(void)
00609 {
00610     return(_R(IDS_ATTROVERPRINTLINE));
00611 }
00612 
00613 
00614 
00615 /********************************************************************************************
00616 
00617 >   virtual void AttrOverprintLine::GetDebugDetails(StringBase *Str)
00618 
00619     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
00620     Created:    23/7/96
00621 
00622     Outputs:    On return, Str is filled in with details on this node
00623 
00624     Purpose:    Produces debug details about this node
00625 
00626 ********************************************************************************************/
00627 
00628 void AttrOverprintLine::GetDebugDetails(StringBase *Str)
00629 {
00630 #ifdef _DEBUG
00631     NodeAttribute::GetDebugDetails(Str);
00632 
00633     String_256 TempStr;
00634     TempStr._MakeMsg( _T("\r\nOverprint of Lines is #1%s\r\n"), (Value.IsOverprintOn()) ? _T("ON") : _T("OFF") );
00635     *Str += TempStr;
00636 #endif
00637 }
00638 
00639 
00640 
00641 /********************************************************************************************
00642 
00643 >   virtual UINT32 AttrOverprintLine::GetNodeSize() const
00644 
00645     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
00646     Created:    23/7/96
00647 
00648     Returns:    The size of this node, in bytes
00649 
00650     Purpose:    For finding the size of the node, in bytes
00651 
00652 ********************************************************************************************/
00653 
00654 UINT32 AttrOverprintLine::GetNodeSize() const
00655 {
00656     return(sizeof(AttrOverprintLine));
00657 }
00658 
00659 
00660 
00661 /***********************************************************************************************
00662 
00663 >   virtual INT32 AttrOverprintLine::operator==(const NodeAttribute &NodeAttrib); 
00664 
00665     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
00666     Created:    23/7/96
00667 
00668     Inputs:     NodeAttrib - The node to compare this node to
00669     Returns:    TRUE if the nodes are considered equal
00670 
00671     Purpose:    Comparison operator - determines if the AttributeValues of both objects are ==
00672 
00673 ***********************************************************************************************/
00674 
00675 INT32 AttrOverprintLine::operator==(const NodeAttribute &NodeAttrib)
00676 {
00677     // First check they are of the same type
00678     if (((NodeAttribute*)&NodeAttrib)->GetAttributeType() != GetAttributeType())
00679         return FALSE;
00680 
00681     // Make a more sensible pointer
00682     AttrOverprintLine *Attr = (AttrOverprintLine *) &NodeAttrib;
00683 
00684     // Now let the AttributeValues compare themselves
00685     return( *((OverprintLineAttrValue *) Attr->GetAttributeValue())  ==
00686             *((OverprintLineAttrValue *) GetAttributeValue()) );
00687 }
00688 
00689 
00690 
00691 /********************************************************************************************
00692 
00693 >   virtual BOOL AttrOverprintLine::WritePreChildrenWeb(BaseCamelotFilter *pFilter)
00694 >   virtual BOOL AttrOverprintLine::WritePreChildrenNative(BaseCamelotFilter *pFilter)
00695 
00696     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
00697     Created:    26/7/96
00698 
00699     Inputs:     pFilter - filter to write to
00700 
00701     Returns:    TRUE if the Node has written out a record to the filter
00702 
00703     Purpose:    Writes out a record that represents the node, to either Native or Web
00704                 file format.
00705 
00706                 This function is called before any of the AttrOverprintLine's children
00707                 are written to the filter.
00708 
00709                 If the AttrOverprintLine writes out a record successfully to the file,
00710                 it will return TRUE.
00711 
00712                 If the AttrOverprintLine chooses not to write itself to the filter
00713                 (e.g. because it is not appropriate for this filter), then this
00714                 function will return FALSE.
00715 
00716     SeeAlso:    Node::WritePreChildrenNative; Node::WritePreChildrenWeb;
00717                 ImagesettingAttrRecordHandler::HandleRecord
00718 
00719 ********************************************************************************************/
00720 
00721 BOOL AttrOverprintLine::WritePreChildrenWeb(BaseCamelotFilter *pFilter)
00722 {
00723 #ifdef DO_EXPORT
00724     // Imagesetting attributes are not saved in the web file format
00725     return FALSE;
00726 #else
00727     return FALSE;
00728 #endif
00729 }
00730 
00731 BOOL AttrOverprintLine::WritePreChildrenNative(BaseCamelotFilter *pFilter)
00732 {
00733 #ifdef DO_EXPORT
00734     ERROR3IF(pFilter == NULL, "Illegal NULL param");
00735 
00736     CamelotFileRecord *Rec = NULL;
00737     if (Value.IsOverprintOn())
00738         Rec = new CamelotFileRecord(pFilter, TAG_OVERPRINTLINEON, TAG_OVERPRINTLINEON_SIZE);
00739     else
00740         Rec = new CamelotFileRecord(pFilter, TAG_OVERPRINTLINEOFF, TAG_OVERPRINTLINEOFF_SIZE);
00741 
00742     BOOL ok = (Rec != NULL);
00743 
00744     if (ok) ok = Rec->Init();
00745     if (ok) ok = pFilter->Write(Rec);
00746 
00747     if (!ok)
00748         pFilter->GotError(_R(IDE_FILE_WRITE_ERROR));
00749 
00750     if (Rec != NULL)        // We've written the record - now delete it
00751         delete Rec;
00752 
00753     return(ok);
00754 #else
00755     return FALSE;
00756 #endif
00757 }
00758 
00759 
00760 
00761 
00762 
00763 
00764 
00765 
00766 
00767 
00768 
00769 
00770 /********************************************************************************************
00771 
00772 >   OverprintFillAttrValue::OverprintFillAttrValue()
00773 
00774     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
00775     Created:    23/7/96
00776 
00777     Purpose:    Default Constuctor for OverprintFillAttrValue
00778                 The Overprint state is set to FALSE
00779 
00780 ********************************************************************************************/
00781 
00782 OverprintFillAttrValue::OverprintFillAttrValue()
00783 {
00784     OverprintOn = FALSE;
00785 } 
00786 
00787 
00788 
00789 /********************************************************************************************
00790 
00791 >   OverprintFillAttrValue::OverprintFillAttrValue(BOOL OverprintIsOn)
00792 
00793     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
00794     Created:    23/7/96
00795 
00796     Inputs:     OverprintIsOn - Initial state of Fill overprint for this attribute
00797 
00798     Purpose:    OverprintFillAttrValue constructor
00799 
00800 ********************************************************************************************/
00801 
00802 OverprintFillAttrValue::OverprintFillAttrValue(BOOL OverprintIsOn)
00803 { 
00804     OverprintOn = OverprintIsOn;
00805 }
00806 
00807 
00808 
00809 /********************************************************************************************
00810 
00811 >   BOOL OverprintFillAttrValue::Init(void)
00812 
00813     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
00814     Created:    23/7/96
00815 
00816     Returns:    TRUE if it initilised successfully
00817 
00818     Purpose:    Registers a default attribute of this type with the attribute manager
00819 
00820 ********************************************************************************************/
00821 
00822 BOOL OverprintFillAttrValue::Init(void)
00823 {
00824     OverprintFillAttrValue *pAttr = new OverprintFillAttrValue;
00825     if (pAttr == NULL)
00826         return FALSE;
00827 
00828     UINT32 ID = AttributeManager::RegisterDefaultAttribute(CC_RUNTIME_CLASS(OverprintFillAttrValue),
00829                                                             pAttr);
00830 
00831     ERROR2IF(ID == ATTR_BAD_ID, FALSE, "Bad ID when Initialising OverprintFillAttrValue");
00832 
00833     return(TRUE);
00834 }
00835 
00836 
00837 
00838 /********************************************************************************************
00839 
00840 >   virtual void OverprintFillAttrValue::Render(RenderRegion *pRegion, BOOL Temp)
00841 
00842     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
00843     Created:    23/7/96
00844 
00845     Inputs:     pRegion - the render region to render this attribute into.
00846 
00847     Purpose:    Sets the OverprintFillAttrValue attribute for the given render region.
00848 
00849     Notes:      This attribute is so simple that its state can be read directly off
00850                 the render region's stack. Thus, there is minimal special render region
00851                 support for this attribute - we just stack and unstack it directly here.
00852 
00853 ********************************************************************************************/
00854 
00855 void OverprintFillAttrValue::Render(RenderRegion *pRegion, BOOL Temp)
00856 {
00857     // Stack the current overprint attribute and set ourselves up as the new one
00858     pRegion->SetFillOverprint(this, Temp);
00859 }
00860 
00861 
00862 
00863 /********************************************************************************************
00864 
00865 >   virtual void OverprintFillAttrValue::Restore(RenderRegion *pRegion, BOOL Temp)
00866 
00867     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
00868     Created:    23/7/96
00869 
00870     Inputs:     pRegion - the render region to restore the attribute into.
00871                 Temp    - TRUE if this is a temporary attribute, FALSE if it is
00872                           permanent (e.g. it's in a document tree).
00873 
00874     Purpose:    Restores the OverprintFillAttrValue attribute for the given render region. 
00875 
00876     Notes:      This attribute is so simple that its state can be read directly off
00877                 the render region's stack. Thus, there is minimal special render region
00878                 support for this attribute - we just stack and unstack it directly here.
00879 
00880 ********************************************************************************************/
00881 
00882 void OverprintFillAttrValue::Restore(RenderRegion *pRegion, BOOL Temp)
00883 {
00884     pRegion->RestoreFillOverprint(this, Temp);
00885 }
00886 
00887 
00888 
00889 /********************************************************************************************
00890 
00891 >   virtual void OverprintFillAttrValue::SimpleCopy(AttributeValue *pValue)
00892 
00893     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
00894     Created:    23/7/96
00895 
00896     Inputs:     pValue - pointer to the AttributeValue to copy
00897 
00898     Purpose:    See AttributeValue::SimpleCopy
00899 
00900 ********************************************************************************************/
00901 
00902 void OverprintFillAttrValue::SimpleCopy(AttributeValue *pValue)
00903 {
00904     ERROR3IF(!IS_A(pValue, OverprintFillAttrValue),
00905                 "Invalid Attribute value passed to OverprintFillAttrValue::SimpleCopy");
00906 
00907     // Just uses the assignment operator
00908     *this = *((OverprintFillAttrValue *) pValue);
00909 }
00910 
00911 
00912 
00913 /********************************************************************************************
00914 
00915 >   virtual NodeAttribute *OverprintFillAttrValue::MakeNode()
00916 
00917     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
00918     Created:    23/7/96
00919 
00920     Returns:    Pointer to the new node, or NULL if out of memory.
00921 
00922     Purpose:    Make a new attribute node for this type of attr value - see base class
00923 
00924     SeeAlso:    AttributeValue::MakeNode
00925 
00926 ********************************************************************************************/
00927 
00928 NodeAttribute *OverprintFillAttrValue::MakeNode()
00929 {
00930     // Create new attribute node
00931     AttrOverprintFill *pAttr = new AttrOverprintFill();
00932     if (pAttr == NULL)
00933         return NULL;
00934 
00935     // Copy attribute value into the new node.
00936     pAttr->Value.SimpleCopy(this);
00937 
00938     return(pAttr);
00939 }
00940 
00941 
00942 
00943 /********************************************************************************************
00944 
00945 >   virtual BOOL OverprintFillAttrValue::IsDifferent(AttributeValue *pAttr)
00946 
00947     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
00948     Created:    23/7/96
00949 
00950     Purpose:    Determines if this AttrValue is different from the given one
00951 
00952     Errors:     ERROR3 if the two attributes are not of the same type
00953 
00954     SeeAlso:    AttributeValue::IsDifferent
00955 
00956 ********************************************************************************************/
00957 
00958 BOOL OverprintFillAttrValue::IsDifferent(AttributeValue *pAttr)
00959 {
00960     ERROR3IF(!pAttr->IsKindOf(CC_RUNTIME_CLASS(OverprintFillAttrValue)),
00961                 "Different attribute types in OverprintFillAttrValue::IsDifferent()");
00962 
00963     // Check they are NOT the same using the == operator
00964     return ( !(*((OverprintFillAttrValue *)pAttr) == *this) );
00965 }
00966 
00967 
00968 
00969 /********************************************************************************************
00970 
00971 >   virtual OverprintFillAttrValue &OverprintFillAttrValue::operator=(OverprintFillAttrValue &Attrib)
00972 
00973     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
00974     Created:    23/7/96
00975 
00976     Inputs:     Attrib - the attribute to copy
00977 
00978     Purpose:    Assignment operator
00979 
00980 ********************************************************************************************/
00981 
00982 OverprintFillAttrValue &OverprintFillAttrValue::operator=(OverprintFillAttrValue &Attrib)
00983 {
00984     OverprintOn = Attrib.OverprintOn;
00985 
00986     return(*this);
00987 }
00988 
00989 
00990 
00991 /********************************************************************************************
00992 
00993 >   virtual INT32 OverprintFillAttrValue::operator==(const ImagesettingAttrValue &Attrib)
00994 
00995     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
00996     Created:    23/7/96
00997 
00998     Inputs:     Attrib - the attribute to compare this attribute with
00999 
01000     Returns:    TRUE if the attributes are considered equal
01001 
01002     Purpose:    Comparison operator
01003 
01004 ********************************************************************************************/
01005 
01006 INT32 OverprintFillAttrValue::operator==(const ImagesettingAttrValue &Attrib)
01007 {
01008     ERROR3IF(!Attrib.IsKindOf(CC_RUNTIME_CLASS(OverprintFillAttrValue)),
01009                 "Other attribute value isn't an OverprintFillAttrValue");
01010 
01011     OverprintFillAttrValue *Other = (OverprintFillAttrValue *) &Attrib;
01012     return(Other->OverprintOn == OverprintOn);
01013 }
01014 
01015 
01016 
01017 
01018 
01019 
01020 
01021 
01022 
01023 
01024 
01025 
01026 
01027 /********************************************************************************************
01028 
01029 >   AttrOverprintFill::AttrOverprintFill()
01030 
01031     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
01032     Created:    23/7/96
01033 
01034     Purpose:    Default constructor for AttrOverprintFill
01035 
01036 ********************************************************************************************/
01037 
01038 AttrOverprintFill::AttrOverprintFill()
01039 {
01040 }
01041 
01042 
01043 
01044 /********************************************************************************************
01045 
01046 >   AttrOverprintFill::AttrOverprintFill(Node *ContextNode,
01047                                         AttachNodeDirection Direction,
01048                                         BOOL Locked,
01049                                         BOOL Mangled,
01050                                         BOOL Marked,
01051                                         BOOL Selected)
01052     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
01053     Created:    23/7/96
01054 
01055     Purpose:    Constructs an AttrOverprintFill Attribute
01056 
01057 ********************************************************************************************/
01058 
01059 AttrOverprintFill::AttrOverprintFill(Node *ContextNode,
01060                                     AttachNodeDirection Direction,
01061                                     BOOL Locked,
01062                                     BOOL Mangled,
01063                                     BOOL Marked,
01064                                     BOOL Selected)
01065                 : AttrImagesetting(ContextNode, Direction, Locked, Mangled, Marked, Selected)
01066 {
01067 }
01068 
01069 
01070 
01071 /********************************************************************************************
01072 
01073 >   virtual Node *AttrOverprintFill::SimpleCopy()
01074 
01075     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
01076     Created:    24/7/96
01077 
01078     Returns:    A copy of the node, or NULL if memory runs out 
01079 
01080     Purpose:    This method returns a shallow copy of the node with all Node pointers NULL. 
01081                 The function is virtual, and must be defined for all derived classes.  
01082 
01083 ********************************************************************************************/
01084 
01085 Node *AttrOverprintFill::SimpleCopy()
01086 {
01087     AttrOverprintFill* NodeCopy = new AttrOverprintFill;
01088     if (NodeCopy == NULL)
01089         return(NULL);
01090 
01091     // Call the base class
01092     NodeAttribute::CopyNodeContents(NodeCopy);
01093 
01094     // And call our AttributeValue to copy itself too
01095     NodeCopy->GetAttributeValue()->SimpleCopy(GetAttributeValue());
01096     
01097     return(NodeCopy);
01098 }
01099 
01100 
01101 
01102 /********************************************************************************************
01103 
01104 >   virtual UINT32 AttrOverprintFill::GetAttrNameID(void)  
01105 
01106     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
01107     Created:    23/7/96
01108 
01109     Returns:    Attribute description string-resource ID
01110 
01111     Purpose:    Retrieves a string resource ID describing this attribute
01112 
01113 ********************************************************************************************/
01114 
01115 UINT32 AttrOverprintFill::GetAttrNameID(void)
01116 {
01117     return(_R(IDS_ATTROVERPRINTFILL));
01118 }
01119 
01120 
01121 
01122 /********************************************************************************************
01123 
01124 >   virtual void AttrOverprintFill::GetDebugDetails(StringBase *Str)
01125 
01126     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
01127     Created:    23/7/96
01128 
01129     Outputs:    On return, Str is filled in with details on this node
01130 
01131     Purpose:    Produces debug details about this node
01132 
01133 ********************************************************************************************/
01134 
01135 void AttrOverprintFill::GetDebugDetails(StringBase *Str)
01136 {
01137 #ifdef _DEBUG
01138     NodeAttribute::GetDebugDetails(Str);
01139 
01140     String_256 TempStr;
01141     TempStr._MakeMsg( _T("\r\nOverprint of Fill is #1%s\r\n"), (Value.IsOverprintOn()) ? _T("ON") : _T("OFF") );
01142     *Str += TempStr;
01143 #endif
01144 }
01145 
01146 
01147 
01148 /********************************************************************************************
01149 
01150 >   virtual UINT32 AttrOverprintFill::GetNodeSize() const
01151 
01152     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
01153     Created:    23/7/96
01154 
01155     Returns:    The size of this node, in bytes
01156 
01157     Purpose:    For finding the size of the node, in bytes
01158 
01159 ********************************************************************************************/
01160 
01161 UINT32 AttrOverprintFill::GetNodeSize() const
01162 {
01163     return(sizeof(AttrOverprintFill));
01164 }
01165 
01166 
01167 
01168 /***********************************************************************************************
01169 
01170 >   virtual INT32 AttrOverprintFill::operator==(const NodeAttribute &NodeAttrib); 
01171 
01172     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
01173     Created:    23/7/96
01174 
01175     Inputs:     NodeAttrib - The node to compare this node to
01176     Returns:    TRUE if the nodes are considered equal
01177 
01178     Purpose:    Comparison operator - determines if the AttributeValues of both objects are ==
01179 
01180 ***********************************************************************************************/
01181 
01182 INT32 AttrOverprintFill::operator==(const NodeAttribute &NodeAttrib)
01183 {
01184     // First check they are of the same type
01185     if (((NodeAttribute*)&NodeAttrib)->GetAttributeType() != GetAttributeType())
01186         return FALSE;
01187 
01188     // Make a more sensible pointer
01189     AttrOverprintFill *Attr = (AttrOverprintFill *) &NodeAttrib;
01190 
01191     // Now let the AttributeValues compare themselves
01192     return( *((OverprintFillAttrValue *) Attr->GetAttributeValue())  ==
01193             *((OverprintFillAttrValue *) GetAttributeValue()) );
01194 }
01195 
01196 
01197 
01198 /********************************************************************************************
01199 
01200 >   virtual BOOL AttrOverprintFill::WritePreChildrenWeb(BaseCamelotFilter *pFilter)
01201 >   virtual BOOL AttrOverprintFill::WritePreChildrenNative(BaseCamelotFilter *pFilter)
01202 
01203     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
01204     Created:    26/7/96
01205 
01206     Inputs:     pFilter - filter to write to
01207 
01208     Returns:    TRUE if the Node has written out a record to the filter
01209 
01210     Purpose:    Writes out a record that represents the node, to either Native or Web
01211                 file format.
01212 
01213                 This function is called before any of the AttrOverprintFill's children
01214                 are written to the filter.
01215 
01216                 If the AttrOverprintFill writes out a record successfully to the file,
01217                 it will return TRUE.
01218 
01219                 If the AttrOverprintFill chooses not to write itself to the filter
01220                 (e.g. because it is not appropriate for this filter), then this
01221                 function will return FALSE.
01222 
01223     SeeAlso:    Node::WritePreChildrenNative; Node::WritePreChildrenWeb;
01224                 ImagesettingAttrRecordHandler::HandleRecord
01225 
01226 ********************************************************************************************/
01227 
01228 BOOL AttrOverprintFill::WritePreChildrenWeb(BaseCamelotFilter *pFilter)
01229 {
01230 #ifdef DO_EXPORT
01231     // Imagesetting attributes are not saved in the web file format
01232     return FALSE;
01233 #else
01234     return FALSE;
01235 #endif
01236 }
01237 
01238 BOOL AttrOverprintFill::WritePreChildrenNative(BaseCamelotFilter *pFilter)
01239 {
01240 #ifdef DO_EXPORT
01241     ERROR3IF(pFilter == NULL, "Illegal NULL param");
01242 
01243     CamelotFileRecord *Rec = NULL;
01244     if (Value.IsOverprintOn())
01245         Rec = new CamelotFileRecord(pFilter, TAG_OVERPRINTFILLON, TAG_OVERPRINTFILLON_SIZE);
01246     else
01247         Rec = new CamelotFileRecord(pFilter, TAG_OVERPRINTFILLOFF, TAG_OVERPRINTFILLOFF_SIZE);
01248 
01249     BOOL ok = (Rec != NULL);
01250 
01251     if (ok) ok = Rec->Init();
01252     if (ok) ok = pFilter->Write(Rec);
01253 
01254     if (!ok)
01255         pFilter->GotError(_R(IDE_FILE_WRITE_ERROR));
01256 
01257     if (Rec != NULL)        // We've written the record - now delete it
01258         delete Rec;
01259 
01260     return(ok);
01261 #else
01262     return FALSE;
01263 #endif
01264 }
01265 
01266 
01267 
01268 
01269 
01270 
01271 
01272 
01273 
01274 
01275 
01276 
01277 /********************************************************************************************
01278 
01279 >   PrintOnAllPlatesAttrValue::PrintOnAllPlatesAttrValue()
01280 
01281     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
01282     Created:    23/7/96
01283 
01284     Purpose:    Default Constuctor for PrintOnAllPlatesAttrValue
01285                 The "Print On All Plates" state is set to FALSE
01286 
01287 ********************************************************************************************/
01288 
01289 PrintOnAllPlatesAttrValue::PrintOnAllPlatesAttrValue()
01290 {
01291     PrintOnAllPlates = FALSE;
01292 } 
01293 
01294 
01295 
01296 /********************************************************************************************
01297 
01298 >   PrintOnAllPlatesAttrValue::PrintOnAllPlatesAttrValue(BOOL PrintOnAllPlatesIsOn)
01299 
01300     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
01301     Created:    23/7/96
01302 
01303     Inputs:     PrintOnAllPlatesIsOn - Initial state of PrintOnAllPlates for this attribute
01304 
01305     Purpose:    PrintOnAllPlatesAttrValue constructor
01306 
01307 ********************************************************************************************/
01308 
01309 PrintOnAllPlatesAttrValue::PrintOnAllPlatesAttrValue(BOOL PrintOnAllPlatesIsOn)
01310 { 
01311     PrintOnAllPlates = PrintOnAllPlatesIsOn;
01312 }
01313 
01314 
01315 
01316 /********************************************************************************************
01317 
01318 >   BOOL PrintOnAllPlatesAttrValue::Init(void)
01319 
01320     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
01321     Created:    23/7/96
01322 
01323     Returns:    TRUE if it initilised successfully
01324 
01325     Purpose:    Registers a default attribute of this type with the attribute manager
01326 
01327 ********************************************************************************************/
01328 
01329 BOOL PrintOnAllPlatesAttrValue::Init(void)
01330 {
01331     PrintOnAllPlatesAttrValue *pAttr = new PrintOnAllPlatesAttrValue;
01332     if (pAttr == NULL)
01333         return FALSE;
01334 
01335     UINT32 ID = AttributeManager::RegisterDefaultAttribute(CC_RUNTIME_CLASS(PrintOnAllPlatesAttrValue),
01336                                                             pAttr);
01337 
01338     ERROR2IF(ID == ATTR_BAD_ID, FALSE, "Bad ID when Initialising PrintOnAllPlatesAttrValue");
01339 
01340     return(TRUE);
01341 }
01342 
01343 
01344 
01345 /********************************************************************************************
01346 
01347 >   virtual void PrintOnAllPlatesAttrValue::Render(RenderRegion *pRegion, BOOL Temp)
01348 
01349     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
01350     Created:    23/7/96
01351 
01352     Inputs:     pRegion - the render region to render this attribute into.
01353 
01354     Purpose:    Sets the PrintOnAllPlatesAttrValue attribute for the given render region.
01355 
01356     Notes:      This attribute is so simple that its state can be read directly off
01357                 the render region's stack. Thus, there is minimal special render region
01358                 support for this attribute - we just stack and unstack it directly here.
01359 
01360 ********************************************************************************************/
01361 
01362 void PrintOnAllPlatesAttrValue::Render(RenderRegion *pRegion, BOOL Temp)
01363 {
01364     // Stack the current overprint attribute and set ourselves up as the new one
01365     pRegion->SetPrintOnAllPlates(this, Temp);
01366 }
01367 
01368 
01369 
01370 /********************************************************************************************
01371 
01372 >   virtual void PrintOnAllPlatesAttrValue::Restore(RenderRegion *pRegion, BOOL Temp)
01373 
01374     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
01375     Created:    23/7/96
01376 
01377     Inputs:     pRegion - the render region to restore the attribute into.
01378                 Temp    - TRUE if this is a temporary attribute, FALSE if it is
01379                           permanent (e.g. it's in a document tree).
01380 
01381     Purpose:    Restores the PrintOnAllPlatesAttrValue attribute for the given render region. 
01382 
01383     Notes:      This attribute is so simple that its state can be read directly off
01384                 the render region's stack. Thus, there is minimal special render region
01385                 support for this attribute - we just stack and unstack it directly here.
01386 
01387 ********************************************************************************************/
01388 
01389 void PrintOnAllPlatesAttrValue::Restore(RenderRegion *pRegion, BOOL Temp)
01390 {
01391     pRegion->RestorePrintOnAllPlates(this, Temp);
01392 }
01393 
01394 
01395 
01396 /********************************************************************************************
01397 
01398 >   virtual void PrintOnAllPlatesAttrValue::SimpleCopy(AttributeValue *pValue)
01399 
01400     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
01401     Created:    23/7/96
01402 
01403     Inputs:     pValue - pointer to the AttributeValue to copy
01404 
01405     Purpose:    See AttributeValue::SimpleCopy
01406 
01407 ********************************************************************************************/
01408 
01409 void PrintOnAllPlatesAttrValue::SimpleCopy(AttributeValue *pValue)
01410 {
01411     ERROR3IF(!IS_A(pValue, PrintOnAllPlatesAttrValue),
01412                 "Invalid Attribute value passed to PrintOnAllPlatesAttrValue::SimpleCopy");
01413 
01414     // Just uses the assignment operator
01415     *this = *((PrintOnAllPlatesAttrValue *) pValue);
01416 }
01417 
01418 
01419 
01420 /********************************************************************************************
01421 
01422 >   virtual NodeAttribute *PrintOnAllPlatesAttrValue::MakeNode()
01423 
01424     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
01425     Created:    23/7/96
01426 
01427     Returns:    Pointer to the new node, or NULL if out of memory.
01428 
01429     Purpose:    Make a new attribute node for this type of attr value - see base class
01430 
01431     SeeAlso:    AttributeValue::MakeNode
01432 
01433 ********************************************************************************************/
01434 
01435 NodeAttribute *PrintOnAllPlatesAttrValue::MakeNode()
01436 {
01437     // Create new attribute node
01438     AttrPrintOnAllPlates *pAttr = new AttrPrintOnAllPlates();
01439     if (pAttr == NULL)
01440         return NULL;
01441 
01442     // Copy attribute value into the new node.
01443     pAttr->Value.SimpleCopy(this);
01444 
01445     return(pAttr);
01446 }
01447 
01448 
01449 
01450 /********************************************************************************************
01451 
01452 >   virtual BOOL PrintOnAllPlatesAttrValue::IsDifferent(AttributeValue *pAttr)
01453 
01454     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
01455     Created:    23/7/96
01456 
01457     Purpose:    Determines if this AttrValue is different from the given one
01458 
01459     Errors:     ERROR3 if the two attributes are not of the same type
01460 
01461     SeeAlso:    AttributeValue::IsDifferent
01462 
01463 ********************************************************************************************/
01464 
01465 BOOL PrintOnAllPlatesAttrValue::IsDifferent(AttributeValue *pAttr)
01466 {
01467     ERROR3IF(!pAttr->IsKindOf(CC_RUNTIME_CLASS(PrintOnAllPlatesAttrValue)),
01468                 "Different attribute types in PrintOnAllPlatesAttrValue::IsDifferent()");
01469 
01470     // Check they are NOT the same using the == operator
01471     return ( !(*((PrintOnAllPlatesAttrValue *)pAttr) == *this) );
01472 }
01473 
01474 
01475 
01476 /********************************************************************************************
01477 
01478 >   virtual PrintOnAllPlatesAttrValue &PrintOnAllPlatesAttrValue::operator=(PrintOnAllPlatesAttrValue &Attrib)
01479 
01480     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
01481     Created:    23/7/96
01482 
01483     Inputs:     Attrib - the attribute to copy
01484 
01485     Purpose:    Assignment operator
01486 
01487 ********************************************************************************************/
01488 
01489 PrintOnAllPlatesAttrValue &PrintOnAllPlatesAttrValue::operator=(PrintOnAllPlatesAttrValue &Attrib)
01490 {
01491     PrintOnAllPlates = Attrib.PrintOnAllPlates;
01492 
01493     return(*this);
01494 }
01495 
01496 
01497 
01498 /********************************************************************************************
01499 
01500 >   virtual INT32 PrintOnAllPlatesAttrValue::operator==(const ImagesettingAttrValue &Attrib)
01501 
01502     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
01503     Created:    23/7/96
01504 
01505     Inputs:     Attrib - the attribute to compare this attribute with
01506 
01507     Returns:    TRUE if the attributes are considered equal
01508 
01509     Purpose:    Comparison operator
01510 
01511 ********************************************************************************************/
01512 
01513 INT32 PrintOnAllPlatesAttrValue::operator==(const ImagesettingAttrValue &Attrib)
01514 {
01515     ERROR3IF(!Attrib.IsKindOf(CC_RUNTIME_CLASS(PrintOnAllPlatesAttrValue)),
01516                 "Other attribute value isn't an PrintOnAllPlatesAttrValue");
01517 
01518     PrintOnAllPlatesAttrValue *Other = (PrintOnAllPlatesAttrValue *) &Attrib;
01519     return(Other->PrintOnAllPlates == PrintOnAllPlates);
01520 }
01521 
01522 
01523 
01524 
01525 
01526 
01527 
01528 
01529 
01530 
01531 
01532 
01533 
01534 /********************************************************************************************
01535 
01536 >   AttrPrintOnAllPlates::AttrPrintOnAllPlates()
01537 
01538     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
01539     Created:    23/7/96
01540 
01541     Purpose:    Default constructor for AttrPrintOnAllPlates
01542 
01543 ********************************************************************************************/
01544 
01545 AttrPrintOnAllPlates::AttrPrintOnAllPlates()
01546 {
01547 }
01548 
01549 
01550 
01551 /********************************************************************************************
01552 
01553 >   AttrPrintOnAllPlates::AttrPrintOnAllPlates(Node *ContextNode,
01554                                         AttachNodeDirection Direction,
01555                                         BOOL Locked,
01556                                         BOOL Mangled,
01557                                         BOOL Marked,
01558                                         BOOL Selected)
01559     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
01560     Created:    23/7/96
01561 
01562     Purpose:    Constructs an AttrPrintOnAllPlates Attribute
01563 
01564 ********************************************************************************************/
01565 
01566 AttrPrintOnAllPlates::AttrPrintOnAllPlates(Node *ContextNode,
01567                                     AttachNodeDirection Direction,
01568                                     BOOL Locked,
01569                                     BOOL Mangled,
01570                                     BOOL Marked,
01571                                     BOOL Selected)
01572                 : AttrImagesetting(ContextNode, Direction, Locked, Mangled, Marked, Selected)
01573 {
01574 }
01575 
01576 
01577 
01578 /********************************************************************************************
01579 
01580 >   virtual Node *AttrPrintOnAllPlates::SimpleCopy()
01581 
01582     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
01583     Created:    24/7/96
01584 
01585     Returns:    A copy of the node, or NULL if memory runs out 
01586 
01587     Purpose:    This method returns a shallow copy of the node with all Node pointers NULL. 
01588                 The function is virtual, and must be defined for all derived classes.  
01589 
01590 ********************************************************************************************/
01591 
01592 Node *AttrPrintOnAllPlates::SimpleCopy()
01593 {
01594     AttrPrintOnAllPlates* NodeCopy = new AttrPrintOnAllPlates;
01595     if (NodeCopy == NULL)
01596         return(NULL);
01597 
01598     // Call the base class
01599     NodeAttribute::CopyNodeContents(NodeCopy);
01600 
01601     // And call our AttributeValue to copy itself too
01602     NodeCopy->GetAttributeValue()->SimpleCopy(GetAttributeValue());
01603     
01604     return(NodeCopy);
01605 }
01606 
01607 
01608 
01609 /********************************************************************************************
01610 
01611 >   virtual UINT32 AttrPrintOnAllPlates::GetAttrNameID(void)  
01612 
01613     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
01614     Created:    23/7/96
01615 
01616     Returns:    Attribute description string-resource ID
01617 
01618     Purpose:    Retrieves a string resource ID describing this attribute
01619 
01620 ********************************************************************************************/
01621 
01622 UINT32 AttrPrintOnAllPlates::GetAttrNameID(void)
01623 {
01624     return(_R(IDS_ATTRPRINTONALLPLATES));
01625 }
01626 
01627 
01628 
01629 /********************************************************************************************
01630 
01631 >   virtual void AttrPrintOnAllPlates::GetDebugDetails(StringBase *Str)
01632 
01633     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
01634     Created:    23/7/96
01635 
01636     Outputs:    On return, Str is filled in with details on this node
01637 
01638     Purpose:    Produces debug details about this node
01639 
01640 ********************************************************************************************/
01641 
01642 void AttrPrintOnAllPlates::GetDebugDetails(StringBase *Str)
01643 {
01644 #ifdef _DEBUG
01645     NodeAttribute::GetDebugDetails(Str);
01646 
01647     String_256 TempStr;
01648     TempStr._MakeMsg( _T("\r\nPrintOnAllPlates is #1%s\r\n"), (Value.IsPrintOnAllPlatesOn()) ? _T("ON") : _T("OFF") );
01649     *Str += TempStr;
01650 #endif
01651 }
01652 
01653 
01654 
01655 /********************************************************************************************
01656 
01657 >   virtual UINT32 AttrPrintOnAllPlates::GetNodeSize() const
01658 
01659     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
01660     Created:    23/7/96
01661 
01662     Returns:    The size of this node, in bytes
01663 
01664     Purpose:    For finding the size of the node, in bytes
01665 
01666 ********************************************************************************************/
01667 
01668 UINT32 AttrPrintOnAllPlates::GetNodeSize() const
01669 {
01670     return(sizeof(AttrPrintOnAllPlates));
01671 }
01672 
01673 
01674 
01675 /***********************************************************************************************
01676 
01677 >   virtual INT32 AttrPrintOnAllPlates::operator==(const NodeAttribute &NodeAttrib); 
01678 
01679     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
01680     Created:    23/7/96
01681 
01682     Inputs:     NodeAttrib - The node to compare this node to
01683     Returns:    TRUE if the nodes are considered equal
01684 
01685     Purpose:    Comparison operator - determines if the AttributeValues of both objects are ==
01686 
01687 ***********************************************************************************************/
01688 
01689 INT32 AttrPrintOnAllPlates::operator==(const NodeAttribute &NodeAttrib)
01690 {
01691     // First check they are of the same type
01692     if (((NodeAttribute*)&NodeAttrib)->GetAttributeType() != GetAttributeType())
01693         return FALSE;
01694 
01695     // Make a more sensible pointer
01696     AttrPrintOnAllPlates *Attr = (AttrPrintOnAllPlates *) &NodeAttrib;
01697 
01698     // Now let the AttributeValues compare themselves
01699     return( *((PrintOnAllPlatesAttrValue *) Attr->GetAttributeValue())  ==
01700             *((PrintOnAllPlatesAttrValue *) GetAttributeValue()) );
01701 }
01702 
01703 
01704 
01705 /********************************************************************************************
01706 
01707 >   virtual BOOL AttrPrintOnAllPlates::WritePreChildrenWeb(BaseCamelotFilter *pFilter)
01708 >   virtual BOOL AttrPrintOnAllPlates::WritePreChildrenNative(BaseCamelotFilter *pFilter)
01709 
01710     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
01711     Created:    26/7/96
01712 
01713     Inputs:     pFilter - filter to write to
01714 
01715     Returns:    TRUE if the Node has written out a record to the filter
01716 
01717     Purpose:    Writes out a record that represents the node, to either Native or Web
01718                 file format.
01719 
01720                 This function is called before any of the AttrPrintOnAllPlates's children
01721                 are written to the filter.
01722 
01723                 If the AttrPrintOnAllPlates writes out a record successfully to the file,
01724                 it will return TRUE.
01725 
01726                 If the AttrPrintOnAllPlates chooses not to write itself to the filter
01727                 (e.g. because it is not appropriate for this filter), then this
01728                 function will return FALSE.
01729 
01730     SeeAlso:    Node::WritePreChildrenNative; Node::WritePreChildrenWeb;
01731                 ImagesettingAttrRecordHandler::HandleRecord
01732 
01733 ********************************************************************************************/
01734 
01735 BOOL AttrPrintOnAllPlates::WritePreChildrenWeb(BaseCamelotFilter *pFilter)
01736 {
01737 #ifdef DO_EXPORT
01738     // Imagesetting attributes are not saved in the web file format
01739     return FALSE;
01740 #else
01741     return FALSE;
01742 #endif
01743 }
01744 
01745 BOOL AttrPrintOnAllPlates::WritePreChildrenNative(BaseCamelotFilter *pFilter)
01746 {
01747 #ifdef DO_EXPORT
01748     ERROR3IF(pFilter == NULL, "Illegal NULL param");
01749 
01750     CamelotFileRecord *Rec = NULL;
01751     if (Value.IsPrintOnAllPlatesOn())
01752         Rec = new CamelotFileRecord(pFilter, TAG_PRINTONALLPLATESON, TAG_PRINTONALLPLATESON_SIZE);
01753     else
01754         Rec = new CamelotFileRecord(pFilter, TAG_PRINTONALLPLATESOFF, TAG_PRINTONALLPLATESOFF_SIZE);
01755 
01756     BOOL ok = (Rec != NULL);
01757 
01758     if (ok) ok = Rec->Init();
01759     if (ok) ok = pFilter->Write(Rec);
01760 
01761     if (!ok)
01762         pFilter->GotError(_R(IDE_FILE_WRITE_ERROR));
01763 
01764     if (Rec != NULL)        // We've written the record - now delete it
01765         delete Rec;
01766 
01767     return(ok);
01768 #else
01769     return FALSE;
01770 #endif
01771 }
01772 
01773 
01774 
01775 
01776 
01777 
01778 
01779 
01780 
01781 
01782 
01783 
01784 /********************************************************************************************
01785 
01786 >   virtual UINT32 *ImagesettingAttrRecordHandler::GetTagList()
01787 
01788     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
01789     Created:    26/7/96
01790 
01791     Returns:    A list of tag values, terminated by CXFRH_TAG_LIST_END
01792 
01793     Purpose:    Provides the record handler system with a list of records handled by this
01794                 handler - all Imagesetting attributes:
01795                     Overprint line (on/off)
01796                     Overprint fill (on/off)
01797                     Print on all plates (on/off)
01798 
01799     SeeAlso:    ImagesettingAttrRecordHandler::HandleRecord
01800 
01801 ********************************************************************************************/
01802 
01803 UINT32 *ImagesettingAttrRecordHandler::GetTagList()
01804 {
01805     static UINT32 TagList[] =
01806     {
01807         TAG_OVERPRINTLINEON,
01808         TAG_OVERPRINTLINEOFF,
01809         TAG_OVERPRINTFILLON,
01810         TAG_OVERPRINTFILLOFF,
01811         TAG_PRINTONALLPLATESON,
01812         TAG_PRINTONALLPLATESOFF,
01813         CXFRH_TAG_LIST_END
01814     };
01815 
01816     return(TagList);
01817 }
01818 
01819 
01820 
01821 /********************************************************************************************
01822 
01823 >   virtual BOOL ImagesettingAttrRecordHandler::HandleRecord(CXaraFileRecord *pCXaraFileRecord)
01824 
01825     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
01826     Created:    26/7/96
01827 
01828     Inputs:     pCXaraFileRecord - The record to handle - may not be NULL
01829     Returns:    TRUE if handled successfuly
01830 
01831     Purpose:    Handles loading of the given imagesetting attribute record
01832 
01833     SeeAlso:    AttrOverprintLine::WritePreChildrenNative;
01834                 AttrOverprintFill::WritePreChildrenNative;
01835                 AttrPrintOnAllPlates::WritePreChildrenNative
01836 
01837 ********************************************************************************************/
01838 
01839 BOOL ImagesettingAttrRecordHandler::HandleRecord(CXaraFileRecord *pCXaraFileRecord)
01840 {
01841     ERROR3IF(pCXaraFileRecord == NULL, "pCXaraFileRecord is NULL");
01842 
01843     NodeAttribute *NewNode = NULL;
01844     
01845     switch (pCXaraFileRecord->GetTag())
01846     {
01847         case TAG_OVERPRINTLINEON:
01848             NewNode = new AttrOverprintLine;
01849             if (NewNode != NULL)
01850                 ((OverprintLineAttrValue *)NewNode->GetAttributeValue())->SetOverprint(TRUE);
01851             break;
01852 
01853         case TAG_OVERPRINTLINEOFF:
01854             NewNode = new AttrOverprintLine;
01855             if (NewNode != NULL)
01856                 ((OverprintLineAttrValue *)NewNode->GetAttributeValue())->SetOverprint(FALSE);
01857             break;
01858 
01859         case TAG_OVERPRINTFILLON:
01860             NewNode = new AttrOverprintFill;
01861             if (NewNode != NULL)
01862                 ((OverprintFillAttrValue *)NewNode->GetAttributeValue())->SetOverprint(TRUE);
01863             break;
01864 
01865         case TAG_OVERPRINTFILLOFF:
01866             NewNode = new AttrOverprintFill;
01867             if (NewNode != NULL)
01868                 ((OverprintFillAttrValue *)NewNode->GetAttributeValue())->SetOverprint(FALSE);
01869             break;
01870 
01871         case TAG_PRINTONALLPLATESON:
01872             NewNode = new AttrPrintOnAllPlates;
01873             if (NewNode != NULL)
01874                 ((PrintOnAllPlatesAttrValue *)NewNode->GetAttributeValue())->SetPrintOnAllPlates(TRUE);
01875             break;
01876 
01877         case TAG_PRINTONALLPLATESOFF:
01878             NewNode = new AttrPrintOnAllPlates;
01879             if (NewNode != NULL)
01880                 ((PrintOnAllPlatesAttrValue *)NewNode->GetAttributeValue())->SetPrintOnAllPlates(FALSE);
01881             break;
01882 
01883         default:
01884             ERROR3_PF(("I don't handle records with the tag (%d)\n",pCXaraFileRecord->GetTag()));
01885             break;
01886     }
01887 
01888     if (NewNode == NULL)
01889         return(FALSE);
01890 
01891     // Get the base class to insert the new node for us
01892     InsertNode(NewNode);
01893     return(TRUE);
01894 }
01895 
01896 

Generated on Sat Nov 10 03:45:34 2007 for Camelot by  doxygen 1.4.4