diff --git a/TimeProfile/ShowProfile.dcl b/TimeProfile/ShowProfile.dcl index 66c9f397d6509b67bcec0ea3784fbf07d11ee315..8cafe447b4d83e294fbcbfbdb7bed23a581f3471 100644 --- a/TimeProfile/ShowProfile.dcl +++ b/TimeProfile/ShowProfile.dcl @@ -7,7 +7,7 @@ import StdIOCommon, StdPicture, StdPSt, StdPrint open_profile :: {#.Char} !*a -> *((.Bool,[.Profile]),!*a) | FileSystem a; sum_time_and_allocation :: ![.Profile] -> .(Int,Int,Int,Int,Real); -totals_per_module :: ![.Profile] -> ![.Profile] +totals_per_module :: ![.Profile] -> [.Profile] format_profile :: .Int .Int .Int .Int .Real [.Profile] -> ([.FormattedProfile],.FormattedProfile); le_module_name :: !.Profile !.Profile -> Bool; diff --git a/TimeProfile/ShowProfile.icl b/TimeProfile/ShowProfile.icl index 4b32c556905e7a96d80921c7318fb58ac0086256..b5608c09e9ec280e9d18de65c504855ce533f91a 100644 --- a/TimeProfile/ShowProfile.icl +++ b/TimeProfile/ShowProfile.icl @@ -228,7 +228,7 @@ where = (s+n_strict_calls,l+n_lazy_calls,c+n_curried_calls,a+n_allocated_words,t+time) = (s+n_strict_calls,l+n_lazy_calls,c+n_curried_calls,a,t+time) -totals_per_module :: ![.Profile] -> ![.Profile] +totals_per_module :: ![.Profile] -> [.Profile] totals_per_module [] = [] totals_per_module [f=:{module_name}:l] @@ -355,7 +355,7 @@ where where error file = (False,abort "error in read_function_profile",file) - read_function_name :: !*File -> !(!Bool,!String,!*File) + read_function_name :: !*File -> (!Bool,!String,!*File) read_function_name file # (ok,c,file) = freadc file | not ok || c==' ' || c=='\n' diff --git a/TimeProfile/timeprofiler.icl b/TimeProfile/timeprofiler.icl index 9f16d1cb9c504845edc7895039042d7c76f2cc57..f6f54aabab8bb7ac02264c2bed8d8ed179ac5eee 100644 --- a/TimeProfile/timeprofiler.icl +++ b/TimeProfile/timeprofiler.icl @@ -4,10 +4,10 @@ import StdArray, StdBool, StdList, StdFunc, StdTuple, StdOrdList import StdProcess, StdId, StdMenu, StdReceiver, StdMenuElement, StdFileSelect, StdPStClass import flexwin -import ArgEnv import ExtNotice import Help import ShowProfile +import Platform ApplicationName :== "ShowTimeProfile" HelpFileName :== ApplicationName +++ "Help" @@ -72,7 +72,7 @@ where # (_,ps) = openMenu Void (sort_menu recId) ps # (_,ps) = openMenu Void (view_menu recId) ps # (_,ps) = openMenu Void (help_menu) ps - = ps + = installPlatformEventHandlers ps file_menu hasClose winId closeId printId recId = Menu "&File" @@ -130,23 +130,15 @@ info = //-- Support functions... open_time_file_from_command_line ps - | size commandline == 1 - = (([],[],""),ps) - # (ok,pathname) = GetLongPathName commandline.[1] - | not ok + # (commandline,ps) = initPlatformCommandLine ps + | length commandline <= 1 = (([],[],""),ps) - = open_file_function pathname ps -where - commandline - = getCommandLine + = open_file_function (commandline!!1) ps openFiles _ _ _ _ [] ps = ps openFiles winId closeId printId recId [h:t] ps - # (ok,pathname) = GetLongPathName h - | not ok - = ps # ((mods,funs,name),ps) - = open_file_function pathname ps + = open_file_function h ps # (viewer_mode,ps) = accPLoc (\vs=:{mode}-> (mode,{vs & mods = mods, funs = funs, name = name})) ps # info = case viewer_mode of ViewByModule -> mods @@ -234,12 +226,16 @@ printfun recId ps = ps # info = fromJust info # (functionData,[sumData:_]) = splitAt (dec (length info)) info - # ((ok,printFont),ps) = accPIO (accScreenPicture (openFont {fName="Courier New",fStyles=[BoldStyle],fSize=8})) ps - | not ok - = ps + # ((ok,printFont),ps) = accPIO (accScreenPicture (openFont printFont)) ps +// | not ok +// = ps # (printSetup,ps) = printTable printFont printSetup functionData sumData ps # ps = appPLoc (\vs -> {vs & pset = printSetup}) ps = ps +where + printFont = PlatformDependant + {fName="Courier New",fStyles=[BoldStyle],fSize=8} + {fName="Monaco",fStyles=[],fSize=8} //-- Profile stuff... @@ -296,10 +292,3 @@ where # line_height = fontLineHeight metrics = line_height * (length lines) -//-- - -import expand_8_3_names_in_path - -GetLongPathName :: !String -> (!Bool,!String); -GetLongPathName short_path - = (True, expand_8_3_names_in_path short_path);