فهرست منبع

* two new priority classes for all but wince. See comments in process.pp
* some left over changes to RunCommandEventCode in preparation of more events.

git-svn-id: trunk@39681 -

marco 7 سال پیش
والد
کامیت
0f619c3ef8
3فایلهای تغییر یافته به همراه9 افزوده شده و 4 حذف شده
  1. 5 2
      packages/fcl-process/src/process.pp
  2. 2 1
      packages/fcl-process/src/unix/process.inc
  3. 2 1
      packages/fcl-process/src/win/process.inc

+ 5 - 2
packages/fcl-process/src/process.pp

@@ -36,11 +36,14 @@ Type
   TStartupOption = (suoUseShowWindow,suoUseSize,suoUsePosition,
                     suoUseCountChars,suoUseFillAttribute);
 
-  TProcessPriority = (ppHigh,ppIdle,ppNormal,ppRealTime);
+  // only win32/64 and wince uses this. wince doesn't have the constants in the headers for the latter two.
+  // unix defines them (as nice levels?), but doesn't use them.
+  TProcessPriority = (ppHigh,ppIdle,ppNormal,ppRealTime{$ifndef wince},ppBelowNormal,ppAboveNormal{$endif});
 
   TProcessOptions = set of TProcessOption;
   TStartupOptions = set of TStartupOption;
-  TRunCommandEventCode = (RunCommandIdle,RunCommandReadOutput,RunCommandFinished,RunCommandException);
+  TRunCommandEventCode = (RunCommandIdle,RunCommandReadOutputString,RunCommandReadOutputStream,RunCommandFinished,RunCommandException);
+  TRunCommandEventCodeSet = set of TRunCommandEventCode;
   TOnRunCommandEvent = procedure(Sender,Context : TObject;Status:TRunCommandEventCode;const Message:string) of object;
   EProcess = Class(Exception);
 

+ 2 - 1
packages/fcl-process/src/unix/process.inc

@@ -26,8 +26,9 @@ Resourcestring
   SErrCannotCreatePipes = 'Failed to create pipes';
 
 Const
+  // unused as of yet, I assume these are nice levels ?
   PriorityConstants : Array [TProcessPriority] of Integer =
-                      (20,20,0,-20);
+                      (-10,19,0,-20,5,-5);  // was (20,20,0,-20) before introduction of last two levels.
 
 Const
   GeometryOption : String = '-geometry';

+ 2 - 1
packages/fcl-process/src/win/process.inc

@@ -25,7 +25,8 @@ Resourcestring
 Const
   PriorityConstants : Array [TProcessPriority] of Cardinal =
                       (HIGH_PRIORITY_CLASS,IDLE_PRIORITY_CLASS,
-                       NORMAL_PRIORITY_CLASS,REALTIME_PRIORITY_CLASS);
+                       NORMAL_PRIORITY_CLASS,REALTIME_PRIORITY_CLASS,
+                       BELOW_NORMAL_PRIORITY_CLASS,ABOVE_NORMAL_PRIORITY_CLASS);
 
 procedure TProcessnamemacro.CloseProcessHandles;
 begin