pmwp.pas 7.1 KB

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