Application Class Reference

Represents an instance of the Camelot application. More...

#include <app.h>

List of all members.

Public Member Functions

 Application ()
 Initialise the application.
 ~Application ()
 Destroys any documents associated with this object.
BOOL Init ()
 Initialise the application, including the user preferences system. This is the earliest kernel-level code to be called - do NOT ADD THINGS HERE. Almost everything that needs to be initialised should go in InitKernel, which gets called after this and some OIL initialisation. If you think you qualify to add something here, speak to Andy first.
BOOL LateInit ()
 Initialise the application object bits that require the preferences system to be fully up & running. Currently that means the pen only.
void Deinit ()
 Close down the kernel application object, including the user preferences system.
BOOL CreateDragTargets (DragInformation *DragInfo)
void AddRenderRegion (RenderRegion *)
 To add a RenderRegion object to the RenderList. Automatically sets a flag to do immediate rendering if the render region is an immediate one.
BOOL DeleteRenderRegion (RenderRegion *)
 To remove a RenderRegion object from the RenderList. If the region in not in the list, no errors occur. The RenderRegion object will be destroyed (i.e. delete will be called on it).
void DeleteRenderRegions (Document *pDoc)
void DeleteRenderRegions (View *pView)
RenderRegionListGetRegionList ()
 Gets a pointer to the Applications RenderRegion list.
BOOL IsRenderingComplete ()
BOOL ServiceRendering (BOOL bImmediate=FALSE)
 Render some objects! This function will either render any outstanding 'immediate' render regions to completion, or render a background render regions for one time-slice.
BOOL IsBgRendering ()
 Find out if there is Background rendering in progress or not.
ColourManagerFindTheColourManager (void)
void UpdateSelection ()
SelRangeFindSelection ()
BlobManagerGetBlobManager ()
ATMIniCache * GetATMIniCache ()
FontManagerGetFontManager ()
XaraCMS * GetCMSManager () const
PrintMarksManGetMarksManager () const
PlugInManagerGetPlugInManager () const
FilterManagerGetFilterManager () const
APIObject * GetAPIObject () const
NoiseManGetNoiseManager () const
HandleManager * GetHandleManager () const
WizOpsGetWizOps () const
CBitmapCacheGetBitmapCache () const
GlobalBitmapListGetGlobalBitmapList ()
GlobalFractalListGetGlobalFractalList ()
void RegisterDocComponent (DocComponentClass *)
 Register a new Document Component class with the application. This class will be asked to add an instance to a document every time a new document is created.
