home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / bpos2i.zip / BDCALLS.PAS next >
Pascal/Delphi Source File  |  1994-05-31  |  10KB  |  285 lines

  1. (* ====================================================== *)
  2. (*                        BDCALLS.PAS                     *)
  3. (*    Implementation of the functions of BDCALLS.DLL      *)
  4. (*                OS/2 Bidi public header file.           *)
  5. (*          Translation to Pascal by wr/toolbox mag       *)
  6. (* ====================================================== *)
  7. {$IFNDEF OS2}
  8.   Error: Wrong target/Compiler not patched
  9. {$ENDIF}
  10.  
  11. UNIT BDCalls;
  12.  
  13. INTERFACE
  14.  
  15. USES
  16.   Os2Def;
  17.  
  18.  
  19. (*******  BidiHotKeys in BIDISTRUCT ***********************)
  20. (*                                                        *)
  21. (* The following defined value may be used to             *)
  22. (* Enable/Disable the Bidi keyboard hot keys.             *)
  23. (* To enable a hot key, perform an 'OR' operation on the  *)
  24. (* Bidi hot key flag word in the KBVCBTYPE  structure     *)
  25. (* with the required defined value.  To disable a hot key,*)
  26. (* perform an 'AND NOT' operation on the Bidi hot key     *)
  27. (* flag word in the KBVCBTYPE  structure with the         *)
  28. (* required defined value.                                *)
  29. (*                                                        *)
  30. (**********************************************************)
  31.  
  32. CONST
  33.   BDHKFLAG_PUSH         = $0004;
  34.   BDHKFLAG_END_PUSH     = $0008;
  35.   BDHKFLAG_AUTO_PUSH    = $0010;
  36.   BDHKFLAG_FIELD_REV    = $0020;
  37.   BDHKFLAG_SCREEN_REV   = $0040;
  38.   BDHKFLAG_BIDI_POPUP   = $0200;
  39.   BDHKFLAG_AUTOMATIC    = $0400;
  40.   BDHKFLAG_INITIAL      = $0800;
  41.   BDHKFLAG_MIDDLE       = $1000;
  42.   BDHKFLAG_FINAL        = $2000;
  43.   BDHKFLAG_ISOLATED     = $4000;
  44.  
  45. (***********  Bidi Flags in BIDISTRUCT ********************)
  46. (*                                                        *)
  47. (* The following defined value may be used to             *)
  48. (* Enable/Disable the Bidi functions.                     *)
  49. (* To enable a Bidi function, perform an 'OR' operation   *)
  50. (* on the Bidi flags word in the BDKBVCB  structure with  *)
  51. (* the required defined value.                            *)
  52. (* To disable a Bidi fuction, perform an 'AND NOT'        *)
  53. (* operation on the Bidi flags word in the BDKBVCB        *)
  54. (* structure with the required defined value.             *)
  55. (*                                                        *)
  56. (**********************************************************)
  57.  
  58. CONST
  59.   BDFLAG_AUTOPUSH_RTL   = $0001;
  60.   BDFLAG_AUTOPUSH_LTR   = $0002;
  61.   BDFLAG_PUSHLEVEL      = $0004;
  62.   BDFLAG_LAYER          = $0010;
  63.   BDFLAG_FIELD_REV      = $0020;
  64.  
  65. (********************* CSD in BIDIATT *********************)
  66. (*                                                        *)
  67. (* The following defined value may be used to select the  *)
  68. (* specified                                              *)
  69. (* bit in the Bidi Attributes.                            *)
  70. (*                                                        *)
  71. (**********************************************************)
  72.  
  73. CONST
  74.   BDCSD_AUTOMATIC   =   $00000000;
  75.   BDCSD_PASSTHRU    =   $00000001;
  76.   BDCSD_BASE        =   $00000010;
  77.   BDCSD_INITIAL     =   $00000011;
  78.   BDCSD_MIDDLE      =   $00000012;
  79.   BDCSD_FINAL       =   $00000013;
  80.   BDCSD_ISOLATED    =   $00000014;
  81.   BDNUM_ARABIC      =   $00000000;
  82.   BDNUM_PASSTHRU    =   $00001000;
  83.   BDNUM_HINDU       =   $00002000;
  84.   BDORIENT_LTR      =   $00000000;
  85.   BDORIENT_RTL      =   $00010000;
  86.   BD_LEVEL          =   $30000000;
  87.   BD_SUPPORT        =   $00000000;
  88.  
  89.  
  90. (*********** the keyboard control block structure *********)
  91.  
  92. TYPE
  93.   BdKvcB   = RECORD
  94.     BDLength      : WORD;
  95.     BDVersionId   : WORD;
  96.     BDAtts        : WORD;
  97.     Reserved      : WORD;
  98.     BDHotKeyFlags : WORD;
  99.     BDFlags       : WORD;
  100.     Reserved2     : ARRAY[0..64] OF BYTE;
  101.   END;
  102.  
  103.  
  104. (******* the printer control block structure **************)
  105. TYPE
  106.   BdPrcb  = RECORD
  107.     PRLength : WORD ;
  108.     PRAtts   : LongInt;
  109.     Reserved : ARRAY [0..14] OF BYTE;
  110.   END;
  111.  
  112. (***** the Character Shape Determination structure *********)
  113.  
  114. TYPE
  115.   Char16    = ARRAY[0..16] OF CHAR;
  116.   pChar16   = ^Char16;
  117.  
  118.   UChar16   = ARRAY[0..16] OF BYTE;
  119.   pUChar16  = ^UChar16;
  120.  
  121.   CSDRec = RECORD
  122.     RecLength    : LONGINT;
  123.     Buffer       : Char16;
  124.     BufferLength : LONGINT;
  125.     BufferIndex  : LONGINT;
  126.   END;
  127.  
  128.  
  129.   pCSDRec  = ^CSDRec; (* FAR16PTR *)
  130.   pRetInfo = pBYTE;
  131.   pSetInfo = pBYTE;
  132.  
  133.  
  134. TYPE
  135.   ApiRet16 = WORD; (* APIRET = ULong ????????????? *)
  136.   FUNCTION NlsQueryBidiAtt(Effect: LongInt;
  137.                            RetInfo: pRetInfo): ApiRet16;
  138.  
  139.  
  140.   FUNCTION NlsSetBidiAtt(Effect  : LongInt;
  141.                          SetInfo : pSetInfo): ApiRet16;
  142.  
  143.  
  144.   FUNCTION NlsShapeBidiString(BidiAtts : LONGINT;
  145.                               Reserved : LONGINT;
  146.                               Source   : pChar16;
  147.                               Target   : pChar16;
  148.                               Length   : LONGINT;
  149.                               Increment: LONGINT): ApiRet16;
  150.  
  151.  
  152.   FUNCTION NlsEditShape (BidiAtts  : LONGINT;
  153.                          Effect    : LongInt;
  154.                          Source    : pCSDRec;
  155.                          Target    : pCSDRec;
  156.                          CSDState  : pULong;
  157.                          Increment : LONGINT): ApiRet16;
  158.  
  159.  
  160.   FUNCTION NlsInverseString(Source    : pChar16;
  161.                             Target    : pChar16;
  162.                             Length    : LONGINT;
  163.                             Increment : LONGINT): ApiRet16;
  164.  
  165.  
  166.   FUNCTION NlsConvertBidiNumerics(BidiAtts  : LONGINT;
  167.                                   Reserved  : LongInt;
  168.                                   Source    : pUChar16;
  169.                                   Target    : pUChar16;
  170.                                   Length    : LONGINT;
  171.                                   Increment : LONGINT
  172.                                            ): ApiRet16;
  173.  
  174.  
  175.   FUNCTION NlsSetBidiPrint(BidiAtts   : LONGINT;
  176.                            Length     : LONGINT;
  177.                            FileHandle : WORD): ApiRet16;
  178.  
  179.  
  180.   FUNCTION NlsConvertBidiString(Source   : pUChar16;
  181.                                 Target   : pUChar16;
  182.                                 Length,
  183.                                 Increment,
  184.                                 SBidiAtts,
  185.                                 TBidiAtts,
  186.                                 Reserved : LONGINT): ApiRet16;
  187.  
  188.   FUNCTION Nls16QueryBidiAtt(Effect  : LongInt;
  189.                              RetInfo : pRetInfo): ApiRet16;
  190.  
  191.  
  192.   FUNCTION Nls16SetBidiAtt (Effect : LongInt;
  193.                           SetInfo  : pSetInfo): ApiRet16;
  194.  
  195.  
  196.   FUNCTION Nls16ShapeBidiString(BidiAtts : LONGINT;
  197.                               Reserved   : LONGINT;
  198.                               Source     : pChar16;
  199.                               Target     : pChar16;
  200.                               Length     : LONGINT;
  201.                               Increment  : LONGINT): ApiRet16;
  202.  
  203.  
  204.   FUNCTION Nls16EditShape (BidiAtts  : LONGINT;
  205.                          Effect      : LongInt;
  206.                          Source      : pCSDRec;
  207.                          Target      : pCSDRec;
  208.                          CSDState    : pULong;
  209.                          Increment   : LONGINT): ApiRet16;
  210.  
  211.  
  212.   FUNCTION Nls16InverseString(Source    : pChar16;
  213.                               Target    : pChar16;
  214.                               Length    : LONGINT;
  215.                               Increment : LONGINT): ApiRet16;
  216.  
  217.  
  218.   FUNCTION Nls16ConvertBidiNumerics(BidiAtts : LONGINT;
  219.                                     Reserved : LongInt;
  220.                                     Source   : pUChar16;
  221.                                     Target   : pUChar16;
  222.                                     Length   : LONGINT;
  223.                                     Increment: LONGINT
  224.                                             ): ApiRet16;
  225.  
  226.  
  227.   FUNCTION Nls16SetBidiPrint(BidiAtts   : LONGINT;
  228.                              Length     : LONGINT;
  229.                              FileHandle : WORD): ApiRet16;
  230.  
  231.  
  232.   FUNCTION Nls16ConvertBidiString(Source    : pUChar16 ;
  233.                                   Target    : pUChar16;
  234.                                   Length    : LONGINT;
  235.                                   Increment : LONGINT;
  236.                                   SBidiAtts : LONGINT;
  237.                                   TBidiAtts : LONGINT;
  238.                                   Reserved  : LONGINT
  239.                                            ): ApiRet16;
  240.  
  241. IMPLEMENTATION
  242.  
  243.   FUNCTION NlsConvertBidiNumerics;
  244.     EXTERNAL 'BDCalls'INDEX  1;
  245.   FUNCTION Nls16ConvertBidiNumerics;
  246.     EXTERNAL 'BDCalls'INDEX  1;
  247.  
  248.   FUNCTION NlsConvertBidiString;EXTERNAL 'BDCalls' INDEX  2;
  249.   FUNCTION Nls16ConvertBidiString;
  250.     EXTERNAL 'BDCalls' INDEX  2;
  251.  
  252. {                 NOT      IMPLEMENTED
  253.   FUNCTION NlsIntSetBidiAtt;    EXTERNAL 'BDCalls' INDEX  3;
  254.   FUNCTION Nls16IntSetBidiAtt;  EXTERNAL 'BDCalls' INDEX  3;
  255.  
  256.   FUNCTION NlsIntQueryBidiAtt;  EXTERNAL 'BDCalls' INDEX  4;
  257.   FUNCTION Nls16IntQueryBidiAtt;EXTERNAL 'BDCalls' INDEX  4;
  258. }
  259.  
  260.   FUNCTION NlsSetBidiAtt;       EXTERNAL 'BDCalls' INDEX  5;
  261.   FUNCTION Nls16SetBidiAtt;     EXTERNAL 'BDCalls' INDEX  5;
  262.  
  263.   FUNCTION NlsQueryBidiAtt;     EXTERNAL 'BDCalls' INDEX  6;
  264.   FUNCTION Nls16QueryBidiAtt;   EXTERNAL 'BDCalls' INDEX  6;
  265.  
  266.   FUNCTION NlsInverseString;    EXTERNAL 'BDCalls' INDEX  7;
  267.   FUNCTION Nls16InverseString;  EXTERNAL 'BDCalls' INDEX  7;
  268.  
  269.   FUNCTION NlsSetBidiPrint;     EXTERNAL 'BDCalls' INDEX  8;
  270.   FUNCTION Nls16SetBidiPrint;   EXTERNAL 'BDCalls' INDEX  8;
  271.  
  272.   FUNCTION NlsEditShape;        EXTERNAL 'BDCalls' INDEX  9;
  273.   FUNCTION Nls16EditShape;      EXTERNAL 'BDCalls' INDEX  9;
  274.  
  275.   FUNCTION NlsShapeBidiString;  EXTERNAL 'BDCalls' INDEX 10;
  276.   FUNCTION Nls16ShapeBidiString;EXTERNAL 'BDCalls' INDEX 10;
  277.  
  278. {                       NOT   IMPLEMENTED
  279.   FUNCTION NlPopup;             EXTERNAL 'BDCalls' INDEX 11;
  280.   FUNCTION Nl16Popup;           EXTERNAL 'BDCalls' INDEX 11;
  281. }
  282. END.
  283.  
  284. (* ====================================================== *)
  285.