blobby.h

Go to the documentation of this file.
00001 // $Id: blobby.h 1282 2006-06-09 09:46:49Z alex $
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 // Declaration of the following classes
00100 /*
00101     BlobbyOp         : Demonstration temporary operation which changes the colour of a 
00102                        documents paper. 
00103                        and it's actions
00104 
00105 */  
00106 
00107 
00108 
00109 /*
00110  */        
00111 
00112 #ifndef INC_BLOBBY
00113 #define INC_BLOBBY
00114     
00115 //#include "undoop.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00116 //#include "opdesc.h"    - in camtypes.h [AUTOMATICALLY REMOVED]
00117 //#include "doccolor.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00118 //#include "ops.h"          // Operation class   - in camtypes.h [AUTOMATICALLY REMOVED]
00119 //#include "dlgtypes.h"     // The DialogOp types - in camtypes.h [AUTOMATICALLY REMOVED]
00120 #include "dlgmgr.h"     // the dialogue box manager 
00121 //#include "convert.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00122 //#include "dialogop.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00123 
00124 #define OPTOKEN_BLOBBY _T("Blobby")
00125 
00126 class CCAPI BlobbyOp: public UndoableOperation
00127 {                             
00128     CC_DECLARE_DYNCREATE( BlobbyOp )
00129 
00130 public:
00131     BlobbyOp();                             // Constructor
00132 
00133     static BOOL     Init();                 // Register an OpDescriptor
00134                                             // Read the state of an operation
00135     static OpState  GetState(String_256*, OpDescriptor*);       
00136     
00137     void            Do(OpDescriptor*);      // "Do" function
00138     
00139 
00140 };
00141      
00142 class RedoColAction;      
00143      
00144 /********************************************************************************************
00145 
00146 >   class UndoColAction : public Action
00147 
00148     Author:     Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
00149     Created:    16/8/93
00150     Purpose:    Simple BlobbyOp action which restores the colour of a documents page to 
00151                 the  colour it was prior to the operation being performed. 
00152     SeeAlso:    BlobbyOp
00153 
00154 ********************************************************************************************/
00155 
00156 class CCAPI UndoColAction: public Action
00157 {                                
00158     CC_DECLARE_DYNCREATE( UndoColAction )
00159     friend class RedoColAction;
00160     friend class BlobbyOp; 
00161 
00162 public:
00163     UndoColAction(); 
00164     virtual ActionCode Execute();    
00165     static ActionCode Init(Operation* const pOp, 
00166                            ActionList* pActionList,     
00167                            UINT32 ActionSize,    
00168                            Action** NewAction);   
00169 private:
00170     DocColour Color;  
00171 };
00172   
00173 
00174 /********************************************************************************************
00175 
00176 >   class RedoColAction : public Action
00177 
00178     Author:     Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
00179     Created:    16/8/93
00180     Purpose:    Simple BlobbyOp action which restores the colour of a documents page to 
00181                 the  colour it was prior to the operation being undone. 
00182     SeeAlso:    BlobbyOp
00183 
00184 ********************************************************************************************/
00185 
00186   
00187 class CCAPI RedoColAction: public Action
00188 {              
00189     CC_DECLARE_DYNCREATE( RedoColAction )  
00190     friend class UndoColAction; 
00191 
00192 public:
00193     RedoColAction(); 
00194     virtual ActionCode Execute();    
00195     static ActionCode Init(Operation* const pOp, 
00196                            ActionList* pActionList, 
00197                            UINT32 ActionSize, 
00198                            Action** NewAction);
00199 private:
00200     DocColour Color; 
00201 };
00202        
00203 
00204 /********************************************************************************************
00205 
00206 >   class RedoAction2 : public Action
00207 
00208     Author:     Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
00209     Created:    16/8/93
00210     Purpose:    Dummy BlobbyOp REDO action. Does nothing when it executes.
00211     SeeAlso:    BlobbyOp
00212 
00213 ********************************************************************************************/
00214 
00215 class CCAPI RedoAction2: public Action
00216 {              
00217     CC_DECLARE_DYNCREATE( RedoAction2 )  
00218     friend class UndoColAction; 
00219 
00220 public:
00221     RedoAction2(); 
00222     virtual ActionCode Execute();    
00223     static ActionCode Init(Operation* const pOp, 
00224                            ActionList* pActionList, 
00225                            UINT32 ActionSize, 
00226                            Action** NewAction);
00227 private:
00228     DocColour Color; 
00229 };
00230 
00231  
00232 
00233 /********************************************************************************************
00234 
00235 >   class RedoAction3 : public Action
00236 
00237     Author:     Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
00238     Created:    16/8/93
00239     Purpose:    Dummy BlobbyOp REDO action. Does nothing when it executes.
00240     SeeAlso:    BlobbyOp
00241 
00242 ********************************************************************************************/
00243  
00244   
00245 class CCAPI RedoAction3: public Action
00246 {              
00247     CC_DECLARE_DYNCREATE( RedoAction3 )  
00248     friend class UndoColAction; 
00249 
00250 public:
00251     RedoAction3(); 
00252     virtual ActionCode Execute();    
00253     static ActionCode Init(Operation* const pOp, 
00254                            ActionList* pActionList, 
00255                            UINT32 ActionSize, 
00256                            Action** NewAction);
00257 private:
00258     DocColour Color; 
00259 };
00260                
00261 
00262 /********************************************************************************************
00263 
00264 >   class UndoAction2 : public Action
00265 
00266     Author:     Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
00267     Created:    16/8/93
00268     Purpose:    Dummy BlobbyOp UNDO action. Does nothing when it executes.
00269     SeeAlso:    BlobbyOp
00270 
00271 ********************************************************************************************/
00272                
00273                
00274 class CCAPI UndoAction2: public Action
00275 {              
00276     CC_DECLARE_DYNCREATE( UndoAction2 )  
00277     friend class UndoColAction; 
00278 
00279 public:
00280     UndoAction2(); 
00281     virtual ActionCode Execute();    
00282     static ActionCode Init(Operation* const pOp, 
00283                            ActionList* pActionList, 
00284                            UINT32 ActionSize, 
00285                            Action** NewAction);
00286 private:
00287     DocColour Color;                           
00288     
00289 };
00290 
00291 
00292 /********************************************************************************************
00293 
00294 >   class UndoAction3 : public Action
00295 
00296     Author:     Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
00297     Created:    16/8/93
00298     Purpose:    Dummy BlobbyOp UNDO action. Does nothing when it executes.
00299     SeeAlso:    BlobbyOp
00300 
00301 ********************************************************************************************/
00302 
00303   
00304 class CCAPI UndoAction3: public Action
00305 {              
00306     CC_DECLARE_DYNCREATE( UndoAction3 )  
00307     friend class UndoColAction; 
00308 
00309 public:
00310     UndoAction3(); 
00311     virtual ActionCode Execute();    
00312     static ActionCode Init(Operation* const pOp, 
00313                            ActionList* pActionList, 
00314                            UINT32 ActionSize, 
00315                            Action** NewAction);
00316 private:
00317     DocColour Color; 
00318 };       
00319 
00320 
00321 // -----------------------------------------------------------------------------------------
00322 // BlobbyDlg used to test the Dialog system
00323 
00324 #define OPTOKEN_BLOBBYDLG _T("BlobbyDlg")    
00325    
00326 class BlobbyDlg: public DialogOp
00327 {         
00328     CC_DECLARE_DYNCREATE( BlobbyDlg )  
00329 public:
00330 
00331     BlobbyDlg(); 
00332     MsgResult Message( Msg* Message );  
00333     void Do(OpDescriptor*);     // "Do" function        
00334     static BOOL Init();                        
00335     BOOL Create(); 
00336     static OpState GetState(String_256*, OpDescriptor*);    
00337 
00338     static const UINT32 IDD;
00339 //  enum { IDD = _R(IDD_BLOBBYDLG) };     
00340     static const CDlgMode Mode;   
00341     
00342     String_256 UnitStrList[9];    
00343     UnitType UnitList[9];   
00344     UnitType DefaultUnit; 
00345     UnitType ConvUnit; 
00346 }; 
00347 
00348 // -----------------------------------------------------------------------------------------
00349 // BlobbyBar used to test the Dialog system
00350 
00351 #define OPTOKEN_BLOBBYBAR _T("BlobbyBar")    
00352    
00353 class BlobbyBar: public DialogOp
00354 {         
00355     CC_DECLARE_DYNCREATE( BlobbyBar )  
00356 public:
00357 
00358     BlobbyBar(); 
00359     MsgResult Message( Msg* Message );  
00360     void Do(OpDescriptor*);     // "Do" function        
00361     static BOOL Init();
00362     BOOL Create(); 
00363     static OpState GetState(String_256*, OpDescriptor*);    
00364 
00365     static const UINT32 IDD;
00366     static const CDlgMode Mode;   
00367 
00368     BOOL IsABar() { return TRUE; }
00369 
00370 }; 
00371 
00372 // -----------------------------------------------------------------------------------------
00373 
00374 // BlobbyTabDlg used to test the Dialog system
00375 
00376 #define OPTOKEN_BLOBBYTABDLG _T("BlobbyTabDlg")    
00377    
00378 class BlobbyTabDlg: public DialogTabOp
00379 {         
00380     CC_DECLARE_DYNCREATE( BlobbyTabDlg )  
00381 public:
00382 
00383     BlobbyTabDlg(); 
00384     MsgResult Message( Msg* Message ); 
00385      
00386     void Do(OpDescriptor*);     // "Do" function        
00387     static BOOL Init();                        
00388     static OpState GetState(String_256*, OpDescriptor*);    
00389     virtual BOOL RegisterYourPagesInOrderPlease(); 
00390     static const CDlgMode Mode; 
00391 
00392     // We need to give our Tab dialog's a unique resource ID as this is used to 
00393     static const UINT32 IDD;
00394 private:
00395     // Message handlers for each page in the tabbed dialog
00396     void HandleCoordsMsg(DialogMsg* Msg); 
00397     void HandleRadioDazeMsg(DialogMsg* Msg); 
00398     void HandleConvertMsg(DialogMsg* Msg);
00399 
00400     // Used by Convert page 
00401     String_256 UnitStrList[9];    
00402     UnitType UnitList[9];   
00403     UnitType DefaultUnit; 
00404     UnitType ConvUnit; 
00405 
00406 }; 
00407                    
00408 
00409        
00410 #endif
00411                    

Generated on Sat Nov 10 03:44:25 2007 for Camelot by  doxygen 1.4.4