viewmod.cpp

Go to the documentation of this file.
00001 // $Id: viewmod.cpp 1464 2006-07-18 12:32:26Z gerry $
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 
00099 /*
00100 */
00101 
00102 #include "camtypes.h"
00103 #include "nodecont.h"
00104 //#include "tool.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00105 #include "viewmod.h"
00106 //#ifndef _AFXDLL
00107 // tools that can go in DLLs go here
00108 #include "pushtool.h"
00109 #include "zoomtool.h"
00110 #include "freehand.h"
00111 #include "pentool.h"
00112 #include "blndtool.h"
00113 #include "beztool.h"
00114 #include "filltool.h"
00115 //#include "gridtool.h"
00116 #include "regshape.h"
00117 #include "rectangl.h"
00118 #include "moldtool.h"
00119 #include "texttool.h"
00120 #include "shadtool.h"   // shadow tool header, Olivier 29/10/96
00121 //#include "blnktool.h"
00122 #include "cntrtool.h"  // contour tool, DavidM 24/8/99
00123 //#endif
00124 // tools that cannot go in DLLs go here
00125 #include "selector.h"
00126 #include "eliptool.h"
00127 #include "bevtool.h"
00128 //#include "slicetool.h"
00129 //#include "liveeffectstool.h"
00130 
00131 
00132 static char Name[]      = "Kernel Module";
00133 static char Purpose[]   = "Tools that need to be in the kernel";
00134 static char Author[]    = "The Nasty People";
00135 
00136 DECLARE_SOURCE("$Revision: 1464 $");
00137 
00138 // Declare smart memory handling in Debug builds
00139 #define new CAM_DEBUG_NEW
00140 
00141 // this macro makes it easier to move tools from the .exe to the .dll
00142 // in AFXDLL builds, the macro returns NULL, otherwise it does a 'new classtype'
00143 
00144 //#if _AFXDLL
00145 //#define   IN_DLL(classname)   NULL
00146 //#else
00147 #define IN_DLL(classname)   new classname
00148 //#endif
00149 
00150 #define NOT_IN_DLL(classname)   new classname
00151 
00152 /********************************************************************************************
00153 
00154 >   virtual BOOL ViewModule::Init()
00155 
00156     Author:     Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
00157     Created:    1/7/93
00158     Inputs:     -
00159     Outputs:    -
00160     Returns:    -
00161     Purpose:    Initialise the view module (which contains the Push and Zoom tools).
00162                 Does nothing at the moment.
00163     Errors:     -
00164     SeeAlso:    -
00165 
00166 ********************************************************************************************/
00167 
00168 BOOL ViewModule::Init()
00169 {
00170 #if !defined(EXCLUDE_FROM_RALPH)
00171 #ifdef STANDALONE
00172     TextTool* pTextTool = new TextTool();
00173     if (pTextTool)
00174         pTextTool->Init();
00175 #endif
00176 #endif
00177 
00178     return TRUE;
00179 }
00180     
00181 /********************************************************************************************
00182 
00183 >   virtual void ViewModule::Describe(void* Info)
00184 
00185     Author:     Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
00186     Created:    1/7/93
00187     Inputs:     -
00188     Outputs:    -
00189     Returns:    -
00190     Purpose:    Get info on the Module.
00191     Errors:     -
00192     SeeAlso:    -
00193 
00194 ********************************************************************************************/
00195 
00196 void ViewModule::Describe(void* Info)
00197 {
00198     // Cast the pointer into one we understand...
00199     
00200     ModInfo_v1 *ModInfo = (ModInfo_v1 *) Info;
00201     
00202     // ...and fill in the fields
00203     
00204     ModInfo->InfoVersion = 1;
00205     ModInfo->InterfaceVersion = GetInterfaceVersion();
00206     ModInfo->Version = 1;
00207     ModInfo->ID = MODULEID_KERNEL;
00208 #ifdef STANDALONE
00209     ModInfo->NumTools = 2;
00210 #else
00211 #ifdef BUILDSHADOWS
00212     ModInfo->NumTools = 21; // Shadows + Bevels + Contours + Slicing
00213 #else
00214     ModInfo->NumTools = 18; // Shadows + Bevels + Contours + Slicing
00215 #endif
00216 #endif
00217     ModInfo->Name = Name;
00218     ModInfo->Purpose = Purpose;
00219     ModInfo->Author = Author;
00220 }
00221     
00222 
00223 /********************************************************************************************
00224 
00225 >   virtual void *ViewModule::CreateTool(UINT32 Type)
00226 
00227     Author:     Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
00228     Created:    1/7/93
00229     Inputs:     -
00230     Outputs:    -
00231     Returns:    -
00232     Purpose:    Create an instance of a given tool.
00233     Errors:     -
00234     SeeAlso:    -
00235 
00236 ********************************************************************************************/
00237 
00238 void *ViewModule::CreateTool(UINT32 Type)
00239 {
00240     switch (Type)
00241     {
00242         case 1:
00243             return IN_DLL(ZoomTool);
00244             
00245         case 2:
00246             return IN_DLL(PushTool);
00247 
00248 #ifndef STANDALONE
00249         case 3:
00250             return IN_DLL(RectangleTool);
00251 
00252 #ifndef WEBSTER //Martin-06/11/96-begin
00253         case 4:
00254             return IN_DLL(FreeHandTool);
00255 #endif  //WEBSTER
00256 
00257         case 5:
00258             return NOT_IN_DLL(SelectorTool);
00259 
00260 PORTNOTE("other","Removed grid tool usage")
00261 #ifndef EXCLUDE_FROM_XARALX
00262 #ifndef WEBSTER //Martin
00263         case 6:
00264             return IN_DLL(GridTool);
00265 
00266 #endif  //WEBSTER
00267 #endif
00268         case 7:
00269             return IN_DLL(BezierTool);
00270 
00271         case 8:
00272             return NOT_IN_DLL(EllipseTool);
00273 
00274         case 9:
00275             return IN_DLL(GradFillTool);
00276 
00277 #ifndef WEBSTER //Martin
00278         case 10:
00279             return IN_DLL(PenTool);
00280 
00281         case 11:
00282             return IN_DLL(BlendTool);
00283 #endif  //WEBSTER
00284 
00285         case 12:
00286             return IN_DLL(TranspTool);
00287 
00288         case 13:
00289             return IN_DLL(QuickShapeTool);
00290 
00291 #ifndef WEBSTER //Martin
00292         case 14:
00293             return IN_DLL(MouldTool);
00294 
00295 PORTNOTE("other","Removed blank tool usage")
00296 #ifndef EXCLUDE_FROM_XARALX
00297         case 15:
00298             return IN_DLL(BlankTool);
00299 #endif
00300 #endif  //WEBSTER-Martin-06/11/96-end
00301 
00302         case 16:
00303             return IN_DLL(TextTool);
00304 
00305 #ifndef NO_ADVANCED_TOOLS
00306 PORTNOTE("other","Removed effects tool usage")
00307 #ifndef EXCLUDE_FROM_XARALX
00308         case 17:
00309             return IN_DLL(LiveEffectsTool);
00310 #endif
00311 
00312         case 18:
00313             return IN_DLL(SoftShadowTool);
00314 
00315         case 19:
00316             return IN_DLL(BevelTool);
00317 
00318         case 20:
00319             return IN_DLL(ContourTool);
00320 #endif
00321 
00322 PORTNOTE("other","Removed slice tool usage")
00323 #ifndef EXCLUDE_FROM_XARALX
00324         case 21:
00325             return IN_DLL(SliceTool);
00326 #endif
00327 
00328         // Add more view tools here...
00329 
00330 #endif
00331     }
00332     
00333     return NULL;
00334 }
00335 
00336 

Generated on Sat Nov 10 03:48:02 2007 for Camelot by  doxygen 1.4.4