DocComponentClassEnumerateDocComponents (DocComponentClass *)
 Allow the caller to examine/use all the registered document components. pContext should be NULL for the first call, which will return the first registered document component. After that, the returned pointer should be passed back in to this function, which will return the next one, and so on. For example: MonoOn DocComponentClass *pDocComp = NULL; do { pDocComp = Camelot.EnumerateDocComponents(pDocComp);.
BOOL ApplyDocComponents (BaseDocument *)
 Given a document, apply all the currently registered document components to it. i.e., add a colour table, units information, etc.
BOOL OnKeyPress (KeyPress *pKeyPress)
 This is where key presses are handled in Camelot. It does the following in this order -.
BOOL OnIdle (BOOL IdleRedraw)
 This is where idle events are recived by the kernel.
void RemoveIdleProcessor (INT32 Priority, Operation *pOp)
 Stops an operation from receiving idle events.
void RegisterIdleProcessor (INT32 Priority, Operation *pOp)
 If an operation wants to do processing on idle events then it must register to receive them. It registers by calling this function with a pointer to itself. On idle events the operations OnIdle function is called.
void NeedMoreIdles ()
 Tells the application we need more idles.
void DumpAllOps (Document *pDoc)
 To find the single 'global' ColourManager instance in Camelot Dumps information about all the operations in the history list to the debugger.
void DumpLastOp (Document *pDoc)
 Dumps information about the last operation in the history list to the debugger.
void DumpTree (BaseDocument *pDoc)
 Dumps information about the document tree to the debugger.
void DumpAllOps ()
void DumpLastOp ()
void DumpTree ()
CTemplateManagerGetTemplateManager ()
ObjectCacheGetObjectCache ()
 Dumps information about the document tree to the debugger return a pointer to the cache object so that external objects can add object in the cache.
void ShowViewScrollers (BOOL fIsVisible)
void WritePreferences ()
void WipePreferenceFile ()
void WipeDangerousPrefs ()
BOOL DeclareSection (LPTCHAR Section, UINT32 InitialSize)
BOOL DeclarePref (LPTCHAR Section, LPTCHAR Pref, INT32 *PrefVar, INT32 Min=INT_MIN, INT32 Max=INT_MAX)
BOOL DeclarePref (LPTCHAR Section, LPTCHAR Pref, UINT32 *PrefVar, UINT32 Min=0, UINT32 Max=UINT_MAX)
BOOL DeclarePref (LPTCHAR Section, LPTCHAR Pref, double *PrefVar, double Min=DBL_MIN, double Max=DBL_MAX)
BOOL DeclarePref (LPTCHAR Section, LPTCHAR Pref, StringBase *PrefVar)
BOOL GetPrefValue (LPTCHAR Section, LPTCHAR Pref, INT32 *PrefVar)
BOOL GetPrefValue (LPTCHAR Section, LPTCHAR Pref, UINT32 *PrefVar)
BOOL GetPrefValue (LPTCHAR Section, LPTCHAR Pref, double *PrefVar)
BOOL SetPrefValue (LPTCHAR Section, LPTCHAR Pref, INT32 *PrefVar)
BOOL SetPrefValue (LPTCHAR Section, LPTCHAR Pref, UINT32 *PrefVar)
BOOL SetPrefValue (LPTCHAR Section, LPTCHAR Pref, double *PrefVar)
BOOL SetPrefDirect (LPTCHAR Section, LPTCHAR Pref, const TCHAR *pValue, BOOL Force=FALSE)
BOOL SetPrefDirect (LPTCHAR Section, LPTCHAR Pref, INT32 *pValue)
BOOL SetPrefDirect (LPTCHAR Section, LPTCHAR Pref, UINT32 *pValue)
BOOL SetPrefDirect (LPTCHAR Section, LPTCHAR Pref, double *pValue)
BOOL GetPrefDirect (LPTCHAR Section, LPTCHAR Pref, StringBase *pValue)
BOOL GetPrefDirect (LPTCHAR Section, LPTCHAR Pref, INT32 *pValue)
BOOL GetPrefDirect (LPTCHAR Section, LPTCHAR Pref, UINT32 *pValue)
BOOL GetPrefDirect (LPTCHAR Section, LPTCHAR Pref, double *pValue)
BOOL GetConvertToEditableShapesDPI (INT32 *pValue)
 Wrapper function for gaining access to convert to editable shapes DPI (as requested by karim).
BOOL CamelotIsDying ()
void ShuttingDown (BOOL fState=TRUE)
void CheckRealDownload ()
 Disables RealDownload browser integration if necessary - to prevent camelot from dying when downloading files that are registered with RealDownload.
void ResetRealDownload ()
 Re-enables RealDownload browser integration if we disabled it.
BOOL UpdateStatusBarText (String_256 *text, BOOL PrefixSelDesc=TRUE)
 Just interfaces to similar StatusLine funtion Notes: This has been bodged by Jason to return without an error if the status line has not yet been initialised as the progress system is tries to use it in this state!
BOOL LockOutControlHelp ()
 Just interfaces to similar StatusLine funtion Notes: This is really a bodge to fix the annoying features of camelot that persist in infinitely updating the status bar with different text. At present, this occurs in two places (known to me): the transparency slider and when typing text within the text tool. This function locks the status bar to prevent these guys such annoying things. NOTE: if one calls this - then you MUST also have a matching Application::UnlockControlHelp () somewhere; cause otherwise camelots status bar will never again update itself ....
BOOL UnlockControlHelp ()
 Just interfaces to similar StatusLine funtion Notes: See Application::LockOutControlHelp () See Also: Application::LockOutControlHelp ().
CCStatusBarGetpCCStatusBar ()
 return pointer to CMainFrame::CCStatusBar
StatusLineGetpStatusLine ()
void RegenerateNodesInList ()
 Calls all of the regeneration functions of the nodes in the list.
BOOL AddNodeToRegenList (Node *pNode)
 Adds a node to the regeneration list.

Public Attributes

List Documents
BOOL BgRendering
SelRangeSelection

Protected Member Functions

BOOL InitFilterManager ()
 Support function to initialize this Application's FilterManager.
BOOL DeinitFilterManager ()
 Support function to deinitialize & destruct this Application's FilterManager.
BOOL InitWizOps ()
 Support function to initialize this Application's WizardOfOps from the local registry.
BOOL DeinitWizOps ()
 Support function to deinitialize & destruct this Application's WizOps.

Private Member Functions

 CC_DECLARE_MEMDUMP (Application)
BOOL CallIdleProcessors ()
 To call registered operations OnIdle functions.
BOOL ChangeRealDownloadBrowserOtion (HKEY rootKey, HKEY key, BOOL changeVal)
 Change the RealDownload "EnableBrowserWatch" key value.

Private Attributes

RenderRegionList RenderList
BOOL ImmediateRenderPending
PreferencesCamelotPrefs
ColourManagerTheColourManager
BlobManagerBlobMgr
ListDocComponentClasses
GlobalBitmapList GlobalBitmaps
GlobalFractalList GlobalFractals
List IdleHighPriorityOps
List IdleLowPriorityOps
ATMIniCache * pATMIniCache
FontManagerFontMgr
XaraCMS * CMSManager
PrintMarksManTheMarksManager
PlugInManagerThePlugInManager
FilterManagerTheFilterManager
APIObject * TheAPIObject
HandleManager * TheHandleManager
NoiseManTheNoiseManager
ObjectCachem_pObjCache
CBitmapCacheTheBitmapCache
WizOpsTheWizardOfOps
StatusLinem_pStatusLine
std::auto_ptr< CTemplateManagerm_pTemplateManager
BOOL CamelotShuttingDown
BOOL DisabledRealDownload
HKEY key
HKEY key2
List RegenList


Detailed Description

Represents an instance of the Camelot application.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/5/1993 Base Class: None
General

There is only one Application object; it is a global, and it is called Camelot.

The data member 'Documents' is a list of 'Document' objects associated with this instance of the application. Any documents left in this list are deleted by the Application's destructor.

The data member 'RenderRegions' is a RenderRegionList object, and is the list of RenderRegions outstanding for this instance of the application.

The data member 'Selection' is a SelRange object which caches information about the current selection for quick access. NOTE: There is only one Selection object and it is used by all documents because the selection follows the input focus - when the user selects something in a document any existing selection in any other document is cleared. So that the inline functions get fast access to the SelRange object the Application class is a friend of the SelRange class.

User Preferences

The Camelot object is responsible for controlling the application preferences.

When a client wishes to use a preference, they should allocate some space to hold its value, and then use DeclarePref to inform the preferences system of its existence.

e.g. MonoOn INT32 AutoSaveDelay; Camelot.DeclarePref("Global", "AutoSaveDelay", &AutoSaveDelay); MonoOff

This will inform the preferences system that there is a preference called AutoSaveDelay in the section called Global (the names of the sections and preferences are always case-insensitive). The DeclarePref call will also attempt to read this preference from the application's preference file - if it exists, it will read the value and store it in the AutoSaveDelay variable. The DeclarePref function is currently overloaded for INTs, UINTs, doubles, and Camelot String objects.

NB! You should NOT pass the address of an auto variable to DeclarePref, because this will obviously be invalid as soon as your function exits, and will cause interesting values to be written to the .ini file - hence all preference variables should be declared as static . (This should be fairly obvious though, because actually using a preference variable that isn't static wouldn't really work all that well.)

Another effect of declaring a preference is that when the application saves the preferences out (e.g. on normal application close-down), the preference is automatically saved out under its correct name and section, using the value contained in (assuming the above example) AutoSaveDelay when the save occurs.

Note that before a preference can be declared, its parent section must have been declared via a call to DeclareSection :

MonoOn Application::DeclareSection("Global", 100); MonoOff

The value of 100 indicates that the caller expects there to about 100 preferences stored in this section - this is used as a guideline by the preferences system when allocating memory for preferences. This is not an absolute limit - the section is automatically extended when necessary, but the more accurate the initial estimate, the more efficient the memory usage will be. Obviously for some sections, the accuracy is limited - for example, it may depend on how many tools the user loads/uses.

Returns:
Errors: None.

Definition at line 229 of file app.h.


Constructor & Destructor Documentation

Application::Application  ) 
 

