#include <app.h>
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) |
RenderRegionList * | GetRegionList () |
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. | |
ColourManager * | FindTheColourManager (void) |
void | UpdateSelection () |
SelRange * | FindSelection () |
BlobManager * | GetBlobManager () |
ATMIniCache * | GetATMIniCache () |
FontManager * | GetFontManager () |
XaraCMS * | GetCMSManager () const |
PrintMarksMan * | GetMarksManager () const |
PlugInManager * | GetPlugInManager () const |
FilterManager * | GetFilterManager () const |
APIObject * | GetAPIObject () const |
NoiseMan * | GetNoiseManager () const |
HandleManager * | GetHandleManager () const |
WizOps * | GetWizOps () const |
CBitmapCache * | GetBitmapCache () const |
GlobalBitmapList * | GetGlobalBitmapList () |
GlobalFractalList * | GetGlobalFractalList () |
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. | |
DocComponentClass * | EnumerateDocComponents (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 () |
CTemplateManager & | GetTemplateManager () |
ObjectCache * | GetObjectCache () |
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 (). | |
CCStatusBar * | GetpCCStatusBar () |
return pointer to CMainFrame::CCStatusBar | |
StatusLine * | GetpStatusLine () |
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 |
SelRange * | Selection |
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 |
Preferences * | CamelotPrefs |
ColourManager * | TheColourManager |
BlobManager * | BlobMgr |
List * | DocComponentClasses |
GlobalBitmapList | GlobalBitmaps |
GlobalFractalList | GlobalFractals |
List | IdleHighPriorityOps |
List | IdleLowPriorityOps |
ATMIniCache * | pATMIniCache |
FontManager * | FontMgr |
XaraCMS * | CMSManager |
PrintMarksMan * | TheMarksManager |
PlugInManager * | ThePlugInManager |
FilterManager * | TheFilterManager |
APIObject * | TheAPIObject |
HandleManager * | TheHandleManager |
NoiseMan * | TheNoiseManager |
ObjectCache * | m_pObjCache |
CBitmapCache * | TheBitmapCache |
WizOps * | TheWizardOfOps |
StatusLine * | m_pStatusLine |
std::auto_ptr< CTemplateManager > | m_pTemplateManager |
BOOL | CamelotShuttingDown |
BOOL | DisabledRealDownload |
HKEY | key |
HKEY | key2 |
List | RegenList |
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.
Definition at line 229 of file app.h.
|
Initialise the application.
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 }
|
|
Destroys any documents associated with this object.
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 }
|
|
Adds a node to the regeneration list.
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 }
|
|
To add a RenderRegion object to the RenderList. Automatically sets a flag to do immediate rendering if the render region is an immediate one.
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 }
|
|
Given a document, apply all the currently registered document components to it. i.e., add a colour table, units information, etc.
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 }
|
|
To call registered operations OnIdle functions.
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.]
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 }
|
|
Definition at line 544 of file app.h. 00544 { return CamelotShuttingDown; }
|
|
|
|
Change the RealDownload "EnableBrowserWatch" key value.
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 }
|
|
Disables RealDownload browser integration if necessary - to prevent camelot from dying when downloading files that are registered with RealDownload.
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 }
|
|
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 }
|
|
Definition at line 490 of file app.h. 00491 { return CamelotPrefs->DeclarePref(Section, Pref, PrefVar); };
|
|
Definition at line 486 of file app.h. 00488 { return CamelotPrefs->DeclarePref(Section, Pref, PrefVar, Min, Max); };
|
|
Definition at line 482 of file app.h. 00484 { return CamelotPrefs->DeclarePref(Section, Pref, PrefVar, Min, Max); };
|
|
Definition at line 478 of file app.h. 00480 { return CamelotPrefs->DeclarePref(Section, Pref, PrefVar, Min, Max); };
|
|
Definition at line 475 of file app.h. 00476 { return CamelotPrefs->DeclareSection(Section, InitialSize); };
|
|
Close down the kernel application object, including the user preferences system.
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 }
|
|
Support function to deinitialize & destruct this Application's FilterManager.
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 }
|
|
Support function to deinitialize & destruct this Application's WizOps.
Definition at line 835 of file app.cpp. 00836 { 00837 BOOL Ok = TRUE; 00838 00839 if (TheWizardOfOps != NULL) 00840 { 00841 delete TheWizardOfOps; 00842 TheWizardOfOps = NULL; 00843 } 00844 else 00845 { 00846 TRACE( wxT("No WizOps") ); 00847 Ok = FALSE; 00848 } 00849 00850 return Ok; 00851 }
|
|
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).
Definition at line 951 of file app.cpp. 00952 { 00953 #ifdef RALPH 00954 // Wait until it's safe to enter 00955 CCamApp::EnterGDrawCriticalSection(); 00956 #endif 00957 if (RenderList.FindPosition(Region) == NOT_IN_LIST) 00958 { 00959 #ifdef RALPH 00960 // Let another process have a go 00961 CCamApp::ExitGDrawCriticalSection(); 00962 #endif 00963 ENSURE( FALSE, "Couldn't find Region in List" ); 00964 return FALSE; 00965 } 00966 00967 RenderList.Remove(Region); 00968 #ifdef RALPH 00969 // Let another process have a go 00970 CCamApp::ExitGDrawCriticalSection(); 00971 #endif 00972 return TRUE; 00973 }
|
|
Definition at line 250 of file app.h. 00251 { RenderList.Remove(pView); };
|
|
Definition at line 248 of file app.h. 00249 { RenderList.Remove(pDoc); };
|
|
Definition at line 355 of file app.h. 00355 {DumpAllOps(NULL);} // The stupid QuickWatch window dosent allow default params!
|
|
To find the single 'global' ColourManager instance in Camelot Dumps information about all the operations in the history list to the debugger.
Definition at line 1690 of file app.cpp. 01691 { 01692 PORTNOTETRACE("other","Application::DumpAllOps - do nothing"); 01693 #ifndef EXCLUDE_FROM_XARALX 01694 #if DEBUG_TREE 01695 if (pDoc == NULL) 01696 pDoc = Document::GetSelected(); 01697 01698 pDoc->GetOpHistory().DumpAll(); 01699 #endif 01700 #endif 01701 }
|
|
Definition at line 356 of file app.h. 00356 {DumpLastOp(NULL);}
|
|
Dumps information about the last operation in the history list to the debugger.
Definition at line 1719 of file app.cpp. 01720 { 01721 PORTNOTE("other","Application::DumpLastOp - do nothing") 01722 #ifndef EXCLUDE_FROM_XARALX 01723 #if DEBUG_TREE 01724 if (pDoc == NULL) 01725 pDoc = Document::GetSelected(); 01726 01727 pDoc->GetOpHistory().DumpLast(); 01728 #endif 01729 #endif 01730 }
|
|
Definition at line 357 of file app.h.
|
|
Dumps information about the document tree to the debugger.
Definition at line 1748 of file app.cpp. 01749 { 01750 PORTNOTE("other","Removed DebugTreeDlg usage") 01751 #ifndef EXCLUDE_FROM_XARALX 01752 #if DEBUG_TREE 01753 DebugTreeDlg::TweeDump(pDoc); 01754 #endif 01755 #endif 01756 }
|
|
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);.
Definition at line 1137 of file app.cpp. 01138 { 01139 if (pContext == NULL) 01140 { 01141 // Return the first item in the list... 01142 return (DocComponentClass *) (DocComponentClasses->GetHead()); 01143 } 01144 else 01145 { 01146 // Return the next document component... 01147 return (DocComponentClass *) (DocComponentClasses->GetNext(pContext)); 01148 } 01149 }
|
|
Definition at line 270 of file app.h. 00271 { return(Selection); }; // SelRange object.
|
|
Definition at line 261 of file app.h. 00262 { return(TheColourManager); };
|
|
Definition at line 303 of file app.h. 00303 { return TheAPIObject; }
|
|
Definition at line 285 of file app.h. 00285 { return pATMIniCache; }
|
|
Definition at line 315 of file app.h. 00315 { return TheBitmapCache; }
|
|
Definition at line 282 of file app.h. 00282 { return BlobMgr; }
|
|
Definition at line 291 of file app.h. 00291 { return CMSManager; }
|
|
Wrapper function for gaining access to convert to editable shapes DPI (as requested by karim).
Definition at line 2148 of file app.cpp. 02149 { 02150 return (Camelot.GetPrefValue(TEXT("Displays"),TEXT("CompCToEDPI"),pValue)); 02151 }
|
|
Definition at line 300 of file app.h. 00300 { return TheFilterManager; }
|
|
Definition at line 288 of file app.h. 00288 { return FontMgr; }
|
|
Definition at line 323 of file app.h. 00323 { return &GlobalBitmaps; }
|
|
Definition at line 324 of file app.h. 00324 { return &GlobalFractals; }
|
|
Definition at line 309 of file app.h. 00309 {return TheHandleManager;}
|
|
Definition at line 294 of file app.h. 00294 { return TheMarksManager; }
|
|
Definition at line 306 of file app.h. 00306 { return TheNoiseManager; }
|
|
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.
Definition at line 1809 of file app.cpp. 01810 { 01811 return m_pObjCache; 01812 }
|
|
return pointer to CMainFrame::CCStatusBar
Definition at line 1627 of file app.cpp. 01628 { 01629 PORTNOTETRACE("other","Application::GetpCCStatusBar - do nothing"); 01630 #ifndef EXCLUDE_FROM_XARALX 01631 CMainFrame* mfwindow = (CMainFrame*)(AfxGetApp()->m_pMainWnd); 01632 ERROR2IF(mfwindow==NULL,NULL,"Application::GetpCCStatusBar() - mfwindow==NULL"); 01633 01634 return mfwindow->GetpCCStatusBar(); 01635 #else 01636 return NULL; 01637 #endif 01638 }
|
|
Definition at line 297 of file app.h. 00297 { return ThePlugInManager; }
|
|
Definition at line 525 of file app.h. 00526 { return CamelotPrefs->GetPrefDirect(Section, Pref, pValue); }
|
|
Definition at line 523 of file app.h. 00524 { return CamelotPrefs->GetPrefDirect(Section, Pref, pValue); }
|
|
Definition at line 521 of file app.h. 00522 { return CamelotPrefs->GetPrefDirect(Section, Pref, pValue); }
|
|
Definition at line 519 of file app.h. 00520 { return CamelotPrefs->GetPrefDirect(Section, Pref, pValue); }
|
|
Definition at line 498 of file app.h. 00499 { return CamelotPrefs->GetPrefValue(Section, Pref, PrefVar); };
|
|
Definition at line 496 of file app.h. 00497 { return CamelotPrefs->GetPrefValue(Section, Pref, PrefVar); };
|
|
Definition at line 494 of file app.h. 00495 { return CamelotPrefs->GetPrefValue(Section, Pref, PrefVar); };
|
|
Definition at line 1651 of file app.cpp. 01652 { 01653 return StatusLine::Get(); 01654 }
|
|
Gets a pointer to the Applications RenderRegion list.
Definition at line 897 of file app.cpp. 00898 { 00899 return &RenderList; 00900 }
|
|
Definition at line 455 of file app.h. 00456 { 00457 return *m_pTemplateManager.get(); 00458 }
|
|
Definition at line 312 of file app.h. 00312 { return TheWizardOfOps; }
|
|
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.
Definition at line 299 of file app.cpp. 00300 { 00301 00302 // Initialise the message handler class groups 00303 if(!( 00304 MessageHandler::RegisterClassGroup(CC_RUNTIME_CLASS(MessageHandler)) && 00305 MessageHandler::RegisterClassGroup(CC_RUNTIME_CLASS(Operation)) && 00306 MessageHandler::RegisterClassGroup(CC_RUNTIME_CLASS(DialogOp)) && 00307 MessageHandler::RegisterClassGroup(CC_RUNTIME_CLASS(OpDescriptor)) && 00308 MessageHandler::RegisterClassGroup(CC_RUNTIME_CLASS(DialogBarOp)) && 00309 MessageHandler::RegisterClassGroup(CC_RUNTIME_CLASS(SelRangeMessageHandler)) 00310 )) 00311 { 00312 return FALSE; // Failed 00313 } 00314 00315 #if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX) 00316 PORTNOTE("colourmanager","Removed XaraCMS usage") 00317 // Create the Xara CMS manager - we have to get this in there 00318 // before a colour manager initialise otherwise there'll be trouble. 00319 // Note that if this fails in any way, we continue happily, simply disabling 00320 // the advanced colour management functions. 00321 CMSManager = new XaraCMS; 00322 if (CMSManager != NULL) 00323 { 00324 // We got one. Let's initialise it 00325 if (!CMSManager->Initialise(1)) 00326 { 00327 delete CMSManager; 00328 CMSManager = NULL; 00329 } 00330 } 00331 CMSManager = NULL; 00332 #else 00333 CMSManager = NULL; 00334 #endif 00335 00336 // startup the noise system 00337 TheNoiseManager = new NoiseMan; 00338 if (TheNoiseManager == NULL) 00339 return FALSE; 00340 00341 if (!TheNoiseManager->Initialise()) 00342 return FALSE; 00343 00344 // Initialise the colour system 00345 if (!ColourManager::Init()) 00346 return FALSE; 00347 00348 // Create and initialise the Camelot Selection object 00349 // This must be done AFTER registering the SelRangeMessageHandler class above, 00350 // as the Selection tries to register a message handler when it is constructed. 00351 // Thus it is necessary to defer creation of the object until the msg system 00352 // has been appropriately set up. 00353 Selection = new SelRange; 00354 if (Selection == NULL) 00355 return(FALSE); 00356 00357 // startup the noise system 00358 // Create and initialise the colour manager 00359 // THis is done here for the same reasons as described for the SelRange, above. 00360 TheColourManager = new ColourManager; 00361 if (TheColourManager == NULL) 00362 return(FALSE); 00363 00364 // create and initialise a new Blob Manager 00365 BlobMgr = new BlobManager; 00366 if (BlobMgr == NULL) 00367 return FALSE; 00368 00369 PORTNOTE("other","Removed init of stuff that is not supported") 00370 #if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX) 00371 // create the ATM ini cache. 00372 pATMIniCache = new ATMIniCache; 00373 if (pATMIniCache == NULL) 00374 return FALSE; 00375 #endif 00376 00377 // Create the font mangler 00378 FontMgr = new FontManager; 00379 if (FontMgr == NULL) 00380 return FALSE; 00381 00382 // And make sure its initialised; 00383 if (!FontMgr->Init()) 00384 return FALSE; 00385 00386 #if !defined(EXCLUDE_FROM_RALPH) 00387 #ifndef STANDALONE 00388 #ifndef WEBSTER 00389 // Do not do do on Webster as this conflicts with the CleanUpAfterExport code in BaseCamelotFilter 00390 00391 // Create a print marks manager please 00392 TheMarksManager = new PrintMarksMan; 00393 if (TheMarksManager == NULL) 00394 return FALSE; 00395 #endif // WEBSTER 00396 #endif 00397 #endif 00398 00399 #if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX) 00400 #ifndef STANDALONE 00401 #ifdef FREEHANDPLUGINS 00402 // Only add in if required - general plug-in removal at present 00403 // Create the external (Freehand Xtra) API object 00404 TheAPIObject = new APIObject; 00405 if (TheAPIObject == NULL) 00406 return FALSE; // Actually we can probably run without this... 00407 #endif // FREEHANDPLUGINS 00408 00409 #ifdef PLUGINSUPPORT 00410 // Create a plug-in manager please 00411 ThePlugInManager = new PlugInManager; 00412 if (ThePlugInManager == NULL) 00413 return FALSE; 00414 #endif // PLUGINSUPPORT 00415 00416 #ifdef FREEHANDPLUGINS 00417 TRACEUSER( "claude", _T("new handlemanager\n")); 00418 TheHandleManager = new HandleManager; 00419 if (TheHandleManager == NULL) 00420 return FALSE; 00421 #endif // FREEHANDPLUGINS 00422 00423 if (!InitFilterManager()) 00424 { 00425 return FALSE; 00426 } 00427 00428 #endif // STANDALONE 00429 #endif // EXCLUDE_FROM_RALPH, EXCLUDE_FROM_XARALX 00430 00431 #ifndef EXCLUDE_FROM_XARALX 00432 #ifdef AUTOMATION 00433 if (!InitCCC()) 00434 { 00435 return FALSE; 00436 } 00437 #endif 00438 #endif 00439 00440 // Initialise the object registry. 00441 if (!ObjectRegistry::Init()) 00442 { 00443 // Error has been set 00444 return (FALSE); 00445 } 00446 00447 if (!InitWizOps()) 00448 { 00449 return FALSE; 00450 } 00451 00452 #if !defined(EXCLUDE_FROM_RALPH) 00453 // Create and initialise the CamelotPrefs object. 00454 // This object is dynamically created rather than being embedded in the Appliation object 00455 // because the Application destructor is called after the SimpleCCObject::MemoryDump() 00456 // function is called. Hence if the CamelotPrefs object were embedded, the MemoryDump 00457 // would list all the preference-related objects on application termination. 00458 CamelotPrefs = new Preferences; 00459 00460 if (!((CamelotPrefs != NULL) && CamelotPrefs->Init())) 00461 return FALSE; 00462 #endif 00463 00464 #ifdef VECTOR_STROKING // Neville 6/8/97 00465 m_pObjCache = new ObjectCacheFIFO(50); // set a cache of 50 bytes 00466 00467 if (m_pObjCache == NULL) 00468 return FALSE; 00469 // Set the cache size with an arbitrary value (in bytes) 00470 //m_ObjCache->SetMaxCacheSize(50); 00471 #endif // VECTOR_STROKING 00472 00473 // Set up the Bitmap Cache... 00474 TheBitmapCache = new CBitmapCache(); 00475 TheBitmapCache->Initialise(); // Initialise with default settings 00476 00477 // Get an empty list object to hold all the registered doc components 00478 DocComponentClasses = new List; 00479 if (DocComponentClasses == NULL) 00480 return FALSE; 00481 00482 // Eveything worked (gasp!) 00483 return TRUE; 00484 }
|
|
Support function to initialize this Application's FilterManager.
Definition at line 497 of file app.cpp. 00498 { 00499 BOOL Success = FALSE; 00500 00501 TheFilterManager = new FilterManager; 00502 if (TheFilterManager != NULL) 00503 { 00504 Success = TheFilterManager->Init(); 00505 } 00506 else 00507 { 00508 Success = FALSE; 00509 } 00510 00511 return Success; 00512 }
|
|
Support function to initialize this Application's WizardOfOps from the local registry.
Definition at line 528 of file app.cpp. 00529 { 00530 BOOL Ok = TRUE; 00531 00532 TheWizardOfOps = new WizOps; 00533 if (TheWizardOfOps != NULL) 00534 { 00535 Ok = TheWizardOfOps->InitializeFromRegistry(); 00536 } 00537 else 00538 { 00539 Ok = FALSE; 00540 } 00541 00542 return Ok; 00543 }
|
|
Find out if there is Background rendering in progress or not.
Definition at line 1059 of file app.cpp. 01060 { 01061 return BgRendering; 01062 }
|
|
Definition at line 255 of file app.h. 00255 { return (RenderList.IsEmpty ()); }
|
|
Initialise the application object bits that require the preferences system to be fully up & running. Currently that means the pen only.
Definition at line 590 of file app.cpp. 00591 { 00592 #ifdef PLUGINSUPPORT 00593 // Only add in if required - general plug-in removal at present 00594 // We need the preferences system present so we must wait until here 00595 // before we ask the PlugInManager to initialise iteself; 00596 if (ThePlugInManager == NULL || !ThePlugInManager->Init()) 00597 return FALSE; 00598 #endif // PLUGINSUPPORT 00599 00600 m_pTemplateManager->Init(); 00601 00602 // Everything went ok 00603 return TRUE; 00604 }
|
|
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 ....
Definition at line 1582 of file app.cpp. 01583 { 01584 StatusLine* pStatusLine = GetpStatusLine (); 01585 01586 if (pStatusLine==NULL) 01587 return FALSE; 01588 01589 return (pStatusLine->LockOutControlHelp ()); 01590 }
|
|
Tells the application we need more idles.
Definition at line 1350 of file app.cpp. 01351 { 01352 CCamApp::NeedMoreIdles(); 01353 }
|
|
This is where idle events are recived by the kernel.
Definition at line 1457 of file app.cpp. 01458 { 01459 // If the system is disabled (due to an error box being up) we must not do anything, 01460 // as we definitely do not want to cause a re-entrant error situation! 01461 if( CCamApp::IsDisabled() ) 01462 return(TRUE); 01463 01464 Tool* CurTool=Tool::GetCurrent(); 01465 BOOL Idles =FALSE; 01466 01467 if (IdleRedraw) 01468 if (ServiceRendering()) 01469 Idles=TRUE; 01470 01471 if (CurTool!=NULL) 01472 if (CurTool->OnIdle()) 01473 Idles=TRUE; 01474 01475 if (CallIdleProcessors()) 01476 Idles=TRUE; 01477 01478 // ControlList::Idle(); 01479 01480 // Idles=TRUE; 01481 01482 return Idles; 01483 }
|
|
This is where key presses are handled in Camelot. It does the following in this order -.
If at any of the stages the key is processed, this function exits immediately with TRUE, i.e. it doesn't let the next stage try and deal with a key press that's been processed
Definition at line 1213 of file app.cpp. 01214 { 01215 #if !defined(EXCLUDE_FROM_RALPH) 01216 PORTNOTE("other","Removed XaraCMS usage") 01217 // First, pass the keypress to the Colour Editor. 01218 // This is used to stop keypresses while dragging in the editor, so must be done first 01219 if (ColourEditDlg::OnKeyPress(pKeyPress)) 01220 return(TRUE); 01221 #endif 01222 01223 // Pass this keypress on to selected DocView, if we have one, otherwise 01224 // pass on to tools, hotkeys etc. 01225 DocView* pDocView = DocView::GetSelected(); 01226 return ( (pDocView != NULL && pDocView->HandleKeyPress(pKeyPress)) 01227 || Tool::SwitchTool(pKeyPress) 01228 || HotKey::OnKeyPress(pKeyPress) 01229 // removed by Ed 27/4/95 - no-one uses this and it slows text typing by 20%! 01230 // || (BROADCAST_TO_ALL(KeyMsg(KeyMsg::KEYPRESS, pKeyPress)) == EAT_MSG ) 01231 ); 01232 }
|
|
Calls all of the regeneration functions of the nodes in the list.
Definition at line 1830 of file app.cpp. 01831 { 01832 if (RegenList.IsEmpty()) 01833 return; 01834 01835 NodeListItem *pItem = (NodeListItem *)RegenList.GetHead(); 01836 01837 while (pItem) 01838 { 01839 if (pItem->pNode) 01840 { 01841 if (pItem->pNode->GetHiddenCnt()==0) 01842 { 01843 if (pItem->pNode->IsBounded()) 01844 { 01845 ((NodeRenderableBounded *)pItem->pNode)->InvalidateBoundingRect(); 01846 } 01847 01848 pItem->pNode->RegenerateNode(NULL, FALSE, FALSE); 01849 01850 if (pItem->pNode->IsBounded()) 01851 { 01852 ((NodeRenderableBounded *)pItem->pNode)->InvalidateBoundingRect(); 01853 } 01854 } 01855 } 01856 01857 pItem = (NodeListItem *)RegenList.GetNext(pItem); 01858 } 01859 01860 RegenList.DeleteAll(); 01861 }
|
|
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.
Definition at line 1080 of file app.cpp. 01081 { 01082 // Check for multiple registrations in debug build... 01083 #if _DEBUG 01084 DocComponentClass *pItem = (DocComponentClass *) DocComponentClasses->GetHead(); 01085 01086 while (pItem != NULL) 01087 { 01088 // Already registered? 01089 if (pItem->GetRuntimeClass() == pClass->GetRuntimeClass()) 01090 { 01091 ENSURE(FALSE, "Document component registered more than once!"); 01092 return; 01093 } 01094 // Try the next one 01095 pItem = (DocComponentClass *) DocComponentClasses->GetNext(pItem); 01096 } 01097 #endif 01098 01099 // Simple - just add it to the list 01100 DocComponentClasses->AddTail(pClass); 01101 }
|
|
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.
HIGH priority handlers are called on every Idle event. LOW priority handlers will only be called on idle events if there were no high priority handlers which returned TRUE from their OnIdle method. i.e. If any high priority handler is active, all low-priority idles cease to occur.
Definition at line 1265 of file app.cpp. 01266 { 01267 List* Current = (Priority==IDLEPRIORITY_HIGH) ? &IdleHighPriorityOps : &IdleLowPriorityOps; 01268 01269 // Ensure the given Op is only registered once on the list 01270 ListItemOpPtr* Entry = (ListItemOpPtr *)Current->GetHead(); 01271 while (Entry != NULL) 01272 { 01273 if (Entry->pOp == pOp) // Hey, you're already registered! 01274 return; 01275 01276 Entry = (ListItemOpPtr *) Current->GetNext(Entry); 01277 } 01278 01279 // Have not found an entry in this list for this Op, so add one 01280 Entry = new ListItemOpPtr; 01281 Entry->pOp = pOp; 01282 Current->AddTail(Entry); 01283 01284 NeedMoreIdles(); // ensure it gets at least a first idle event 01285 }
|
|
Stops an operation from receiving idle events.
It is safe to call this method when processing an idle event - the event processing code ensures that if you remove yourself from the list, it does not give a toss (or an access violation!).
Definition at line 1313 of file app.cpp. 01314 { 01315 List* Current = (Priority==IDLEPRIORITY_HIGH) ? &IdleHighPriorityOps : &IdleLowPriorityOps; 01316 ListItemOpPtr* Entry = (ListItemOpPtr *)Current->GetHead(); 01317 01318 while (Entry != NULL) 01319 { 01320 if (Entry->pOp == pOp) 01321 { 01322 Current->RemoveItem(Entry); 01323 delete Entry; 01324 return; 01325 } 01326 01327 Entry = (ListItemOpPtr *) Current->GetNext(Entry); 01328 } 01329 }
|
|
Re-enables RealDownload browser integration if we disabled it.
Definition at line 2095 of file app.cpp. 02096 { 02097 PORTNOTE("other","Application::ResetRealDownload - do nothing") 02098 #ifndef EXCLUDE_FROM_XARALX 02099 if (DisabledRealDownload) 02100 { 02101 if (key) 02102 { 02103 // both HKEY_CURRENT_USER and HKEY_LOCAL_MACHINE could have been used, reset both .... 02104 02105 ChangeRealDownloadBrowserOtion (HKEY_CURRENT_USER, key, TRUE); 02106 RegCloseKey (key); 02107 02108 if (key2) 02109 { 02110 ChangeRealDownloadBrowserOtion (HKEY_LOCAL_MACHINE, key2, TRUE); 02111 RegCloseKey (key2); 02112 } 02113 02114 DisabledRealDownload = FALSE; 02115 } 02116 else if (key2) 02117 { 02118 // only HKEY_LOCAL_MACHINE will have been used, reset it .... 02119 02120 ChangeRealDownloadBrowserOtion (HKEY_LOCAL_MACHINE, key2, TRUE); 02121 RegCloseKey (key2); 02122 02123 DisabledRealDownload = FALSE; 02124 } 02125 } 02126 #endif 02127 }
|
|
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.
Definition at line 991 of file app.cpp. 00992 { 00993 #ifdef RALPH 00994 #ifdef _DEBUG 00995 if(::GetCurrentThreadId() == RalphDocument::GetImportingThreadID()) 00996 { 00997 // If we get in here, it's extremely BAD ! 00998 AfxDebugBreak(); 00999 } 01000 #endif 01001 01002 // Fixes splodgy text problems... 01003 RalphCriticalSection RCS; 01004 #endif 01005 01006 #ifdef RALPH 01007 // Wait until it's safe to enter 01008 CCamApp::EnterGDrawCriticalSection(); 01009 #endif 01010 01011 // DMc - render the list of nodes to regenerate 01012 RegenerateNodesInList(); 01013 01014 // TRACEUSER( "Gerry", _T("Service Rendering - Enter\n")); 01015 if (ImmediateRenderPending || bImmediate) 01016 { 01017 // Render all immediate render regions to completion, and then clear the 01018 // flag so we do some background rendering the next time around. 01019 RenderList.ImmediateRender(bImmediate); 01020 ImmediateRenderPending = FALSE; 01021 01022 #ifdef RALPH 01023 // Let another process have a go 01024 CCamApp::ExitGDrawCriticalSection(); 01025 #endif 01026 01027 // Try background rendering next 01028 // TRACEUSER( "Gerry", _T("Service Rendering - Exit - More\n")); 01029 return TRUE; 01030 } 01031 else 01032 { 01033 BOOL ok = RenderList.BackgroundRender(); 01034 #ifdef RALPH 01035 // Let another process have a go 01036 CCamApp::ExitGDrawCriticalSection(); 01037 #endif 01038 01039 // TRACEUSER( "Gerry", _T("Service Rendering - Exit - %s\n"), ok ? _T("More") : _T("Finished")); 01040 return ok; 01041 } 01042 01043 // TRACEUSER( "Gerry", _T("Service Rendering - Exit - More\n")); 01044 return TRUE; 01045 }
|
|
Definition at line 516 of file app.h. 00517 { return CamelotPrefs->SetPrefDirect(Section, Pref, pValue); }
|
|
Definition at line 514 of file app.h. 00515 { return CamelotPrefs->SetPrefDirect(Section, Pref, pValue); }
|
|
Definition at line 512 of file app.h. 00513 { return CamelotPrefs->SetPrefDirect(Section, Pref, pValue); }
|
|
Definition at line 510 of file app.h. 00511 { return CamelotPrefs->SetPrefDirect(Section, Pref, pValue, Force); }
|
|
Definition at line 505 of file app.h. 00506 { return CamelotPrefs->SetPrefValue(Section, Pref, PrefVar); };
|
|
Definition at line 503 of file app.h. 00504 { return CamelotPrefs->SetPrefValue(Section, Pref, PrefVar); };
|
|
Definition at line 501 of file app.h. 00502 { return CamelotPrefs->SetPrefValue(Section, Pref, PrefVar); };
|
|
Definition at line 1523 of file app.cpp. 01524 { 01525 Document* pDocument = (Document*) Documents.GetHead(); 01526 while (pDocument != NULL) 01527 { 01528 pDocument->ShowViewScrollers(fIsVisible); 01529 pDocument = (Document*) Documents.GetNext(pDocument); 01530 } 01531 01532 }
|
|
Definition at line 547 of file app.h. 00547 { CamelotShuttingDown = fState; }
|
|
Just interfaces to similar StatusLine funtion Notes: See Application::LockOutControlHelp () See Also: Application::LockOutControlHelp ().
Definition at line 1606 of file app.cpp. 01607 { 01608 StatusLine* pStatusLine = GetpStatusLine (); 01609 01610 if (pStatusLine==NULL) 01611 return FALSE; 01612 01613 return (pStatusLine->UnlockControlHelp ()); 01614 }
|
|
Definition at line 267 of file app.h.
|
|
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!
Definition at line 1548 of file app.cpp. 01549 { 01550 StatusLine* pStatusLine = GetpStatusLine(); 01551 01552 // ERROR2IF(pStatusLine==NULL,FALSE,"Application::UpdateStatusBarText() - pStatusLine==NULL"); 01553 if (pStatusLine==NULL) 01554 return FALSE; 01555 01556 return pStatusLine->UpdateText(ptext,PrefixSelDesc); 01557 }
|
|
Definition at line 472 of file app.h. 00473 { CamelotPrefs->WipeDangerousPrefs (); };
|
|
Definition at line 470 of file app.h. 00471 { CamelotPrefs->WipePreferenceFile(); };
|
|
Definition at line 467 of file app.h. 00468 { CamelotPrefs->Write(); };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|