00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101 #include "camtypes.h"
00102
00103
00104 #include "camframe.h"
00105
00106
00107 #include "colcontx.h"
00108 #include "colormgr.h"
00109
00110 #include "isetattr.h"
00111
00112
00113 #include "menuops.h"
00114 #include "opimgset.h"
00115 #include "progress.h"
00116
00117
00118
00119
00120
00121 CC_IMPLEMENT_DYNCREATE(OpShowPrinterColours, Operation)
00122
00123
00124
00125
00126
00127
00128
00129 CC_IMPLEMENT_DYNCREATE(OpOverprintLine, SelOperation)
00130 CC_IMPLEMENT_DYNCREATE(OpOverprintFill, SelOperation)
00131 CC_IMPLEMENT_DYNCREATE(OpPrintOnAllPlates, SelOperation)
00132
00133
00134 #define new CAM_DEBUG_NEW
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151 BOOL InitImagesettingOps(void)
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
00187
00188 return(Operation::RegisterOpDescriptor(0,
00189 _R(IDS_IMAGESETTING),
00190 CC_RUNTIME_CLASS(DummyOp),
00191 OPTOKEN_IMAGESETTING,
00192 DummyOp::GetState,
00193 0,
00194 0,
00195 0,
00196 0
00197 ));
00198 }
00199
00200 IndexedColour* FindWhichSpot(INT32 WhichSpot)
00201 {
00202 INT32 Count = 0;
00203
00204
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 }
00223
00224
00225 void SetNewColourPlate(ColourPlateType NewType, INT32 WhichToggle, INT32 WhichSpot)
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237 {
00238
00239 View *SelView = DocView::GetSelected();
00240 if (SelView == NULL)
00241 return;
00242
00243
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
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
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
00304 SepDescriptor = NULL;
00305
00306
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
00318 if (SpotColour != NULL)
00319 SepDescriptor = new ColourPlate(SpotColour, Mono, Negate);
00320
00321
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);
00343 delete SepDescriptor;
00344
00345
00346
00347
00348 }
00349
00350
00351
00352
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363
00364 void OpShowPrinterColours::Do(OpDescriptor *OpDesc)
00365 {
00366 if (DocView::GetSelected() != NULL &&
00367 GetApplication()->GetCMSManager() != NULL)
00368 {
00369 String Token = OpDesc->Token;
00370 INT32 WhichToggle = 0;
00371
00372 INT32 TokenSpot = 0;
00373 ColourPlateType TokenPlate = COLOURPLATE_NONE;
00374 IndexedColour* pSpotColour = NULL;
00375 IndexedColour* pTokenColour = NULL;
00376 String_16 TempString;
00377 Token.Left(&TempString, 11);
00378 if (Token == String(OPTOKEN_COMPOSITEPREVIEW))
00379 TokenPlate = COLOURPLATE_COMPOSITE;
00380 else if (Token == String(OPTOKEN_CYANPREVIEW))
00381 TokenPlate = COLOURPLATE_CYAN;
00382 else if (Token == String(OPTOKEN_MAGENTAPREVIEW))
00383 TokenPlate = COLOURPLATE_MAGENTA;
00384 else if (Token == String(OPTOKEN_YELLOWPREVIEW))
00385 TokenPlate = COLOURPLATE_YELLOW;
00386 else if (Token == String(OPTOKEN_KEYPREVIEW))
00387 TokenPlate = COLOURPLATE_KEY;
00388 else if (TempString == String(OPTOKEN_SPOTPREVIEWBASE))
00389 {
00390 TokenSpot = (Token[11] - _T('0'));
00391 if (TokenSpot > 8)
00392 TokenSpot = -1;
00393 pTokenColour = FindWhichSpot(TokenSpot);
00394 TokenPlate = COLOURPLATE_SPOT;
00395 }
00396 else if (Token == String(OPTOKEN_MONOPLATEPREVIEW))
00397 WhichToggle = 1;
00398
00399
00400 ColourPlateType PlateType = COLOURPLATE_NONE;
00401 ColourContext *cc = DocView::GetSelected()->GetColourContext(COLOURMODEL_RGBT);
00402 if (cc && cc->GetColourPlate())
00403 {
00404 PlateType = cc->GetColourPlate()->GetType();
00405
00406 if (PlateType == COLOURPLATE_SPOT)
00407 {
00408 pSpotColour = cc->GetColourPlate()->GetSpotColour();
00409 if (pSpotColour != pTokenColour)
00410 PlateType = COLOURPLATE_NONE;
00411 }
00412 }
00413
00414 if (PlateType == TokenPlate ||
00415 (Token == String(OPTOKEN_CANCELPREVIEW) && PlateType != COLOURPLATE_NONE))
00416 {
00417
00418 DocView::GetSelected()->SetColourPlate(NULL);
00419 ColourManager::SelViewContextHasChanged();
00420 PORTNOTE("printing", "Disabled SetPrinterColourStatus")
00421 #ifndef EXCLUDE_FROM_XARALX
00422 CCamFrame* pMainFrame = CCamFrame::GetMainFrame();
00423 if (pMainFrame)
00424 pMainFrame->SetPrinterColourStatus(FALSE);
00425 #endif
00426 }
00427 else
00428 {
00429 SetNewColourPlate(TokenPlate, WhichToggle, TokenSpot);
00430
00431
00432
00433
00434
00435 PORTNOTE("printing", "Disabled SetPrinterColourStatus")
00436 #ifndef EXCLUDE_FROM_XARALX
00437 Progress::Start();
00438 DWORD *Dummy = GetApplication()->GetCMSManager()->GetPaperViewTable();
00439 Progress::Stop();
00440 CCamFrame* pMainFrame = CCamFrame::GetMainFrame();
00441 if (pMainFrame)
00442 {
00443 String_256 sPlateName;
00444
00445 switch (TokenPlate)
00446 {
00447 case COLOURPLATE_CYAN:
00448 sPlateName.Load(_R(IDS_PLATENAME_CYAN));
00449 break;
00450 case COLOURPLATE_MAGENTA:
00451 sPlateName.Load(_R(IDS_PLATENAME_MAGENTA));
00452 break;
00453 case COLOURPLATE_YELLOW:
00454 sPlateName.Load(_R(IDS_PLATENAME_YELLOW));
00455 break;
00456 case COLOURPLATE_KEY:
00457 sPlateName.Load(_R(IDS_PLATENAME_KEY));
00458 break;
00459 case COLOURPLATE_COMPOSITE:
00460 sPlateName.Load(_R(IDS_PLATENAME_COMPOSITE));
00461 break;
00462 case COLOURPLATE_SPOT:
00463 if (pTokenColour)
00464 sPlateName = *(pTokenColour->GetName());
00465 break;
00466 }
00467
00468 pMainFrame->SetPrinterColourStatus(TRUE, &sPlateName);
00469 }
00470 #endif
00471 }
00472 }
00473
00474 End();
00475 }
00476
00477
00478
00479
00480
00481
00482
00483
00484
00485
00486
00487
00488
00489
00490 BOOL OpShowPrinterColours::Init()
00491 {
00492
00493 if (!Operation::RegisterOpDescriptor(
00494 0,
00495 _R(IDS_TOGGLENORMALPREVIEW),
00496 CC_RUNTIME_CLASS(OpShowPrinterColours),
00497 OPTOKEN_CANCELPREVIEW,
00498 OpShowPrinterColours::GetState,
00499 _R(IDS_TOGGLENORMALHELP),
00500 _R(IDS_TOGGLENORMALBBL)
00501 ))
00502 return(FALSE);
00503
00504 if (!Operation::RegisterOpDescriptor(
00505 0,
00506 _R(IDS_TOGGLECOMPPREVIEW),
00507 CC_RUNTIME_CLASS(OpShowPrinterColours),
00508 OPTOKEN_SHOWPRINTERCOLOURS,
00509 OpShowPrinterColours::GetState,
00510 _R(IDS_TOGGLECOMPHELP),
00511 _R(IDS_TOGGLECOMPBBL)
00512 ))
00513 return(FALSE);
00514
00515 if (!Operation::RegisterOpDescriptor(
00516 0,
00517 _R(IDS_TOGGLESHOWPRINTCOLS),
00518 CC_RUNTIME_CLASS(OpShowPrinterColours),
00519 OPTOKEN_COMPOSITEPREVIEW,
00520 OpShowPrinterColours::GetState,
00521 _R(IDS_TOGGLESHOWPRINTCOLSHELP),
00522 _R(IDS_TOGGLESHOWPRINTCOLSBBL),
00523 _R(IDD_BARCONTROLSTORE),
00524 _R(IDC_COMPOSITEPREVIEW),
00525 SYSTEMBAR_UTILITIES
00526 ))
00527 return(FALSE);
00528
00529 if (!Operation::RegisterOpDescriptor(
00530 0,
00531 _R(IDS_TOGGLECYANPREVIEW),
00532 CC_RUNTIME_CLASS(OpShowPrinterColours),
00533 OPTOKEN_CYANPREVIEW,
00534 OpShowPrinterColours::GetState,
00535 _R(IDS_TOGGLECYANHELP),
00536 _R(IDS_TOGGLECYANBBL)
00537 ))
00538 return(FALSE);
00539
00540 if (!Operation::RegisterOpDescriptor(
00541 0,
00542 _R(IDS_TOGGLEMAGENTAPREVIEW),
00543 CC_RUNTIME_CLASS(OpShowPrinterColours),
00544 OPTOKEN_MAGENTAPREVIEW,
00545 OpShowPrinterColours::GetState,
00546 _R(IDS_TOGGLEMAGENTAHELP),
00547 _R(IDS_TOGGLEMAGENTABBL)
00548 ))
00549 return(FALSE);
00550
00551 if (!Operation::RegisterOpDescriptor(
00552 0,
00553 _R(IDS_TOGGLEYELLOWPREVIEW),
00554 CC_RUNTIME_CLASS(OpShowPrinterColours),
00555 OPTOKEN_YELLOWPREVIEW,
00556 OpShowPrinterColours::GetState,
00557 _R(IDS_TOGGLEYELLOWHELP),
00558 _R(IDS_TOGGLEYELLOWBBL)
00559 ))
00560 return(FALSE);
00561
00562 if (!Operation::RegisterOpDescriptor(
00563 0,
00564 _R(IDS_TOGGLEKEYPREVIEW),
00565 CC_RUNTIME_CLASS(OpShowPrinterColours),
00566 OPTOKEN_KEYPREVIEW,
00567 OpShowPrinterColours::GetState,
00568 _R(IDS_TOGGLEKEYHELP),
00569 _R(IDS_TOGGLEKEYBBL)
00570 ))
00571 return(FALSE);
00572
00573 if (!Operation::RegisterOpDescriptor(
00574 0,
00575 _R(IDS_TOGGLEMONOPLATEPREVIEW),
00576 CC_RUNTIME_CLASS(OpShowPrinterColours),
00577 OPTOKEN_MONOPLATEPREVIEW,
00578 OpShowPrinterColours::GetState,
00579 _R(IDS_TOGGLEMONOPLATEHELP),
00580 _R(IDS_TOGGLEMONOPLATEBBL)
00581 ))
00582 return(FALSE);
00583
00584 if (!Operation::RegisterOpDescriptor(
00585 0,
00586 _R(IDS_TOGGLESPOTPREVIEW),
00587 CC_RUNTIME_CLASS(OpShowPrinterColours),
00588 OPTOKEN_SPOTPREVIEW1,
00589 OpShowPrinterColours::GetState,
00590 _R(IDS_TOGGLESPOTHELP),
00591 _R(IDS_TOGGLESPOTBBL)
00592 ))
00593 return(FALSE);
00594
00595 if (!Operation::RegisterOpDescriptor(
00596 0,
00597 _R(IDS_TOGGLESPOTPREVIEW),
00598 CC_RUNTIME_CLASS(OpShowPrinterColours),
00599 OPTOKEN_SPOTPREVIEW2,
00600 OpShowPrinterColours::GetState,
00601 _R(IDS_TOGGLESPOTHELP),
00602 _R(IDS_TOGGLESPOTBBL)
00603 ))
00604 return(FALSE);
00605
00606 if (!Operation::RegisterOpDescriptor(
00607 0,
00608 _R(IDS_TOGGLESPOTPREVIEW),
00609 CC_RUNTIME_CLASS(OpShowPrinterColours),
00610 OPTOKEN_SPOTPREVIEW3,
00611 OpShowPrinterColours::GetState,
00612 _R(IDS_TOGGLESPOTHELP),
00613 _R(IDS_TOGGLESPOTBBL)
00614 ))
00615 return(FALSE);
00616
00617 if (!Operation::RegisterOpDescriptor(
00618 0,
00619 _R(IDS_TOGGLESPOTPREVIEW),
00620 CC_RUNTIME_CLASS(OpShowPrinterColours),
00621 OPTOKEN_SPOTPREVIEW4,
00622 OpShowPrinterColours::GetState,
00623 _R(IDS_TOGGLESPOTHELP),
00624 _R(IDS_TOGGLESPOTBBL)
00625 ))
00626 return(FALSE);
00627
00628 if (!Operation::RegisterOpDescriptor(
00629 0,
00630 _R(IDS_TOGGLESPOTPREVIEW),
00631 CC_RUNTIME_CLASS(OpShowPrinterColours),
00632 OPTOKEN_SPOTPREVIEW5,
00633 OpShowPrinterColours::GetState,
00634 _R(IDS_TOGGLESPOTHELP),
00635 _R(IDS_TOGGLESPOTBBL)
00636 ))
00637 return(FALSE);
00638
00639 if (!Operation::RegisterOpDescriptor(
00640 0,
00641 _R(IDS_TOGGLESPOTPREVIEW),
00642 CC_RUNTIME_CLASS(OpShowPrinterColours),
00643 OPTOKEN_SPOTPREVIEW6,
00644 OpShowPrinterColours::GetState,
00645 _R(IDS_TOGGLESPOTHELP),
00646 _R(IDS_TOGGLESPOTBBL)
00647 ))
00648 return(FALSE);
00649
00650 if (!Operation::RegisterOpDescriptor(
00651 0,
00652 _R(IDS_TOGGLESPOTPREVIEW),
00653 CC_RUNTIME_CLASS(OpShowPrinterColours),
00654 OPTOKEN_SPOTPREVIEW7,
00655 OpShowPrinterColours::GetState,
00656 _R(IDS_TOGGLESPOTHELP),
00657 _R(IDS_TOGGLESPOTBBL)
00658 ))
00659 return(FALSE);
00660
00661 if (!Operation::RegisterOpDescriptor(
00662 0,
00663 _R(IDS_TOGGLESPOTPREVIEW),
00664 CC_RUNTIME_CLASS(OpShowPrinterColours),
00665 OPTOKEN_SPOTPREVIEW8,
00666 OpShowPrinterColours::GetState,
00667 _R(IDS_TOGGLESPOTHELP),
00668 _R(IDS_TOGGLESPOTBBL)
00669 ))
00670 return(FALSE);
00671
00672 return(TRUE);
00673 }
00674
00675
00676
00677
00678
00679
00680
00681
00682
00683
00684
00685
00686
00687
00688 OpState OpShowPrinterColours::GetState(String_256 *ShadeReason, OpDescriptor* OpDesc)
00689 {
00690
00691 OpState OpSt(FALSE, TRUE, FALSE);
00692
00693 if (DocView::GetSelected() == NULL ||
00694 GetApplication()->GetCMSManager() == NULL)
00695 {
00696
00697 ShadeReason->MakeMsg(_R(IDS_NOCOMPPREVIEW));
00698 return(OpSt);
00699 }
00700
00701 String Token = OpDesc->Token;
00702 if (Token != String(OPTOKEN_MONOPLATEPREVIEW))
00703 OpSt.Greyed = FALSE;
00704
00705 String_16 TempString;
00706 Token.Left(&TempString, 11);
00707 BOOL bIsSpot = (TempString == String(OPTOKEN_SPOTPREVIEWBASE));
00708
00709 IndexedColour* pSpotColour = NULL;
00710 INT32 TokenSpot = 0;
00711 if (bIsSpot)
00712 {
00713 TokenSpot = (Token[11] - _T('0'));
00714 if (TokenSpot > 8)
00715 TokenSpot = -1;
00716 }
00717
00718 IndexedColour *pTokenColour = NULL;
00719 if (TokenSpot > 0)
00720 {
00721 pTokenColour = FindWhichSpot(TokenSpot);
00722 if (pTokenColour == NULL)
00723 {
00724
00725 return(OpState(FALSE, FALSE, TRUE));
00726 }
00727 *ShadeReason = *(pTokenColour->GetName());
00728 }
00729
00730
00731 ColourContext *cc = DocView::GetSelected()->GetColourContext(COLOURMODEL_RGBT);
00732 if (cc && cc->GetColourPlate())
00733 {
00734 ColourPlateType PlateType = cc->GetColourPlate()->GetType();
00735 if (TokenSpot > 0)
00736 {
00737 if (PlateType == COLOURPLATE_SPOT)
00738 {
00739 pSpotColour = cc->GetColourPlate()->GetSpotColour();
00740 if (pSpotColour == pTokenColour)
00741 OpSt.Ticked = TRUE;
00742 }
00743
00744 return(OpSt);
00745 }
00746 else if (Token == String(OPTOKEN_MONOPLATEPREVIEW))
00747 {
00748 OpSt.Greyed = (PlateType != COLOURPLATE_CYAN && PlateType != COLOURPLATE_MAGENTA && PlateType != COLOURPLATE_YELLOW);
00749 OpSt.Ticked = cc->GetColourPlate()->IsMonochrome();
00750 }
00751 else if (Token == String(OPTOKEN_CANCELPREVIEW))
00752 {
00753 OpSt.Ticked = (PlateType == COLOURPLATE_NONE);
00754 }
00755 else
00756 {
00757 ColourPlateType TokenPlate = COLOURPLATE_NONE;
00758 if (Token == String(OPTOKEN_COMPOSITEPREVIEW))
00759 TokenPlate = COLOURPLATE_COMPOSITE;
00760 else if (Token == String(OPTOKEN_CYANPREVIEW))
00761 TokenPlate = COLOURPLATE_CYAN;
00762 else if (Token == String(OPTOKEN_MAGENTAPREVIEW))
00763 TokenPlate = COLOURPLATE_MAGENTA;
00764 else if (Token == String(OPTOKEN_YELLOWPREVIEW))
00765 TokenPlate = COLOURPLATE_YELLOW;
00766 else if (Token == String(OPTOKEN_KEYPREVIEW))
00767 TokenPlate = COLOURPLATE_KEY;
00768
00769 if (PlateType == TokenPlate)
00770 OpSt.Ticked = TRUE;
00771 }
00772 }
00773 else if (Token == String(OPTOKEN_CANCELPREVIEW))
00774 {
00775
00776 OpSt.Ticked = TRUE;
00777 }
00778
00779 return(OpSt);
00780 }
00781
00782
00783
00784
00785
00786
00787
00788
00789
00790
00791
00792
00793
00794
00795
00796
00797 OpOverprintLine::OpOverprintLine()
00798 {
00799 }
00800
00801
00802
00803
00804
00805
00806
00807
00808
00809
00810
00811
00812
00813
00814 void OpOverprintLine::Do(OpDescriptor *OpDesc)
00815 {
00816
00817
00818 OpState State = GetState(NULL, OpDesc);
00819
00820 if (!State.Greyed)
00821 {
00822
00823 NodeAttribute *Attrib = new AttrOverprintLine;
00824
00825 if (Attrib != NULL)
00826 {
00827
00828
00829
00830 if (!State.Ticked)
00831 ((OverprintLineAttrValue *)Attrib->GetAttributeValue())->SetOverprint(TRUE);
00832
00833
00834 AttributeManager::AttributeSelected(Attrib);
00835 }
00836 }
00837
00838 End();
00839 }
00840
00841
00842
00843
00844
00845
00846
00847
00848
00849
00850
00851
00852
00853
00854 BOOL OpOverprintLine::Init()
00855 {
00856 return(Operation::RegisterOpDescriptor(
00857 0,
00858 _R(IDS_ATTROVERPRINTLINE),
00859 CC_RUNTIME_CLASS(OpOverprintLine),
00860 OPTOKEN_OVERPRINTLINE,
00861 OpOverprintLine::GetState,
00862 _R(IDS_HELP_OVERPRINTLINE),
00863 _R(IDS_BBL_OVERPRINTLINE),
00864 _R(IDD_BARCONTROLSTORE),
00865 _R(IDC_OVERPRINTLINE),
00866 SYSTEMBAR_UTILITIES,
00867 TRUE,
00868 FALSE,
00869 FALSE,
00870 NULL,
00871 0,
00872 GREY_WHEN_NO_SELECTION |
00873 DONT_GREY_WHEN_SELECT_INSIDE
00874 ));
00875 }
00876
00877
00878
00879
00880
00881
00882
00883
00884
00885
00886
00887
00888
00889
00890
00891
00892
00893
00894
00895
00896
00897
00898
00899 OpState OpOverprintLine::GetState(String_256 *ShadeReason, OpDescriptor *OpDesc)
00900 {
00901 OpState State;
00902
00903 SelRange *Selection = GetApplication()->FindSelection();
00904 if (Selection == NULL || Selection->Count() < 1)
00905 {
00906 State.Greyed = TRUE;
00907 if (ShadeReason != NULL)
00908 ShadeReason->MakeMsg(_R(IDS_NO_OBJECTS_SELECTED));
00909 }
00910 else
00911 {
00912
00913 NodeAttribute *CurAttr = NULL;
00914
00915 SelRange::CommonAttribResult result =
00916 Selection->FindCommonAttribute(CC_RUNTIME_CLASS(AttrOverprintLine), &CurAttr);
00917
00918 if (result == SelRange::ATTR_MANY)
00919 State.Ticked = TRUE;
00920 else if (result == SelRange::ATTR_COMMON)
00921 {
00922
00923 if ( ((OverprintLineAttrValue *)CurAttr->GetAttributeValue())->IsOverprintOn() )
00924 State.Ticked = TRUE;
00925 }
00926 }
00927
00928 return(State);
00929 }
00930
00931
00932
00933
00934
00935
00936
00937
00938
00939
00940
00941
00942
00943
00944
00945
00946
00947
00948
00949
00950
00951
00952
00953
00954 OpOverprintFill::OpOverprintFill()
00955 {
00956 }
00957
00958
00959
00960
00961
00962
00963
00964
00965
00966
00967
00968
00969
00970
00971 void OpOverprintFill::Do(OpDescriptor *OpDesc)
00972 {
00973
00974
00975 OpState State = GetState(NULL, OpDesc);
00976
00977 if (!State.Greyed)
00978 {
00979
00980 NodeAttribute *Attrib = new AttrOverprintFill;
00981
00982 if (Attrib != NULL)
00983 {
00984
00985
00986
00987 if (!State.Ticked)
00988 ((OverprintFillAttrValue *)Attrib->GetAttributeValue())->SetOverprint(TRUE);
00989
00990
00991 AttributeManager::AttributeSelected(Attrib);
00992 }
00993 }
00994
00995 End();
00996 }
00997
00998
00999
01000
01001
01002
01003
01004
01005
01006
01007
01008
01009
01010
01011 BOOL OpOverprintFill::Init()
01012 {
01013 return(Operation::RegisterOpDescriptor(
01014 0,
01015 _R(IDS_ATTROVERPRINTFILL),
01016 CC_RUNTIME_CLASS(OpOverprintFill),
01017 OPTOKEN_OVERPRINTFILL,
01018 OpOverprintFill::GetState,
01019 _R(IDS_HELP_OVERPRINTFILL),
01020 _R(IDS_BBL_OVERPRINTFILL),
01021 _R(IDD_BARCONTROLSTORE),
01022 _R(IDC_OVERPRINTFILL),
01023 SYSTEMBAR_UTILITIES,
01024 TRUE,
01025 FALSE,
01026 FALSE,
01027 NULL,
01028 0,
01029 GREY_WHEN_NO_SELECTION |
01030 DONT_GREY_WHEN_SELECT_INSIDE
01031 ));
01032 }
01033
01034
01035
01036
01037
01038
01039
01040
01041
01042
01043
01044
01045
01046
01047
01048
01049
01050
01051
01052
01053
01054
01055
01056 OpState OpOverprintFill::GetState(String_256 *ShadeReason, OpDescriptor *OpDesc)
01057 {
01058 OpState State;
01059
01060 SelRange *Selection = GetApplication()->FindSelection();
01061 if (Selection == NULL || Selection->Count() < 1)
01062 {
01063 State.Greyed = TRUE;
01064 if (ShadeReason != NULL)
01065 ShadeReason->MakeMsg(_R(IDS_NO_OBJECTS_SELECTED));
01066 }
01067 else
01068 {
01069
01070 NodeAttribute *CurAttr = NULL;
01071
01072 SelRange::CommonAttribResult result =
01073 Selection->FindCommonAttribute(CC_RUNTIME_CLASS(AttrOverprintFill), &CurAttr);
01074
01075 if (result == SelRange::ATTR_MANY)
01076 State.Ticked = TRUE;
01077 else if (result == SelRange::ATTR_COMMON)
01078 {
01079
01080 if ( ((OverprintFillAttrValue *)CurAttr->GetAttributeValue())->IsOverprintOn() )
01081 State.Ticked = TRUE;
01082 }
01083 }
01084
01085 return(State);
01086 }
01087
01088
01089
01090
01091
01092
01093
01094
01095
01096
01097
01098
01099
01100
01101
01102
01103
01104
01105
01106
01107
01108
01109
01110
01111
01112
01113 OpPrintOnAllPlates::OpPrintOnAllPlates()
01114 {
01115 }
01116
01117
01118
01119
01120
01121
01122
01123
01124
01125
01126
01127
01128
01129
01130 void OpPrintOnAllPlates::Do(OpDescriptor *OpDesc)
01131 {
01132
01133
01134 OpState State = GetState(NULL, OpDesc);
01135
01136 if (!State.Greyed)
01137 {
01138
01139 NodeAttribute *Attrib = new AttrPrintOnAllPlates;
01140
01141 if (Attrib != NULL)
01142 {
01143
01144
01145
01146 if (!State.Ticked)
01147 ((PrintOnAllPlatesAttrValue *)Attrib->GetAttributeValue())->SetPrintOnAllPlates(TRUE);
01148
01149
01150 AttributeManager::AttributeSelected(Attrib);
01151 }
01152 }
01153
01154 End();
01155 }
01156
01157
01158
01159
01160
01161
01162
01163
01164
01165
01166
01167
01168
01169
01170 BOOL OpPrintOnAllPlates::Init()
01171 {
01172 return(Operation::RegisterOpDescriptor(
01173 0,
01174 _R(IDS_ATTRPRINTONALLPLATES),
01175 CC_RUNTIME_CLASS(OpPrintOnAllPlates),
01176 OPTOKEN_PRINTONALLPLATES,
01177 OpPrintOnAllPlates::GetState,
01178 _R(IDS_HELP_PRINTONALLPLATES),
01179 _R(IDS_BBL_PRINTONALLPLATES),
01180 _R(IDD_BARCONTROLSTORE),
01181 _R(IDC_PRINTONALLPLATES),
01182 SYSTEMBAR_UTILITIES,
01183 TRUE,
01184 FALSE,
01185 FALSE,
01186 NULL,
01187 0,
01188 GREY_WHEN_NO_SELECTION |
01189 DONT_GREY_WHEN_SELECT_INSIDE
01190 ));
01191 }
01192
01193
01194
01195
01196
01197
01198
01199
01200
01201
01202
01203
01204
01205
01206
01207
01208
01209
01210
01211
01212
01213
01214
01215 OpState OpPrintOnAllPlates::GetState(String_256 *ShadeReason, OpDescriptor *OpDesc)
01216 {
01217 OpState State;
01218
01219 SelRange *Selection = GetApplication()->FindSelection();
01220 if (Selection == NULL || Selection->Count() < 1)
01221 {
01222 State.Greyed = TRUE;
01223 if (ShadeReason != NULL)
01224 ShadeReason->MakeMsg(_R(IDS_NO_OBJECTS_SELECTED));
01225 }
01226 else
01227 {
01228
01229 NodeAttribute *CurAttr = NULL;
01230
01231 SelRange::CommonAttribResult result =
01232 Selection->FindCommonAttribute(CC_RUNTIME_CLASS(AttrPrintOnAllPlates), &CurAttr);
01233
01234 if (result == SelRange::ATTR_MANY)
01235 State.Ticked = TRUE;
01236 else if (result == SelRange::ATTR_COMMON)
01237 {
01238
01239 if ( ((PrintOnAllPlatesAttrValue *)CurAttr->GetAttributeValue())->IsPrintOnAllPlatesOn() )
01240 State.Ticked = TRUE;
01241 }
01242 }
01243
01244 return(State);
01245 }
01246
01247
01248
01249 #if FALSE
01250
01251
01252
01253
01254
01255
01256
01257
01258
01259
01260
01261
01262 OpToggleCompositePreview::OpToggleCompositePreview()
01263 {
01264 }
01265
01266
01267
01268
01269
01270
01271
01272
01273
01274
01275
01276
01277
01278
01279
01280 void OpToggleCompositePreview::Do(OpDescriptor *)
01281 {
01282 if (CanToggleState())
01283 {
01284 if (IsInCompositeMode())
01285 {
01286 if (DocView::GetSelected() != NULL)
01287 {
01288
01289 DocView::GetSelected()->SetColourPlate(NULL);
01290 ColourManager::SelViewContextHasChanged();
01291 }
01292 }
01293 else
01294 {
01295 SetNewColourPlate(COLOURPLATE_COMPOSITE, 0, 0);
01296
01297
01298
01299
01300
01301 Progress::Start();
01302 DWORD *Dummy = GetApplication()->GetCMSManager()->GetPaperViewTable();
01303 Progress::Stop();
01304 }
01305 }
01306
01307 End();
01308 }
01309
01310
01311
01312
01313
01314
01315
01316
01317
01318
01319
01320
01321
01322
01323 BOOL OpToggleCompositePreview::Init()
01324 {
01325 return(Operation::RegisterOpDescriptor(
01326 0,
01327 _R(IDS_TOGGLECOMPPREVIEW),
01328 CC_RUNTIME_CLASS(OpToggleCompositePreview),
01329 OPTOKEN_COMPOSITEPREVIEW,
01330 OpToggleCompositePreview::GetState,
01331 _R(IDS_TOGGLECOMPHELP),
01332 _R(IDS_TOGGLECOMPBBL),
01333 _R(IDD_BARCONTROLSTORE),
01334 _R(IDC_COMPOSITEPREVIEW),
01335 SYSTEMBAR_UTILITIES,
01336 TRUE,
01337 FALSE,
01338 TRUE,
01339 NULL,
01340 NULL,
01341 0
01342 ));
01343 }
01344
01345
01346
01347
01348
01349
01350
01351
01352
01353
01354
01355
01356
01357
01358 OpState OpToggleCompositePreview::GetState(String_256 *ShadeReason, OpDescriptor*)
01359 {
01360 OpState OpSt;
01361
01362 if (!CanToggleState())
01363 {
01364 OpSt.Greyed = TRUE;
01365 ShadeReason->MakeMsg(_R(IDS_NOCOMPPREVIEW));
01366 }
01367
01368 if (IsInCompositeMode())
01369 OpSt.Ticked = TRUE;
01370
01371 return OpSt;
01372 }
01373
01374
01375
01376
01377
01378
01379
01380
01381
01382
01383
01384
01385
01386
01387
01388
01389
01390
01391 BOOL OpToggleCompositePreview::CanToggleState(void)
01392 {
01393 if (DocView::GetSelected() == NULL)
01394 return(FALSE);
01395
01396 if (GetApplication()->GetCMSManager() == NULL)
01397 return(FALSE);
01398
01399 return(TRUE);
01400 }
01401
01402
01403
01404
01405
01406
01407
01408
01409
01410
01411
01412
01413
01414
01415
01416
01417
01418
01419
01420 BOOL OpToggleCompositePreview::IsInCompositeMode(void)
01421 {
01422 if (DocView::GetSelected() == NULL)
01423 return(FALSE);
01424
01425 ColourContext *cc = DocView::GetSelected()->GetColourContext(COLOURMODEL_RGBT);
01426
01427 if (cc == NULL || cc->GetColourPlate() == NULL)
01428 return(FALSE);
01429
01430 if (cc->GetColourPlate()->GetType() != COLOURPLATE_COMPOSITE)
01431 return(FALSE);
01432
01433 return(TRUE);
01434 }
01435
01436
01437
01438
01439
01440
01441
01442
01443
01444
01445
01446
01447
01448
01449
01450
01451
01452
01453 void OpToggleCyanPreview::Do(OpDescriptor *)
01454 {
01455 if (CanToggleState())
01456 {
01457 if (IsInCyanMode())
01458 {
01459 if (DocView::GetSelected() != NULL)
01460 {
01461
01462 DocView::GetSelected()->SetColourPlate(NULL);
01463 ColourManager::SelViewContextHasChanged();
01464 }
01465 }
01466 else
01467 {
01468 SetNewColourPlate(COLOURPLATE_CYAN, 0, 0);
01469
01470
01471
01472
01473
01474
01475
01476
01477 }
01478 }
01479
01480 End();
01481 }
01482
01483
01484
01485
01486
01487
01488
01489
01490
01491
01492
01493
01494
01495
01496 BOOL OpToggleCyanPreview::Init()
01497 {
01498 return(Operation::RegisterOpDescriptor(
01499 0,
01500 _R(IDS_TOGGLECYANPREVIEW),
01501 CC_RUNTIME_CLASS(OpToggleCyanPreview),
01502 OPTOKEN_CYANPREVIEW,
01503 OpToggleCyanPreview::GetState,
01504 _R(IDS_TOGGLECYANHELP),
01505 _R(IDS_TOGGLECYANBBL),
01506 NULL,
01507 NULL,
01508 SYSTEMBAR_UTILITIES,
01509 TRUE,
01510 FALSE,
01511 TRUE,
01512 NULL,
01513 NULL,
01514 0
01515 ));
01516 }
01517
01518
01519
01520
01521
01522
01523
01524
01525
01526
01527
01528
01529
01530
01531 OpState OpToggleCyanPreview::GetState(String_256 *ShadeReason, OpDescriptor*)
01532 {
01533 OpState OpSt;
01534
01535 if (!CanToggleState())
01536 {
01537 OpSt.Greyed = TRUE;
01538 ShadeReason->MakeMsg(_R(IDS_NOCOMPPREVIEW));
01539 }
01540
01541 if (IsInCyanMode())
01542 OpSt.Ticked = TRUE;
01543
01544 return OpSt;
01545 }
01546
01547
01548
01549
01550
01551
01552
01553
01554
01555
01556
01557
01558
01559
01560
01561
01562
01563
01564 BOOL OpToggleCyanPreview::CanToggleState(void)
01565 {
01566 if (DocView::GetSelected() == NULL)
01567 return(FALSE);
01568
01569 if (GetApplication()->GetCMSManager() == NULL)
01570 return(FALSE);
01571
01572 return(TRUE);
01573 }
01574
01575
01576
01577
01578
01579
01580
01581
01582
01583
01584
01585
01586
01587
01588
01589
01590
01591
01592
01593 BOOL OpToggleCyanPreview::IsInCyanMode(void)
01594 {
01595 if (DocView::GetSelected() == NULL)
01596 return(FALSE);
01597
01598 ColourContext *cc = DocView::GetSelected()->GetColourContext(COLOURMODEL_RGBT);
01599
01600 if (cc == NULL || cc->GetColourPlate() == NULL)
01601 return(FALSE);
01602
01603 if (cc->GetColourPlate()->GetType() != COLOURPLATE_CYAN)
01604 return(FALSE);
01605
01606 return(TRUE);
01607 }
01608
01609
01610
01611
01612
01613
01614
01615
01616
01617
01618
01619
01620
01621
01622
01623
01624
01625
01626 void OpToggleMagentaPreview::Do(OpDescriptor *)
01627 {
01628 if (CanToggleState())
01629 {
01630 if (IsInMagentaMode())
01631 {
01632 if (DocView::GetSelected() != NULL)
01633 {
01634
01635 DocView::GetSelected()->SetColourPlate(NULL);
01636 ColourManager::SelViewContextHasChanged();
01637 }
01638 }
01639 else
01640 {
01641 SetNewColourPlate(COLOURPLATE_MAGENTA, 0, 0);
01642
01643
01644
01645
01646
01647
01648
01649
01650 }
01651 }
01652
01653 End();
01654 }
01655
01656
01657
01658
01659
01660
01661
01662
01663
01664
01665
01666
01667
01668
01669 BOOL OpToggleMagentaPreview::Init()
01670 {
01671 return(Operation::RegisterOpDescriptor(
01672 0,
01673 _R(IDS_TOGGLEMAGENTAPREVIEW),
01674 CC_RUNTIME_CLASS(OpToggleMagentaPreview),
01675 OPTOKEN_MAGENTAPREVIEW,
01676 OpToggleMagentaPreview::GetState,
01677 _R(IDS_TOGGLEMAGENTAHELP),
01678 _R(IDS_TOGGLEMAGENTABBL),
01679 NULL,
01680 NULL,
01681 SYSTEMBAR_UTILITIES,
01682 TRUE,
01683 FALSE,
01684 TRUE,
01685 NULL,
01686 NULL,
01687 0
01688 ));
01689 }
01690
01691
01692
01693
01694
01695
01696
01697
01698
01699
01700
01701
01702
01703
01704 OpState OpToggleMagentaPreview::GetState(String_256 *ShadeReason, OpDescriptor*)
01705 {
01706 OpState OpSt;
01707
01708 if (!CanToggleState())
01709 {
01710 OpSt.Greyed = TRUE;
01711 ShadeReason->MakeMsg(_R(IDS_NOCOMPPREVIEW));
01712 }
01713
01714 if (IsInMagentaMode())
01715 OpSt.Ticked = TRUE;
01716
01717 return OpSt;
01718 }
01719
01720
01721
01722
01723
01724
01725
01726
01727
01728
01729
01730
01731
01732
01733
01734
01735
01736
01737 BOOL OpToggleMagentaPreview::CanToggleState(void)
01738 {
01739 if (DocView::GetSelected() == NULL)
01740 return(FALSE);
01741
01742 if (GetApplication()->GetCMSManager() == NULL)
01743 return(FALSE);
01744
01745 return(TRUE);
01746 }
01747
01748
01749
01750
01751
01752
01753
01754
01755
01756
01757
01758
01759
01760
01761
01762
01763
01764
01765
01766 BOOL OpToggleMagentaPreview::IsInMagentaMode(void)
01767 {
01768 if (DocView::GetSelected() == NULL)
01769 return(FALSE);
01770
01771 ColourContext *cc = DocView::GetSelected()->GetColourContext(COLOURMODEL_RGBT);
01772
01773 if (cc == NULL || cc->GetColourPlate() == NULL)
01774 return(FALSE);
01775
01776 if (cc->GetColourPlate()->GetType() != COLOURPLATE_MAGENTA)
01777 return(FALSE);
01778
01779 return(TRUE);
01780 }
01781
01782
01783
01784
01785
01786
01787
01788
01789
01790
01791
01792
01793
01794
01795
01796
01797 void OpToggleYellowPreview::Do(OpDescriptor *)
01798 {
01799 if (CanToggleState())
01800 {
01801 if (IsInYellowMode())
01802 {
01803 if (DocView::GetSelected() != NULL)
01804 {
01805
01806 DocView::GetSelected()->SetColourPlate(NULL);
01807 ColourManager::SelViewContextHasChanged();
01808 }
01809 }
01810 else
01811 {
01812 SetNewColourPlate(COLOURPLATE_YELLOW, 0, 0);
01813
01814
01815
01816
01817
01818
01819
01820
01821 }
01822 }
01823
01824 End();
01825 }
01826
01827
01828
01829
01830
01831
01832
01833
01834
01835
01836
01837
01838
01839
01840 BOOL OpToggleYellowPreview::Init()
01841 {
01842 return(Operation::RegisterOpDescriptor(
01843 0,
01844 _R(IDS_TOGGLEYELLOWPREVIEW),
01845 CC_RUNTIME_CLASS(OpToggleYellowPreview),
01846 OPTOKEN_YELLOWPREVIEW,
01847 OpToggleYellowPreview::GetState,
01848 _R(IDS_TOGGLEYELLOWHELP),
01849 _R(IDS_TOGGLEYELLOWBBL),
01850 NULL,
01851 NULL,
01852 SYSTEMBAR_UTILITIES,
01853 TRUE,
01854 FALSE,
01855 TRUE,
01856 NULL,
01857 NULL,
01858 0
01859 ));
01860 }
01861
01862
01863
01864
01865
01866
01867
01868
01869
01870
01871
01872
01873
01874
01875 OpState OpToggleYellowPreview::GetState(String_256 *ShadeReason, OpDescriptor*)
01876 {
01877 OpState OpSt;
01878
01879 if (!CanToggleState())
01880 {
01881 OpSt.Greyed = TRUE;
01882 ShadeReason->MakeMsg(_R(IDS_NOCOMPPREVIEW));
01883 }
01884
01885 if (IsInYellowMode())
01886 OpSt.Ticked = TRUE;
01887
01888 return OpSt;
01889 }
01890
01891
01892
01893
01894
01895
01896
01897
01898
01899
01900
01901
01902
01903
01904
01905
01906
01907
01908 BOOL OpToggleYellowPreview::CanToggleState(void)
01909 {
01910 if (DocView::GetSelected() == NULL)
01911 return(FALSE);
01912
01913 if (GetApplication()->GetCMSManager() == NULL)
01914 return(FALSE);
01915
01916 return(TRUE);
01917 }
01918
01919
01920
01921
01922
01923
01924
01925
01926
01927
01928
01929
01930
01931
01932
01933
01934
01935
01936
01937 BOOL OpToggleYellowPreview::IsInYellowMode(void)
01938 {
01939 if (DocView::GetSelected() == NULL)
01940 return(FALSE);
01941
01942 ColourContext *cc = DocView::GetSelected()->GetColourContext(COLOURMODEL_RGBT);
01943
01944 if (cc == NULL || cc->GetColourPlate() == NULL)
01945 return(FALSE);
01946
01947 if (cc->GetColourPlate()->GetType() != COLOURPLATE_YELLOW)
01948 return(FALSE);
01949
01950 return(TRUE);
01951 }
01952
01953
01954
01955
01956
01957
01958
01959
01960
01961
01962
01963
01964
01965
01966
01967 void OpToggleKeyPreview::Do(OpDescriptor *)
01968 {
01969 if (CanToggleState())
01970 {
01971 if (IsInKeyMode())
01972 {
01973 if (DocView::GetSelected() != NULL)
01974 {
01975
01976 DocView::GetSelected()->SetColourPlate(NULL);
01977 ColourManager::SelViewContextHasChanged();
01978 }
01979 }
01980 else
01981 {
01982 SetNewColourPlate(COLOURPLATE_KEY, 0, 0);
01983
01984
01985
01986
01987
01988
01989
01990
01991 }
01992 }
01993
01994 End();
01995 }
01996
01997
01998
01999
02000
02001
02002
02003
02004
02005
02006
02007
02008
02009
02010 BOOL OpToggleKeyPreview::Init()
02011 {
02012 return(Operation::RegisterOpDescriptor(
02013 0,
02014 _R(IDS_TOGGLEKEYPREVIEW),
02015 CC_RUNTIME_CLASS(OpToggleKeyPreview),
02016 OPTOKEN_KEYPREVIEW,
02017 OpToggleKeyPreview::GetState,
02018 _R(IDS_TOGGLEKEYHELP),
02019 _R(IDS_TOGGLEKEYBBL),
02020 NULL,
02021 NULL,
02022 SYSTEMBAR_UTILITIES,
02023 TRUE,
02024 FALSE,
02025 TRUE,
02026 NULL,
02027 NULL,
02028 0
02029 ));
02030 }
02031
02032
02033
02034
02035
02036
02037
02038
02039
02040
02041
02042
02043
02044
02045 OpState OpToggleKeyPreview::GetState(String_256 *ShadeReason, OpDescriptor*)
02046 {
02047 OpState OpSt;
02048
02049 if (!CanToggleState())
02050 {
02051 OpSt.Greyed = TRUE;
02052 ShadeReason->MakeMsg(_R(IDS_NOCOMPPREVIEW));
02053 }
02054
02055 if (IsInKeyMode())
02056 OpSt.Ticked = TRUE;
02057
02058 return OpSt;
02059 }
02060
02061
02062
02063
02064
02065
02066
02067
02068
02069
02070
02071
02072
02073
02074
02075
02076
02077
02078 BOOL OpToggleKeyPreview::CanToggleState(void)
02079 {
02080 if (DocView::GetSelected() == NULL)
02081 return(FALSE);
02082
02083 if (GetApplication()->GetCMSManager() == NULL)
02084 return(FALSE);
02085
02086 return(TRUE);
02087 }
02088
02089
02090
02091
02092
02093
02094
02095
02096
02097
02098
02099
02100
02101
02102
02103
02104
02105
02106
02107 BOOL OpToggleKeyPreview::IsInKeyMode(void)
02108 {
02109 if (DocView::GetSelected() == NULL)
02110 return(FALSE);
02111
02112 ColourContext *cc = DocView::GetSelected()->GetColourContext(COLOURMODEL_RGBT);
02113
02114 if (cc == NULL || cc->GetColourPlate() == NULL)
02115 return(FALSE);
02116
02117 if (cc->GetColourPlate()->GetType() != COLOURPLATE_KEY)
02118 return(FALSE);
02119
02120 return(TRUE);
02121 }
02122
02123
02124
02125
02126
02127
02128
02129
02130
02131
02132
02133
02134
02135
02136
02137 void OpToggleSpotPreview::Do(OpDescriptor *)
02138 {
02139 if (CanToggleState())
02140 {
02141 if (IsInSpotMode())
02142 {
02143 if (DocView::GetSelected() != NULL)
02144 {
02145
02146 DocView::GetSelected()->SetColourPlate(NULL);
02147 ColourManager::SelViewContextHasChanged();
02148 }
02149 }
02150 else
02151 {
02152 SetNewColourPlate(COLOURPLATE_SPOT, 0, 1);
02153
02154
02155
02156
02157
02158
02159
02160
02161 }
02162 }
02163
02164 End();
02165 }
02166
02167
02168
02169
02170
02171
02172
02173
02174
02175
02176
02177
02178
02179
02180 BOOL OpToggleSpotPreview::Init()
02181 {
02182 return(Operation::RegisterOpDescriptor(
02183 0,
02184 _R(IDS_TOGGLESPOTPREVIEW),
02185 CC_RUNTIME_CLASS(OpToggleSpotPreview),
02186 OPTOKEN_SPOTPREVIEW,
02187 OpToggleSpotPreview::GetState,
02188 _R(IDS_TOGGLESPOTHELP),
02189 _R(IDS_TOGGLESPOTBBL),
02190 NULL,
02191 NULL,
02192 SYSTEMBAR_UTILITIES,
02193 TRUE,
02194 FALSE,
02195 TRUE,
02196 NULL,
02197 NULL,
02198 0
02199 ));
02200 }
02201
02202
02203
02204
02205
02206
02207
02208
02209
02210
02211
02212
02213
02214
02215 OpState OpToggleSpotPreview::GetState(String_256 *ShadeReason, OpDescriptor*)
02216 {
02217 OpState OpSt;
02218
02219 if (!CanToggleState())
02220 {
02221 OpSt.Greyed = TRUE;
02222 ShadeReason->MakeMsg(_R(IDS_NOCOMPPREVIEW));
02223 }
02224
02225 if (IsInSpotMode())
02226 OpSt.Ticked = TRUE;
02227
02228 return OpSt;
02229 }
02230
02231
02232
02233
02234
02235
02236
02237
02238
02239
02240
02241
02242
02243
02244
02245
02246
02247
02248 BOOL OpToggleSpotPreview::CanToggleState(void)
02249 {
02250 if (DocView::GetSelected() == NULL)
02251 return(FALSE);
02252
02253 if (GetApplication()->GetCMSManager() == NULL)
02254 return(FALSE);
02255
02256 return(TRUE);
02257 }
02258
02259
02260
02261
02262
02263
02264
02265
02266
02267
02268
02269
02270
02271
02272
02273
02274
02275
02276
02277 BOOL OpToggleSpotPreview::IsInSpotMode(void)
02278 {
02279 if (DocView::GetSelected() == NULL)
02280 return(FALSE);
02281
02282 ColourContext *cc = DocView::GetSelected()->GetColourContext(COLOURMODEL_RGBT);
02283
02284 if (cc == NULL || cc->GetColourPlate() == NULL)
02285 return(FALSE);
02286
02287 if (cc->GetColourPlate()->GetType() != COLOURPLATE_SPOT)
02288 return(FALSE);
02289
02290 return(TRUE);
02291 }
02292
02293
02294
02295
02296
02297
02298
02299
02300
02301
02302
02303
02304
02305
02306
02307
02308 void OpToggleMonoPlatePreview::Do(OpDescriptor *)
02309 {
02310 if (CanToggleState())
02311 {
02312 if (IsInMonoMode())
02313 {
02314 if (DocView::GetSelected() != NULL)
02315 {
02316
02317 DocView::GetSelected()->SetColourPlate(NULL);
02318 ColourManager::SelViewContextHasChanged();
02319 }
02320 }
02321 else
02322 {
02323 SetNewColourPlate(COLOURPLATE_NONE, 1, 0);
02324
02325
02326
02327
02328
02329
02330
02331
02332 }
02333 }
02334
02335 End();
02336 }
02337
02338
02339
02340
02341
02342
02343
02344
02345
02346
02347
02348
02349
02350
02351 BOOL OpToggleMonoPlatePreview::Init()
02352 {
02353 return(Operation::RegisterOpDescriptor(
02354 0,
02355 _R(IDS_TOGGLEMONOPLATEPREVIEW),
02356 CC_RUNTIME_CLASS(OpToggleMonoPlatePreview),
02357 OPTOKEN_MONOPLATEPREVIEW,
02358 OpToggleMonoPlatePreview::GetState,
02359 _R(IDS_TOGGLEMONOPLATEHELP),
02360 _R(IDS_TOGGLEMONOPLATEBBL),
02361 NULL,
02362 NULL,
02363 SYSTEMBAR_UTILITIES,
02364 TRUE,
02365 FALSE,
02366 TRUE,
02367 NULL,
02368 NULL,
02369 0
02370 ));
02371 }
02372
02373
02374
02375
02376
02377
02378
02379
02380
02381
02382
02383
02384
02385
02386 OpState OpToggleMonoPlatePreview::GetState(String_256 *ShadeReason, OpDescriptor*)
02387 {
02388 OpState OpSt;
02389
02390 if (!CanToggleState())
02391 {
02392 OpSt.Greyed = TRUE;
02393 ShadeReason->MakeMsg(_R(IDS_NOCOMPPREVIEW));
02394 }
02395
02396 if (IsInMonoMode())
02397 OpSt.Ticked = TRUE;
02398
02399 return OpSt;
02400 }
02401
02402
02403
02404
02405
02406
02407
02408
02409
02410
02411
02412
02413
02414
02415
02416
02417
02418
02419 BOOL OpToggleMonoPlatePreview::CanToggleState(void)
02420 {
02421 if (DocView::GetSelected() == NULL)
02422 return(FALSE);
02423
02424
02425
02426 return(TRUE);
02427 }
02428
02429
02430
02431
02432
02433
02434
02435
02436
02437
02438
02439
02440
02441
02442
02443
02444
02445
02446
02447 BOOL OpToggleMonoPlatePreview::IsInMonoMode(void)
02448 {
02449 if (DocView::GetSelected() == NULL)
02450 return(FALSE);
02451
02452 ColourContext *cc = DocView::GetSelected()->GetColourContext(COLOURMODEL_RGBT);
02453
02454 if (cc == NULL || cc->GetColourPlate() == NULL)
02455 return(FALSE);
02456
02457 if (!(cc->GetColourPlate()->IsMonochrome()))
02458 return(FALSE);
02459
02460 return(TRUE);
02461 }
02462
02463 #endif