Initialise the application.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/5/93
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: None.

Definition at line 188 of file app.cpp.

00188                          : m_pTemplateManager( new CTemplateManager )
00189 {
00190 // WEBSTER - markn 25/4/97
00191 // No pen stuff required in Webster
00192 // Now taken out via vector stroking code Neville 2/10/97
00193 #ifdef VECTOR_STROKING
00194     PressurePen = NULL;
00195     PenInitialised = FALSE;
00196 #endif // VECTOR_STROKING
00197 
00198     CamelotPrefs = NULL;
00199     Selection = NULL;
00200     TheColourManager = NULL;
00201     BlobMgr = NULL;
00202     DocComponentClasses = NULL;
00203     pATMIniCache = NULL;
00204 
00205     FontMgr                     = NULL;
00206     CMSManager                  = NULL;
00207     TheMarksManager             = NULL;
00208     ThePlugInManager            = NULL;
00209     TheFilterManager            = NULL;
00210     TheAPIObject                = NULL;
00211     TheHandleManager            = NULL;
00212     TheNoiseManager             = NULL;
00213     TheWizardOfOps              = NULL;
00214     DisabledRealDownload        = FALSE;
00215 PORTNOTE("other","Removed HKEY usage")
00216 #ifndef EXCLUDE_FROM_XARALX
00217     key                         = NULL;
00218     key2                        = NULL;
00219 #endif
00220 #ifdef AUTOMATION
00221     TheConcurrencyController    = NULL;
00222 #endif
00223 
00224     // This variable will get set to TRUE when Camelot starts to shut down
00225     CamelotShuttingDown = FALSE; 
00226     BgRendering = FALSE;
00227 
00228     // Temporary: Remove when Kernel StatusLine is actually created by Oil statusline
00229     m_pStatusLine = NULL;
00230 }

