datatypes.pas 50 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475
  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 2005 Karoly Balogh
  4. datatypes.library interface unit for MorphOS/PowerPC
  5. Based on work of Nils Sjoholm member of the Amiga RTL
  6. development team.
  7. MorphOS port was done on a free Pegasos II/G4 machine
  8. provided by Genesi S.a.r.l. <www.genesi.lu>
  9. See the file COPYING.FPC, included in this distribution,
  10. for details about the copyright.
  11. This program is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  14. **********************************************************************}
  15. {$INLINE ON}
  16. {$PACKRECORDS 2}
  17. unit datatypes;
  18. interface
  19. uses exec, doslib, intuition, utility,
  20. graphics{, iffparse, amigaprinter, prtbase};
  21. const
  22. {***************************************************************************}
  23. ID_DTYP = 1146378576;
  24. {***************************************************************************}
  25. ID_DTHD = 1146374212;
  26. Type
  27. pDataTypeHeader = ^tDataTypeHeader;
  28. tDataTypeHeader = record
  29. dth_Name, { Descriptive name of the data type }
  30. dth_BaseName, { Base name of the data type }
  31. dth_Pattern : PChar; { Match pattern for file name. }
  32. dth_Mask : Pointer; { Comparision mask }
  33. dth_GroupID, { Group that the DataType is in }
  34. dth_ID : longword; { ID for DataType (same as IFF FORM type) }
  35. dth_MaskLen, { Length of comparision mask }
  36. dth_Pad : smallint; { Unused at present (must be 0) }
  37. dth_Flags, { Flags }
  38. dth_Priority : WORD; { Priority }
  39. end;
  40. const
  41. DTHSIZE = 32;
  42. {***************************************************************************}
  43. { Basic type }
  44. DTF_TYPE_MASK = $000F;
  45. DTF_BINARY = $0000;
  46. DTF_ASCII = $0001;
  47. DTF_IFF = $0002;
  48. DTF_MISC = $0003;
  49. { Set if case is important }
  50. DTF_CASE = $0010;
  51. { Reserved for system use }
  52. DTF_SYSTEM1 = $1000;
  53. {****************************************************************************
  54. *
  55. * GROUP ID and ID
  56. *
  57. * This is used for filtering out objects that you don't want. For
  58. * example, you could make a filter for the ASL file requester so
  59. * that it only showed the files that were pictures, or even to
  60. * narrow it down to only show files that were ILBM pictures.
  61. *
  62. * Note that the Group ID's are in lower case, and always the first
  63. * four characters of the word.
  64. *
  65. * For ID's; If it is an IFF file, then the ID is the same as the
  66. * FORM type. If it isn't an IFF file, then the ID would be the
  67. * first four characters of name for the file type.
  68. *
  69. ****************************************************************************}
  70. { System file, such as; directory, executable, library, device, font, etc. }
  71. GID_SYSTEM = 1937339252;
  72. { Formatted or unformatted text }
  73. GID_TEXT = 1952807028;
  74. { Formatted text with graphics or other DataTypes }
  75. GID_DOCUMENT = 1685021557;
  76. { Sound }
  77. GID_SOUND = 1936684398;
  78. { Musical instruments used for musical scores }
  79. GID_INSTRUMENT = 1768846196;
  80. { Musical score }
  81. GID_MUSIC = 1836413801;
  82. { Still picture }
  83. GID_PICTURE = 1885954932;
  84. { Animated picture }
  85. GID_ANIMATION = 1634625901;
  86. { Animation with audio track }
  87. GID_MOVIE = 1836021353;
  88. {***************************************************************************}
  89. { A code chunk contains an embedded executable that can be loaded
  90. * with InternalLoadSeg. }
  91. ID_CODE = 1146372932;
  92. Type
  93. { DataTypes comparision hook context (Read-Only). This is the
  94. * argument that is passed to a custom comparision routine. }
  95. pDTHookContext = ^tDTHookContext;
  96. tDTHookContext = record
  97. { Libraries that are already opened for your use }
  98. dthc_SysBase,
  99. dthc_DOSBase,
  100. dthc_IFFParseBase,
  101. dthc_UtilityBase : pLibrary;
  102. { File context }
  103. dthc_Lock : longword; { Lock on the file }
  104. dthc_FIB : pFileInfoBlock; { Pointer to a FileInfoBlock }
  105. dthc_FileHandle : longword; { Pointer to the file handle (may be NULL) }
  106. {$WARNING FIX ME!!! IFF handle type}
  107. // dthc_IFF : pIFFHandle; { Pointer to an IFFHandle (may be NULL) }
  108. dthc_IFF : Pointer; { Pointer to an IFFHandle (may be NULL) }
  109. dthc_Buffer : PChar; { Buffer }
  110. dthc_BufferLength : longword; { Length of the buffer }
  111. end;
  112. {***************************************************************************}
  113. const
  114. ID_TOOL = 1146377292;
  115. Type
  116. pTool = ^tTool;
  117. tTool = record
  118. tn_Which, { Which tool is this }
  119. tn_Flags : WORD; { Flags }
  120. tn_Program : PChar; { Application to use }
  121. end;
  122. const
  123. TSIZE = 8;
  124. { defines for tn_Which }
  125. TW_INFO = 1;
  126. TW_BROWSE = 2;
  127. TW_EDIT = 3;
  128. TW_PRINT = 4;
  129. TW_MAIL = 5;
  130. { defines for tn_Flags }
  131. TF_LAUNCH_MASK = $000F;
  132. TF_SHELL = $0001;
  133. TF_WORKBENCH = $0002;
  134. TF_RX = $0003;
  135. {***************************************************************************}
  136. ID_TAGS = 1146377287;
  137. {***************************************************************************}
  138. Type
  139. pDataType = ^tDataType;
  140. tDataType = record
  141. dtn_Node1, { Reserved for system use }
  142. dtn_Node2 : tNode; { Reserved for system use }
  143. dtn_Header : pDataTypeHeader; { Pointer to the DataTypeHeader }
  144. dtn_ToolList: tList; { List of tool nodes }
  145. dtn_FunctionName : PChar; { Name of comparision routine }
  146. dtn_AttrList : pTagItem; { Object creation tags }
  147. dtn_Length : longword; { Length of the memory block }
  148. end;
  149. {***************************************************************************}
  150. pToolNode = ^tToolNode;
  151. tToolNode = Record
  152. tn_Node : tNode; { Embedded node }
  153. tn_Tool : tTool; { Embedded tool }
  154. tn_Length : longword; { Length of the memory block }
  155. end;
  156. {***************************************************************************}
  157. const
  158. ID_NAME = 1312902469;
  159. {***************************************************************************}
  160. { text ID's }
  161. DTERROR_UNKNOWN_DATATYPE = 2000;
  162. DTERROR_COULDNT_SAVE = 2001;
  163. DTERROR_COULDNT_OPEN = 2002;
  164. DTERROR_COULDNT_SEND_MESSAGE = 2003;
  165. { new for V40 }
  166. DTERROR_COULDNT_OPEN_CLIPBOARD = 2004;
  167. DTERROR_Reserved = 2005;
  168. DTERROR_UNKNOWN_COMPRESSION = 2006;
  169. DTERROR_NOT_ENOUGH_DATA = 2007;
  170. DTERROR_INVALID_DATA = 2008;
  171. { New for V44 }
  172. DTERROR_NOT_AVAILABLE = 2009;
  173. { Offset for types }
  174. DTMSG_TYPE_OFFSET = 2100;
  175. {***************************************************************************}
  176. DATATYPESCLASS : Pchar = 'datatypesclass';
  177. {***************************************************************************}
  178. DTA_Dummy = (TAG_USER+$1000);
  179. { Generic attributes }
  180. DTA_TextAttr = (DTA_Dummy+10);
  181. { (struct TextAttr ) Pointer to the default TextAttr to use for
  182. * the text within the object. }
  183. DTA_TopVert = (DTA_Dummy+11);
  184. { (LONG) Current top vertical unit }
  185. DTA_VisibleVert = (DTA_Dummy+12);
  186. { (LONG) Number of visible vertical units }
  187. DTA_TotalVert = (DTA_Dummy+13);
  188. { (LONG) Total number of vertical units }
  189. DTA_VertUnit = (DTA_Dummy+14);
  190. { (LONG) Number of pixels per vertical unit }
  191. DTA_TopHoriz = (DTA_Dummy+15);
  192. { (LONG) Current top horizontal unit }
  193. DTA_VisibleHoriz = (DTA_Dummy+16);
  194. { (LONG) Number of visible horizontal units }
  195. DTA_TotalHoriz = (DTA_Dummy+17);
  196. { (LONG) Total number of horizontal units }
  197. DTA_HorizUnit = (DTA_Dummy+18);
  198. { (LONG) Number of pixels per horizontal unit }
  199. DTA_NodeName = (DTA_Dummy+19);
  200. { (UBYTE ) Name of the current element within the object. }
  201. DTA_Title = (DTA_Dummy+20);
  202. { (UBYTE ) Title of the object. }
  203. DTA_TriggerMethods = (DTA_Dummy+21);
  204. { (struct DTMethod ) Pointer to a NULL terminated array of
  205. * supported trigger methods. }
  206. DTA_Data = (DTA_Dummy+22);
  207. { (Pointer) Object specific data. }
  208. DTA_TextFont = (DTA_Dummy+23);
  209. { (struct TextFont ) Default font to use for text within the
  210. * object. }
  211. DTA_Methods = (DTA_Dummy+24);
  212. { (longword ) Pointer to a ~0 terminated array of supported
  213. * methods. }
  214. DTA_PrinterStatus = (DTA_Dummy+25);
  215. { (LONG) Printer error message. Error numbers are defined in
  216. * <devices/printer.h> }
  217. DTA_PrinterProc = (DTA_Dummy+26);
  218. { PRIVATE (struct Process ) Pointer to the print process. }
  219. DTA_LayoutProc = (DTA_Dummy+27);
  220. { PRIVATE (struct Process ) Pointer to the layout process. }
  221. DTA_Busy = (DTA_Dummy+28);
  222. { Used to turn the applications' busy pointer off and on }
  223. DTA_Sync = (DTA_Dummy+29);
  224. { Used to indicate that new information has been loaded into
  225. * an object. This is for models that cache the DTA_TopVert-
  226. * like tags }
  227. DTA_BaseName = (DTA_Dummy+30);
  228. { The base name of the class }
  229. DTA_GroupID = (DTA_Dummy+31);
  230. { Group that the object must belong in }
  231. DTA_ErrorLevel = (DTA_Dummy+32);
  232. { Error level }
  233. DTA_ErrorNumber = (DTA_Dummy+33);
  234. { datatypes.library error number }
  235. DTA_ErrorString = (DTA_Dummy+34);
  236. { Argument for datatypes.library error }
  237. DTA_Conductor = (DTA_Dummy+35);
  238. { New for V40. (UBYTE ) specifies the name of the
  239. * realtime.library conductor. Defaults to "Main". }
  240. DTA_ControlPanel = (DTA_Dummy+36);
  241. { New for V40. (BOOL) Indicate whether a control panel should be
  242. * embedded within the object (in the animation datatype, for
  243. * example). Defaults to TRUE. }
  244. DTA_Immediate = (DTA_Dummy+37);
  245. { New for V40. (BOOL) Indicate whether the object should
  246. * immediately begin playing. Defaults to FALSE. }
  247. DTA_Repeat = (DTA_Dummy+38);
  248. { New for V40. (BOOL) Indicate that the object should repeat
  249. * playing. Defaults to FALSE. }
  250. { New for V44. Address of a DTST_MEMORY source type
  251. * object (Pointer).
  252. }
  253. DTA_SourceAddress = (DTA_Dummy+39);
  254. { New for V44. Size of a DTST_MEMORY source type
  255. * object (longword).
  256. }
  257. DTA_SourceSize = (DTA_Dummy+40);
  258. { Reserved tag; DO NOT USE (V44) }
  259. DTA_Reserved = (DTA_Dummy+41);
  260. { DTObject attributes }
  261. DTA_Name = (DTA_Dummy+100);
  262. DTA_SourceType = (DTA_Dummy+101);
  263. DTA_Handle = (DTA_Dummy+102);
  264. DTA_DataType = (DTA_Dummy+103);
  265. DTA_Domain = (DTA_Dummy+104);
  266. { DON'T USE THE FOLLOWING FOUR TAGS. USE THE CORRESPONDING TAGS IN
  267. * <intuition/gadgetclass.h> }
  268. DTA_Left = (DTA_Dummy+105);
  269. DTA_Top = (DTA_Dummy+106);
  270. DTA_Width = (DTA_Dummy+107);
  271. DTA_Height = (DTA_Dummy+108);
  272. DTA_ObjName = (DTA_Dummy+109);
  273. DTA_ObjAuthor = (DTA_Dummy+110);
  274. DTA_ObjAnnotation = (DTA_Dummy+111);
  275. DTA_ObjCopyright = (DTA_Dummy+112);
  276. DTA_ObjVersion = (DTA_Dummy+113);
  277. DTA_ObjectID = (DTA_Dummy+114);
  278. DTA_UserData = (DTA_Dummy+115);
  279. DTA_FrameInfo = (DTA_Dummy+116);
  280. { DON'T USE THE FOLLOWING FOUR TAGS. USE THE CORRESPONDING TAGS IN
  281. * <intuition/gadgetclass.h> }
  282. DTA_RelRight = (DTA_Dummy+117);
  283. DTA_RelBottom = (DTA_Dummy+118);
  284. DTA_RelWidth = (DTA_Dummy+119);
  285. DTA_RelHeight = (DTA_Dummy+120);
  286. DTA_SelectDomain = (DTA_Dummy+121);
  287. DTA_TotalPVert = (DTA_Dummy+122);
  288. DTA_TotalPHoriz = (DTA_Dummy+123);
  289. DTA_NominalVert = (DTA_Dummy+124);
  290. DTA_NominalHoriz = (DTA_Dummy+125);
  291. { Printing attributes }
  292. DTA_DestCols = (DTA_Dummy+400);
  293. { (LONG) Destination X width }
  294. DTA_DestRows = (DTA_Dummy+401);
  295. { (LONG) Destination Y height }
  296. DTA_Special = (DTA_Dummy+402);
  297. { (UWORD) Option flags }
  298. DTA_RastPort = (DTA_Dummy+403);
  299. { (struct RastPort ) RastPort to use when printing. (V40) }
  300. DTA_ARexxPortName = (DTA_Dummy+404);
  301. { (PChar) Pointer to base name for ARexx port (V40) }
  302. {***************************************************************************}
  303. DTST_RAM = 1;
  304. DTST_FILE = 2;
  305. DTST_CLIPBOARD = 3;
  306. DTST_HOTLINK = 4;
  307. DTST_MEMORY = 5; { New for V44 }
  308. {***************************************************************************}
  309. { Attached to the Gadget.SpecialInfo field of the gadget. Don't access directly,
  310. * use the Get/Set calls instead.
  311. }
  312. Type
  313. pDTSpecialInfo = ^tDTSpecialInfo;
  314. tDTSpecialInfo = record
  315. si_Lock : tSignalSemaphore; { Locked while in DoAsyncLayout() }
  316. si_Flags,
  317. si_TopVert, { Top row (in units) }
  318. si_VisVert, { Number of visible rows (in units) }
  319. si_TotVert, { Total number of rows (in units) }
  320. si_OTopVert, { Previous top (in units) }
  321. si_VertUnit, { Number of pixels in vertical unit }
  322. si_TopHoriz, { Top column (in units) }
  323. si_VisHoriz, { Number of visible columns (in units) }
  324. si_TotHoriz, { Total number of columns (in units) }
  325. si_OTopHoriz, { Previous top (in units) }
  326. si_HorizUnit : Longint; { Number of pixels in horizontal unit }
  327. end;
  328. const
  329. { Object is in layout processing }
  330. DTSIF_LAYOUT = 1;
  331. { Object needs to be layed out }
  332. DTSIF_NEWSIZE = 2;
  333. DTSIF_DRAGGING = 4;
  334. DTSIF_DRAGSELECT = 8;
  335. DTSIF_HIGHLIGHT = 16;
  336. { Object is being printed }
  337. DTSIF_PRINTING = 32;
  338. { Object is in layout process }
  339. DTSIF_LAYOUTPROC = 64;
  340. {***************************************************************************}
  341. Type
  342. pDTMethod = ^tDTMethod;
  343. tDTMethod = record
  344. dtm_Label,
  345. dtm_Command : PChar;
  346. dtm_Method : longword;
  347. end;
  348. {***************************************************************************}
  349. Const
  350. DTM_Dummy = ($600);
  351. { Inquire what environment an object requires }
  352. DTM_FRAMEBOX = ($601);
  353. { Same as GM_LAYOUT except guaranteed to be on a process already }
  354. DTM_PROCLAYOUT = ($602);
  355. { Layout that is occurring on a process }
  356. DTM_ASYNCLAYOUT = ($603);
  357. { When a RemoveDTObject() is called }
  358. DTM_REMOVEDTOBJECT = ($604);
  359. DTM_SELECT = ($605);
  360. DTM_CLEARSELECTED = ($606);
  361. DTM_COPY = ($607);
  362. DTM_PRINT = ($608);
  363. DTM_ABORTPRINT = ($609);
  364. DTM_NEWMEMBER = ($610);
  365. DTM_DISPOSEMEMBER = ($611);
  366. DTM_GOTO = ($630);
  367. DTM_TRIGGER = ($631);
  368. DTM_OBTAINDRAWINFO = ($640);
  369. DTM_DRAW = ($641);
  370. DTM_RELEASEDRAWINFO = ($642);
  371. DTM_WRITE = ($650);
  372. { Used to ask the object about itself }
  373. type
  374. pFrameInfo = ^tFrameInfo;
  375. tFrameInfo = record
  376. fri_PropertyFlags : longword;
  377. fri_Resolution : tPoint;
  378. fri_RedBits : BYTE;
  379. fri_GreenBits : BYTE;
  380. fri_BlueBits : BYTE;
  381. fri_Dimensions : record
  382. Width : longword;
  383. Height : longword;
  384. Depth : longword;
  385. end;
  386. fri_Screen : pScreen;
  387. fri_ColorMap : pColorMap;
  388. fri_Flags : longword;
  389. end;
  390. CONST
  391. FIF_SCALABLE = $1;
  392. FIF_SCROLLABLE = $2;
  393. FIF_REMAPPABLE = $4;
  394. { DTM_REMOVEDTOBJECT, DTM_CLEARSELECTED, DTM_COPY, DTM_ABORTPRINT }
  395. Type
  396. pdtGeneral = ^tdtGeneral;
  397. tdtGeneral = record
  398. MethodID : longword;
  399. dtg_GInfo : pGadgetInfo;
  400. end;
  401. { DTM_SELECT }
  402. pdtSelect = ^tdtSelect;
  403. tdtSelect = record
  404. MethodID : longword;
  405. dts_GInfo : pGadgetInfo;
  406. dts_Select : tRectangle;
  407. end;
  408. { DTM_FRAMEBOX }
  409. pdtFrameBox = ^tdtFrameBox;
  410. tdtFrameBox = record
  411. MethodID : longword;
  412. dtf_GInfo : pGadgetInfo;
  413. dtf_ContentsInfo, { Input }
  414. dtf_FrameInfo : pFrameInfo; { Output }
  415. dtf_SizeFrameInfo,
  416. dtf_FrameFlags : longword;
  417. end;
  418. { DTM_GOTO }
  419. pdtGoto = ^tdtGoto;
  420. tdtGoto = record
  421. MethodID : longword;
  422. dtg_GInfo : pGadgetInfo;
  423. dtg_NodeName : PChar; { Node to goto }
  424. dtg_AttrList : pTagItem; { Additional attributes }
  425. end;
  426. { DTM_TRIGGER }
  427. pdtTrigger = ^tdtTrigger;
  428. tdtTrigger = record
  429. MethodID : longword;
  430. dtt_GInfo : pGadgetInfo;
  431. dtt_Function : longword;
  432. dtt_Data : Pointer;
  433. end;
  434. const
  435. STM_PAUSE = 1 ;
  436. STM_PLAY = 2 ;
  437. STM_CONTENTS = 3 ;
  438. STM_INDEX = 4 ;
  439. STM_RETRACE = 5 ;
  440. STM_BROWSE_PREV = 6 ;
  441. STM_BROWSE_NEXT = 7 ;
  442. STM_NEXT_FIELD = 8 ;
  443. STM_PREV_FIELD = 9 ;
  444. STM_ACTIVATE_FIELD = 10;
  445. STM_COMMAND = 11;
  446. { New for V40 }
  447. STM_REWIND = 12;
  448. STM_FASTFORWARD = 13;
  449. STM_STOP = 14;
  450. STM_RESUME = 15;
  451. STM_LOCATE = 16;
  452. Type
  453. { Printer IO request }
  454. pprinterIO = ^tprinterIO;
  455. tprinterIO = record
  456. ios : tIOStdReq;
  457. {$WARNING FIX ME!!! TPrinterIO}
  458. {
  459. iodrp : tIODRPReq;
  460. iopc : tIOPrtCmdReq;
  461. }
  462. end;
  463. { DTM_PRINT }
  464. pdtPrint = ^tdtPrint;
  465. tdtPrint = record
  466. MethodID : longword;
  467. dtp_GInfo : pGadgetInfo;
  468. dtp_PIO : pprinterIO;
  469. dtp_AttrList : pTagItem;
  470. end;
  471. { DTM_DRAW }
  472. pdtDraw = ^tdtDraw;
  473. tdtDraw = record
  474. MethodID : longword;
  475. dtd_RPort : pRastPort;
  476. dtd_Left,
  477. dtd_Top,
  478. dtd_Width,
  479. dtd_Height,
  480. dtd_TopHoriz,
  481. dtd_TopVert : Longint;
  482. dtd_AttrList : pTagItem; { Additional attributes }
  483. end;
  484. { DTM_WRITE }
  485. pdtWrite = ^tdtWrite;
  486. tdtWrite = record
  487. MethodID : longword;
  488. dtw_GInfo : pGadgetInfo; { Gadget information }
  489. dtw_FileHandle : longword; { File handle to write to }
  490. dtw_Mode : longword;
  491. dtw_AttrList : pTagItem; { Additional attributes }
  492. end;
  493. const
  494. { Save data as IFF data }
  495. DTWM_IFF = 0;
  496. { Save data as local data format }
  497. DTWM_RAW = 1;
  498. {***************************************************************************}
  499. PICTUREDTCLASS : PChar = 'picture.datatype';
  500. {***************************************************************************}
  501. { Picture attributes }
  502. PDTA_ModeID = (DTA_Dummy + 200);
  503. { Mode ID of the picture }
  504. PDTA_BitMapHeader = (DTA_Dummy + 201);
  505. PDTA_BitMap = (DTA_Dummy + 202);
  506. { Pointer to a class-allocated bitmap, that will end
  507. * up being freed by picture.class when DisposeDTObject()
  508. * is called }
  509. { Picture colour table (struct ColorRegister *) }
  510. PDTA_ColorRegisters = (DTA_Dummy + 203);
  511. { Color table to use with SetRGB32CM() (longword *) }
  512. PDTA_CRegs = (DTA_Dummy + 204);
  513. { Color table; this table is initialized during the layout
  514. * process and will contain the colours the picture will use
  515. * after remapping. If no remapping takes place, these colours
  516. * will match those in the PDTA_CRegs table (longword *).
  517. }
  518. PDTA_GRegs = (DTA_Dummy + 205);
  519. { Shared pen table; this table is initialized during the layout
  520. * process while the picture is being remapped (UBYTE *).
  521. }
  522. PDTA_ColorTable = (DTA_Dummy + 206);
  523. { Shared pen table; in most places this table will be identical to
  524. * the PDTA_ColorTable table. Some of the colours in this table might
  525. * match the original colour palette a little better than the colours
  526. * picked for the other table. The picture.datatype uses the two tables
  527. * during remapping, alternating for each pixel (UBYTE *).
  528. }
  529. PDTA_ColorTable2 = (DTA_Dummy + 207);
  530. { OBSOLETE; DO NOT USE }
  531. PDTA_Allocated = (DTA_Dummy + 208);
  532. { Number of colors used by the picture. (UWORD) }
  533. PDTA_NumColors = (DTA_Dummy + 209);
  534. { Number of colors allocated by the picture (UWORD) }
  535. PDTA_NumAlloc = (DTA_Dummy + 210);
  536. PDTA_Remap = (DTA_Dummy + 211);
  537. { Boolean : Remap picture (defaults to TRUE) }
  538. PDTA_Screen = (DTA_Dummy + 212);
  539. { Screen to remap to }
  540. PDTA_FreeSourceBitMap = (DTA_Dummy + 213);
  541. { Boolean : Free the source bitmap after remapping }
  542. PDTA_Grab = (DTA_Dummy + 214);
  543. { Pointer to a Point structure }
  544. PDTA_DestBitMap = (DTA_Dummy + 215);
  545. { Pointer to the destination (remapped) bitmap }
  546. PDTA_ClassBitMap = (DTA_Dummy + 216);
  547. { Pointer to class-allocated bitmap, that will end
  548. * up being freed by the class after DisposeDTObject()
  549. * is called }
  550. PDTA_NumSparse = (DTA_Dummy + 217);
  551. { (UWORD) Number of colors used for sparse remapping }
  552. PDTA_SparseTable = (DTA_Dummy + 218);
  553. { (UBYTE *) Pointer to a table of pen numbers indicating
  554. * which colors should be used when remapping the image.
  555. * This array must contain as many entries as there
  556. * are colors specified with PDTA_NumSparse }
  557. { Index number of the picture to load (longword). (V44) }
  558. PDTA_WhichPicture = (DTA_Dummy + 219);
  559. { Get the number of pictures stored in the file (longword *). (V44) }
  560. PDTA_GetNumPictures = (DTA_Dummy + 220);
  561. { Maximum number of colours to use for dithering (longword). (V44) }
  562. PDTA_MaxDitherPens = (DTA_Dummy + 221);
  563. { Quality of the dithering algorithm to be used during colour
  564. * quantization (longword). (V44)
  565. }
  566. PDTA_DitherQuality = (DTA_Dummy + 222);
  567. { Pointer to the allocated pen table (UBYTE *). (V44) }
  568. PDTA_AllocatedPens = (DTA_Dummy + 223);
  569. { Quality for scaling. (V45) }
  570. PDTA_ScaleQuality = (DTA_Dummy + 224);
  571. {***************************************************************************}
  572. { When querying the number of pictures stored in a file, the
  573. * following value denotes "the number of pictures is unknown".
  574. }
  575. PDTANUMPICTURES_Unknown = (0);
  576. {***************************************************************************}
  577. { V43 extensions (attributes) }
  578. { Set the sub datatype interface mode (LONG); see "Interface modes" below }
  579. PDTA_SourceMode = (DTA_Dummy + 250);
  580. { Set the app datatype interface mode (LONG); see "Interface modes" below }
  581. PDTA_DestMode = (DTA_Dummy + 251);
  582. { Allocates the resulting bitmap as a friend bitmap (BOOL) }
  583. PDTA_UseFriendBitMap = (DTA_Dummy + 255);
  584. { NULL or mask plane for use with BltMaskBitMapRastPort() (PLANEPTR) }
  585. PDTA_MaskPlane = (DTA_Dummy + 258);
  586. PDTA_Displayable = (DTA_Dummy + 259); { * defaults to TRUE * }
  587. {***************************************************************************}
  588. { Interface modes }
  589. PMODE_V42 = (0); { Compatibility mode }
  590. PMODE_V43 = (1); { Extended mode }
  591. {***************************************************************************}
  592. { V43 extensions (methods) }
  593. PDTM_Dummy = (DTM_Dummy + $60);
  594. { Transfer pixel data to the picture object in the specified format }
  595. PDTM_WRITEPIXELARRAY = (PDTM_Dummy + 0);
  596. { Transfer pixel data from the picture object in the specified format }
  597. PDTM_READPIXELARRAY = (PDTM_Dummy + 1);
  598. {***************************************************************************}
  599. { * Pixel formats * }
  600. PBPAFMT_RGB = 0;
  601. PBPAFMT_RGBA = 1;
  602. PBPAFMT_ARGB = 2;
  603. PBPAFMT_LUT8 = 3;
  604. PBPAFMT_GREY8 = 4;
  605. { Masking techniques }
  606. mskNone = 0;
  607. mskHasMask = 1;
  608. mskHasTransparentColor = 2;
  609. mskLasso = 3;
  610. mskHasAlpha = 4;
  611. { Compression techniques }
  612. cmpNone = 0;
  613. cmpByteRun1 = 1;
  614. cmpByteRun2 = 2;
  615. Type
  616. { Bitmap header (BMHD) structure }
  617. pBitMapHeader = ^tBitMapHeader;
  618. tBitMapHeader = record
  619. bmh_Width, { Width in pixels }
  620. bmh_Height : Word; { Height in pixels }
  621. bmh_Left, { Left position }
  622. bmh_Top : smallint; { Top position }
  623. bmh_Depth, { Number of planes }
  624. bmh_Masking, { Masking type }
  625. bmh_Compression, { Compression type }
  626. bmh_Pad : Byte;
  627. bmh_Transparent : WORD; { Transparent color }
  628. bmh_XAspect,
  629. bmh_YAspect : Byte;
  630. bmh_PageWidth,
  631. bmh_PageHeight : smallint;
  632. end;
  633. {***************************************************************************}
  634. { Color register structure }
  635. pColorRegister = ^tColorRegister;
  636. tColorRegister = record
  637. red, green, blue : Byte;
  638. end;
  639. {***************************************************************************}
  640. const
  641. { IFF types that may be in pictures }
  642. ID_ILBM = 1229734477;
  643. ID_BMHD = 1112361028;
  644. ID_BODY = 1112491097;
  645. ID_CMAP = 1129136464;
  646. ID_CRNG = 1129467463;
  647. ID_GRAB = 1196572994;
  648. ID_SPRT = 1397772884;
  649. ID_DEST = 1145394004;
  650. ID_CAMG = 1128353095;
  651. {***************************************************************************}
  652. SOUNDDTCLASS : PChar = 'sound.datatype';
  653. {***************************************************************************}
  654. { Sound attributes }
  655. SDTA_Dummy = (DTA_Dummy + 500);
  656. SDTA_VoiceHeader = (SDTA_Dummy + 1);
  657. SDTA_Sample = (SDTA_Dummy + 2);
  658. { (UBYTE *) Sample data }
  659. SDTA_SampleLength = (SDTA_Dummy + 3);
  660. { (longword) Length of the sample data in UBYTEs }
  661. SDTA_Period = (SDTA_Dummy + 4);
  662. { (UWORD) Period }
  663. SDTA_Volume = (SDTA_Dummy + 5);
  664. { (UWORD) Volume. Range from 0 to 64 }
  665. SDTA_Cycles = (SDTA_Dummy + 6);
  666. { The following tags are new for V40 }
  667. SDTA_SignalTask = (SDTA_Dummy + 7);
  668. { (struct Task *) Task to signal when sound is complete or
  669. next buffer needed. }
  670. { (longword) Signal mask to use on completion or 0 to disable
  671. *
  672. * NOTE: Due to a bug in sound.datatype V40 SDTA_SignalBit
  673. * was actually implemented as a signal mask as opposed
  674. * to a bit number. The documentation now reflects
  675. * this. If you intend to use a signal bit number
  676. * instead of the mask, use the new V44 tag
  677. * SDTA_SignalBitNumber below.
  678. *}
  679. SDTA_SignalBit = (SDTA_Dummy + 8);
  680. SDTA_SignalBitMask = SDTA_SignalBit;
  681. { (BYTE) Signal bit to use on completion or -1 to disable }
  682. SDTA_Continuous = (SDTA_Dummy + 9);
  683. { (longword) Playing a continuous stream of data. Defaults to
  684. FALSE. }
  685. { The following tags are new for V44 }
  686. { (BYTE) Signal bit to use on completion or -1 to disable }
  687. SDTA_SignalBitNumber = (SDTA_Dummy + 10);
  688. { (UWORD) Samples per second }
  689. SDTA_SamplesPerSec = (SDTA_Dummy + 11);
  690. { (struct timeval *) Sample replay period }
  691. SDTA_ReplayPeriod = (SDTA_Dummy + 12);
  692. { (BYTE *) Sample data }
  693. SDTA_LeftSample = (SDTA_Dummy + 13);
  694. SDTA_RightSample = (SDTA_Dummy + 14);
  695. { (BYTE) Stereo panning }
  696. SDTA_Pan = (SDTA_Dummy + 15);
  697. { (BOOL) FreeVec() all sample data upon OM_DISPOSE. }
  698. SDTA_FreeSampleData = (SDTA_Dummy + 16);
  699. { (BOOL) Wait for the current sample to be played back before
  700. * switching to the new sample data.
  701. }
  702. SDTA_SyncSampleChange = (SDTA_Dummy + 17);
  703. {***************************************************************************}
  704. CMP_NONE = 0;
  705. CMP_FIBDELTA = 1;
  706. Type
  707. pVoiceHeader = ^tVoiceHeader;
  708. tVoiceHeader = record
  709. vh_OneShotHiSamples,
  710. vh_RepeatHiSamples,
  711. vh_SamplesPerHiCycle : longword;
  712. vh_SamplesPerSec : WORD;
  713. vh_Octaves,
  714. vh_Compression : Byte;
  715. vh_Volume : longword;
  716. end;
  717. {***************************************************************************}
  718. const
  719. { Channel allocation }
  720. SAMPLETYPE_Left = (2);
  721. SAMPLETYPE_Right = (4);
  722. SAMPLETYPE_Stereo = (6);
  723. { IFF types }
  724. ID_8SVX = 944985688;
  725. ID_VHDR = 1447576658;
  726. ID_CHAN = $4348414E;
  727. {***************************************************************************}
  728. { ***************************************************************************}
  729. TEXTDTCLASS : PChar = 'text.datatype';
  730. { ***************************************************************************}
  731. { Text attributes }
  732. TDTA_Buffer = (DTA_Dummy + 300);
  733. TDTA_BufferLen = (DTA_Dummy + 301);
  734. TDTA_LineList = (DTA_Dummy + 302);
  735. TDTA_WordSelect = (DTA_Dummy + 303);
  736. TDTA_WordDelim = (DTA_Dummy + 304);
  737. TDTA_WordWrap = (DTA_Dummy + 305);
  738. { Boolean. Should the text be word wrapped. Defaults to false. }
  739. { ***************************************************************************}
  740. Type
  741. { There is one Line structure for every line of text in our document. }
  742. pLine = ^tLine;
  743. tLine = record
  744. ln_Link : tMinNode; { to link the lines together }
  745. ln_Text : PChar; { pointer to the text for this line }
  746. ln_TextLen : longword; { the character length of the text for this line }
  747. ln_XOffset, { where in the line the text starts }
  748. ln_YOffset, { line the text is on }
  749. ln_Width, { Width of line in pixels }
  750. ln_Height, { Height of line in pixels }
  751. ln_Flags : WORD; { info on the line }
  752. ln_FgPen, { foreground pen }
  753. ln_BgPen : Shortint; { background pen }
  754. ln_Style : longword; { Font style }
  755. ln_Data : Pointer; { Link data... }
  756. end;
  757. { ***************************************************************************}
  758. const
  759. { Line.ln_Flags }
  760. { Line Feed }
  761. LNF_LF = 1;
  762. { Segment is a link }
  763. LNF_LINK = 2;
  764. { ln_Data is a pointer to an DataTypes object }
  765. LNF_OBJECT = 4;
  766. { Object is selected }
  767. LNF_SELECTED = 8;
  768. { ***************************************************************************}
  769. { IFF types that may be text }
  770. ID_FTXT = 1179932756;
  771. ID_CHRS = 1128813139;
  772. { ***************************************************************************}
  773. ANIMATIONDTCLASS : PChar = 'animation.datatype';
  774. { ***************************************************************************}
  775. { Animation attributes }
  776. ADTA_Dummy = (DTA_Dummy + 600);
  777. ADTA_ModeID = PDTA_ModeID ;
  778. ADTA_KeyFrame = PDTA_BitMap ;
  779. { (struct BitMap *) Key frame (first frame) bitmap }
  780. ADTA_ColorRegisters = PDTA_ColorRegisters;
  781. ADTA_CRegs = PDTA_CRegs ;
  782. ADTA_GRegs = PDTA_GRegs ;
  783. ADTA_ColorTable = PDTA_ColorTable ;
  784. ADTA_ColorTable2 = PDTA_ColorTable2 ;
  785. ADTA_Allocated = PDTA_Allocated ;
  786. ADTA_NumColors = PDTA_NumColors ;
  787. ADTA_NumAlloc = PDTA_NumAlloc ;
  788. ADTA_Remap = PDTA_Remap;
  789. { (BOOL) : Remap animation (defaults to TRUE) }
  790. ADTA_Screen = PDTA_Screen;
  791. { (struct Screen *) Screen to remap to }
  792. ADTA_NumSparse = PDTA_NumSparse;
  793. { (UWORD) Number of colors used for sparse remapping }
  794. ADTA_SparseTable = PDTA_SparseTable;
  795. { (UBYTE *) Pointer to a table of pen numbers indicating
  796. * which colors should be used when remapping the image.
  797. * This array must contain as many entries as there
  798. * are colors specified with ADTA_NumSparse }
  799. ADTA_Width = (ADTA_Dummy + 1);
  800. ADTA_Height = (ADTA_Dummy + 2);
  801. ADTA_Depth = (ADTA_Dummy + 3);
  802. ADTA_Frames = (ADTA_Dummy + 4);
  803. { (longword) Number of frames in the animation }
  804. ADTA_Frame = (ADTA_Dummy + 5);
  805. { (longword) Current frame }
  806. ADTA_FramesPerSecond = (ADTA_Dummy + 6);
  807. { (longword) Frames per second }
  808. ADTA_FrameIncrement = (ADTA_Dummy + 7);
  809. { (LONG) Amount to change frame by when fast forwarding or
  810. * rewinding. Defaults to 10. }
  811. ADTA_PreloadFrameCount = (ADTA_Dummy + 8); { (V44) }
  812. { Sound attributes }
  813. ADTA_Sample = SDTA_Sample ;
  814. ADTA_SampleLength = SDTA_SampleLength;
  815. ADTA_Period = SDTA_Period ;
  816. ADTA_Volume = SDTA_Volume ;
  817. ADTA_Cycles = SDTA_Cycles ;
  818. ADTA_LeftSample = SDTA_LeftSample; { (V44) }
  819. ADTA_RightSample = SDTA_RightSample; { (V44) }
  820. ADTA_SamplesPerSec = SDTA_SamplesPerSec; { (V44) }
  821. { ***************************************************************************}
  822. ID_ANIM = 1095649613;
  823. ID_ANHD = 1095649348;
  824. ID_DLTA = 1145852993;
  825. { ***************************************************************************}
  826. { Required ANHD structure describes an ANIM frame }
  827. Type
  828. pAnimHeader = ^tAnimHeader;
  829. tAnimHeader = record
  830. ah_Operation : Byte; { The compression method:
  831. 0 set directly (normal ILBM BODY),
  832. 1 XOR ILBM mode,
  833. 2 Long Delta mode,
  834. 3 Short Delta mode,
  835. 4 Generalized short/long Delta mode,
  836. 5 Byte Vertical Delta mode
  837. 6 Stereo op 5 (third party)
  838. 74 (ascii 'J') reserved for Eric Graham's
  839. compression technique (details to be
  840. released later). }
  841. ah_Mask : Byte; { (XOR mode only - plane mask where each
  842. bit is set =1 if there is data and =0
  843. if not.) }
  844. ah_Width, { (XOR mode only - width and height of the }
  845. ah_Height, { area represented by the BODY to eliminate }
  846. { unnecessary un-changed data) }
  847. ah_Left, { (XOR mode only - position of rectangular }
  848. ah_Top : WORD; { area representd by the BODY) }
  849. ah_AbsTime, { Timing for a frame relative to the time
  850. the first frame was displayed, in
  851. jiffies (1/60 sec) }
  852. ah_RelTime : longword; { Timing for frame relative to time
  853. previous frame was displayed - in
  854. jiffies (1/60 sec) }
  855. ah_Interleave, { Indicates how may frames back this data is to
  856. modify. 0 defaults to indicate two frames back
  857. (for double buffering). n indicates n frames back.
  858. The main intent here is to allow values
  859. of 1 for special applications where
  860. frame data would modify the immediately
  861. previous frame. }
  862. ah_Pad0 : Byte; { Pad byte, not used at present. }
  863. ah_Flags : longword; { 32 option bits used by options=4 and 5.
  864. At present only 6 are identified, but the
  865. rest are set =0 so they can be used to
  866. implement future ideas. These are defined
  867. for option 4 only at this point. It is
  868. recommended that all bits be set =0 for
  869. option 5 and that any bit settings
  870. used in the future (such as for XOR mode)
  871. be compatible with the option 4
  872. bit settings. Player code should check
  873. undefined bits in options 4 and 5 to assure
  874. they are zero.
  875. The six bits for current use are:
  876. bit # set =0 set =1
  877. ===============================================
  878. 0 short data long data
  879. 1 set XOR
  880. 2 separate info one info list
  881. for each plane for all planes
  882. 3 not RLC RLC (run length coded)
  883. 4 horizontal vertical
  884. 5 short info offsets long info offsets
  885. }
  886. ah_Pad : Array[0..15] of Byte; { This is a pad for future use for future
  887. compression modes. }
  888. end;
  889. { ***************************************************************************}
  890. const
  891. ADTM_Dummy = ($700);
  892. ADTM_LOADFRAME = ($701);
  893. { Used to load a frame of the animation }
  894. ADTM_UNLOADFRAME = ($702);
  895. { Used to unload a frame of the animation }
  896. ADTM_START = ($703);
  897. { Used to start the animation }
  898. ADTM_PAUSE = ($704);
  899. { Used to pause the animation (don't reset the timer) }
  900. ADTM_STOP = ($705);
  901. { Used to stop the animation }
  902. ADTM_LOCATE = ($706);
  903. { Used to locate a frame in the animation (as set by a slider...) }
  904. { Used to load a new format frame of the animation (V44) }
  905. ADTM_LOADNEWFORMATFRAME = ($707);
  906. { Used to unload a new format frame of the animation (V44) }
  907. ADTM_UNLOADNEWFORMATFRAME = ($708);
  908. { ***************************************************************************}
  909. { ADTM_LOADFRAME, ADTM_UNLOADFRAME }
  910. Type
  911. padtFrame = ^tadtFrame;
  912. tadtFrame = record
  913. MethodID,
  914. alf_TimeStamp, { Timestamp of frame to load }
  915. { The following fields are filled in by the ADTM_LOADFRAME method, }
  916. { and are read-only for any other methods. }
  917. alf_Frame, { Frame number }
  918. alf_Duration : longword; { Duration of frame }
  919. alf_BitMap : pBitMap; { Loaded BitMap }
  920. alf_CMap : pColorMap; { Colormap, if changed }
  921. alf_Sample : Pointer; { Sound data }
  922. alf_SampleLength,
  923. alf_Period : longword;
  924. alf_UserData : Pointer; { Used by load frame for extra data }
  925. end;
  926. { ADTM_LOADNEWFORMATFRAME, ADTM_UNLOADNEWFORMATFRAME }
  927. PadtNewFormatFrame = ^tadtNewFormatFrame;
  928. tadtNewFormatFrame = record
  929. MethodID : longword;
  930. alf_TimeStamp : longword; { Timestamp of frame to load }
  931. { The following fields are filled in by the ADTM_NEWLOADFRAME method, }
  932. { and are read-only for any other methods. }
  933. alf_Frame : longword; { Frame number }
  934. alf_Duration : longword; { Duration of frame }
  935. alf_BitMap : PBitMap; { Loaded BitMap }
  936. alf_CMap : PColorMap; { Colormap, if changed }
  937. alf_Sample : PBYTE;
  938. alf_SampleLength : longword; { Sound data }
  939. alf_Period : longword;
  940. alf_UserData : Pointer; { Used by load frame for extra data }
  941. alf_Size : longword; { Size of this data structure (in bytes) }
  942. alf_LeftSample : PBYTE; { Sound for left channel, or NULL if none }
  943. alf_RightSample : PBYTE; { Sound for right channel, or NULL if none }
  944. alf_SamplesPerSec : longword; { Replay speed; if > 0, this overrides alf_Period }
  945. end;
  946. { ADTM_START, ADTM_PAUSE, ADTM_STOP, ADTM_LOCATE }
  947. padtStart = ^tadtStart;
  948. tadtStart = record
  949. MethodID,
  950. asa_Frame : longword; { Frame # to start at }
  951. end;
  952. { *************************************************************************** }
  953. var
  954. DataTypesBase : PLibrary;
  955. const
  956. DATATYPESNAME : PChar = 'datatypes.library';
  957. function ObtainDataTypeA(type_ : CARDINAL location 'd0'; handle : POINTER location 'a0'; attrs : pTagItem location 'a1') : pDataType;
  958. SysCall DataTypesBase 036;
  959. function ObtainDataType(type_ : CARDINAL; handle : POINTER; attrs : array of LongWord) : pDataType; Inline;
  960. procedure ReleaseDataType(dt : pDataType location 'a0');
  961. SysCall DataTypesBase 042;
  962. function NewDTObjectA(name : PChar location 'd0'; attrs : pTagItem location 'a0') : CARDINAL;
  963. SysCall DataTypesBase 048;
  964. function NewDTObject(name : PChar; attrs : array of LongWord) : CARDINAL; Inline;
  965. procedure DisposeDTObject(o : CARDINAL location 'a0');
  966. SysCall DataTypesBase 054;
  967. function SetDTAttrsA(o : CARDINAL location 'a0'; win : pWindow location 'a1'; req : pRequester location 'a2'; attrs : pTagItem location 'a3') : CARDINAL;
  968. SysCall DataTypesBase 060;
  969. function SetDTAttrs(o : CARDINAL; win : pWindow; req : pRequester; attrs : array of LongWord) : CARDINAL; Inline;
  970. function GetDTAttrsA(o : CARDINAL location 'a0'; attrs : pTagItem location 'a2') : CARDINAL;
  971. SysCall DataTypesBase 066;
  972. function GetDTAttrs(o : CARDINAL; attrs : array of LongWord) : CARDINAL; Inline;
  973. function AddDTObject(win : pWindow location 'a0'; req : pRequester location 'a1'; o : CARDINAL location 'a2'; pos : LongInt location 'd0') : LongInt;
  974. SysCall DataTypesBase 072;
  975. procedure RefreshDTObjectA(o : CARDINAL location 'a0'; win : pWindow location 'a1'; req : pRequester location 'a2'; attrs : pTagItem location 'a3');
  976. SysCall DataTypesBase 078;
  977. procedure RefreshDTObject(o : CARDINAL; win : pWindow; req : pRequester; attrs : array of LongWord); Inline;
  978. function DoAsyncLayout(o : CARDINAL location 'a0'; gpl : pgpLayout location 'a1') : CARDINAL;
  979. SysCall DataTypesBase 084;
  980. function DoDTMethodA(o : CARDINAL location 'a0'; win : pWindow location 'a1'; req : pRequester location 'a2'; msg : pLongInt location 'a3') : CARDINAL;
  981. SysCall DataTypesBase 090;
  982. function DoDTMethod(o : CARDINAL; win : pWindow; req : pRequester; msg : array of LongInt) : CARDINAL; Inline;
  983. function RemoveDTObject(win : pWindow location 'a0'; o : CARDINAL location 'a1') : LongInt;
  984. SysCall DataTypesBase 096;
  985. function GetDTMethods(o : CARDINAL location 'a0') : pCARDINAL;
  986. SysCall DataTypesBase 102;
  987. function GetDTTriggerMethods(o : CARDINAL location 'a0') : pDTMethod;
  988. SysCall DataTypesBase 108;
  989. function PrintDTObjectA(o : CARDINAL location 'a0'; w : pWindow location 'a1'; r : pRequester location 'a2'; msg : pdtPrint location 'a3') : CARDINAL;
  990. SysCall DataTypesBase 114;
  991. function ObtainDTDrawInfoA(o : CARDINAL location 'a0'; attrs : pTagItem location 'a1') : POINTER;
  992. SysCall DataTypesBase 120;
  993. function ObtainDTDrawInfo(o : CARDINAL; attrs : array of LongWord) : POINTER; Inline;
  994. function DrawDTObjectA(rp : pRastPort location 'a0'; o : CARDINAL location 'a1'; x : LongInt location 'd0'; y : LongInt location 'd1'; w : LongInt location 'd2'; h : LongInt location 'd3'; th : LongInt location 'd4'; tv : LongInt location 'd5'; attrs : pTagItem location 'a2') : LongInt;
  995. SysCall DataTypesBase 126;
  996. function DrawDTObject(rp : pRastPort; o : CARDINAL; x : LongInt; y : LongInt; w : LongInt; h : LongInt; th : LongInt; tv : LongInt; attrs : array of LongWord) : LongInt; Inline;
  997. procedure ReleaseDTDrawInfo(o : CARDINAL location 'a0'; handle : POINTER location 'a1');
  998. SysCall DataTypesBase 132;
  999. function GetDTString(id : CARDINAL location 'd0') : pSHORTINT;
  1000. SysCall DataTypesBase 138;
  1001. procedure LockDataType(dt : pDataType location 'a0');
  1002. SysCall DataTypesBase 240;
  1003. function FindToolNodeA(tl : pList location 'a0'; attrs : pTagItem location 'a1') : pToolNode;
  1004. SysCall DataTypesBase 246;
  1005. function FindToolNode(tl : pList; attrs : array of LongWord) : pToolNode; Inline;
  1006. function LaunchToolA(t : pTool location 'a0'; project : pSHORTINT location 'a1'; attrs : pTagItem location 'a2') : CARDINAL;
  1007. SysCall DataTypesBase 252;
  1008. function LaunchTool(t : pTool; project : pSHORTINT; attrs : array of LongWord) : CARDINAL; Inline;
  1009. function FindMethod(methods : CARDINAL location 'a0'; id : CARDINAL location 'a1') : pCARDINAL;
  1010. SysCall DataTypesBase 258;
  1011. function FindTriggerMethod(triggermethods : pDTMethod location 'a0'; command : pSHORTINT location 'a1'; method : CARDINAL location 'd0') : pDTMethod;
  1012. SysCall DataTypesBase 264;
  1013. function CopyDTMethods(src : CARDINAL location 'a0'; include : CARDINAL location 'a1'; exclude : CARDINAL location 'a2') : pCARDINAL;
  1014. SysCall DataTypesBase 270;
  1015. function CopyDTTriggerMethods(src : pDTMethod location 'a0'; include : pDTMethod location 'a1'; exclude : pDTMethod location 'a2') : pDTMethod;
  1016. SysCall DataTypesBase 276;
  1017. procedure FreeDTMethods(m : POINTER location 'a0');
  1018. SysCall DataTypesBase 282;
  1019. function GetDTTriggerMethodDataFlags(triggermethod : CARDINAL location 'd0') : CARDINAL;
  1020. SysCall DataTypesBase 288;
  1021. function SaveDTObjectA(o : CARDINAL location 'a0'; win : pWindow location 'a1'; req : pRequester location 'a2'; file_ : PChar location 'a3'; mode : CARDINAL location 'd0'; saveicon : BOOLEAN location 'd1'; attrs : pTagItem location 'a4') : CARDINAL;
  1022. SysCall DataTypesBase 294;
  1023. function SaveDTObject(o : CARDINAL; win : pWindow; req : pRequester; file_ : PChar; mode : CARDINAL; saveicon : BOOLEAN; attrs : array of LongWord) : CARDINAL; Inline;
  1024. function StartDragSelect(o : CARDINAL location 'a0') : CARDINAL;
  1025. SysCall DataTypesBase 300;
  1026. function DoDTDomainA(o : CARDINAL location 'a0'; win : pWindow location 'a1'; req : pRequester location 'a2'; rport : pRastPort location 'a3'; which : CARDINAL location 'd0'; domain : pIBox location 'a4'; attrs : pTagItem location 'a5') : CARDINAL;
  1027. SysCall DataTypesBase 306;
  1028. function DoDTDomain(o : CARDINAL; win : pWindow; req : pRequester; rport : pRastPort; which : CARDINAL; domain : pIBox; attrs : array of LongWord) : CARDINAL; Inline;
  1029. function InitDatatypesLibrary : boolean;
  1030. implementation
  1031. function ObtainDataType(type_ : CARDINAL; handle : POINTER; attrs : array of LongWord) : pDataType; Inline;
  1032. begin
  1033. ObtainDataType:=ObtainDataTypeA(type_, handle, @attrs);
  1034. end;
  1035. function NewDTObject(name : PChar; attrs : array of LongWord) : CARDINAL; Inline;
  1036. begin
  1037. NewDTObject:=NewDTObjectA(name, @attrs);
  1038. end;
  1039. function SetDTAttrs(o : CARDINAL; win : pWindow; req : pRequester; attrs : array of LongWord) : CARDINAL; Inline;
  1040. begin
  1041. SetDTAttrs:=SetDTAttrsA(o, win, req, @attrs);
  1042. end;
  1043. function GetDTAttrs(o : CARDINAL; attrs : array of LongWord) : CARDINAL; Inline;
  1044. begin
  1045. GetDTAttrs:=GetDTAttrsA(o, @attrs);
  1046. end;
  1047. function DoDTMethod(o : CARDINAL; win : pWindow; req : pRequester; msg : array of LongInt) : CARDINAL; Inline;
  1048. begin
  1049. DoDTMethod:=DoDTMethodA(o, win, req, @msg);
  1050. end;
  1051. procedure RefreshDTObject(o : CARDINAL; win : pWindow; req : pRequester; attrs : array of LongWord); Inline;
  1052. begin
  1053. RefreshDTObjectA(o, win, req, @attrs);
  1054. end;
  1055. function ObtainDTDrawInfo(o : CARDINAL; attrs : array of LongWord) : POINTER; Inline;
  1056. begin
  1057. ObtainDTDrawInfo:=ObtainDTDrawInfoA(o, @attrs);
  1058. end;
  1059. function DrawDTObject(rp : pRastPort; o : CARDINAL; x : LongInt; y : LongInt; w : LongInt; h : LongInt; th : LongInt; tv : LongInt; attrs : array of LongWord) : LongInt; Inline;
  1060. begin
  1061. DrawDTObject:=DrawDTObjectA(rp, o, x, y, w, h, th, tv, @attrs);
  1062. end;
  1063. function FindToolNode(tl : pList; attrs : array of LongWord) : pToolNode; Inline;
  1064. begin
  1065. FindToolNode:=FindToolNodeA(tl, @attrs);
  1066. end;
  1067. function LaunchTool(t : pTool; project : pSHORTINT; attrs : array of LongWord) : CARDINAL; Inline;
  1068. begin
  1069. LaunchTool:=LaunchToolA(t, project, @attrs);
  1070. end;
  1071. function SaveDTObject(o : CARDINAL; win : pWindow; req : pRequester; file_ : PChar; mode : CARDINAL; saveicon : BOOLEAN; attrs : array of LongWord) : CARDINAL; Inline;
  1072. begin
  1073. SaveDTObject:=SaveDTObjectA(o, win, req, file_, mode, saveicon, @attrs);
  1074. end;
  1075. function DoDTDomain(o : CARDINAL; win : pWindow; req : pRequester; rport : pRastPort; which : CARDINAL; domain : pIBox; attrs : array of LongWord) : CARDINAL; Inline;
  1076. begin
  1077. DoDTDomain:=DoDTDomainA(o, win, req, rport, which, domain, @attrs);
  1078. end;
  1079. const
  1080. { Change VERSION and LIBVERSION to proper values }
  1081. VERSION : string[2] = '50';
  1082. LIBVERSION : longword = 50;
  1083. var
  1084. datatypes_exit : Pointer;
  1085. procedure CloseDatatypesLibrary;
  1086. begin
  1087. ExitProc := datatypes_exit;
  1088. if DatatypesBase <> nil then begin
  1089. CloseLibrary(PLibrary(DatatypesBase));
  1090. DatatypesBase := nil;
  1091. end;
  1092. end;
  1093. function InitDatatypesLibrary : boolean;
  1094. begin
  1095. DatatypesBase := nil;
  1096. DatatypesBase := OpenLibrary(DATATYPESNAME,LIBVERSION);
  1097. if DatatypesBase <> nil then begin
  1098. datatypes_exit := ExitProc;
  1099. ExitProc := @CloseDatatypesLibrary;
  1100. InitDatatypesLibrary:=True;
  1101. end else begin
  1102. InitDatatypesLibrary:=False;
  1103. end;
  1104. end;
  1105. end. { UNIT DATATYPES }