소스 검색

+ introduced unit UnixKvmBase, which is going to contain miscellaneous routines,
commonly used by the unix keyboard, video and mouse units. Currently, it only
contains the UTF8Enabled function, which was moved away from the video unit
and which will also be used by the keyboard unit in the future, as soon as
that unit also gets UTF-8 input support.

git-svn-id: branches/unicodekvm@41357 -

nickysn 6 년 전
부모
커밋
4ea55963ef
4개의 변경된 파일49개의 추가작업 그리고 13개의 파일을 삭제
  1. 1 0
      .gitattributes
  2. 3 0
      packages/rtl-console/fpmake.pp
  3. 44 0
      packages/rtl-console/src/unix/unixkvmbase.pp
  4. 1 13
      packages/rtl-console/src/unix/video.pp

+ 1 - 0
.gitattributes

@@ -7443,6 +7443,7 @@ packages/rtl-console/src/unix/crt.pp svneol=native#text/plain
 packages/rtl-console/src/unix/keyboard.pp svneol=native#text/plain
 packages/rtl-console/src/unix/keyboard.pp svneol=native#text/plain
 packages/rtl-console/src/unix/mouse.pp svneol=native#text/plain
 packages/rtl-console/src/unix/mouse.pp svneol=native#text/plain
 packages/rtl-console/src/unix/terminfo.pp svneol=native#text/plain
 packages/rtl-console/src/unix/terminfo.pp svneol=native#text/plain
+packages/rtl-console/src/unix/unixkvmbase.pp svneol=native#text/plain
 packages/rtl-console/src/unix/video.pp svneol=native#text/plain
 packages/rtl-console/src/unix/video.pp svneol=native#text/plain
 packages/rtl-console/src/watcom/crt.pp svneol=native#text/plain
 packages/rtl-console/src/watcom/crt.pp svneol=native#text/plain
 packages/rtl-console/src/win/crt.pp svneol=native#text/plain
 packages/rtl-console/src/win/crt.pp svneol=native#text/plain

+ 3 - 0
packages/rtl-console/fpmake.pp

@@ -100,6 +100,7 @@ begin
        AddInclude('convert.inc',AllUnixOSes);
        AddInclude('convert.inc',AllUnixOSes);
        AddInclude('nwsys.inc',[netware]);
        AddInclude('nwsys.inc',[netware]);
        AddUnit   ('mouse',[go32v2,msdos]);
        AddUnit   ('mouse',[go32v2,msdos]);
+       AddUnit   ('unixkvmbase',AllUnixOSes);
      end;
      end;
 
 
     T:=P.Targets.AddUnit('crt.pp',CrtOSes);
     T:=P.Targets.AddUnit('crt.pp',CrtOSes);
@@ -118,6 +119,8 @@ begin
        AddUnit('video');
        AddUnit('video');
        AddUnit('mouse');
        AddUnit('mouse');
      end;
      end;
+
+    T:=P.Targets.AddUnit('unixkvmbase.pp',AllUnixOSes);
   end
   end
 end;
 end;
 
 

+ 44 - 0
packages/rtl-console/src/unix/unixkvmbase.pp

@@ -0,0 +1,44 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 1999-2000 by Florian Klaempfl
+    member of the Free Pascal development team
+
+    Miscellaneous routines used by the Keyboard, Mouse and
+    Video units on Unix-like operating systems.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+unit UnixKvmBase;
+
+{*****************************************************************************}
+                                   interface
+{*****************************************************************************}
+
+function UTF8Enabled: Boolean;
+
+{*****************************************************************************}
+                                implementation
+{*****************************************************************************}
+
+uses
+  baseunix;
+
+function UTF8Enabled: Boolean;
+var
+  lang:string;
+begin
+  {$ifdef BEOS}
+  UTF8Enabled := true;
+  exit;
+  {$endif}
+  lang:=upcase(fpgetenv('LANG'));
+  UTF8Enabled := (Pos('.UTF-8', lang) > 0) or (Pos('.UTF8', lang) > 0);
+end;
+
+end.

+ 1 - 13
packages/rtl-console/src/unix/video.pp

@@ -58,7 +58,7 @@ var internal_codepage,external_codepage:Tencoding;
                                 implementation
                                 implementation
 {*****************************************************************************}
 {*****************************************************************************}
 
 
-uses  baseunix,termio,strings
+uses  baseunix,termio,strings,unixkvmbase
      {$ifdef linux},linuxvcs{$endif};
      {$ifdef linux},linuxvcs{$endif};
 
 
 {$i video.inc}
 {$i video.inc}
@@ -958,18 +958,6 @@ begin
   TCSetAttr(1,TCSANOW,tio);
   TCSetAttr(1,TCSANOW,tio);
 end;
 end;
 
 
-function UTF8Enabled: Boolean;
-var
-  lang:string;
-begin
-  {$ifdef BEOS}
-  UTF8Enabled := true;
-  exit;
-  {$endif}
-  lang:=upcase(fpgetenv('LANG'));
-  UTF8Enabled := (Pos('.UTF-8', lang) > 0) or (Pos('.UTF8', lang) > 0);
-end;
-
 procedure decide_codepages;
 procedure decide_codepages;
 
 
 var s:string;
 var s:string;