Application::~Application  ) 
 

Destroys any documents associated with this object.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/5/93
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: None.

Definition at line 249 of file app.cpp.

00250 {
00251     // Delete any documents still associated with this application
00252     Document *pDocument = (Document *) Documents.GetHead();
00253     
00254     while (pDocument != NULL)
00255     {
00256         delete Documents.RemoveItem(pDocument);
00257         pDocument = (Document *) Documents.GetHead();
00258     }
00259 
00260 //  ERROR3IF(DocComponentClasses != NULL,
00261 //              "Application was not properly de-initialised");
00262     if (DocComponentClasses != 0) TRACE( wxT("WARNING: Application was not properly de-initialised\n") );
00263 
00264     RegenList.DeleteAll();
00265 }


Member Function Documentation

BOOL Application::AddNodeToRegenList Node pNode  ) 
 

Adds a node to the regeneration list.

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
Date:
1/6/99
Parameters:
The node to add to the list [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 1878 of file app.cpp.

01879 {
01880     // check to see if the node is already in the list
01881     NodeListItem * pItem = (NodeListItem *)RegenList.GetHead();
01882 
01883     BOOL bAdd = TRUE;
01884 
01885     while (pItem)
01886     {
01887         if (pItem->pNode == pNode)
01888         {
01889             bAdd = FALSE;
01890             break;
01891         }
01892 
01893         pItem = (NodeListItem *)RegenList.GetNext(pItem);
01894     }
01895 
01896     if (!bAdd)
01897         return TRUE;
01898 
01899     pItem = new NodeListItem(pNode);
01900 
01901     ERROR2IF(!pItem, FALSE, "Memory Error !");
01902 
01903     RegenList.AddTail(pItem);
01904 
01905     return TRUE;
01906 }

void Application::AddRenderRegion RenderRegion pRegion  ) 
 

To add a RenderRegion object to the RenderList. Automatically sets a flag to do immediate rendering if the render region is an immediate one.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/5/93
Parameters:
pRegion - pointer to the RenderRegion to add to the list. [INPUTS]
Returns:
Region - the render region to add.
See also:
RenderRegion; List

Definition at line 916 of file app.cpp.

00917 {
00918     // Is this render region an immediate one?
00919 
00920     View *pView = pRegion->GetRenderView();
00921     ENSURE(pView != NULL, "No View in AddRenderRegion!");
00922 
00923     if (!pView->GetForeBackMode())
00924     {
00925 //      TRACE(_T("ImmediateRender\n"));
00926         // Yes - set the flag to indicate we should do some immediate rendering on the
00927         // next redraw event.
00928         ImmediateRenderPending = TRUE;
00929     }
00930 
00931     // Add this render region to the list.
00932     RenderList.Merge(pRegion);
00933 }

BOOL Application::ApplyDocComponents BaseDocument pDocument  ) 
 

Given a document, apply all the currently registered document components to it. i.e., add a colour table, units information, etc.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
02/08/94
Parameters:
pDocument - the document to add the components to. [INPUTS]
Returns:
TRUE if all the components were added successfully; FALSE if not.

Errors: Out of memory, or other errors depending on implementations of each document component.

See also:
DocComponent; DocComponentClass

Definition at line 1170 of file app.cpp.

01171 {
01172     // Go through the registered components and add their virtual function to add an
01173     // instance of the class to the Document object...
01174     DocComponentClass *pItem = (DocComponentClass *) DocComponentClasses->GetHead();
01175 
01176     while (pItem != NULL)
01177     {
01178         if (!pItem->AddComponent(pDocument))
01179         {
01180             // Component could not be added - probably out of memory.
01181             return FALSE;
01182         }
01183         // Try the next one
01184         pItem = (DocComponentClass *) DocComponentClasses->GetNext(pItem);
01185     }
01186 
01187     // All the components were successfully added
01188     return TRUE;
01189 }

