pmwp.pas 7.3 KB

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