mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-01 13:11:06 +02:00
+ support for SysResize event for Amiga
git-svn-id: trunk@11998 -
This commit is contained in:
parent
4a5a3e3118
commit
2e72bd03a7
@ -31,8 +31,6 @@ var
|
|||||||
lastxsize,lastysize : longint;
|
lastxsize,lastysize : longint;
|
||||||
|
|
||||||
procedure InitSystemMsg;
|
procedure InitSystemMsg;
|
||||||
//var
|
|
||||||
// WinSize : TWinSize;
|
|
||||||
begin
|
begin
|
||||||
If SystemEventActive then
|
If SystemEventActive then
|
||||||
exit;
|
exit;
|
||||||
@ -41,13 +39,11 @@ begin
|
|||||||
PendingSystemTail:=@PendingSystemEvent;
|
PendingSystemTail:=@PendingSystemEvent;
|
||||||
PendingSystemEvents:=0;
|
PendingSystemEvents:=0;
|
||||||
FillChar(LastSystemEvent,sizeof(TSystemEvent),0);
|
FillChar(LastSystemEvent,sizeof(TSystemEvent),0);
|
||||||
// FillChar(WinSize,sizeof(WinSize),0);
|
Video.HasResizeWindow(LastXSize,LastYSize);
|
||||||
// fpioctl(stdinputhandle,TIOCGWINSZ,@winsize);
|
|
||||||
// LastXSize:=WinSize.ws_row;
|
If LastXSize=0 then
|
||||||
// LastYSize:=WinSize.ws_col;
|
|
||||||
// If LastXSize=0 then
|
|
||||||
LastXSize:=80;
|
LastXSize:=80;
|
||||||
// If LastYSize=0 then
|
If LastYSize=0 then
|
||||||
LastYSize:=25;
|
LastYSize:=25;
|
||||||
|
|
||||||
SystemEventActive:=true;
|
SystemEventActive:=true;
|
||||||
@ -78,6 +74,7 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
function PollSystemEvent(var SystemEvent: TSystemEvent):boolean;
|
function PollSystemEvent(var SystemEvent: TSystemEvent):boolean;
|
||||||
|
var width, height : longint;
|
||||||
begin
|
begin
|
||||||
SystemEvent.typ:=SysNothing;
|
SystemEvent.typ:=SysNothing;
|
||||||
if not SystemEventActive then
|
if not SystemEventActive then
|
||||||
@ -95,21 +92,17 @@ begin
|
|||||||
SystemEvent.CloseTyp:=0;
|
SystemEvent.CloseTyp:=0;
|
||||||
PutSystemEvent(SystemEvent);
|
PutSystemEvent(SystemEvent);
|
||||||
PollSystemEvent:=true;
|
PollSystemEvent:=true;
|
||||||
end;
|
end else if Video.HasResizeWindow(width, height) then begin
|
||||||
{
|
if (width>0) and (height>0) and
|
||||||
FillChar(WinSize,sizeof(WinSize),0);
|
((width<>lastxsize) or (height<>lastysize)) then begin
|
||||||
fpioctl(stdinputhandle,TIOCGWINSZ,@winsize);
|
|
||||||
if (winsize.ws_col<>0) and (winsize.ws_row<>0) and
|
|
||||||
((winsize.ws_row<>lastxsize) or (winsize.ws_col<>lastysize)) then
|
|
||||||
begin
|
|
||||||
SystemEvent.typ:=SysResize;
|
SystemEvent.typ:=SysResize;
|
||||||
SystemEvent.x:=WinSize.ws_col;
|
SystemEvent.x:=width;
|
||||||
SystemEvent.y:=WinSize.ws_row;
|
SystemEvent.y:=height;
|
||||||
PutSystemEvent(SystemEvent);
|
PutSystemEvent(SystemEvent);
|
||||||
LastXSize:=WinSize.ws_row;
|
LastXSize:=width;
|
||||||
LastYSize:=WinSize.ws_col;
|
LastYSize:=height;
|
||||||
PollSystemEvent:=true;
|
PollSystemEvent:=true;
|
||||||
end}
|
end;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user