BOOL Application::CallIdleProcessors  )  [private]
 

To call registered operations OnIdle functions.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/9/94
Parameters:
- [INPUTS]
Returns:
TRUE if the registered operations require more idle events. FALSE if no operations need further idle events.
Notes: It is assumed that if there are any processes registered, we still require idle events.

When idle processsor methods are called, they return the following values: HIGH PRIORITY: TRUE = (claim) DO NOT call low-priority processors FALSE = (don't claim) DO call low-priority processors

LOW PRIORITY: The return code is ignored.

This allows us to drag in the DragManager, updating fequently on high-priority idles, but when the mouse is not moving, allow low-priority idles to be called (which allows scrolling in galleries to be highly responsive, but background redraws will kick into action very fast while the mouse stays still)

Most high-priority handlers will just override all events while they're running, though there should never be very many high-priority handlers around.

[TODO: Perhaps low priority handlers should always be called once in a while (e.g. always call them if they have not been called for a second or so), so that we can never get inot a complete-lock-out situation.]

Returns:
Errors: -
See also:
Application::RegisterIdleProcessor

Definition at line 1393 of file app.cpp.

01394 {
01395     // If the system is disabled (due to an error box being up) we must not do anything,
01396     // as we definitely do not want to cause a re-entrant error situation!
01397     if( CCamApp::IsDisabled() )
01398         return(TRUE);
01399 
01400     BOOL CallLowPriorityHandlers = TRUE;
01401 
01402     ListItemOpPtr *CurrentOp = (ListItemOpPtr*)IdleHighPriorityOps.GetHead();
01403     ListItemOpPtr *NextOp;
01404 
01405     // If there are no registered processors, we'll return FALSE as idles aren't needed
01406     BOOL MoreIdlesNeeded = FALSE;
01407 
01408     while (CurrentOp != NULL)
01409     {
01410         // Remember the next item in the list now, in case this one deregisters itself
01411         NextOp = (ListItemOpPtr *) IdleHighPriorityOps.GetNext(CurrentOp);
01412 
01413         // Call the handler, and if it claims idles, disable calling of low-priority handlers
01414         if (CurrentOp->pOp->OnIdleEvent())
01415         {
01416             MoreIdlesNeeded = TRUE; // we need more idles
01417             CallLowPriorityHandlers = FALSE;
01418         }
01419 
01420         CurrentOp = NextOp;
01421     }
01422 
01423     // If nobody objects to a low-priority pass, do one
01424     if (CallLowPriorityHandlers)
01425     {
01426         CurrentOp = (ListItemOpPtr*)IdleLowPriorityOps.GetHead();
01427 
01428         while (CurrentOp != NULL)
01429         {
01430             // Remember the next item in the list now, in case this one deregisters itself
01431             NextOp = (ListItemOpPtr *) IdleLowPriorityOps.GetNext(CurrentOp);               
01432             MoreIdlesNeeded = MoreIdlesNeeded || CurrentOp->pOp->OnIdleEvent();
01433             CurrentOp = NextOp;
01434         }
01435     }
01436 
01437     return MoreIdlesNeeded;
01438 }

BOOL Application::CamelotIsDying  )  [inline]
 

Definition at line 544 of file app.h.

00544 { return CamelotShuttingDown; }

Application::CC_DECLARE_MEMDUMP Application   )  [private]
 

BOOL Application::ChangeRealDownloadBrowserOtion HKEY  rootKey,
HKEY  key,
BOOL  changeVal
[private]
 

Change the RealDownload "EnableBrowserWatch" key value.

Author:
Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/9/2000
Parameters:
rootKey - HKEY_LOCAL_MACHINE or HKEY_CURRENT_USER (not checked) [INPUTS] key - already opened subpath key (to realdownload directory) changeVal - value to change the realdownload "EnableBrowserWatch" key to
- [OUTPUTS]
Returns:
TRUE if changed value, FALSE otherwise

Errors: -

See also:
-

Definition at line 1928 of file app.cpp.

