SGInit Class Reference

Provides static functions for initialisation/deinitialisation of the SuperGallery system, plus useful internal SuperGallery work functions. More...

#include <sginit.h>

List of all members.

Static Public Member Functions

static BOOL Init (void)
 Initialises the supergallery system (Registers Ops for displaying galleries, reads preferences, etc).
static void DeInit (void)
 De-Initialises the supergallery system.
static void UpdateGalleryButton (ResourceID OpToken, BOOL IsVisible)
 Helper function for gallery display Ops - whenever the gallery visibility changes, this should be called to update the button for it.


Detailed Description

Provides static functions for initialisation/deinitialisation of the SuperGallery system, plus useful internal SuperGallery work functions.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/2/95
Note: SGInit::Init() is called from main.cpp. It initialises ALL Ops relating to galleries, to remove the dependency between main.cpp and the supergallery subsystem. This also helps to keep all sgallery related stuff in the same group of files.

See also:
SuperGallery; SGInit::Init

Definition at line 123 of file sginit.h.


Member Function Documentation

void SGInit::DeInit void   )  [static]
 

De-Initialises the supergallery system.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/2/94

Definition at line 227 of file sginit.cpp.

00228 {
00229 // WEBSTER - markn 15/1/97
00230 // Removed some deinit functions that no longer exist
00231 
00232     // Nothing much to deinit as yet
00233 PORTNOTE("galleries", "disabled various galleries deinit")
00234 #ifndef STANDALONE
00235 #ifndef WEBSTER
00236     LayerPropertyTabsDlg::Deinit(); 
00237 #endif  // WEBSTER  
00238     GIFAnimationPropertyTabsDlg::Deinit();
00239 #ifndef EXCLUDE_FROM_XARALX
00240     OpGrabFrame::DeInit();
00241 #endif
00242 #endif
00243 }

BOOL SGInit::Init void   )  [static]
 

Initialises the supergallery system (Registers Ops for displaying galleries, reads preferences, etc).

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/2/94

Definition at line 144 of file sginit.cpp.

00145 {
00146     // Declare the global supergallery preferences...
00147     Camelot.DeclareSection(TEXT("Displays"), 8);
00148     Camelot.DeclarePref(TEXT("Displays"), TEXT("FixedGalleryColours"),
00149                             &SuperGallery::UseFixedColourSet);
00150 
00152     // I'm putting this in here - cause I can't find a better place - and seeing as these
00153     // are mostly display preferences anyway, it makes sense
00154     static INT32 defaultCompoundToEditableShapesBitmapDPI = 96;
00155     Camelot.DeclarePref(TEXT("Displays"), TEXT("CompCToEDPI"), &defaultCompoundToEditableShapesBitmapDPI, 10, 1000);
00157 
00158     // And initialise each of the derived SuperGallery systems...
00159     BOOL ok = ( SGalleryOptionsDlg::Init()          &&
00160                 SGallerySearchDlg::Init()           &&
00161                 SGallerySortDlg::Init()             &&
00162 
00163 PORTNOTE("galleries", "Excluded various galleries")
00164 #ifndef STANDALONE
00165 #ifndef EXCLUDE_FROM_XARALX
00166                 OpDisplayFrameGallery::Init()       &&
00167 #endif // EXCLUDE_FROM_XARALX
00168                 OpLayerGalChange::Init()            &&
00169 #ifndef EXCLUDE_FROM_XARALX
00170                 OpGrabFrame::Init()                 &&
00171 #endif // EXCLUDE_FROM_XARALX
00172 // WEBSTER - markn 15/1/97
00173 // Removed some init functions that no longer exist
00174 #ifndef WEBSTER
00175                 OpDisplayLayerGallery::Init()       &&
00176                 LayerNameDlg::Init()                &&
00177                 LayerPropertyTabsDlg::Init()        &&              
00178 
00179                 OpDisplayLineGallery::Init()        &&
00180 #ifdef _DEBUG // For now name gallery only on debug builds
00181                 OpDisplayNameGallery::Init()        &&
00182 #endif
00183 #endif // WEBSTER               
00184 // Taken out by vector stroking code Neville 2/10/97
00185 #ifndef EXCLUDE_FROM_XARALX
00186 #ifdef VECTOR_STROKING
00187                 SGalleryLinePropertiesDlg::Init()   &&
00188 #endif // VECTOR_STROKING   
00189 #endif          
00190                 ColourSGallery::Init()              &&
00191                 OpDisplayColourGallery::Init()      &&
00192                 ColourNameDlg::Init()               &&
00193                 NewColourDlg::Init()                &&
00194                 OpDisplayBitmapGallery::Init()      &&
00195 #ifndef EXCLUDE_FROM_XARALX
00196                 OpDisplayFontsGallery::Init()       &&
00197 #endif // EXCLUDE_FROM_XARALX
00198 #endif // STANDALONE
00199 #ifndef EXCLUDE_FROM_XARALX
00200                 LibClipartSGallery::Init()          &&
00201                 OpDisplayLibClipartGallery::Init()  &&
00202 
00203 #ifndef STANDALONE
00204                 LibFillsSGallery::Init()            &&
00205                 OpDisplayLibFillsGallery::Init()    &&
00206 #endif
00207 
00208                 Library::InitLibPrefs() &&
00209 #endif // EXCLUDE_FROM_XARALX
00210                 TRUE
00211             );
00212     
00213     return ok;
00214 }

void SGInit::UpdateGalleryButton ResourceID  OpToken,
BOOL  IsVisible
[static]
 

Helper function for gallery display Ops - whenever the gallery visibility changes, this should be called to update the button for it.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/2/94

Definition at line 258 of file sginit.cpp.

00259 {
00260     // Update all button controls that invoke this Op
00261     OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(OpToken);
00262     if (pOpDesc!=NULL)
00263     {
00264         // Found the opdescriptor. Now find all the gadgets associated with it
00265         List Gadgets;
00266         if (pOpDesc->BuildGadgetList(&Gadgets))
00267         {
00268             // Found some. Set the controls accordingly
00269             GadgetListItem* pGadgetItem = (GadgetListItem*) Gadgets.GetHead();
00270 
00271             while (pGadgetItem != NULL)
00272             {
00273                 // Set the gadget
00274                 pGadgetItem->pDialogOp->SetBoolGadgetSelected(pGadgetItem->gidGadgetID,
00275                                                                     IsVisible);
00276                 // Find the next gadget
00277                 pGadgetItem = (GadgetListItem*) Gadgets.GetNext(pGadgetItem);
00278             }
00279     
00280             // Clean out the list
00281             Gadgets.DeleteAll();
00282         }
00283     }
00284 }


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 04:01:06 2007 for Camelot by  doxygen 1.4.4