opimgset.cpp File Reference

(r1785/r1357)

#include "camtypes.h"
#include "camframe.h"
#include "colcontx.h"
#include "colormgr.h"
#include "isetattr.h"
#include "menuops.h"
#include "opimgset.h"
#include "progress.h"

Go to the source code of this file.

Defines

#define new   CAM_DEBUG_NEW

Functions

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


Define Documentation

#define new   CAM_DEBUG_NEW
 

Definition at line 134 of file opimgset.cpp.


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:17 2007 for Camelot by  doxygen 1.4.4