01929 {
01930     LPCTSTR path = "software\\realnetworks\\realdownload\\";
01931     
01932     const INT32 buf_size = 256;
01933     DWORD dwIndex   = 0;                // index of subkey to enumerate 
01934     TCHAR Name[buf_size];               // buffer for subkey name
01935     DWORD cbName    = buf_size;         // size of subkey buffer 
01936     TCHAR Class[buf_size];              // buffer for class string 
01937     DWORD cbClass   = buf_size;         // size of class buffer 
01938     FILETIME ftLastWriteTime;           // time key last written to
01939 
01940     BOOL returnVal = FALSE;
01941 
01942     INT32 nResult = ERROR_SUCCESS;
01943 //  String_256 KeyName;
01944 
01945     do
01946     {
01947         // reset the string sizes to their maximum for receiving data
01948         cbName  = buf_size;
01949         cbClass = buf_size;
01950 
01951         // Does another sub-key exist?
01952         nResult = ::RegEnumKeyEx(key, dwIndex, Name, &cbName, NULL, Class, &cbClass, &ftLastWriteTime);
01953 
01954         if (nResult == ERROR_SUCCESS)
01955         {
01956             // weve hit a real download version number - scan it ....
01957 
01958             char subpath [100];
01959             char newpath [200];
01960             
01961             sprintf (subpath, "%s", Name);
01962             sprintf (newpath, "%s%s", path, subpath);
01963 
01964             HKEY subkey = OpenRegKey (rootKey, newpath);
01965 
01966             DWORD newval = (DWORD) changeVal;
01967 
01968             if (subkey)
01969             {   
01970                 DWORD type, dataVal, dataSize;
01971 
01972                 if (RegQueryValueEx (subkey, "EnableBrowserWatch", NULL, &type, (unsigned char*) &dataVal, &dataSize) == ERROR_SUCCESS)
01973                 {
01974                     BOOL currentVal = (BOOL) dataVal;
01975 
01976                     if (currentVal == TRUE)
01977                     {
01978                         if (RegSetValueEx (subkey, "EnableBrowserWatch", NULL, REG_DWORD, (unsigned char*) &newval, sizeof (newval)) == ERROR_SUCCESS)
01979                         {
01980                             RegCloseKey (subkey);
01981                             return (TRUE);
01982                         }
01983                         else
01984                         {
01985                             RegCloseKey (subkey);
01986                             return (FALSE);
01987                         }
01988                     }
01989                     else if ((currentVal == FALSE) && (changeVal == TRUE))      // were resetting to TRUE
01990                     {
01991                         if (RegSetValueEx (subkey, "EnableBrowserWatch", NULL, REG_DWORD, (unsigned char*) &newval, sizeof (newval)) == ERROR_SUCCESS)
01992                         {
01993                             RegCloseKey (subkey);
01994                             return (TRUE);
01995                         }
01996                         else
01997                         {
01998                             RegCloseKey (subkey);
01999                             return (FALSE);
02000                         }
02001                     }
02002                 }
02003 
02004                 RegCloseKey (subkey);
02005             }
02006             
02007             //          KeyName = Name;
02008         }
02009 
02010         // increment our indexing item and try again
02011         dwIndex ++;
02012 
02013     } while (nResult == ERROR_SUCCESS);
02014 
02015     if (DisabledRealDownload)
02016     {
02017         return (TRUE);
02018     }
02019     else
02020     {
02021         return (FALSE);
02022     }
02023 
02024     return false;
02025 }

void Application::CheckRealDownload  ) 
 

Disables RealDownload browser integration if necessary - to prevent camelot from dying when downloading files that are registered with RealDownload.

Author:
Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/9/2000
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 2044 of file app.cpp.

02045 {
02046     PORTNOTE("other","Application::CheckRealDownload - do nothing")
02047 #ifndef EXCLUDE_FROM_XARALX
02048     key = OpenRegKey (HKEY_CURRENT_USER, "software\\realnetworks\\realdownload\\");
02049 
02050     if (key)
02051     {
02052         // disable it ....
02053         DisabledRealDownload = ChangeRealDownloadBrowserOtion (HKEY_CURRENT_USER, key, FALSE);
02054 
02055         if (DisabledRealDownload)
02056         {
02057             key2 = OpenRegKey (HKEY_LOCAL_MACHINE, "software\\realnetworks\\realdownload\\");
02058 
02059             if (key2)
02060             {
02061                 // disable it ....
02062                 ChangeRealDownloadBrowserOtion (HKEY_LOCAL_MACHINE, key2, FALSE);
02063             }
02064         }
02065     }
02066     else
02067     {
02068         key2 = OpenRegKey (HKEY_LOCAL_MACHINE, "software\\realnetworks\\realdownload\\");
02069 
02070         if (key2)
02071         {
02072             // disable it ....
02073             DisabledRealDownload = ChangeRealDownloadBrowserOtion (HKEY_LOCAL_MACHINE, key2, FALSE);
02074         }
02075     }
02076 #endif
02077 }

