00001 // $Id: main2.cpp 1739 2006-09-05 11:07:16Z luke $ 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 // Contains general initialisation of the kernel, after Tool::InitTools() is called 00099 00100 /* 00101 */ 00102 00103 #include "camtypes.h" 00104 //#include "bars.h" 00105 //#include "bitmap.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00106 //#include "bmplist.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00107 //#include "fraclist.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00108 #include "ophist.h" 00109 //#include "docview.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00110 #include "blobby.h" 00111 #include "groupops.h" 00112 #include "zordops.h" 00113 #include "mkshapes.h" 00114 #include "cutop.h" 00115 #include "menuops.h" 00116 #include "attrappl.h" 00117 #include "aboutdlg.h" 00118 //#include "tooldlg.h" 00119 #include "layermgr.h" 00120 #include "sginit.h" 00121 #include "bfxdlg.h" 00122 #include "dbugtree.h" 00123 #include "printing.h" 00124 //#include "oilfltrs.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00125 #include "filedlgs.h" 00126 #include "nativeop.h" 00127 #include "filelist.h" 00128 #include "exceptio.h" 00129 #include "infobar.h" 00130 //#include "ink.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00131 //#include "node.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00132 //#include "filters.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00133 #include "speedtst.h" 00134 #include "snapops.h" 00135 #include "oppull.h" 00136 #include "pathedit.h" 00137 #include "textops.h" 00138 #include "shapeops.h" 00139 #include "pathops.h" 00140 #include "opsmpshp.h" 00141 #include "qualops.h" 00142 //#include "clipext.h" 00143 #include "opdragbx.h" 00144 #include "optsprin.h" 00145 #include "guides.h" 00146 #include "snapops.h" 00147 #include "opwhat.h" 00148 #include "impexpop.h" 00149 //#include "colmodel.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00150 //#include "xaracms.h" 00151 #include "tipsdlg.h" 00152 //#include "oleprefs.h" 00153 #include "pen.h" 00154 #include "valfunc.h" 00155 #include "mkstroke.h" 00156 #include "bmpsdlg.h" 00157 #include "urlimp.h" 00158 #include "urldlg.h" 00159 #include "aprps.h" 00160 #include "crthumb.h" 00161 #include "bmapprev.h" 00162 #include "opbevel.h" 00163 #include "lattrops.h" // for OpChangeArrowExtendsDesc 00164 #include "opshadow.h" 00165 //#include "slice.h" 00166 #include "biasdlg.h" 00167 #include "opcntr.h" // Contouring operations 00168 #include "barcreationdlg.h" 00169 #include "opbarcreation.h" 00170 #include "opdupbar.h" 00171 //#include "extendsetsdlg.h" // for ExtendSetsDlg 00172 #include "opdrbrsh.h" 00173 #include "opfeathr.h" 00174 #include "opclip.h" // for ClipView operations 00175 #include "brushdlg.h" // for CBrushEditDlg 00176 #include "brushop.h" 00177 #include "brshname.h" 00178 #include "zoomops.h" 00179 //#include "helpdownload.h" 00180 //#include "opliveeffects.h" 00181 #include "nodeliveeffect.h" 00182 #include "stdbars.h" 00183 #include "rendwnd.h" 00184 #include "backgrnd.h" 00185 #include "blndtool.h" 00186 #include "helpuser.h" 00187 #ifdef XAR_TREE_DIALOG 00188 #include "cxftree.h" 00189 #endif 00190 00191 #if _DEBUG 00192 #include "debugdlg.h" 00193 //#include "cmxtree.h" 00194 #endif 00195 00196 #ifdef RALPH 00197 00198 // Ralph only 00199 BOOL InitPostTools1() 00200 { 00201 return ( 00202 OILBitmap::Init() && // read default fill bitmap 00203 GlobalBitmapList::Init() && // Setup the global bitmap list 00204 GlobalFractalList::Init() && // Setup the fractal list 00205 OpToggleScroll::Init() && // Register Toggle proport scrolbar Operation 00206 OpMenuLoad::Init() && // Register Load operation 00207 OpException::Init() && 00208 NodeRenderableInk::Init() && 00209 NodeRenderableBounded::Init() && // Declare the magnetic radii options 00210 Filter::InitFilters() && // Init filters (must be after ExternalClipboard) 00211 OpDragBox::Init() && // drag operation base-class 00212 OpQuality::Init() // init the OpQuality operations 00213 ); 00214 } 00215 00216 #else 00217 00218 // Normal exe's and standalones 00219 BOOL InitPostTools1() 00220 { 00221 return 00222 PORTNOTE("other","Removed DialogBarOp usage") 00223 #ifndef EXCLUDE_FROM_XARALX 00224 DialogBarOp::Init() && 00225 #endif 00226 PORTNOTE("other","Removed SystemBarOp usage") 00227 #ifndef EXCLUDE_FROM_XARALX 00228 SystemBarOp::Init() && // Register system bars 00229 #endif 00230 OILBitmap::Init() && // read default fill bitmap 00231 PORTNOTE("other","Removed Lots of init functions") 00232 #ifndef EXCLUDE_FROM_XARALX 00233 GlobalBitmapList::Init() && // Setup the global bitmap list 00234 GlobalFractalList::Init() && // Setup the fractal list 00235 #endif 00236 OpUndo::Init() && // Register Undo Operation 00237 OpRedo::Init() && // Register Redo Operation 00238 OpToggleFore::Init() && // Register Toggle fore/back render Operation 00239 OpToggleDoubleBuffer::Init() && // Register Toggle double buffer operation 00240 OpToggleSolidDrag::Init() && // Register Toggle solid drag operation 00241 OpCut::Init() && // Register Cut operation 00242 OpCopy::Init() && // Register Copy operation 00243 OpPaste::Init() && // Register Paste operation 00244 OpPasteAttributes::Init() && // Register Paste Attributes operation 00245 OpDelete::Init() && // Register Delete operation 00246 OpDuplicate::Init() && // Register Duplicate operation 00247 OpClone::Init() && // Register Clone operation 00248 OpCopyAndTransform::Init() && // Register the operation for dropping copies 00249 OpExit::Init() && // Register Exit Operation 00250 BlobbyOp::Init() && // Temp ****** 00251 OpGroup::Init() && // Register group operation 00252 OpUngroup::Init() && // Register Ungroup operation 00253 OpUngroupSpecial::Init() && // Register Ungroup Special operation 00254 OpBringToFront::Init() && // Register BringToFront operation 00255 OpPutToBack::Init() && // Register PutToBack operation 00256 OpMoveForwards::Init() && // Register MoveForwards operation 00257 OpMoveBackwards::Init() && // Register MoveBackwards operation 00258 OpMoveToLyrInFront::Init() && // Register Move to layer in front operation 00259 OpMoveToLyrBehind::Init() && // Register Move to layer behind operation 00260 OpApplyAttribToSelected::Init() && // Register OpApplyAttribToSelected Operation 00261 OpApplyAttribsToSelected::Init() && // Register OpApplyAttribsToSelected Operation 00262 OpApplyAttribToNode::Init() && // Register OpApplyAttribToNode Operation 00263 00264 OpReplaceAttributes::Init() && // Register OpReplaceAttributes Operation 00265 DocOps::Init() && // Register Doc Operations 00266 MenuPopupOps::Init() && // Register Menu Popup Operations 00267 OpChangeBlendDistance::Declare() && // Register the change blend steps distance op 00268 00269 #ifndef EXCLUDE_FROM_XARALX 00270 OpToggleScroll::Init() && // Register Toggle proport scrolbar Operation 00271 #endif 00272 OpChangeFeatherSize::Init() && // Register feather size change operation 00273 OpChangeFeatherProfile::Init() && // Register feather profile change operation 00274 OpMakeShapes::Init() && // Register MakeShapes operation 00275 // Neville 5/8/97 remove Stroking code 00276 #ifdef VECTOR_STROKING 00277 OpMakeStroke::Init() && // Register MakeStroke operation 00278 #endif // VECTOR_STROKING 00279 AboutDlg::Init() && // Register "About Camelot" Dialog 00280 #ifndef EXCLUDE_FROM_XARALX 00281 OpUpdate::Init() && // Register Update Operation 00282 OpRegister::Init() && // Register Register Operation 00283 TipsDlg::Init() && // Register "Tip of the Day" Dialog 00284 OpSlice::Init() && // Register Image Slicing 00285 BarStatesDlg::Init() && // Register the Bar States Creation Dlg 00286 BarRedefineStateDlg::Init() && // Register the Redefine Bar State Dlg 00287 BarCreationDlg::Init() && // Register the Bar Creation Dlg 00288 OpBarCreation::Init() && // Register the Bar Creation Op 00289 OpDuplicateBar::Init() && // Register the Bar Duplication Op 00290 OpShortenBar::Init() && // Register the Bar Reducing Op 00291 OpDelBar::Init() && // Register the Bar State Deleting Op 00292 OpShowState::Init() && // Register the Show State-Layer Op 00293 OpMoveToLayer::Init() && // Register the op that moves the selection between layers 00294 ExtendSetsDlg::Init() && // Register the Extend Sets Dialog 00295 #endif 00296 OpMakeNodesShapes::Init() && // Register the OpMakeNodesShapes operation 00297 OpChangeBrush::Declare() && // Register the change brush operation 00298 00299 OpApplyClipView::Init() && // Register the Apply ClipView operation 00300 OpRemoveClipView::Init() && // Register the Remove ClipView operation 00301 // Neville 5/8/97 remove Stroking code 00302 #ifdef VECTOR_STROKING 00303 ValueFunction::Init() && // Init all value function classes 00304 #endif // VECTOR_STROKING 00305 // LayerDlg::Init() && // Register Layer dialog (No longer used) 00306 #ifndef EXCLUDE_FROM_XARALX 00307 #ifndef STANDALONE 00308 ToolbarDlg::Init() && // Register "Toolbar..." dialogs 00309 #endif // STANDALONE 00310 #endif //EXCLUDE_FROM_XARALX 00311 00312 // WEBSTER - markn 15/1/97 00313 // Removed these ops as they are not used 00314 #ifndef WEBSTER 00315 OpLayerChange::Init() && // Register layer change Op 00316 #endif //WEBSTER 00317 00318 #ifndef EXCLUDE_GALS 00319 SGInit::Init() && // Init/Register all the supergallery related Ops 00320 #endif //EXCLUDE_GALS 00321 BmapPrevDlg::Init() && // Bitmap Preview Dialog Box - Dbug Builds for the moment [MartinD] 00322 00323 // Moved this here from inside ColourSGallery::Init 00324 OpBackground::Init() && 00325 00326 // WEBSTER - markn 15/1/97 00327 // Removed these ops as they are not used 00328 #ifndef WEBSTER 00329 OpGuideline::Init() && // Register the guideline op 00330 OpSnapToGuides::Init() && // Register the snap-to-guides menu op 00331 OpShowGuides::Init() && // Register the show-guides menu op 00332 #endif //WEBSTER 00333 00334 BlobbyDlg::Init() && // Temp ****** 00335 BlobbyBar::Init() && // Temp ****** 00336 StandardBar::Init() && 00337 00338 #if DEBUG_TREE 00339 DebugTreeDlg::Init() && // Temp ****** 00340 #endif //DEBUG_TREE 00341 00342 #if _DEBUG 00343 DebugDlg::Init() && // Debug command dialogue - in debug builds only 00344 #endif //_DEBUG 00345 00346 BlobbyTabDlg::Init() && // Temp ****** 00347 #ifndef EXCLUDE_FROM_XARALX 00348 #if _DEBUG 00349 OpCreateFontThumbnails::Init() && // Debug only 00350 OpConvertFileFormats::Init() && // Debug only 00351 #endif //_DEBUG 00352 00353 //#ifndef EXCLUDE_BFX 00354 //#ifndef STANDALONE 00355 //#ifndef WEBSTER 00356 // BfxDlg::Init() && // Register bitmap effects dialog 00357 //#endif //WEBSTER 00358 //#endif 00359 //#endif 00360 00361 #if DEBUG_TREE 00362 PORTNOTE("other","Removed CMXTreeDlg usage") 00363 // CMXTreeDlg::Init() && // Temp ****** 00364 #endif //DEBUG_TREE 00365 #endif //EXCLUDE_FROM_XARALX 00366 00367 #ifdef XAR_TREE_DIALOG 00368 CXFTreeDlg::Init() && // The Xar format debug tree dialog 00369 #endif //XAR_TREE_DIALOG 00370 00371 #ifndef EXCLUDE_FROM_XARALX 00372 OpWhatsThis::Init() && // Register the "What's This?" help mode Operation 00373 #endif //EXCLUDE_FROM_XARALX 00374 ViewOps::Init() && // Register View Operations 00375 WindowOps::Init() && // Register Window Operations 00376 //WEBSTER-ranbirr-12/11/96 00377 #ifndef WEBSTER 00378 #ifndef STANDALONE 00379 // no printing on Viewer version 00380 OpPrint::Init() && // Register Print operations 00381 #endif //STANDALONE 00382 #endif //webster 00383 00384 HelpOps::Init() && // Register Help Operations 00385 00386 OpMenuImport::Init() && // Register import operations 00387 OpMenuExport::Init() && // Register export operations 00388 00389 #ifndef EXCLUDE_FROM_XARALX 00390 OpURLImport::Init() && // Register internet import operations 00391 URLImportDlg::Init() && // Register internet import operations 00392 HelpDownloadOp::Init() && // Register help and support download operations 00393 #ifndef STANDALONE 00394 #endif // STANDALONE 00395 #endif //EXCLUDE_FROM_XARALX 00396 OpDroppedFile::Init() && // Register drag'n'drop import operations 00397 BaseFileDialog::Init() && // Declare the open and save default paths 00398 DummyOp::Init() && // Register dummy ops for unimplemented menu items 00399 OpMenuLoad::Init() && // Register Load operation 00400 #ifndef STANDALONE 00401 OpMenuSave::Init() && // Register Save operation 00402 #endif 00403 OpException::Init() && 00404 #ifndef EXCLUDE_FROM_XARALX 00405 InfoBarOp::Init() && 00406 InfoBarViewOp::Init() && 00407 ExternalClipboard::Init() && // Create the application's external clipboard manager 00408 #endif 00409 FileListOp::Init() && // Init the Recent File List Operation 00410 NodeRenderableInk::Init() && 00411 NodeRenderableBounded::Init() && // Declare the magnetic radii options 00412 Filter::InitFilters() && // Init filters (must be after ExternalClipboard) 00413 OpTimeDraw::Init() && 00414 OpShowGrid::Init() && // op for toggling "show grid" in a view 00415 OpSnapToGrid::Init() && // op for toggling "snap to grid" in a view 00416 // WEBSTER - markn 15/1/97 00417 // Removed these ops as they are not used 00418 #ifndef WEBSTER 00419 OpSnapToObjects::Init() && // op for toggling "snap to objects" in a view 00420 #endif 00421 OpPullOntoGrid::Init() && // Op for pulling selection onto the grid 00422 00423 PORTNOTE("other","Removed OLEPrefs usage") 00424 #ifndef EXCLUDE_FROM_XARALX 00425 OLEPrefs::Init() && // Initialise any OLE related prefs 00426 #endif 00427 00428 PORTNOTE("other","Removed various bevel usage") 00429 #ifdef BUILDSHADOWS 00430 #ifndef EXCLUDE_FROM_XARALX 00431 OpBevel::Init() && // bevelling operator 00432 #endif 00433 OpCreateBevel::Declare() && 00434 OpRemoveBevel::Declare() && 00435 OpChangeBevelLightAngle::Declare() && 00436 OpSelectBevel::Declare() && 00437 OpApplyAttribForShadows::Init() && 00438 #endif 00439 // Contouring ops 00440 OpCreateContour::Declare() && 00441 OpRemoveContour::Declare() && 00442 OpChangeContourWidth::Declare() && 00443 00444 #ifdef ARROWHEADS 00445 OpChangeStartArrowExtendsDesc::Declare()) && // makes arrows sit on the line instead 00446 // of extending the line 00447 OpChangeEndArrowExtendsDesc::Declare()) && 00448 #endif 00449 00450 #ifndef STANDALONE 00451 OpNodePathEditBlob::Init() && // Node path editing itself operation 00452 OpNodePathEditControlBlob::Init() && // Node path editing its control points operation 00453 OpFitTextToCurve::Init() && // Fit text line to path 00454 OpTextKern::Init() && // Apply kern op 00455 OpTextAutoKern::Init() && // Apply kern op 00456 OpJoinShapes::Init() && // Join shapes operation 00457 OpBreakShapes::Init() && // Break shapes operation 00458 OpNodePathAddEndpoint::Init() && // op to add a curve or line at the end of a path 00459 OpCloseNodePaths::Init() && // op to auto-close paths 00460 OpReshapeOrAddPoint::Init() && // op to reform or add a point to a path 00461 OpNewPath::Init() && // Adds a new path and starts editing it 00462 OpEditRegularShape::Init() && // Changing a regular shape 00463 OpDragRegularShape::Init() && // Changing a regular shape via dragging 00464 OpReformShapeEdge::Init() && // Reforming the edges of a regular shape 00465 OpToggleSmooth::Init() && // Toggles between smooth and cusp point 00466 OpMakeSegmentsCurves::Init() && // Make path segments curved 00467 OpMakeSegmentsLines::Init() && // Make path segments lines 00468 OpReversePath::Init() && // Reverse the path(s) 00469 OpMovePathPoint::Init() && // Move a path point operation 00470 // OpEditEllipse::Init() && // Editing of a (old style) node ellipse 00471 OpEditRectangle::Init() && // Editing of a (old style) node rectangle 00472 // DialogBarOp::Init() && // init the DialogBarOp descriptors 00473 //#endif 00474 OpDragBox::Init() && // drag operation base-class 00475 OpQuality::Init() && // init the OpQuality operations 00476 BmpDlg::Init() && // Register Bitmap Properties Dialog 00477 GIFAnimationPropertyTabsDlg::Init() && // Register the GIF animation tabs dialog 00478 AnimExOptns::Init() && // Register the Animation Export Options tabs dialog 00479 OpConvertPathToShapes::Declare() && // convert path to shapes operation 00480 OpChangeBrushDefinition::Declare() && 00481 #ifndef EXCLUDE_FROM_XARALX 00482 // WEBSTER-ranbirr-13/11/96 00483 #ifndef WEBSTER 00484 SepsDlg::Init() && // Init the separation properties dialog 00485 OpShowPrintBorders::Init() && // init the Show Print Borders operation 00486 #endif //webster 00487 00488 // Neville 2/10/97 remove Stroking code 00489 #ifdef VECTOR_STROKING 00490 OpTogglePressure::Init() && // Register the pen pressure On/Off operation 00491 #endif // VECTOR_STROKING 00492 00493 XaraCMS::InitPrefs() && // Init Xara CMS Colour manager settings 00494 #endif 00495 #else 00496 #ifndef EXCLUDE_FROM_XARALX 00497 OpDragBox::Init() && // drag operation base-class 00498 #endif 00499 OpQuality::Init() && // init the OpQuality operations 00500 #endif 00501 CBiasGainDlg::Init() && 00502 CBrushEditDlg::Init () && 00503 OpSelectBrush::Declare() && 00504 CNameBrushDlg::Init() && 00505 CInitBrushNameDlg::Init() && 00506 OpDeactivateBrush::Declare() && 00507 00508 OpZoomIn::Init() && 00509 OpZoomOut::Init() && 00510 #ifndef EXCLUDE_FROM_XARALX 00511 OpLiveEffect::Init() && // Register the liveeffects ops (now done by LiveEffecttool) 00512 && NodeBitmapEffect::Init() && 00513 #endif 00514 InitUserHelp() && 00515 TRUE; 00516 } 00517 00518 #endif 00519