opimgset.h File Reference

(r1785/r1282)

#include "colplate.h"

Go to the source code of this file.

Classes

class  OpShowPrinterColours
 An Op for toggling composite print preview on and off. More...
class  OpToggleCompositePreview
 An Op for toggling composite print preview on and off. More...
class  OpToggleCyanPreview
 An Op for toggling cyan plate print preview on and off. More...
class  OpToggleMagentaPreview
 An Op for toggling Magenta plate print preview on and off. More...
class  OpToggleYellowPreview
 An Op for toggling Yellow plate print preview on and off. More...
class  OpToggleKeyPreview
 An Op for toggling Key plate print preview on and off. More...
class  OpToggleSpotPreview
 An Op for toggling Spot plate print preview on and off. More...
class  OpToggleMonoPlatePreview
 An Op for toggling mono plate print preview on and off. More...
class  OpOverprintLine
 An Op for toggling the AttrOverprintLine attribute. More...
class  OpOverprintFill
 An Op for toggling the AttrOverprintFill attribute. More...
class  OpPrintOnAllPlates
 An Op for toggling the AttrPrintOnAllPlates attribute. More...

Defines

#define OPTOKEN_COMPOSITEPREVIEW   _T("CompositePreview")
#define OPTOKEN_IMAGESETTING   _T("ImagesettingSubmenu")
#define OPTOKEN_OVERPRINTFILL   _T("OverprintFill")
#define OPTOKEN_OVERPRINTLINE   _T("OverprintLine")
#define OPTOKEN_PRINTONALLPLATES   _T("PrintOnAllPlates")
#define OPTOKEN_CYANPREVIEW   _T("CyanPreview")
#define OPTOKEN_MAGENTAPREVIEW   _T("MagentaPreview")
#define OPTOKEN_YELLOWPREVIEW   _T("YellowPreview")
#define OPTOKEN_KEYPREVIEW   _T("KeyPreview")
#define OPTOKEN_MONOPLATEPREVIEW   _T("MonoPlatePreview")
#define OPTOKEN_SHOWPRINTERCOLOURS   _T("ShowPrinterColours")
#define OPTOKEN_CANCELPREVIEW   _T("CancelPreview")
#define OPTOKEN_SPOTPREVIEWBASE   _T("SpotPreview")
#define OPTOKEN_SPOTPREVIEW1   _T("SpotPreview1")
#define OPTOKEN_SPOTPREVIEW2   _T("SpotPreview2")
#define OPTOKEN_SPOTPREVIEW3   _T("SpotPreview3")
#define OPTOKEN_SPOTPREVIEW4   _T("SpotPreview4")
#define OPTOKEN_SPOTPREVIEW5   _T("SpotPreview5")
#define OPTOKEN_SPOTPREVIEW6   _T("SpotPreview6")
#define OPTOKEN_SPOTPREVIEW7   _T("SpotPreview7")
#define OPTOKEN_SPOTPREVIEW8   _T("SpotPreview8")
#define OPTOKEN_SPOTPREVIEWMORE   _T("SpotPreviewMore")

Functions

BOOL InitImagesettingOps (void)
 Centralised initialisation of all the imagesetting Ops in this file (opimgset.cpp). Called from ColourManager::Init().
void SetNewColourPlate (ColourPlateType NewType, INT32 WhichToggle, INT32 WhichSpot)
IndexedColourFindWhichSpot (INT32 WhichSpot)


Define Documentation

#define OPTOKEN_CANCELPREVIEW   _T("CancelPreview")
 

Definition at line 119 of file opimgset.h.

#define OPTOKEN_COMPOSITEPREVIEW   _T("CompositePreview")
 

Definition at line 107 of file opimgset.h.

#define OPTOKEN_CYANPREVIEW   _T("CyanPreview")
 

Definition at line 113 of file opimgset.h.

#define OPTOKEN_IMAGESETTING   _T("ImagesettingSubmenu")
 

Definition at line 108 of file opimgset.h.

#define OPTOKEN_KEYPREVIEW   _T("KeyPreview")
 

Definition at line 116 of file opimgset.h.

#define OPTOKEN_MAGENTAPREVIEW   _T("MagentaPreview")
 

Definition at line 114 of file opimgset.h.

#define OPTOKEN_MONOPLATEPREVIEW   _T("MonoPlatePreview")
 

Definition at line 117 of file opimgset.h.

#define OPTOKEN_OVERPRINTFILL   _T("OverprintFill")
 

Definition at line 109 of file opimgset.h.

#define OPTOKEN_OVERPRINTLINE   _T("OverprintLine")
 