BOOL Application::CreateDragTargets DragInformation DragInfo  ) 
 

Definition at line 1498 of file app.cpp.

01499 {
01500     Document* pDocument = (Document*) Documents.GetHead();
01501     while (pDocument != NULL)
01502     {
01503         pDocument->CreateDragTargets(DragInfo);
01504 
01505         pDocument = (Document*) Documents.GetNext(pDocument);
01506     }
01507     return TRUE;
01508 }

BOOL Application::DeclarePref LPTCHAR  Section,
LPTCHAR  Pref,
StringBase PrefVar
[inline]
 

Definition at line 490 of file app.h.

00491         { return CamelotPrefs->DeclarePref(Section, Pref, PrefVar); };

BOOL Application::DeclarePref LPTCHAR  Section,
LPTCHAR  Pref,
double *  PrefVar,
double  Min = DBL_MIN,
double  Max = DBL_MAX
[inline]
 

Definition at line 486 of file app.h.

00488         { return CamelotPrefs->DeclarePref(Section, Pref, PrefVar, Min, Max); };

BOOL Application::DeclarePref LPTCHAR  Section,
LPTCHAR  Pref,
UINT32 PrefVar,
UINT32  Min = 0,
UINT32  Max = UINT_MAX
[inline]
 

Definition at line 482 of file app.h.

00484         { return CamelotPrefs->DeclarePref(Section, Pref, PrefVar, Min, Max); };

BOOL Application::DeclarePref LPTCHAR  Section,
LPTCHAR  Pref,
INT32 *  PrefVar,
INT32  Min = INT_MIN,
INT32  Max = INT_MAX
[inline]
 

Definition at line 478 of file app.h.

00480         { return CamelotPrefs->DeclarePref(Section, Pref, PrefVar, Min, Max); };

BOOL Application::DeclareSection LPTCHAR  Section,
UINT32  InitialSize
[inline]
 

Definition at line 475 of file app.h.

00476         { return CamelotPrefs->DeclareSection(Section, InitialSize); };

void Application::Deinit  ) 
 

Close down the kernel application object, including the user preferences system.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/8/93

Definition at line 617 of file app.cpp.

