From 2e72bd03a7d75854e09b3210c3db6ba7d4a0a714 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A1roly=20Balogh?= Date: Thu, 30 Oct 2008 20:56:01 +0000 Subject: [PATCH] + support for SysResize event for Amiga git-svn-id: trunk@11998 - --- packages/fv/src/amismsg.inc | 35 ++++++++++++++--------------------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/packages/fv/src/amismsg.inc b/packages/fv/src/amismsg.inc index 1259dc8858..710f52ef62 100644 --- a/packages/fv/src/amismsg.inc +++ b/packages/fv/src/amismsg.inc @@ -31,8 +31,6 @@ var lastxsize,lastysize : longint; procedure InitSystemMsg; -//var -// WinSize : TWinSize; begin If SystemEventActive then exit; @@ -41,13 +39,11 @@ begin PendingSystemTail:=@PendingSystemEvent; PendingSystemEvents:=0; FillChar(LastSystemEvent,sizeof(TSystemEvent),0); -// FillChar(WinSize,sizeof(WinSize),0); -// fpioctl(stdinputhandle,TIOCGWINSZ,@winsize); -// LastXSize:=WinSize.ws_row; -// LastYSize:=WinSize.ws_col; -// If LastXSize=0 then + Video.HasResizeWindow(LastXSize,LastYSize); + + If LastXSize=0 then LastXSize:=80; -// If LastYSize=0 then + If LastYSize=0 then LastYSize:=25; SystemEventActive:=true; @@ -78,6 +74,7 @@ end; function PollSystemEvent(var SystemEvent: TSystemEvent):boolean; +var width, height : longint; begin SystemEvent.typ:=SysNothing; if not SystemEventActive then @@ -95,21 +92,17 @@ begin SystemEvent.CloseTyp:=0; PutSystemEvent(SystemEvent); PollSystemEvent:=true; - end; -{ - FillChar(WinSize,sizeof(WinSize),0); - 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 + end else if Video.HasResizeWindow(width, height) then begin + if (width>0) and (height>0) and + ((width<>lastxsize) or (height<>lastysize)) then begin SystemEvent.typ:=SysResize; - SystemEvent.x:=WinSize.ws_col; - SystemEvent.y:=WinSize.ws_row; + SystemEvent.x:=width; + SystemEvent.y:=height; PutSystemEvent(SystemEvent); - LastXSize:=WinSize.ws_row; - LastYSize:=WinSize.ws_col; + LastXSize:=width; + LastYSize:=height; PollSystemEvent:=true; - end} + end; + end; end; end; -