textservicesmgr.pp 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. {$MACRO ON}
  2. (******************************************************************************
  3. *
  4. * Copyright (c) 1998-2000 Palm, Inc. or its subsidiaries.
  5. * All rights reserved.
  6. *
  7. * File: TextServicesMgr.h
  8. *
  9. * Release: Palm OS SDK 4.0 (63220)
  10. *
  11. * Description:
  12. * Header file for Text Services Manager. This provides the caller with
  13. * an API for interacting with various text services, including front-end
  14. * processors (FEPs), which are sometimes known as input methods.
  15. *
  16. * History:
  17. * 03/05/98 kwk Created by Ken Krugler.
  18. * 02/03/99 kwk Changed name to TextServicesMgr.h, was TextServices.h.
  19. * 10/20/99 kwk Moved private stuff into TextServicesPrv.h
  20. * 04/19/00 kwk Use portable typedef for TsmSelector and TsmFepModeType.
  21. * Fixed up descriptions for TsmGet/SetFepMode. Added new
  22. * selectors for TsmInit, TsmDrawMode, TsmFepHandleEvent,
  23. * TsmFepTerminate, and TsmFepCommit.
  24. * 07/06/00 kwk Set type of unused status ptr param to be void*, and
  25. * moved TsmFepStatusType into the private header file.
  26. * 08/21/00 kwk Moved tsmFtrCreator here from TextServicesPrv.h.
  27. * Added tsmFtrNumFlags, tsmFtrFlagsHasFep.
  28. * 11/15/00 kwk Added tsmGet/SetSystemFep, tsmGet/SetCurrentFep selectors.
  29. *
  30. *****************************************************************************)
  31. unit textservicesmgr;
  32. interface
  33. uses palmos, coretraps, systemresources;
  34. (***********************************************************************
  35. * Public constants
  36. ***********************************************************************)
  37. // Feature Creators and numbers, for use with the FtrGet() call.
  38. const
  39. tsmFtrCreator = sysFileCTextServices;
  40. // Selector used with call to FtrGet(tsmFtrCreator, xxx) to get the
  41. // Text Services Manager flags.
  42. tsmFtrNumFlags = 0;
  43. // Flags returned by FtrGet(tsmFtrCreator, tsmFtrNumFlags) call.
  44. tsmFtrFlagsHasFep = $1; // Bit set if FEP is installed.
  45. // Selectors for routines found in the Text Services manager. The order
  46. // of these selectors MUST match the jump table in TextServicesMgr.c.
  47. type
  48. TsmSelector = UInt16;
  49. const
  50. tsmGetFepMode_ = 0;
  51. tsmSetFepMode_ = 1;
  52. tsmHandleEvent = 2;
  53. tsmInit = 3; // new in 4.0
  54. tsmDrawMode = 4; // new in 4.0
  55. tsmGetSystemFep = 5; // new in 4.0
  56. tsmSetSystemFep = 6; // new in 4.0
  57. tsmGetCurrentFep = 7; // new in 4.0
  58. tsmSetCurrentFep = 8; // new in 4.0
  59. tsmMaxSelector = tsmSetCurrentFep;
  60. // Input mode - used with TsmGet/SetFepMode.
  61. type
  62. TsmFepModeType = UInt16;
  63. const
  64. tsmFepModeDefault = TsmFepModeType(0);
  65. tsmFepModeOff = TsmFepModeType(1);
  66. tsmFepModeCustom = TsmFepModeType(128);
  67. (***********************************************************************
  68. * Public types
  69. ***********************************************************************)
  70. (***********************************************************************
  71. * Public routines
  72. ***********************************************************************)
  73. // Return the current mode for the active FEP. The <nullParam> parameter
  74. // is unused and must be set to NULL.
  75. function TsmGetFepMode(nullParam: Pointer): TsmFepModeType;
  76. // Set the mode for the active FEP to be <inNewMode>. The previous mode
  77. // is returned. The <nullParam> parameter is unused and must be set
  78. // to NULL.
  79. function TsmSetFepMode(nullParam: Pointer; inNewMode: TsmFepModeType): TsmFepModeType;
  80. implementation
  81. function __TsmGetFepMode(nullParam: Pointer): TsmFepModeType; syscall sysTrapTsmDispatch;
  82. function __TsmSetFepMode(nullParam: Pointer; inNewMode: TsmFepModeType): TsmFepModeType; syscall sysTrapTsmDispatch;
  83. function TsmGetFepMode(nullParam: Pointer): TsmFepModeType;
  84. begin
  85. asm
  86. move.l #$tsmGetFepMode_, D2;
  87. end;
  88. TsmGetFepMode := __TsmGetFepMode(nullParam);
  89. end;
  90. function TsmSetFepMode(nullParam: Pointer; inNewMode: TsmFepModeType): TsmFepModeType;
  91. begin
  92. asm
  93. move.l #$tsmSetFepMode_, D2;
  94. end;
  95. TsmSetFepMode := __TsmSetFepMode(nullParam, inNewMode);
  96. end;
  97. end.