00618 {
00619 #ifdef PLUGINSUPPORT
00620 // Only add in if required - general plug-in removal at present
00621     // We need to ask the plug-in manager to save out its list of pathnames.
00622     // So before the prefs system is vaped.
00623     PlugInManager * pPlugMan = GetApplication()->GetPlugInManager();
00624     if (pPlugMan)
00625         pPlugMan->WritePathNameList();
00626 #endif // PLUGINSUPPORT
00627 
00628 #ifdef FREEHANDPLUGINS
00629     //  clean up the memory used by MOA
00630     TRACEUSER( "claude", wxT("Free up frmo the handle manager\n") );
00631     HandleManager* pHandleCleaning = GetApplication()->GetHandleManager();
00632     if(pHandleCleaning)
00633         pHandleCleaning->FreeAll();
00634 #endif // FREEHANDPLUGINS
00635 
00636     if (CamelotPrefs!=NULL)
00637     {
00638         CamelotPrefs->Deinit();
00639         delete CamelotPrefs;
00640         CamelotPrefs = NULL;
00641     }
00642 
00643     if (Selection!=NULL)
00644     {
00645         delete Selection;
00646         Selection = NULL;
00647     }
00648         
00649     if (DocComponentClasses != NULL)
00650     {
00651         DocComponentClasses->DeleteAll();
00652         delete DocComponentClasses;
00653         DocComponentClasses = NULL;
00654     }
00655 
00656     if (TheColourManager!=NULL)
00657     {
00658         ColourManager::Deinit();
00659         delete TheColourManager;
00660         TheColourManager = NULL;
00661     }
00662 
00663     if (TheNoiseManager!=NULL)
00664     {
00665         TheNoiseManager->Destroy();
00666         delete TheNoiseManager;
00667         TheNoiseManager=NULL;
00668     }
00669 
00670 #if !defined(EXCLUDE_FROM_RALPH)
00671 #if !defined(EXCLUDE_FROM_XARALX)
00672 PORTNOTE("colourmanager","Removed XaraCMS usage")
00673     if (CMSManager!=NULL)
00674     {
00675         CMSManager->Finalise();
00676         delete CMSManager;
00677         CMSManager = NULL;
00678     }
00679 
00680 // VECTOR_STROKING - markn 25/4/97
00681 // No pen stuff required in Webster
00682 // Taken out by vector stroking code Neville 2/10/97
00683 #ifdef VECTOR_STROKING
00684     if (PressurePen != NULL)
00685     {
00686         delete PressurePen;
00687         PressurePen = NULL;
00688     }
00689 #endif // VECTOR_STROKING
00690 
00691 #endif  // EXCLUDE_FROM_XARALX
00692     // Get rid of the blob manager
00693     if (BlobMgr!=NULL)
00694     {
00695         delete BlobMgr;
00696         BlobMgr = NULL;
00697     }
00698 #endif // EXCLUDE_FROM_RALPH
00699 
00700 PORTNOTE("other","Removed un-=impl. stuff")
00701 #ifndef EXCLUDE_FROM_XARALX
00702     // Get rid of the ATM Ini cache object
00703     if (pATMIniCache!=NULL)
00704     {
00705         delete pATMIniCache;
00706         pATMIniCache = NULL;
00707     } */
00708 #endif
00709 
00710     // Get rid of the font manager
00711     if (FontMgr!=NULL)
00712     {
00713         delete FontMgr;
00714         FontMgr = NULL;
00715     }
00716 
00717 #if !defined(EXCLUDE_FROM_RALPH)
00718 #ifndef STANDALONE
00719 #ifndef WEBSTER
00720 // Do not do do on Webster as this conflicts with the CleanUpAfterExport code in BaseCamelotFilter
00721 
00722     // Toast the marks manager
00723     if (TheMarksManager!=NULL)
00724     {
00725         delete TheMarksManager;
00726         TheMarksManager = NULL;
00727     }
00728 #endif // WEBSTER
00729 #endif
00730 #endif
00731 
00732 #ifdef PLUGINSUPPORT
00733 // Only add in if required - general plug-in removal at present
00734     // Toast the plug-in manager
00735     if (ThePlugInManager != NULL)
00736     {
00737         delete ThePlugInManager;
00738         ThePlugInManager = NULL;
00739     }
00740 #endif // PLUGINSUPPORT
00741 
00742 #ifdef FREEHANDPLUGINS
00743     // Nuke the API interfaces (must be done after killing the plugin manager). Don't delete
00744     // it afterwards, it's all handled by the reference count...
00745     if(TheAPIObject != NULL)
00746         TheAPIObject->ShutDown();
00747 
00748     //  Delete the Moa handle manager
00749     if(TheHandleManager != NULL)
00750     {
00751         TRACEUSER( "claude", wxT("deleting the moa handle manager\n") );
00752         delete TheHandleManager;
00753         TheHandleManager = NULL;
00754     }
00755 #endif // FREEHANDPLUGINS
00756 
00757     DeinitFilterManager();
00758 
00759     if (m_pObjCache != NULL)
00760     {
00761         delete m_pObjCache;
00762         m_pObjCache = NULL;
00763     }
00764 
00765     if (TheBitmapCache)
00766     {
00767         TheBitmapCache->DeInitialise();
00768         delete TheBitmapCache;
00769         TheBitmapCache = NULL;
00770     }
00771 
00772     DeinitWizOps();
00773 
00774 #ifdef AUTOMATION
00775     DestroyCCC();
00776 #endif
00777 
00778     // DialogManager was deinitialized a while ago, but this bit needs to be done after
00779     // the pref system has gone. It merely frees some memory
00780     DialogManager::FreePaneInfoHash();
00781 
00782     ObjectRegistry::Delete();
00783 }

BOOL Application::DeinitFilterManager  )  [protected]
 

Support function to deinitialize & destruct this Application's FilterManager.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/12/96
Returns:
TRUE if OK, FALSE if failed

Definition at line 796 of file app.cpp.

00797 {
00798     BOOL Success = FALSE;
00799 
00800     FilterManager* pFilterManager = GetFilterManager();
00801     if (pFilterManager != NULL)
00802     {
00803         Success = TheFilterManager->DeInit();
00804         // ...ignore any errors
00805         if (!Success)
00806         {
00807             TRACE( wxT("Deinit of FilterManager not successful") );
00808         }
00809         delete TheFilterManager;
00810         TheFilterManager = NULL;
00811         Success = TRUE;
00812     }
00813     else
00814     {
00815         TRACE( wxT("No Filter Manager") );
00816         Success = FALSE;
00817     }
00818 
00819     return Success;
00820 }

BOOL Application::DeinitWizOps  )  [protected]
 

Support function to deinitialize & destruct this Application's WizOps.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/12/96
Returns:
TRUE if OK, FALSE if failed

Definition at line 835 of file app.cpp.

00836 {
00837     BOOL Ok = TRUE;