Changeset 61 for trunk/NewView
- Timestamp:
- Jan 14, 2007, 8:02:42 PM (19 years ago)
- Location:
- trunk/NewView
- Files:
-
- 6 edited
-
DebugUnit.pas (modified) (4 diffs)
-
GlobalFilelistUnit.pas (modified) (3 diffs)
-
MainForm.pas (modified) (2 diffs)
-
NewView.spr (modified) (14 diffs)
-
StartupUnit.pas (modified) (6 diffs)
-
ViewStub.pas (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/NewView/DebugUnit.pas
r55 r61 26 26 // -- Logging -- 27 27 Type 28 LogAspect = (LogStartup, LogShutdown, LogSettings, LogParse, LogDisplay, LogSearch, LogViewStub );28 LogAspect = (LogStartup, LogShutdown, LogSettings, LogParse, LogDisplay, LogSearch, LogViewStub, LogObjConstDest); 29 29 LogAspects = SET OF LogAspect; 30 30 … … 46 46 const 47 47 activeLogAspects : LogAspects = [ 48 LogStartup 48 LogStartup, 49 49 // LogShutdown, 50 50 // LogSettings, … … 52 52 // LogDisplay, 53 53 // LogSearch, 54 // LogViewStub 54 LogViewStub, 55 LogObjConstDest 55 56 ]; 56 57 … … 64 65 Begin 65 66 Case aLogAspect of 66 LogStartup : result := 'Startup'; 67 LogShutdown : result := 'Start'; 68 LogSettings : result := 'Settings'; 69 LogParse : result := 'Parse'; 70 LogDisplay : result := 'Display'; 71 LogSearch : result := 'Search'; 72 LogViewStub : result := 'ViewStub'; 73 else result := 'Unknown'; 67 LogStartup : result := 'Startup'; 68 LogShutdown : result := 'Start'; 69 LogSettings : result := 'Settings'; 70 LogParse : result := 'Parse'; 71 LogDisplay : result := 'Display'; 72 LogSearch : result := 'Search'; 73 LogViewStub : result := 'ViewStub'; 74 LogObjConstDest : result := 'ObjConstDest'; 75 else result := 'Unknown'; 74 76 end; 75 77 End; -
trunk/NewView/GlobalFilelistUnit.pas
r32 r61 50 50 51 51 uses 52 DebugUnit, 52 53 ACLStringUtility, 53 54 SysUtils; … … 55 56 constructor TGlobalFilelist.Create; 56 57 begin 58 LogEvent(LogObjConstDest, '+ TGlobalFilelist.Create'); 59 57 60 FMem := TSuballocatedSharedMemory.Create( 'NEWVIEW_GLOBAL_FILELIST', 58 61 GLOBAL_FILELIST_SIZE, … … 68 71 destructor TGlobalFilelist.Destroy; 69 72 begin 73 LogEvent(LogObjConstDest, '- TGlobalFilelist.Destroy'); 74 70 75 FMem.Destroy; 71 76 FMutex.Destroy; -
trunk/NewView/MainForm.pas
r60 r61 813 813 Var 814 814 MainForm: TMainForm; 815 CmdLineParameters : TCmdLineParameters; 815 816 816 817 Implementation … … 2270 2271 Lines.Add(''); 2271 2272 Lines.Add('parsed infos:'); 2273 2272 2274 Lines.Add('getShowUsageFlag: ' + boolToStr(CmdLineParameters.getShowUsageFlag)); 2273 2275 Lines.Add('getSearchFlag: ' + boolToStr(CmdLineParameters.getSearchFlag)); -
trunk/NewView/NewView.spr
r44 r61 17 17 [Breakpoints] 18 18 19 Breakpoint0=.\MAINFORM.PAS| 227119 Breakpoint0=.\MAINFORM.PAS|4261 20 20 21 21 [Browser Files] … … 60 60 File37=CUSTOMHEADERCONTROL 61 61 File38=MULTICOLUMNLISTBOX 62 File39=ACLPROFILE 63 File40=ACLFINDFUNCTIONS 64 File41=ACLFILEUTILITY 65 File42=ACLLANGUAGEUNIT 66 File43=GENERICTHREAD 67 File44=STRINGUTILSUNIT 68 File45=DEBUGUNIT 69 File46=CMDLINEPARAMETERUNIT 70 File47=SPLITBAR 71 File48=CONTROLSCROLLING 72 File49=OUTLINE2 73 File50=CANVASFONTMANAGER 74 File51=RICHTEXTDOCUMENTUNIT 75 File52=RICHTEXTSTYLEUNIT 76 File53=CLIPBRD 77 File54=RICHTEXTLAYOUTUNIT 78 File55=CONTROLSUTILITY 79 File56=RICHTEXTDISPLAYUNIT 80 File57=RICHTEXTVIEW 81 File58=CUSTOMLISTBOX 82 File59=IPFFILEFORMATUNIT 83 File60=HELPWINDOWDIMENSIONS 84 File61=ASTRINGUTILITYUNIT 85 File62=SETTINGSUNIT 86 File63=HELPTOPIC 87 File64=CUSTOMMEMO 88 File65=SYSTEMICONUNIT 89 File66=ACLMESSAGEFORM 90 File67=ACLDIALOGS 91 File68=HELPBITMAP 92 File69=SEARCHTABLE 93 File70=HELPFILE 94 File71=HELPWINDOWUNIT 95 File72=NAVIGATEPOINTUNIT 96 File73=MISCUNIT 97 File74=HELPMANAGERUNIT 98 File75=TEXTSEARCHQUERY 99 File76=TABSET2UNIT 100 File77=RUNPROGRAMUNIT 101 File78=RICHTEXTPRINTUNIT 102 File79=INFORMATIONFORMUNIT 103 File80=COLORMAPPING 104 File81=COLORWHEEL 105 File82=CUSTOMFONTDIALOG 106 File83=BSEDEV 107 File84=DRIVEINFOUNIT 108 File85=BITMAPUTILITY 109 File86=CUSTOMFILECONTROLS 110 File87=FILEDIALOGFORM 111 File88=OPTIONSFORM 112 File89=VERSIONUNIT 113 File90=WEBBROWSERUNIT 114 File91=PRODUCTINFORMATIONFORMUNIT 115 File92=NOTEFORM 116 File93=LED 117 File94=SEARCHUNIT 118 File95=SEARCHDIRECTORIESFORMUNIT 119 File96=GLOBALSEARCHFORM 120 File97=BOOKMARKSFORMUNIT 121 File98=PRINTDIALOGUNIT 122 File99=GLOBALFILELISTUNIT 123 File100=STARTUPUNIT 124 File101=MAINFORM 62 File39=ACLFINDFUNCTIONS 63 File40=ACLFILEUTILITY 64 File41=ACLLANGUAGEUNIT 65 File42=GENERICTHREAD 66 File43=STRINGUTILSUNIT 67 File44=DEBUGUNIT 68 File45=CMDLINEPARAMETERUNIT 69 File46=SPLITBAR 70 File47=CONTROLSCROLLING 71 File48=OUTLINE2 72 File49=CANVASFONTMANAGER 73 File50=RICHTEXTDOCUMENTUNIT 74 File51=RICHTEXTSTYLEUNIT 75 File52=CLIPBRD 76 File53=RICHTEXTLAYOUTUNIT 77 File54=CONTROLSUTILITY 78 File55=RICHTEXTDISPLAYUNIT 79 File56=RICHTEXTVIEW 80 File57=CUSTOMLISTBOX 81 File58=IPFFILEFORMATUNIT 82 File59=HELPWINDOWDIMENSIONS 83 File60=ASTRINGUTILITYUNIT 84 File61=SETTINGSUNIT 85 File62=HELPTOPIC 86 File63=CUSTOMMEMO 87 File64=SYSTEMICONUNIT 88 File65=ACLMESSAGEFORM 89 File66=ACLDIALOGS 90 File67=HELPBITMAP 91 File68=SEARCHTABLE 92 File69=HELPFILE 93 File70=HELPWINDOWUNIT 94 File71=NAVIGATEPOINTUNIT 95 File72=MISCUNIT 96 File73=HELPMANAGERUNIT 97 File74=TEXTSEARCHQUERY 98 File75=TABSET2UNIT 99 File76=RUNPROGRAMUNIT 100 File77=RICHTEXTPRINTUNIT 101 File78=INFORMATIONFORMUNIT 102 File79=COLORMAPPING 103 File80=COLORWHEEL 104 File81=CUSTOMFONTDIALOG 105 File82=BSEDEV 106 File83=DRIVEINFOUNIT 107 File84=BITMAPUTILITY 108 File85=CUSTOMFILECONTROLS 109 File86=FILEDIALOGFORM 110 File87=OPTIONSFORM 111 File88=VERSIONUNIT 112 File89=WEBBROWSERUNIT 113 File90=PRODUCTINFORMATIONFORMUNIT 114 File91=NOTEFORM 115 File92=LED 116 File93=SEARCHUNIT 117 File94=SEARCHDIRECTORIESFORMUNIT 118 File95=GLOBALSEARCHFORM 119 File96=BOOKMARKSFORMUNIT 120 File97=PRINTDIALOGUNIT 121 File98=GLOBALFILELISTUNIT 122 File99=STARTUPUNIT 123 File100=MAINFORM 125 124 126 125 [Compiler Options] … … 152 151 [Directories] 153 152 154 LastDir=P:\NEWVIEW_DEV\ Components153 LastDir=P:\NEWVIEW_DEV\NEWVIEW 155 154 OutDir=P:\newview_dev\build\newview 156 155 LibDir=P:\newview_dev\build\sibyl\lib;P:\newview_dev\build\components;P:\newview_dev\build\library … … 170 169 [Find History] 171 170 172 Find0= profile173 Find1= CmdLineParameters174 Find2= tmpCmdLineParameters175 Find3= Startup176 Find4= searchtext177 Find5= color178 Find6= beta3179 Find7= StrDoubleQuote180 Find8= quote181 Find9= t182 Find10= impl183 Find11= rbri184 Find12= url185 Find13= TSerializableStringList186 Find14= StrUnDoubleQuote187 Find15= FullDoubleQuote171 Find0=getOwn 172 Find1=rbri 173 Find2=FindDefaultLanguageHelpFile 174 Find3=GetOwnHelpFileName 175 Find4=Filenames 176 Find5=getSearchFlag 177 Find6=parseCmdLine 178 Find7=Profile 179 Find8=profile 180 Find9=CmdLineParameters 181 Find10=tmpCmdLineParameters 182 Find11=Startup 183 Find12=searchtext 184 Find13=color 185 Find14=beta3 186 Find15=StrDoubleQuote 188 187 189 188 [General] … … 194 193 CompLibName=D:\progs\Sibyl\Bin\CompLib.dll 195 194 Win32CompLibName=D:\progs\Sibyl\Bin\CompLib.dll 196 RunParameter= p:\newview_dev\test\rendering\rendering.hlp195 RunParameter=-h 197 196 InActiveLanguages= 198 197 CurrentLanguage=Default … … 201 200 [Last Closed Files] 202 201 203 File0=.\unittests\cmdlineparameterunittests.pas 204 File1=.\VersionUnit.pas 205 File2=..\.\Library\ACLStringUtility.pas 206 File3=..\.\SIBYL\RTL\SYSTEM.PAS 207 File4=.\HelpFile.pas 202 File0=..\.\SIBYL\RTL\SYSTEM.PAS 203 File1=.\HelpFile.pas 204 File2=.\SettingsUnit.pas 205 File3=.\SearchUnit.pas 206 File4=.\GlobalSearchForm.pas 207 File5=..\.\Library\ACLProfile.pas 208 208 209 209 [Last Open Files] … … 215 215 File0.Height=481 216 216 File0.Column=1 217 File0.Line= 5217 File0.Line=2295 218 218 File1=.\NewView.pas 219 219 File1.Left=-4 … … 228 228 File2.Width=1243 229 229 File2.Height=481 230 File2.Column= 1231 File2.Line= 1232230 File2.Column=31 231 File2.Line=251 232 232 File3=..\.\LIBRARY\RunProgramUnit.pas 233 233 File3.Left=-4 … … 242 242 File4.Width=1243 243 243 File4.Height=481 244 File4.Column= 40245 File4.Line= 280244 File4.Column=15 245 File4.Line=31 246 246 File5=.\StartupUnit.pas 247 247 File5.Left=-4 … … 249 249 File5.Width=1243 250 250 File5.Height=481 251 File5.Column= 13252 File5.Line= 319251 File5.Column=37 252 File5.Line=166 253 253 File6=.\CmdLineParameterUnit.pas 254 254 File6.Left=-4 … … 256 256 File6.Width=1243 257 257 File6.Height=481 258 File6.Column= 26259 File6.Line=1 62258 File6.Column=12 259 File6.Line=105 260 260 File7=.\DebugUnit.pas 261 261 File7.Left=-4 … … 263 263 File7.Width=1243 264 264 File7.Height=481 265 File7.Column= 1266 File7.Line= 31267 File8=. .\.\Library\ACLProfile.pas265 File7.Column=51 266 File7.Line=48 267 File8=.\HelpManagerUnit.pas 268 268 File8.Left=-4 269 269 File8.Bottom=-5 270 270 File8.Width=1243 271 271 File8.Height=481 272 File8.Column=21 273 File8.Line=43 274 File9=..\.\Components\ACLLanguageUnit.pas 275 File9.Left=-4 276 File9.Bottom=-5 277 File9.Width=1243 278 File9.Height=481 279 File9.Column=3 280 File9.Line=799 272 File8.Column=13 273 File8.Line=51 281 274 282 275 [Linker Options] … … 299 292 MainFile0=.\NewView.pas 300 293 MainFile0.Ext=.EXE 301 MainFile0.Checksum=26 624294 MainFile0.Checksum=26368 302 295 MainFile0.Expanded=False 303 296 MainFile0.File0=.\BookmarksFormUnit.pas … … 369 362 MainFile0.Dependency37=..\.\components\CUSTOMHEADERCONTROL.PAS 370 363 MainFile0.Dependency38=..\.\components\MULTICOLUMNLISTBOX.PAS 371 MainFile0.Dependency39=..\.\library\ACLPROFILE.PAS 372 MainFile0.Dependency40=..\.\library\ACLFINDFUNCTIONS.PAS 373 MainFile0.Dependency41=..\.\library\ACLFILEUTILITY.PAS 374 MainFile0.Dependency42=..\.\components\ACLLANGUAGEUNIT.PAS 375 MainFile0.Dependency43=..\.\components\GENERICTHREAD.PAS 376 MainFile0.Dependency44=.\STRINGUTILSUNIT.PAS 377 MainFile0.Dependency45=.\DEBUGUNIT.PAS 378 MainFile0.Dependency46=.\CMDLINEPARAMETERUNIT.PAS 379 MainFile0.Dependency47=..\.\components\SPLITBAR.PAS 380 MainFile0.Dependency48=..\.\components\CONTROLSCROLLING.PAS 381 MainFile0.Dependency49=..\.\components\OUTLINE2.PAS 382 MainFile0.Dependency50=..\.\components\CANVASFONTMANAGER.PAS 383 MainFile0.Dependency51=..\.\components\RICHTEXTDOCUMENTUNIT.PAS 384 MainFile0.Dependency52=..\.\components\RICHTEXTSTYLEUNIT.PAS 385 MainFile0.Dependency53=..\.\sibyl\spcc\CLIPBRD.PAS 386 MainFile0.Dependency54=..\.\components\RICHTEXTLAYOUTUNIT.PAS 387 MainFile0.Dependency55=..\.\components\CONTROLSUTILITY.PAS 388 MainFile0.Dependency56=..\.\components\RICHTEXTDISPLAYUNIT.PAS 389 MainFile0.Dependency57=..\.\components\RICHTEXTVIEW.PAS 390 MainFile0.Dependency58=..\.\components\CUSTOMLISTBOX.PAS 391 MainFile0.Dependency59=.\IPFFILEFORMATUNIT.PAS 392 MainFile0.Dependency60=.\HELPWINDOWDIMENSIONS.PAS 393 MainFile0.Dependency61=..\.\library\ASTRINGUTILITYUNIT.PAS 394 MainFile0.Dependency62=.\SETTINGSUNIT.PAS 395 MainFile0.Dependency63=.\HELPTOPIC.PAS 396 MainFile0.Dependency64=..\.\components\CUSTOMMEMO.PAS 397 MainFile0.Dependency65=..\.\components\SYSTEMICONUNIT.PAS 398 MainFile0.Dependency66=..\.\components\ACLMESSAGEFORM.PAS 399 MainFile0.Dependency67=..\.\components\ACLDIALOGS.PAS 400 MainFile0.Dependency68=.\HELPBITMAP.PAS 401 MainFile0.Dependency69=.\SEARCHTABLE.PAS 402 MainFile0.Dependency70=.\HELPFILE.PAS 403 MainFile0.Dependency71=.\HELPWINDOWUNIT.PAS 404 MainFile0.Dependency72=.\NAVIGATEPOINTUNIT.PAS 405 MainFile0.Dependency73=.\MISCUNIT.PAS 406 MainFile0.Dependency74=.\HELPMANAGERUNIT.PAS 407 MainFile0.Dependency75=.\TEXTSEARCHQUERY.PAS 408 MainFile0.Dependency76=..\.\components\TABSET2UNIT.PAS 409 MainFile0.Dependency77=..\.\library\RUNPROGRAMUNIT.PAS 410 MainFile0.Dependency78=..\.\components\RICHTEXTPRINTUNIT.PAS 411 MainFile0.Dependency79=.\INFORMATIONFORMUNIT.PAS 412 MainFile0.Dependency80=..\.\components\COLORMAPPING.PAS 413 MainFile0.Dependency81=..\.\components\COLORWHEEL.PAS 414 MainFile0.Dependency82=..\.\components\CUSTOMFONTDIALOG.PAS 415 MainFile0.Dependency83=..\.\sibyl\rtl\BSEDEV.PAS 416 MainFile0.Dependency84=..\.\components\DRIVEINFOUNIT.PAS 417 MainFile0.Dependency85=..\.\components\BITMAPUTILITY.PAS 418 MainFile0.Dependency86=..\.\components\CUSTOMFILECONTROLS.PAS 419 MainFile0.Dependency87=.\FILEDIALOGFORM.PAS 420 MainFile0.Dependency88=.\OPTIONSFORM.PAS 421 MainFile0.Dependency89=.\VERSIONUNIT.PAS 422 MainFile0.Dependency90=..\.\components\WEBBROWSERUNIT.PAS 423 MainFile0.Dependency91=.\PRODUCTINFORMATIONFORMUNIT.PAS 424 MainFile0.Dependency92=.\NOTEFORM.PAS 425 MainFile0.Dependency93=.\SEARCHUNIT.PAS 426 MainFile0.Dependency94=.\SEARCHDIRECTORIESFORMUNIT.PAS 427 MainFile0.Dependency95=.\GLOBALSEARCHFORM.PAS 428 MainFile0.Dependency96=.\BOOKMARKSFORMUNIT.PAS 429 MainFile0.Dependency97=.\PRINTDIALOGUNIT.PAS 430 MainFile0.Dependency98=.\GLOBALFILELISTUNIT.PAS 431 MainFile0.Dependency99=.\STARTUPUNIT.PAS 432 MainFile0.Dependency100=.\MAINFORM.PAS 433 MainFile0.Dependency101=.\NewView.scu 364 MainFile0.Dependency39=..\.\library\ACLFINDFUNCTIONS.PAS 365 MainFile0.Dependency40=..\.\library\ACLFILEUTILITY.PAS 366 MainFile0.Dependency41=..\.\components\ACLLANGUAGEUNIT.PAS 367 MainFile0.Dependency42=..\.\components\GENERICTHREAD.PAS 368 MainFile0.Dependency43=.\STRINGUTILSUNIT.PAS 369 MainFile0.Dependency44=.\DEBUGUNIT.PAS 370 MainFile0.Dependency45=.\CMDLINEPARAMETERUNIT.PAS 371 MainFile0.Dependency46=..\.\components\SPLITBAR.PAS 372 MainFile0.Dependency47=..\.\components\CONTROLSCROLLING.PAS 373 MainFile0.Dependency48=..\.\components\OUTLINE2.PAS 374 MainFile0.Dependency49=..\.\components\CANVASFONTMANAGER.PAS 375 MainFile0.Dependency50=..\.\components\RICHTEXTDOCUMENTUNIT.PAS 376 MainFile0.Dependency51=..\.\components\RICHTEXTSTYLEUNIT.PAS 377 MainFile0.Dependency52=..\.\sibyl\spcc\CLIPBRD.PAS 378 MainFile0.Dependency53=..\.\components\RICHTEXTLAYOUTUNIT.PAS 379 MainFile0.Dependency54=..\.\components\CONTROLSUTILITY.PAS 380 MainFile0.Dependency55=..\.\components\RICHTEXTDISPLAYUNIT.PAS 381 MainFile0.Dependency56=..\.\components\RICHTEXTVIEW.PAS 382 MainFile0.Dependency57=..\.\components\CUSTOMLISTBOX.PAS 383 MainFile0.Dependency58=.\IPFFILEFORMATUNIT.PAS 384 MainFile0.Dependency59=.\HELPWINDOWDIMENSIONS.PAS 385 MainFile0.Dependency60=..\.\library\ASTRINGUTILITYUNIT.PAS 386 MainFile0.Dependency61=.\SETTINGSUNIT.PAS 387 MainFile0.Dependency62=.\HELPTOPIC.PAS 388 MainFile0.Dependency63=..\.\components\CUSTOMMEMO.PAS 389 MainFile0.Dependency64=..\.\components\SYSTEMICONUNIT.PAS 390 MainFile0.Dependency65=..\.\components\ACLMESSAGEFORM.PAS 391 MainFile0.Dependency66=..\.\components\ACLDIALOGS.PAS 392 MainFile0.Dependency67=.\HELPBITMAP.PAS 393 MainFile0.Dependency68=.\SEARCHTABLE.PAS 394 MainFile0.Dependency69=.\HELPFILE.PAS 395 MainFile0.Dependency70=.\HELPWINDOWUNIT.PAS 396 MainFile0.Dependency71=.\NAVIGATEPOINTUNIT.PAS 397 MainFile0.Dependency72=.\MISCUNIT.PAS 398 MainFile0.Dependency73=.\HELPMANAGERUNIT.PAS 399 MainFile0.Dependency74=.\TEXTSEARCHQUERY.PAS 400 MainFile0.Dependency75=..\.\components\TABSET2UNIT.PAS 401 MainFile0.Dependency76=..\.\library\RUNPROGRAMUNIT.PAS 402 MainFile0.Dependency77=..\.\components\RICHTEXTPRINTUNIT.PAS 403 MainFile0.Dependency78=.\INFORMATIONFORMUNIT.PAS 404 MainFile0.Dependency79=..\.\components\COLORMAPPING.PAS 405 MainFile0.Dependency80=..\.\components\COLORWHEEL.PAS 406 MainFile0.Dependency81=..\.\components\CUSTOMFONTDIALOG.PAS 407 MainFile0.Dependency82=..\.\sibyl\rtl\BSEDEV.PAS 408 MainFile0.Dependency83=..\.\components\DRIVEINFOUNIT.PAS 409 MainFile0.Dependency84=..\.\components\BITMAPUTILITY.PAS 410 MainFile0.Dependency85=..\.\components\CUSTOMFILECONTROLS.PAS 411 MainFile0.Dependency86=.\FILEDIALOGFORM.PAS 412 MainFile0.Dependency87=.\OPTIONSFORM.PAS 413 MainFile0.Dependency88=.\VERSIONUNIT.PAS 414 MainFile0.Dependency89=..\.\components\WEBBROWSERUNIT.PAS 415 MainFile0.Dependency90=.\PRODUCTINFORMATIONFORMUNIT.PAS 416 MainFile0.Dependency91=.\NOTEFORM.PAS 417 MainFile0.Dependency92=.\SEARCHUNIT.PAS 418 MainFile0.Dependency93=.\SEARCHDIRECTORIESFORMUNIT.PAS 419 MainFile0.Dependency94=.\GLOBALSEARCHFORM.PAS 420 MainFile0.Dependency95=.\BOOKMARKSFORMUNIT.PAS 421 MainFile0.Dependency96=.\PRINTDIALOGUNIT.PAS 422 MainFile0.Dependency97=.\GLOBALFILELISTUNIT.PAS 423 MainFile0.Dependency98=.\STARTUPUNIT.PAS 424 MainFile0.Dependency99=.\MAINFORM.PAS 425 MainFile0.Dependency100=.\NewView.scu 434 426 435 427 [Replace History] -
trunk/NewView/StartupUnit.pas
r58 r61 13 13 OS2Def, 14 14 Classes, 15 ACLString,16 15 GlobalFilelistUnit, 17 16 SharedMemoryUnit, … … 24 23 function AccessSharedMemory: TSuballocatedSharedMemory; 25 24 26 // Returns true if the program should be started as normal.27 // False if it should immediately exit.28 function Startup: boolean;29 30 25 // Look for any items that are actually specifiying environment 31 26 // variables, and expand them to the contents of the variables … … 37 32 // the help and bookshelf paths. 38 33 Function FindHelpFile( FileName: string ): string; 34 Procedure PostNewViewTextMessage( Window: HWND; 35 MessageType: ULONG; 36 s: string ); 39 37 40 38 var 41 CmdLineParameters: TCmdLineParameters;42 39 SharedMemory: TSubAllocatedSharedMemory; 43 40 GlobalFilelist: TGlobalFilelist; … … 50 47 DebugUnit, 51 48 PMWin, 52 ACLUtility,53 49 ACLStringUtility, 54 50 ACLFileUtility, 55 AStringUtilityUnit,56 51 HelpManagerUnit; 57 52 … … 167 162 168 163 169 // If another instance already has the files open170 // activate it and return true.171 function FindExistingWindow: HWND;172 var173 FileItems: TStringList;174 Filenames: TStringList;175 FullFilePath: string;176 i: longint;177 178 FileWindow: HWND;179 begin180 Result := NULLHANDLE;181 182 if length(CmdLineParameters.getInterpretedFileNames) = 0 then183 // not loading files; nothing to check184 exit;185 186 FileItems := TStringList.Create;187 Filenames := TStringList.Create;188 189 StringToList(CmdLineParameters.getInterpretedFileNames, FileItems, '+' );190 TranslateIPFEnvironmentVars( FileItems, FileNames );191 192 for i := 0 to FileNames.Count - 1 do193 begin194 FullFilePath := FindHelpFile( Filenames[ i ] );195 if FullFilePath <> '' then196 begin197 FileWindow := GlobalFilelist.FindFile( FullFilePath );198 199 if FileWindow = NULLHANDLE then200 begin201 // not found - stop searching.202 Result := NULLHANDLE; // no match203 break;204 end;205 206 // found it207 208 // is it the same as any previous match?209 if Result <> NULLHANDLE then210 begin211 if FileWindow <> Result then212 begin213 // no, so we don't have a match.214 // NOTE: We just excluded something: if the same file is215 // open in multiple windows then we may not check all combinations216 Result := NULLHANDLE; // no match217 break;218 end;219 end220 else221 begin222 // no match yet - store this one223 Result := FileWindow;224 end;225 226 end;227 end;228 229 Filenames.Destroy;230 FileItems.Destroy;231 232 end;233 234 164 function AccessSharedMemory: TSuballocatedSharedMemory; 235 165 begin … … 253 183 end; 254 184 255 function Startup: boolean;256 var257 tmpCmdLine: String;258 ExistingWindow: HWND;259 begin260 // open shared memory261 SharedMemory := AccessSharedMemory;262 263 // get access to the system-global filelist264 GlobalFilelist := TGlobalFilelist.Create;265 266 // parse parameters into Parameters object267 tmpCmdLine := nativeOS2GetCmdLineParameter;268 269 CmdLineParameters := TCmdLineParameters.Create;270 CmdLineParameters.parseCmdLine(tmpCmdLine);271 272 ExistingWindow := FindExistingWindow;273 274 if ExistingWindow <> NULLHANDLE then275 begin276 // want to exit without running fully277 Result := false;278 279 // destroy global list - nobody else will280 GlobalFilelist.Destroy;281 282 WinSetFocus( HWND_DESKTOP, ExistingWindow );283 284 // topic search285 if not CmdLineParameters.getSearchFlag286 AND not CmdLineParameters.getGlobalSearchFlag287 AND (CmdLineParameters.getInterpretedSearchText <> '')288 then289 begin290 PostNewViewTextMessage( ExistingWindow,291 NHM_SEARCH,292 CmdLineParameters.getInterpretedSearchText);293 end;294 295 if CmdLineParameters.getGlobalSearchFlag then296 begin297 PostNewViewTextMessage( ExistingWindow,298 NHM_GLOBAL_SEARCH,299 CmdLineParameters.getInterpretedSearchText);300 end;301 302 if CmdLineParameters.getShowUsageFlag then303 begin304 WinPostMsg( ExistingWindow,305 NHM_SHOW_USAGE,306 0,307 0 );308 end;309 310 if CmdLineParameters.getHelpManagerFlag then311 begin312 // tell the new help manager instance to talk to the313 // other viewer314 WinPostMsg( CmdLineParameters.getHelpManagerWindow,315 NHM_VIEWER_READY,316 ExistingWindow,317 0 );318 end;319 320 end321 else322 begin323 // run as normal324 Result := true;325 end;326 end;327 185 328 186 Initialization -
trunk/NewView/ViewStub.pas
r57 r61 12 12 PmWin, 13 13 SysUtils, 14 Classes, 14 15 DebugUnit, 16 GlobalFilelistUnit, 15 17 CmdLineParameterUnit, 18 HelpManagerUnit, 19 StringUtilsUnit, 16 20 StartupUnit; 17 21 … … 45 49 46 50 var 47 tmpCmdLine : String; 48 tmpPCharCmdLine : PChar; 51 tmpCmdLine : String; 52 tmpPCharCmdLine : PChar; 53 tmpCmdLineParameters: TCmdLineParameters; 54 tmpExistingWindow: HWND; 55 56 57 // If another instance already has the files open 58 // activate it and return true. 59 Function FindExistingWindow(aCmdLineParameters : TCmdLineParameters) : HWND; 60 var 61 tmpFileItems: TStringList; 62 tmpFilenames: TStringList; 63 tmpFullFilePath: string; 64 i: longint; 65 66 FileWindow: HWND; 67 begin 68 result := NULLHANDLE; 69 70 if aCmdLineParameters.getInterpretedFileNames = '' then 71 // not loading files; nothing to check 72 exit; 73 74 tmpFileItems := TStringList.Create; 75 tmpFilenames := TStringList.Create; 76 77 StrExtractStrings(tmpFileItems, aCmdLineParameters.getInterpretedFileNames, ['+'], #0); 78 TranslateIPFEnvironmentVars(tmpFileItems, tmpFileNames ); 79 80 for i := 0 to tmpFileNames.Count - 1 do 81 begin 82 tmpFullFilePath := FindHelpFile( tmpFilenames[ i ] ); 83 if tmpFullFilePath <> '' then 84 begin 85 FileWindow := GlobalFilelist.FindFile(tmpFullFilePath); 86 87 if FileWindow = NULLHANDLE then 88 begin 89 // not found - stop searching. 90 Result := NULLHANDLE; // no match 91 break; 92 end; 93 94 // found it 95 96 // is it the same as any previous match? 97 if Result <> NULLHANDLE then 98 begin 99 if FileWindow <> Result then 100 begin 101 // no, so we don't have a match. 102 // NOTE: We just excluded something: if the same file is 103 // open in multiple windows then we may not check all combinations 104 Result := NULLHANDLE; // no match 105 break; 106 end; 107 end 108 else 109 begin 110 // no match yet - store this one 111 result := FileWindow; 112 end; 113 end; 114 end; 115 116 tmpFilenames.Destroy; 117 tmpFileItems.Destroy; 118 end; 119 120 49 121 50 122 Begin 51 123 LogEvent(LogViewStub, 'Starting' ); 52 124 53 if Startup then 125 // open shared memory 126 SharedMemory := AccessSharedMemory; 127 128 // get access to the system-global filelist 129 GlobalFilelist := TGlobalFilelist.Create; 130 131 // parse parameters into Parameters object 132 tmpCmdLine := nativeOS2GetCmdLineParameter; 133 134 tmpCmdLineParameters := TCmdLineParameters.Create; 135 tmpCmdLineParameters.parseCmdLine(tmpCmdLine); 136 137 tmpExistingWindow := FindExistingWindow(tmpCmdLineParameters); 138 139 if tmpExistingWindow = NULLHANDLE then 54 140 begin 55 141 // Want a new instance. 56 57 tmpCmdLine := nativeOS2GetCmdLineParameter; 142 LogEvent(LogViewStub, 'Starting a new NewView instance'); 143 58 144 tmpPCharCmdLine := StrAlloc(length(tmpCmdLine) + 1); 59 145 StrPCopy(tmpPCharCmdLine, tmpCmdLine); 60 146 147 LogEvent(LogViewStub, 'CmdLine for NewView exe: ' + tmpCmdLine); 61 148 // set up details for launching newview 62 149 With Details do … … 83 170 84 171 StrDispose(tmpPCharCmdLine); 172 end 173 else 174 begin 175 // the file is already opend in a running instance 176 LogEvent(LogViewStub, 'Adequate running NewView instance found'); 177 178 WinSetFocus( HWND_DESKTOP, tmpExistingWindow ); 179 180 // search and topic search 181 // topic search is also handled this way 182 // at the moment there is no support for a 183 // seperate window message 184 if not tmpCmdLineParameters.getGlobalSearchFlag 185 AND (tmpCmdLineParameters.getInterpretedSearchText <> '') 186 then 187 begin 188 PostNewViewTextMessage( tmpExistingWindow, 189 NHM_SEARCH, 190 tmpCmdLineParameters.getInterpretedSearchText); 191 end; 192 193 if tmpCmdLineParameters.getGlobalSearchFlag then 194 begin 195 PostNewViewTextMessage( tmpExistingWindow, 196 NHM_GLOBAL_SEARCH, 197 tmpCmdLineParameters.getInterpretedSearchText); 198 end; 199 200 if tmpCmdLineParameters.getShowUsageFlag then 201 begin 202 WinPostMsg( tmpExistingWindow, 203 NHM_SHOW_USAGE, 204 0, 205 0 ); 206 end; 207 208 if tmpCmdLineParameters.getHelpManagerFlag then 209 begin 210 // tell the new help manager instance to talk to the 211 // other viewer 212 WinPostMsg( tmpCmdLineParameters.getHelpManagerWindow, 213 NHM_VIEWER_READY, 214 tmpExistingWindow, 215 0 ); 216 end; 85 217 86 218 end; 219 220 // destroy global list 221 GlobalFilelist.Destroy; 222 223 tmpCmdLineParameters.Destroy; 87 224 LogEvent(LogViewStub, 'Finished' ); 88 225 End.
Note:
See TracChangeset
for help on using the changeset viewer.
