pmwp.pas 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. {****************************************************************************
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyrigth (c) 2003 by Yuri Prokushev ([email protected])
  5. OS/2 Presentation Manager Workplace functions and types.
  6. See the file COPYING.FPC, included in this distribution,
  7. for details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. ****************************************************************************}
  12. unit pmwp;
  13. interface
  14. uses
  15. os2def, pmwin;
  16. //*** Common types *******************************************************/
  17. type
  18. HOBJECT=Cardinal;
  19. //*** Object management calls ********************************************/
  20. //*** Standard object classes *****************************************/
  21. const
  22. CCHMAXCLASS = 3; // Length of a classname
  23. QC_First = 0; // Codes for OA_QueryContent
  24. QC_Next = 1;
  25. QC_Last = 2;
  26. LOCATION_DESKTOP = PChar($FFFF0001); // Current Desktop
  27. // use instead of <WP_DESKTOP>
  28. //*** An object's appearance (icon or bitmap or outline) **************/
  29. type
  30. OBJECTIMAGE=record // oimg
  31. hptrObject: Cardinal;
  32. end;
  33. POBJECTIMAGE=^OBJECTIMAGE;
  34. //*** Class info structure returned by WinEnumObjectClasses ***********/
  35. type
  36. POBJCLASS=^OBJCLASS;
  37. OBJCLASS=record // ocls
  38. pNext: POBJCLASS; // Null for the last structure..
  39. pszClassName: PChar; // Class name
  40. pszModName: PChar; // Module name
  41. end;
  42. //*** Workplace object management functions ***************************/
  43. Function WinRegisterObjectClass(pszClassName,
  44. pszModName: PChar): Longbool; cdecl;
  45. external 'PMWP' index 200;
  46. Function WinDeRegisterObjectClass(pszClassName: PChar): Longbool; cdecl;
  47. external 'PMWP' index 201;
  48. Function WinReplaceObjectClass(pszOldClassName,
  49. pszNewClassName: PChar;
  50. fReplace: Longbool): Longbool; cdecl;
  51. external 'PMWP' index 219;
  52. Function WinEnumObjectClasses(VAR apObjClass: OBJCLASS;
  53. VAR pulSize: Cardinal): Longbool; cdecl;
  54. external 'PMWP' index 205;
  55. Function WinCreateObject(pszClassName,
  56. pszTitle,
  57. pszSetupString,
  58. pszLocation: PChar;
  59. ulFlags: Cardinal): HObject; cdecl;
  60. external 'PMWP' index 281;
  61. const
  62. CO_FAILIFEXISTS = 0;
  63. CO_REPLACEIFEXISTS = 1;
  64. CO_UPDATEIFEXISTS = 2;
  65. Function WinSetObjectData(aobject: HOBJECT;
  66. pszSetupString: PChar): Longbool; cdecl;
  67. external 'PMWP' index 250;
  68. Function WinDestroyObject(aobject: HOBJECT): Longbool; cdecl;
  69. external 'PMWP' index 251;
  70. Function WinQueryObject(pszObjectID: PChar): HObject; cdecl;
  71. external 'PMWP' index 252;
  72. Function WinSaveObject(ahObject: HOBJECT;
  73. fAsync: Longbool): Longbool; cdecl;
  74. external 'PMWP' index 285;
  75. Function WinOpenObject(ahObject: HOBJECT;
  76. ulView: Cardinal;
  77. Flag: Longbool): Longbool; cdecl;
  78. external 'PMWP' index 286;
  79. Function WinMoveObject(hObjectofObject: HOBJECT;
  80. hObjectofDest: HOBJECT;
  81. ulReserved: Cardinal): HObject; cdecl;
  82. external 'PMWP' index 287;
  83. Function WinCopyObject(hObjectofObject: HOBJECT;
  84. hObjectofDest: HOBJECT;
  85. ulReserved: Cardinal): HObject; cdecl;
  86. external 'PMWP' index 288;
  87. Function WinCreateShadow(hObjectofObject: HOBJECT;
  88. hObjectofDest: HOBJECT;
  89. ulReserved: Cardinal): HObject; cdecl;
  90. external 'PMWP' index 289;
  91. Function WinQueryActiveDesktopPathname(pszPathName: PChar;
  92. ulSize: Cardinal): Longbool; cdecl;
  93. external 'PMWP' index 262;
  94. Function WinQueryObjectPath(ahobject: HOBJECT;
  95. pszPathName: PChar;
  96. ulSize: Cardinal): Longbool; cdecl;
  97. external 'PMWP' index 263;
  98. Function WinRestartWPDServer(fState: Longbool): Cardinal; cdecl;
  99. external 'PMWP' index 463;
  100. Function WinIsWPDServerReady: Longbool; cdecl;
  101. external 'PMWP' index 465;
  102. Function WinRestartSOMDD(fState: Longbool): Cardinal; cdecl;
  103. external 'PMWP' index 464;
  104. Function WinIsSOMDDReady: Longbool; cdecl;
  105. external 'PMWP' index 480;
  106. //*** Object settings notebook page insertion structure ******************/
  107. type
  108. PAGEINFO=record // pginf
  109. cb: Cardinal;
  110. hwndPage: HWnd;
  111. pfnwp: proc;
  112. resid: Cardinal;
  113. pCreateParams: Pointer;
  114. dlgid: Word;
  115. usPageStyleFlags: Word;
  116. usPageInsertFlags: Word;
  117. usSettingsFlags: Word;
  118. pszName: PChar;
  119. idDefaultHelpPanel: Word;
  120. usReserved2: Word;
  121. pszHelpLibraryName: PChar;
  122. pHelpSubtable: ^Word; // PHELPSUBTABLE when PMHELP.H is included
  123. hmodHelpSubtable: Cardinal;
  124. ulPageInsertId: Cardinal;
  125. end;
  126. PPAGEINFO=^PAGEINFO;
  127. const
  128. SETTINGS_PAGE_NUMBERS = $01;
  129. //*** Utility apis +******************************************************/
  130. type
  131. ICONPOS=record // icp
  132. ptlIcon: POINTL; // Location
  133. szIdentity: Array[0..1-1] of Char; // Object identity string
  134. end;
  135. PICONPOS=^ICONPOS;
  136. //*********************************************************************/
  137. Function WinSetFileIcon(pszFileName: PChar;
  138. var pIcon: ICONINFO): Longbool; cdecl;
  139. external 'PMWP' index 210;
  140. Function WinFreeFileIcon(hptr: Cardinal): Longbool; cdecl;
  141. external 'PMWP' index 216;
  142. Function WinLoadFileIcon(pszFileName: PChar;
  143. fPrivate: Longbool): Cardinal; cdecl;
  144. external 'PMWP' index 209;
  145. Function WinStoreWindowPos(pszAppName,
  146. pszKeyName: PChar;
  147. ahwnd: HWND): Longbool; cdecl;
  148. external 'PMWP' index 207;
  149. Function WinRestoreWindowPos(pszAppName,
  150. pszKeyName: PChar;
  151. ahwnd: HWND): Longbool; cdecl;
  152. external 'PMWP' index 208;
  153. Function WinShutdownSystem(ahab: HAB;
  154. ahmq: HMQ): Longbool; cdecl;
  155. external 'PMWP' index 149;
  156. implementation
  157. end.
  158. {
  159. // Not implemented/not documented APIs
  160. WinShutdownAndReboot PMWP 152 ?
  161. WinShutdown PMWP 153 ?
  162. OldWinCreateObject PMWP 202 ?
  163. WinRestartWorkplace PMWP 221 ?
  164. ShlGetUserWordPtr PMWP 224 ?
  165. WinUnlockSystem PMWP 282 ?
  166. WinLockupSystem PMWP 283 ?
  167. WinNotebookButtonFromID PMWP 511 ?
  168. WinWaitForShell PMWP 512 ?
  169. }
  170. {
  171. // Not founded indexes
  172. Function WinSetFileIconN(pszFileName: PChar
  173. pIcnInfo: PICONINFO;
  174. ulIconIndex: Cardinal): Longbool; cdecl;
  175. external 'PMWP' index ???;
  176. Function WinLoadFileIconN(pszFileName: PChar;
  177. fPrivate: Longbool,
  178. ulIconIndex: Cardinal): Cardinal; cdecl;
  179. external 'PMWP' index ???;
  180. }
  181. {
  182. $Log$
  183. Revision 1.1 2003-03-28 13:36:02 yuri
  184. * Initial import
  185. }