소스 검색

--- Merging r43324 into '.':
U rtl/unix/genfdset.inc
--- Recording mergeinfo for merge of r43324 into '.':
U .
--- Merging r43389 into '.':
U packages/ncurses/src/ncurses.pp
--- Recording mergeinfo for merge of r43389 into '.':
G .

# revisions: 43324,43389

git-svn-id: branches/fixes_3_2@43927 -

marco 5 년 전
부모
커밋
09e568fb0f
2개의 변경된 파일22개의 추가작업 그리고 4개의 파일을 삭제
  1. 19 1
      packages/ncurses/src/ncurses.pp
  2. 3 3
      rtl/unix/genfdset.inc

+ 19 - 1
packages/ncurses/src/ncurses.pp

@@ -69,7 +69,12 @@ const
    NCURSES_VERSION_MINOR = 6;
    NCURSES_VERSION_PATCH = 20061217;
    NCURSES_VERSION = '5.6';
-   NCURSES_MOUSE_VERSION = 1;
+
+{$MACRO ON}
+{$IFNDEF NCURSES_MOUSE_VERSION}
+{$DEFINE NCURSES_MOUSE_VERSION:=2} // Can be changed for ancient versions of ncurses
+{$ENDIF}
+{$MACRO OFF}
 
 type
    pchtype = ^chtype;
@@ -939,6 +944,18 @@ const
    BUTTON4_DOUBLE_CLICKED = 8 shl (3 * 6);
    BUTTON4_TRIPLE_CLICKED = 16 shl (3 * 6);
 
+{$IF NCURSES_MOUSE_VERSION > 1}
+   BUTTON5_RELEASED       = BUTTON1_RELEASED shl (4 * 6);
+   BUTTON5_PRESSED        = BUTTON1_PRESSED shl (4 * 6);
+   BUTTON5_CLICKED        = BUTTON1_CLICKED shl (4 * 6);
+   BUTTON5_DOUBLE_CLICKED = BUTTON1_DOUBLE_CLICKED shl (4 * 6);
+   BUTTON5_TRIPLE_CLICKED = BUTTON1_TRIPLE_CLICKED shl (4 * 6);
+
+   BUTTON_CTRL            = 1 shl (5 * 6);
+   BUTTON_SHIFT           = 2 shl (5 * 6);
+   BUTTON_ALT             = 4 shl (5 * 6);
+   REPORT_MOUSE_POSITION  = 8 shl (5 * 6);
+{$ELSE}
    BUTTON1_RESERVED_EVENT = 32;
    BUTTON2_RESERVED_EVENT = 32 shl 6;
    BUTTON3_RESERVED_EVENT = 32 shl (2 * 6);
@@ -948,6 +965,7 @@ const
    BUTTON_SHIFT           = 2 shl (4 * 6);
    BUTTON_ALT             = 4 shl (4 * 6);
    REPORT_MOUSE_POSITION  = 8 shl (4 * 6);
+{$ENDIF}
 
    ALL_MOUSE_EVENTS       = REPORT_MOUSE_POSITION - 1;
 

+ 3 - 3
rtl/unix/genfdset.inc

@@ -17,7 +17,7 @@
 function fpFD_SET(fdno:cint;var nset : TFDSet): cint;
 
 Begin
-   if (fdno<0) or (fdno > FD_MAXFDSET) Then
+   if (fdno<0) or (fdno >= FD_MAXFDSET) Then
        exit(-1);
    nset[fdno shr ln2bitsinword]:=nset[(fdno) shr ln2bitsinword] OR (TFDSetEl(1) shl ((fdno) and ln2bitmask));
    fpFD_SET:=0;
@@ -26,7 +26,7 @@ End;
 function fpFD_CLR(fdno:cint;var nset : TFDSet): cint;
 
 Begin
-   if (fdno<0) or (fdno >  FD_MAXFDSET) Then
+   if (fdno<0) or (fdno >=  FD_MAXFDSET) Then
        exit(-1);
    nset[(fdno) shr ln2bitsinword]:=nset[(fdno) shr ln2bitsinword] AND TFDSetEl(NOT (culong(1) shl ((fdno) and ln2bitmask)));
    fpFD_CLR:=0;
@@ -54,7 +54,7 @@ End;
 function fpFD_ISSET(fdno:cint;const nset : TFDSet): cint;
 
 Begin
-   if (fdno<0) or (fdno >  FD_MAXFDSET) Then
+   if (fdno<0) or (fdno >=  FD_MAXFDSET) Then
        exit(-1);
    if ((nset[fdno shr ln2bitsinword]) and (TFDSetEl(1) shl ((fdno) and ln2bitmask)))>0 Then
      fpFD_ISSET:=1