Definition at line 110 of file opimgset.h.

#define OPTOKEN_PRINTONALLPLATES   _T("PrintOnAllPlates")
 

Definition at line 111 of file opimgset.h.

#define OPTOKEN_SHOWPRINTERCOLOURS   _T("ShowPrinterColours")
 

Definition at line 118 of file opimgset.h.

#define OPTOKEN_SPOTPREVIEW1   _T("SpotPreview1")
 

Definition at line 122 of file opimgset.h.

#define OPTOKEN_SPOTPREVIEW2   _T("SpotPreview2")
 

Definition at line 123 of file opimgset.h.

#define OPTOKEN_SPOTPREVIEW3   _T("SpotPreview3")
 

Definition at line 124 of file opimgset.h.

#define OPTOKEN_SPOTPREVIEW4   _T("SpotPreview4")
 

Definition at line 125 of file opimgset.h.

#define OPTOKEN_SPOTPREVIEW5   _T("SpotPreview5")
 

Definition at line 126 of file opimgset.h.

#define OPTOKEN_SPOTPREVIEW6   _T("SpotPreview6")
 

Definition at line 127 of file opimgset.h.

#define OPTOKEN_SPOTPREVIEW7   _T("SpotPreview7")
 

Definition at line 128 of file opimgset.h.

#define OPTOKEN_SPOTPREVIEW8   _T("SpotPreview8")
 

Definition at line 129 of file opimgset.h.

#define OPTOKEN_SPOTPREVIEWBASE   _T("SpotPreview")
 

Definition at line 121 of file opimgset.h.

#define OPTOKEN_SPOTPREVIEWMORE   _T("SpotPreviewMore")
 

Definition at line 130 of file opimgset.h.

#define OPTOKEN_YELLOWPREVIEW   _T("YellowPreview")
 

Definition at line 115 of file opimgset.h.


Function Documentation

IndexedColour* FindWhichSpot INT32  WhichSpot  ) 
 

Definition at line 200 of file opimgset.cpp.

00201 {
00202     INT32 Count = 0;
00203     
00204     // Find the required "live" spot colour in the colour list
00205     ColourList *ColList = Document::GetSelected()->GetIndexedColours();
00206     IndexedColour *SpotColour = (IndexedColour *) ColList->GetHead();
00207 
00208     while (SpotColour != NULL)
00209     {
00210         if (!SpotColour->IsDeleted() && SpotColour->GetType() == COLOURTYPE_SPOT)
00211         {
00212             Count++;
00213         }
00214 
00215         if (Count == WhichSpot)
00216             break;
00217 
00218         SpotColour = (IndexedColour *) ColList->GetNext(SpotColour);
00219     }
00220 
00221     return(SpotColour);
00222 }

BOOL InitImagesettingOps void   ) 
 

Centralised initialisation of all the imagesetting Ops in this file (opimgset.cpp). Called from ColourManager::Init().

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/7/96

Definition at line 151 of file opimgset.cpp.

00152 {
00153     if (!OpShowPrinterColours::Init())
00154         return(FALSE);
00155 #if FALSE
00156     if (!OpToggleCompositePreview::Init())
00157         return(FALSE);
00158 
00159     if (!OpToggleCyanPreview::Init())
00160         return(FALSE);
00161 
00162     if (!OpToggleMagentaPreview::Init())
00163         return(FALSE);
00164 
00165     if (!OpToggleYellowPreview::Init())
00166         return(FALSE);
00167 
00168     if (!OpToggleKeyPreview::Init())
00169         return(FALSE);
00170 
00171     if (!OpToggleSpotPreview::Init())
00172         return(FALSE);
00173 
00174     if (!OpToggleMonoPlatePreview::Init())
00175         return(FALSE);
00176 #endif
00177     if (!OpOverprintLine::Init())
00178         return(FALSE);
00179 
00180     if (!OpOverprintFill::Init())
00181         return(FALSE);
00182 
00183     if (!OpPrintOnAllPlates::Init())
00184         return(FALSE);
00185 
00186     // Finally, register an OpDescriptor for the "Imagesetting" Submenu item,
00187     // which just connects up to DummyOp (see menuops.cpp)
00188     return(Operation::RegisterOpDescriptor(0,
00189                                 _R(IDS_IMAGESETTING),
00190                                 CC_RUNTIME_CLASS(DummyOp),
00191                                 OPTOKEN_IMAGESETTING,
00192                                 DummyOp::GetState,
00193                                 0,  /* help ID */
00194                                 0,  /* bubble help ID */
00195                                 0,  /* resource ID */
00196                                 0   /* control ID */
00197                             ));
00198 }

