intlmgr.pp 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. {$MACRO ON}
  2. (******************************************************************************
  3. *
  4. * Copyright (c) 1998-2000 Palm, Inc. or its subsidiaries.
  5. * All rights reserved.
  6. *
  7. * File: IntlMgr.h
  8. *
  9. * Release: Palm OS SDK 4.0 (63220)
  10. *
  11. * Description:
  12. * This file defines public Int'l Mgr structures and routines.
  13. *
  14. * History:
  15. * 03/21/98 kwk Created by Ken Krugler.
  16. * 10/14/98 kwk Added intlIntlGetRoutineAddress selector and
  17. * IntlGetRoutineAddress routine declaration.
  18. * 08/05/99 kwk Added intlIntlHandleEvent selector and the
  19. * IntlHandleEvent routine declaration.
  20. * 09/22/99 kwk Added intlTxtParamString selector.
  21. * 10/20/99 kwk Moved private stuff to IntlPrv.h
  22. * 03/01/00 kwk Added intlTxtConvertEncoding selector.
  23. * 05/10/00 kwk Added intlIntlSetRoutineAddress selector & routine declaration.
  24. * Also intlErrInvalidSelector.
  25. * 05/18/00 kwk Added intlMgrStrict feature flag.
  26. * 05/26/00 kwk Added intlTxtGetWordWrapOffset selector.
  27. * 07/13/00 kwk Added intlTxtNameToEncoding selector.
  28. * 07/27/00 kwk Added intlTxtConvertEncodingV35 selector.
  29. * 11/29/00 kwk Added intlIntlStrictChecks selector.
  30. *
  31. *****************************************************************************)
  32. unit intlmgr;
  33. interface
  34. uses palmos, coretraps, errorbase;
  35. (***********************************************************************
  36. * Public constants
  37. ***********************************************************************)
  38. const
  39. // Bits set for the Intl Mgr feature.
  40. intlMgrExists = $00000001; // IntlMgr/TextMgr calls can be made.
  41. intlMgrStrict = $00000002; // Trigger extra errors on debug ROM.
  42. // Intl manager error codes.
  43. intlErrInvalidSelector = intlErrorClass or 1;
  44. // Selectors for routines found in the international manager. The order
  45. // of these selectors MUST match the jump table in IntlDispatch.c.
  46. const
  47. intlIntlInit = 0;
  48. intlTxtByteAttr = 1;
  49. intlTxtCharAttr = 2;
  50. intlTxtCharXAttr = 3;
  51. intlTxtCharSize = 4;
  52. intlTxtGetPreviousChar = 5;
  53. intlTxtGetNextChar = 6;
  54. intlTxtGetChar = 7;
  55. intlTxtSetNextChar = 8;
  56. intlTxtCharBounds = 9;
  57. intlTxtPrepFindString = 10;
  58. intlTxtFindString = 11;
  59. intlTxtReplaceStr = 12;
  60. intlTxtWordBounds = 13;
  61. intlTxtCharEncoding = 14;
  62. intlTxtStrEncoding = 15;
  63. intlTxtEncodingName = 16;
  64. intlTxtMaxEncoding = 17;
  65. intlTxtTransliterate = 18;
  66. intlTxtCharIsValid = 19;
  67. intlTxtCompare = 20;
  68. intlTxtCaselessCompare = 21;
  69. intlTxtCharWidth = 22;
  70. intlTxtGetTruncationOffset = 23;
  71. intlIntlGetRoutineAddress = 24;
  72. // New for Palm OS 3.5
  73. intlIntlHandleEvent = 25;
  74. intlTxtParamString = 26;
  75. // Patched for Palm OS 3.5.2
  76. intlTxtConvertEncodingV35 = 27;
  77. // New for Palm OS 4.0
  78. intlTxtConvertEncoding = 28;
  79. intlIntlSetRoutineAddress = 29;
  80. intlTxtGetWordWrapOffset = 30;
  81. intlTxtNameToEncoding = 31;
  82. intlIntlStrictChecks = 32;
  83. intlMaxSelector = intlIntlStrictChecks;
  84. type
  85. IntlSelector = UInt16;
  86. (***********************************************************************
  87. * Public routines
  88. ***********************************************************************)
  89. // Return back the address of the routine indicated by <inSelector>. If
  90. // <inSelector> isn't a valid routine selector, return back NULL.
  91. function IntlGetRoutineAddress(inSelector: IntlSelector): Pointer;
  92. // Set the address of the international mgr routine indicated by <iSelector>
  93. // to be <iProcPtr>. If <iSelector> isn't valid, return an error.
  94. function IntlSetRoutineAddress(iSelector: IntlSelector; iProcPtr: Pointer): Err;
  95. implementation
  96. function __IntlGetRoutineAddress(inSelector: IntlSelector): Pointer; syscall sysTrapIntlDispatch;
  97. function __IntlSetRoutineAddress(iSelector: IntlSelector; iProcPtr: Pointer): Err; syscall sysTrapIntlDispatch;
  98. function IntlGetRoutineAddress(inSelector: IntlSelector): Pointer;
  99. begin
  100. asm
  101. move.l #$intlIntlGetRoutineAddress, D2;
  102. end;
  103. IntlGetRoutineAddress := __IntlGetRoutineAddress(inSelector);
  104. end;
  105. function IntlSetRoutineAddress(iSelector: IntlSelector; iProcPtr: Pointer): Err;
  106. begin
  107. asm
  108. move.l #$intlIntlSetRoutineAddress, D2;
  109. end;
  110. IntlSetRoutineAddress := __IntlSetRoutineAddress(iSelector, iProcPtr);
  111. end;
  112. end.