mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-07 20:50:42 +02:00
* unicode fixes in the implementation part of the uapp unit
git-svn-id: branches/unicodekvm@48612 -
This commit is contained in:
parent
7cf1d227fb
commit
f0adf5d612
@ -709,8 +709,13 @@ END;
|
|||||||
DESTRUCTOR TProgram.Done;
|
DESTRUCTOR TProgram.Done;
|
||||||
BEGIN
|
BEGIN
|
||||||
{ Do not free the Buffer of Video Unit }
|
{ Do not free the Buffer of Video Unit }
|
||||||
|
{$ifdef FV_UNICODE}
|
||||||
|
If Buffer = UViews.PVideoBuf(EnhancedVideoBuf) then
|
||||||
|
Buffer:=nil;
|
||||||
|
{$else FV_UNICODE}
|
||||||
If Buffer = Views.PVideoBuf(VideoBuf) then
|
If Buffer = Views.PVideoBuf(VideoBuf) then
|
||||||
Buffer:=nil;
|
Buffer:=nil;
|
||||||
|
{$endif FV_UNICODE}
|
||||||
If (Desktop <> Nil) Then Dispose(Desktop, Done); { Destroy desktop }
|
If (Desktop <> Nil) Then Dispose(Desktop, Done); { Destroy desktop }
|
||||||
If (MenuBar <> Nil) Then Dispose(MenuBar, Done); { Destroy menu bar }
|
If (MenuBar <> Nil) Then Dispose(MenuBar, Done); { Destroy menu bar }
|
||||||
If (StatusLine <> Nil) Then
|
If (StatusLine <> Nil) Then
|
||||||
@ -827,7 +832,11 @@ BEGIN
|
|||||||
{ the orginal code can't be used here because of the limited
|
{ the orginal code can't be used here because of the limited
|
||||||
video unit capabilities, the mono modus can't be handled
|
video unit capabilities, the mono modus can't be handled
|
||||||
}
|
}
|
||||||
|
{$ifdef FV_UNICODE}
|
||||||
|
UDrivers.DetectVideo;
|
||||||
|
{$else FV_UNICODE}
|
||||||
Drivers.DetectVideo;
|
Drivers.DetectVideo;
|
||||||
|
{$endif FV_UNICODE}
|
||||||
{ ScreenMode.Row may be 0 if there's no console on startup }
|
{ ScreenMode.Row may be 0 if there's no console on startup }
|
||||||
if ScreenMode.Row = 0 then
|
if ScreenMode.Row = 0 then
|
||||||
begin
|
begin
|
||||||
@ -847,7 +856,11 @@ BEGIN
|
|||||||
end;
|
end;
|
||||||
ShadowSize.Y := 1;
|
ShadowSize.Y := 1;
|
||||||
ShowMarkers := False;
|
ShowMarkers := False;
|
||||||
|
{$ifdef FV_UNICODE}
|
||||||
|
Buffer := UViews.PVideoBuf(EnhancedVideoBuf);
|
||||||
|
{$else FV_UNICODE}
|
||||||
Buffer := Views.PVideoBuf(VideoBuf);
|
Buffer := Views.PVideoBuf(VideoBuf);
|
||||||
|
{$endif FV_UNICODE}
|
||||||
END;
|
END;
|
||||||
|
|
||||||
|
|
||||||
@ -913,7 +926,11 @@ begin
|
|||||||
{ DoneMemory;}
|
{ DoneMemory;}
|
||||||
{ InitMemory;}
|
{ InitMemory;}
|
||||||
InitScreen;
|
InitScreen;
|
||||||
|
{$ifdef FV_UNICODE}
|
||||||
|
Buffer := UViews.PVideoBuf(EnhancedVideoBuf);
|
||||||
|
{$else FV_UNICODE}
|
||||||
Buffer := Views.PVideoBuf(VideoBuf);
|
Buffer := Views.PVideoBuf(VideoBuf);
|
||||||
|
{$endif FV_UNICODE}
|
||||||
R.Assign(0, 0, ScreenWidth, ScreenHeight);
|
R.Assign(0, 0, ScreenWidth, ScreenHeight);
|
||||||
ChangeBounds(R);
|
ChangeBounds(R);
|
||||||
ShowMouse;
|
ShowMouse;
|
||||||
@ -939,7 +956,11 @@ begin
|
|||||||
InitScreen;
|
InitScreen;
|
||||||
ScreenWidth:=Video.ScreenWidth;
|
ScreenWidth:=Video.ScreenWidth;
|
||||||
ScreenHeight:=Video.ScreenHeight;
|
ScreenHeight:=Video.ScreenHeight;
|
||||||
|
{$ifdef FV_UNICODE}
|
||||||
|
Buffer := UViews.PVideoBuf(EnhancedVideoBuf);
|
||||||
|
{$else FV_UNICODE}
|
||||||
Buffer := Views.PVideoBuf(VideoBuf);
|
Buffer := Views.PVideoBuf(VideoBuf);
|
||||||
|
{$endif FV_UNICODE}
|
||||||
R.Assign(0, 0, ScreenWidth, ScreenHeight);
|
R.Assign(0, 0, ScreenWidth, ScreenHeight);
|
||||||
ChangeBounds(R);
|
ChangeBounds(R);
|
||||||
ShowMouse;
|
ShowMouse;
|
||||||
@ -973,7 +994,11 @@ BEGIN
|
|||||||
ReDraw;
|
ReDraw;
|
||||||
End;
|
End;
|
||||||
If (Event.What = evNothing) Then Begin { No mouse event }
|
If (Event.What = evNothing) Then Begin { No mouse event }
|
||||||
|
{$ifdef FV_UNICODE}
|
||||||
|
UDrivers.GetMouseEvent(Event); { Load mouse event }
|
||||||
|
{$else FV_UNICODE}
|
||||||
Drivers.GetMouseEvent(Event); { Load mouse event }
|
Drivers.GetMouseEvent(Event); { Load mouse event }
|
||||||
|
{$endif FV_UNICODE}
|
||||||
If (Event.What = evNothing) Then
|
If (Event.What = evNothing) Then
|
||||||
begin
|
begin
|
||||||
{$IFNDEF HASAMIGA}
|
{$IFNDEF HASAMIGA}
|
||||||
@ -981,7 +1006,11 @@ BEGIN
|
|||||||
we skip this here, and let the IDE to handle it
|
we skip this here, and let the IDE to handle it
|
||||||
directly on Amiga-like systems. The FV itself cannot
|
directly on Amiga-like systems. The FV itself cannot
|
||||||
handle the System Events anyway. (KB) }
|
handle the System Events anyway. (KB) }
|
||||||
|
{$ifdef FV_UNICODE}
|
||||||
|
UDrivers.GetSystemEvent(Event); { Load system event }
|
||||||
|
{$else FV_UNICODE}
|
||||||
Drivers.GetSystemEvent(Event); { Load system event }
|
Drivers.GetSystemEvent(Event); { Load system event }
|
||||||
|
{$endif FV_UNICODE}
|
||||||
If (Event.What = evNothing) Then
|
If (Event.What = evNothing) Then
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
Idle; { Idle if no event }
|
Idle; { Idle if no event }
|
||||||
@ -1030,14 +1059,23 @@ BEGIN
|
|||||||
halt(1);
|
halt(1);
|
||||||
end;}
|
end;}
|
||||||
initkeyboard;
|
initkeyboard;
|
||||||
|
{$ifdef FV_UNICODE}
|
||||||
|
if not UDrivers.InitVideo then { Start video up }
|
||||||
|
{$else FV_UNICODE}
|
||||||
if not Drivers.InitVideo then { Start video up }
|
if not Drivers.InitVideo then { Start video up }
|
||||||
|
{$endif FV_UNICODE}
|
||||||
begin
|
begin
|
||||||
donekeyboard;
|
donekeyboard;
|
||||||
writeln(sVideoFailed);
|
writeln(sVideoFailed);
|
||||||
halt(1);
|
halt(1);
|
||||||
end;
|
end;
|
||||||
|
{$ifdef FV_UNICODE}
|
||||||
|
UDrivers.InitEvents; { Start event drive }
|
||||||
|
UDrivers.InitSysError; { Start system error }
|
||||||
|
{$else FV_UNICODE}
|
||||||
Drivers.InitEvents; { Start event drive }
|
Drivers.InitEvents; { Start event drive }
|
||||||
Drivers.InitSysError; { Start system error }
|
Drivers.InitSysError; { Start system error }
|
||||||
|
{$endif FV_UNICODE}
|
||||||
InitHistory; { Start history up }
|
InitHistory; { Start history up }
|
||||||
Inherited Init; { Call ancestor }
|
Inherited Init; { Call ancestor }
|
||||||
InitMsgBox;
|
InitMsgBox;
|
||||||
@ -1053,9 +1091,15 @@ DESTRUCTOR TApplication.Done;
|
|||||||
BEGIN
|
BEGIN
|
||||||
Inherited Done; { Call ancestor }
|
Inherited Done; { Call ancestor }
|
||||||
DoneHistory; { Close history }
|
DoneHistory; { Close history }
|
||||||
|
{$ifdef FV_UNICODE}
|
||||||
|
UDrivers.DoneSysError; { Close system error }
|
||||||
|
UDrivers.DoneEvents; { Close event drive }
|
||||||
|
Udrivers.donevideo;
|
||||||
|
{$else FV_UNICODE}
|
||||||
Drivers.DoneSysError; { Close system error }
|
Drivers.DoneSysError; { Close system error }
|
||||||
Drivers.DoneEvents; { Close event drive }
|
Drivers.DoneEvents; { Close event drive }
|
||||||
drivers.donevideo;
|
drivers.donevideo;
|
||||||
|
{$endif FV_UNICODE}
|
||||||
{ DoneMemory;} { Close memory }
|
{ DoneMemory;} { Close memory }
|
||||||
donekeyboard;
|
donekeyboard;
|
||||||
{ DoneResource;}
|
{ DoneResource;}
|
||||||
@ -1093,8 +1137,13 @@ var s:string;
|
|||||||
BEGIN { Compatability only }
|
BEGIN { Compatability only }
|
||||||
DoneSysError;
|
DoneSysError;
|
||||||
DoneEvents;
|
DoneEvents;
|
||||||
|
{$ifdef FV_UNICODE}
|
||||||
|
udrivers.donevideo;
|
||||||
|
udrivers.donekeyboard;
|
||||||
|
{$else FV_UNICODE}
|
||||||
drivers.donevideo;
|
drivers.donevideo;
|
||||||
drivers.donekeyboard;
|
drivers.donekeyboard;
|
||||||
|
{$endif FV_UNICODE}
|
||||||
{ DoneDosMem;}
|
{ DoneDosMem;}
|
||||||
WriteShellMsg;
|
WriteShellMsg;
|
||||||
{$ifdef Unix}
|
{$ifdef Unix}
|
||||||
@ -1108,8 +1157,13 @@ BEGIN { Compatability only }
|
|||||||
SwapVectors;
|
SwapVectors;
|
||||||
{$endif}
|
{$endif}
|
||||||
{ InitDosMem;}
|
{ InitDosMem;}
|
||||||
|
{$ifdef FV_UNICODE}
|
||||||
|
udrivers.initkeyboard;
|
||||||
|
udrivers.initvideo;
|
||||||
|
{$else FV_UNICODE}
|
||||||
drivers.initkeyboard;
|
drivers.initkeyboard;
|
||||||
drivers.initvideo;
|
drivers.initvideo;
|
||||||
|
{$endif FV_UNICODE}
|
||||||
Video.SetCursorType(crHidden);
|
Video.SetCursorType(crHidden);
|
||||||
InitScreen;
|
InitScreen;
|
||||||
InitEvents;
|
InitEvents;
|
||||||
|
Loading…
Reference in New Issue
Block a user