void SetNewColourPlate ColourPlateType  NewType,
INT32  WhichToggle,
INT32  WhichSpot
 

Definition at line 225 of file opimgset.cpp.

00237 {
00238     // For convenience in Jason's debug cases
00239     View *SelView = DocView::GetSelected();
00240     if (SelView == NULL)
00241         return;
00242 
00243     // Get the currently active ColourPlate descriptor for the selected view (may be NULL)
00244     ColourPlate *SepDescriptor = SelView->GetColourPlate();
00245 
00246     BOOL Mono   = (SepDescriptor != NULL) ? SepDescriptor->IsMonochrome()  : FALSE;
00247     BOOL Negate = (SepDescriptor != NULL) ? SepDescriptor->IsNegative()    : FALSE;
00248     BOOL Overprint = (SepDescriptor != NULL) ? SepDescriptor->Overprints() : FALSE;
00249 
00250     switch(WhichToggle)
00251     {
00252         case 0:
00253             // Nothing to do here
00254             break;
00255 
00256         case 1:
00257             Mono = (Mono) ? FALSE : TRUE;
00258             NewType = (SepDescriptor != NULL) ? SepDescriptor->GetType() : COLOURPLATE_NONE;
00259             break;
00260 
00261         case 2:
00262             Negate = (Negate) ? FALSE : TRUE;
00263             NewType = (SepDescriptor != NULL) ? SepDescriptor->GetType() : COLOURPLATE_NONE;
00264             break;
00265 
00266         case 3:
00267             Overprint = (Overprint) ? FALSE : TRUE;
00268             NewType = (SepDescriptor != NULL) ? SepDescriptor->GetType() : COLOURPLATE_NONE;
00269             break;
00270     }
00271 
00272     if (SepDescriptor && SepDescriptor->GetType() == COLOURPLATE_SPOT)
00273     {
00274         if (WhichSpot < 1)
00275         {
00276             IndexedColour *pSpotCol = SepDescriptor->GetSpotColour();
00277             if (pSpotCol)
00278             {
00279                 // Count the spot colours until we find the required one
00280                 ColourList* pColList = Document::GetSelected()->GetIndexedColours();
00281                 IndexedColour* pCol = (IndexedColour*) pColList->GetHead();
00282                 INT32 Count = 0;
00283 
00284                 while (pCol != NULL)
00285                 {
00286                     if (pCol->GetType() == COLOURTYPE_SPOT && !pCol->IsDeleted())
00287                     {
00288                         Count++;
00289                     }
00290 
00291                     if (pCol == pSpotCol)
00292                         break;
00293 
00294                     pCol = (IndexedColour*) pColList->GetNext(pCol);
00295                 }
00296 
00297                 if (pCol && Count > 0)
00298                     WhichSpot = Count;
00299             }
00300         }
00301     }
00302 
00303     // Make sure we blank this
00304     SepDescriptor = NULL;
00305 
00306     // Try to create a spot plate
00307     if (NewType == COLOURPLATE_SPOT)
00308     {
00309         if (WhichSpot < 1)
00310         {
00311             ERROR3("Spot plate must be greater than 0");
00312             return;
00313         }
00314 
00315         IndexedColour *SpotColour = FindWhichSpot(WhichSpot);
00316 
00317         // If we found a spot colour, create the plate
00318         if (SpotColour != NULL)
00319             SepDescriptor = new ColourPlate(SpotColour, Mono, Negate);
00320 
00321         // Can't do it - no memory or no spots
00322         if (SepDescriptor == NULL)
00323         {
00324             ERROR3("Can't create spot plate - requested spot colour does not exist");
00325             return;
00326         }
00327     }
00328 
00329     if (NewType == COLOURPLATE_COMPOSITE)
00330     {
00331         Mono = FALSE;
00332         Negate = FALSE;
00333         Overprint = FALSE;
00334     }
00335 
00336     if (SepDescriptor == NULL)
00337         SepDescriptor = new ColourPlate(NewType, Mono, Negate);
00338 
00339     if (SepDescriptor != NULL)
00340         SepDescriptor->SetOverprint(Overprint);
00341 
00342     SelView->SetColourPlate(SepDescriptor);     // This makes a copy of the plate
00343     delete SepDescriptor;
00344 
00345     // Redraw anything affected by the change
00346     // Removed by Gerry as it already happens in SetColourPlate above
00347 //  ColourManager::SelViewContextHasChanged();
00348 }


Generated on Sat Nov 10 03:49:18 2007 for Camelot by  doxygen 1.4.4