# Aros/Developer/Docs/Libraries/DataTypes

* Navbar for the Aros wikibook
* Aros User
* Aros User Docs
* Aros User FAQs
* Aros User Applications
* Aros User DOS Shell
* Aros/User/AmigaLegacy
* Aros Dev Docs
* Aros Developer Docs
* Porting Software from AmigaOS/SDL
* For Zune Beginners
* Zune .MUI Classes
* For SDL Beginners
* Aros Developer BuildSystem
* Specific platforms
* Aros x86 Complete System HCL
* Aros x86 Audio/Video Support
* Aros x86 Network Support
* Aros Intel AMD x86 Installing
* Aros Storage Support IDE SATA etc
* Aros Poseidon USB Support
* x86-64 Support
* Motorola 68k Amiga Support
* Linux and FreeBSD Support
* Windows Mingw and MacOSX Support
* Android Support
* Arm Raspberry Pi Support
* PPC Power Architecture
* misc
* Aros Public License

## Introduction

The datatypes.library was introduced to decode file formats (#?.png #?.jpg etc.) easily using different classes which can be installed as they are needed.
First you should learn about BOOPSI (Amiga OOP object oriented system). Once understand, it's makes it easier to understand datatypes, MUI, etc
The descriptors in devs/datatypes contain the information how to identify a file type. Usually the file is opened only once by datatypes.library and a small buffer is used for comparisons which contains the first few bytes of the file (64 bytes IIRC).
dt descriptor is related to the struct DataTypeHeader dth_Name, dth_BaseName, etc.
Most datatype descriptors are held very simple, for example "compare the first 12 bytes with the pattern FORM????ILBM". The comparison is done by datatypes.library, there is no foreign code involved.
Only very few descriptors actually contain code. In this code everything can be done, though. For example, the code can close and reopen the file and read it entirely if needed. But this should not be done because identification needs to be very fast.
Dtdesc tool (and accompanied documentation) createdtdesc package is aimed at creating (picture) datatypes (as a whole, including makefiles). dtdescr is aimed at (only) viewing and creating the descriptor.
Once the file type is identified and the application wants to load the file, the class library from classes/datatypes is called. This library contains the code to decode the file contents and to make it available to datatypes.library.
Datatypes consist of a few libraries that exposes a couple of methods to load and save pictures of a certain type. Internally there is a 'common' storage method of the pixels that is used by the picture datatype, and so each 'library' that can handle its own type is able to 'convert' this common storage method into a specific format or load to this specific format.
The datatypes system itself exposes methods for the developer/user that allows for easy loading and saving by just calling some functions.
The only problem with AmigaOS implementation of datatypes is that they aren't really bidirectional. You can generally only save in IFF but AROS aspires to bring the original idea back
The ideal implementation would allow each datatype superclass (picture.datatype, sound.datatype etc.) to provide a list of all currently known sub-classes that support encoding. You'd then be able to pick one and encode data for that datatype and write it out to disk in that format.
Wanderer (AROS WB replacement) does not utilise the datatype subsystem directly "except" for loading window background imagery. The datatype system cannot deal with progressive loading and streaming yet.

## How to Use

create a Datatype Object, use the NewDTObject function ...
The parameters of this functions uses Tags as defined in datatypes/datatypesclasses.h and intuition/gadgetclass.h
Once a datatype object is no longer required, it is disposed of and memory released: e.g.
To get attributes from a datatype object, you can use the GetDTAttrs function e.g.
and examining the results from the dtn structure you can retrieve:
The function GetDTString returns a localised Datatypes string of the id given. This string could be syst, text, docu, soun, inst, musi, pict, anim or movi (see datatypes.h). e.g.
opening a file and know the base class it is, you just need:
The DTA_GroupID tag ensure that the file is of that type. Otherwise you'll get problems later when you try to read data.
You'll need to use GetDTAttrs or call some methods before DisposeDTObject, if you want to do anything useful.
If you merely want to find out what filetype a file is, you need something like:
You can then open the file and handle it as per the base type dth_GroupID
what you usually do is, to create an object (initial state), get/set some attributes (attribute change) and then do layout or extract a type.
in that case there many programs that call remap but doesn't have a gpinfo structure.
is there some info what remap have on initial state ?
AROS dt set it to true.
when a program has no gpinfo with screen, then remap should be set to false. Maybe AmigaOS AOS does that somewhere.
same can happen on AROS dt too, maybe on AOS dt bitmap (state change and get/set); however it is not clearly defined in which way state changes may affect attributes (screen, colors) or what happens in case some attributes have not been set prior triggering the state change; it's not even exactly clear which states are possible
Your application can find out when a refresh is appropriate by using the Boopsi ICATarget attribute with the ICTargetIDCMP value. This causes the datatype (gadget) to send an IDCMP_IDCMPUpdate IntuiMessage to the window port on certain status changes. That message carries a pointer to one or more attributes and if DTA_Sync is in that list with a value of 1 then the datatype object is ready for refresh.
You get one of these on attaching the datatype object to your window, and also a stream of them when the window is resized.
In order to create a jpeg datatype object (jpeg subclass of picture class)
DTImage = NewDTObject(NULL, DTA_SourceType, DTST_RAM, DTA_BaseName, "jpeg", PDTA_DestMode, PMODE_V43, TAG_DONE);

### Text

AROS/workbench/classes/datatypes/text/ V44.5 of the text.datatype replacement sebauer@t-online.de (Sebastian Bauer)
Most OS outside AROS prefer XML but others like doc, docx, ood, rtf, etc
Originally, FTXT was used by the the clipboard for cut/copy function on AmigaOS, current apps use only use raw ASCII data. IFF FTXT is supposed to be Formatted TeXT, but there's very little formatting apparently supported, and this impacts what can be put on the clipboard too (copying a table with all the formatting intact is not easy).

### Picture

AROS/workbench/classes/datatypes/picture/

### Sound

AROS/workbench/classes/datatypes/sound.datatype based on Stephan Rupprechts sounddt 41 from Aminet
only have two sound datatypes for AROS those being Wave Datatype & 8SVX Datatype. The 8SVX datatype first looked at OM_NEW & Read8SVX. But the Read Function doesn't test for DTST_RAM & an empty filehandle
8bit sound only with 16bit 32bit still needed

### Animation
## Creating New Datatypes
### Text

Other text sub-classes are
The original specs provided some support for FTXT, an IFF “data section” or “FORM type” Text is stored in one or more “CHRS” chunks inside an FTXT. Each CHRS contains a stream of 8-bit text compatible with ANSI/ISO standard
* C0 terminal control characters in the range NUL (hex 00) through hex 1F. Only LF (hex 0A) and ESC (hex 1B) are significant. ESC begins a control sequence. LF is the line terminator, CR (hex 0D) is not recognized as terminator.
* G0 gui graphic characters in the range hex 20 through hex 7F. SP (hex 20) is the space character. DEL (hex 7F) is the delete character which is not used. The rest are the standard ASCII printable characters “!” (hex 21) through “~” (hex 7E).
* C1 extended control characters in the range hex 80 through hex 9F. The control sequence starting with CSI (hex 9B) is used for FTXT formatting. All other control sequences and C1 control characters are unused.
* G1 is the group of extended graphic characters in the range NBSP (hex A0) through “y” (hex FF).
optional “FONS” holds a FontSpecifier as below. It assigns a font to a numbered register so it can be referenced by number within other CHRS chunks. CHRS text uses font 1 until another font is chosen. If font 1 hasn’t been specified, the selected system font is used as font 1. The SGR sequence has parameters 10-19 to select from ten pre-defined fonts meaning only ten FONS chunks would be meaningful within an IFF FTXT file
If application programmers ever start using formatted text as per the FTXT specification, other programmers can no longer assume the clipboard to only include plain text data. Therefore, they'll need to implement proper control-code stripping (again, as per the FTXT specification) in their clipboard handling routines

### Picture

Other datatypes for image files that can store multiple images such as INFO, ICO, ICNS, etc. added "WhichPicture" & "GetNumPictures" PDTA Methods to the AROS picture datatype. We can display multiple images using picture datatypes!
It would be easy to add a function to Count Image Directories (IFD's) for GetNumPictures.
TIFF Datatype can count directories using PDTA_GetNumPictures and it can set a directory current using PDTA_WhichPicture. So now it can display Multiple Images.

### Sound

Sound Datatype the Sound_Write function is the SuperMethod. Normally when a datatype has two methods: OM_NEW & DTM_WRITE. The first links the Load function of the datatype with Datatypes Library for getting new datatypes. The second links the Save function of the datatype or if DT Write Method is not DTWM_RAW then it is supposed to defer to the SuperMethod. In this case it would send the DTWM_IFF message to the Sound Datatype function Sound_Write
Should it be better to use DTMethod to decompress on a buffer and then use this uncompressed buffer ? For sound, get the data using the SDTA_Sample (or SDTA_LeftSample/SDTA_RightSample) attributes. You can retrieve sample data using SDTA_Sample tag but AmigaOS lacks support for SDTA_SampleType so you can get only 8-bit sample data there. AROS and MorphOS are more advanced there.
Any applications will query the methods supported by your class. Make sure that if you choose to implement support for the OM_GET/DTA_Methods tag the methods you return should also include the methods supported by your superclass. Otherwise, the user will be unable to use functions such as "Copy" or "Print".

### Hypertext

AmigaOS users experimented with this to provide HTML, pictures, animations and audio combined
AROS has nothing like this so far

### How to compile datatypes

Build dtdesc tool, this is what you need. The source is located in tools/dtdesc. This tool is used in order to make a datatype descriptor from .dtd file. Class library is built in a usual way, using a usual crosscompiler.
A package so that it will be easy to build datatypes independently of the whole build system. Compiled createdtdesc and examinedtdesc for native AROS. One other tool that is needed is genmodule.
What is needed is a READ/WRITEPIXELARRAY interface, that replaces the former SET PDTA_BitMap and GET PDTA_DestBtMap interface. If a Bitmap was SET (legacy interface), it gets converted to LUT8 format during layout. A destination BitMap is only created, if this is set by Prefs or an applications requests it by GET PDTA_DestBitMap.
RENDER Method chooses one of these functions for displaying
* cgfx/WritePixelArray: Truecolor pic -> Truecolor screen
* cgfx/WriteLUTPixelArray: Colormapped pic -> Truecolor screen
* graphics/WriteChunkyPixels: Colormapped pic -> Colormapped chunky screen
* graphics/BltBitMapRastPort: Colormapped pic -> Colormapped planar screen
Truecolor pic -> Colormapped screen is handled during layout, with a fixed colormap and some simple but fast dithering algorithm (one dimensional error propagation). Floyd-Steinberg dithering algorithm could be used for slightly better results (two dimensional error propagation). Much better results could be obtained by a calculated colormap (e.g. median cut algorithm), but this is much slower.
Colormapped data is always stored in LUT8 format, or BitMap format for legacy. Truecolor data is always stored in ARGB format. This isn't memory effective, but makes things more simple and faster. Some optimization could be done here.
Created a template for new graphic datatypes here.

### Streaming

The datatype system cannot deal with progressive loading and streaming yet.

## References

* V30 Amiga OS 2
* V40 Amiga OS 3
* V44 Amiga OS 3.5+
Commodore and Electronics Arts developed the IFF (Interchangable File Format) to cover pictures (ILBM), sound (8SVX) and text (FTXT) etc. So for AmigaOS 3.0 introduced the Datatype library which can decode file formats easily using different classes which can be installed as they are needed.
Include the following headers to use datatypes:
To use datatypes, you need to open the datatypes library along with the other libraries in your program:
DataTypesBase = OpenLibrary ("datatypes.library", 39)
To create a Datatype Object, use the NewDTObject function as below:
The type of source that Datatypes can use include Clipboard (DTST_CLIPBOARD), a file (DTST_FILE), RAM (DTST_RAM, DTST_MEMORY), or a hotlink (DTST_HOTLINK).
The group of objects you can use for Datatypes include:
Example, read a object from the clipboard:
The parameters of this functions uses Tags as defined in datatypes/datatypesclasses.h and intuition/gadgetclass.h
This example read a file to be displayed from 'pathname' and it is of type picture (ILBM, JPEG, GIF, PNG etc):
Once we have a datatype loaded with NewDTObject, the program should create a window and then the datatype object can be added to window or a requester, simply with single command:
LONG realposition = AddDTObject( struct Window *win, struct Requester *req, Object *obj, LONG pos);
Parameters:
realpos = AddDTObject(win, NULL, pictDT, -1);
Once a datatype object is no longer required, it is removed from the window and disposed and memory released
position = RemoveDTObject(window, object);
void DisposeDTObject(Object *o)
RemoveDTObject(win, gd->gd_DisplayObject);
DisposeDTObject (gd->gd_DisplayObject);
To get attributes from a datatype object, you can use the the GetDTAttrs function
GetDTAttrs (gd->gd_DisplayObject, DTA_DataType, (ULONG)&dtn, TAG_DONE);
and examing the results from the dtn structure you can retreive:
The function GetDTString returns a localised Datatypes string of the id given. This string could be syst, text, docu, soun, inst, musi, pict, anim or movi (see datatypes.h).
GetDTString (dtn->dtn_Header->dth_GroupID)
Other functions available for datatypes: ObtainDataType, ReleaseDataType, SetDTAttrs, RefreshDRObject, DoAsyncLayout, DoDTMethod, GetDTMethods, DTMethods, PrintDTObject.
datatypes
Index AddDTObject CopyDTMethods CopyDTTriggerMethods DisposeDTObject DoAsyncLayout DoDTDomainA DoDTMethodA DrawDTObjectA FindMethod FindToolNodeA FindTriggerMethod FreeDTMethods GetDTAttrsA GetDTMethods GetDTString GetDTTriggerMethodDataFlags GetDTTriggerMethods LaunchToolA LockDataType NewDTObjectA ObtainDataTypeA ObtainDTDrawInfoA PrintDTObjectA RefreshDTObjectA ReleaseDataType ReleaseDTDrawInfo RemoveDTObject SaveDTObjectA SetDTAttrsA StartDragSelect
AddDTObject
LONG AddDTObject(
Function
Add an object to the window 'win' or requester 'req' at the position in the gadget list specified by the 'pos' argument.
Inputs
win -- window the object should be added to; may be NULL in which case
req -- requester the object should be added to obj -- the object to add; may be NULL in which case nothing is done pos -- the position of the object in the list
Result
The position where the object was added (may be different from what you asked for).
Notes
The object will receice a GM_LAYOUT message with the gpl_Initial field set to 1 when the object is added.
See also RemoveDTObject intuition.library/AddGList
CopyDTMethods
ULONG * CopyDTMethods(
Function
Copy and modify an array of methods. This is used by subclass implementors who want to add supported methods to an existing class.
Inputs
methods -- array of methods; may be NULL include -- array of methods to include terminated with ~0UL; may be NULL method -- array of methods to exclude terminated with ~0UL; may be NULL.
Result
The new array of methods or NULL if something went wrong (like out of memory).
See also
FindMethod CopyDTTriggerMethods FreeDTMethods
CopyDTTriggerMethods
struct DTMethod * CopyDTTriggerMethods(
Function
Copy and modify an array of DTMethod:s. This is used by subclass implementors who want to add supported methods to an existing class.
Inputs
methods -- array of methods; may be NULL include -- array of methods to include terminated with ~0UL; may be NULL method -- array of methods to exclude terminated with ~0UL; may be NULL
Result
The new array of methods or NULL if something went wrong (like out of memory).
Notes
dtm_Label and dtm_Command must be valid as long as the object exists as they are not copied.
methods to its superclass.
See also
FindTriggerMethod CopyDTMethods FreeDTMethods
DisposeDTObject
void DisposeDTObject(
Function
Dispose a data type object obtained by NewDTObjectA.
Inputs
o -- The data type object to dispose of; may be NULL.
See also
NewDTObjectA DoAsyncLayout Synopsis
ULONG DoAsyncLayout(
Function
Perform an object's DTM_ASYNCLAYOUT method -- doing it asynchronously off loads the input.device. The method should exit when a SIGBREAK_CTRL_C is received; this signal means that the data is obsolete and the method will be called again.
Inputs
object -- pointer to data type object gpl -- gpLayout message pointer
DoDTDomainA Synopsis
ULONG DoDTDomainA(
ULONG DoDTDomain(
Function
Obtain the maximum/minimum/nominal domains of a data type object.
Inputs
o -- data type object in question win -- window that the object is attached to req -- requester the object is attached to rport -- rastport; used for domain calculations which -- the domain to obtain (GDOMAIN_, see <intuition/gadgetclass.h> domain -- the result will be put here attrs -- additional attributes (subclass specific)
Result
The return value of GM_DOMAIN or 0 if an error occurred. The 'domain' IBox will be filled with the requested values as a side effect.
Notes
This function requires an object to perform the GM_DOMAIN method. To achieve similar results without an object, you must use CoerceMethodA manually.
See also intuition/gadgetclass.h
DoDTMethodA
IPTR DoDTMethodA(
IPTR DoDTMethod(
Function
Perform a specific datatypes methodl.
Inputs
o -- pointer to data type object win -- window the object is attached to req -- requester the object is attached to msg -- the message to send to the object
Result
The value returned by the specified method.
See also
intuition.library/DoGadgetMethodA
DrawDTObjectA
LONG DrawDTObjectA(
LONG DrawDTObject(
Function
Draw a data type object into a RastPort. You must have successfully called ObtainDTDrawInfoA before calling this function; it invokes the object's DTM_DRAW method.
Inputs
rp -- pointer to the RastPort to draw the object into o -- pointer to the data type object to draw x -- left edge of drawing area y -- top edge of drawing area w -- width of drawing area h -- height of drawing area th -- horizontal top in units tv -- vertical top in units attrs -- additional attributes
Tags
ADTA_Frame for animationclass objects (selects the frame that should be drawn.
Result
TRUE if rendering went OK, FALSE if failure.
Notes
The RastPort in question must support clipping, i.e. have a valid layer structure attached to it; if not, some datatypes can't draw and FALSE will be returned.
See also ObtainDataTypeA
FindMethod
ULONG * FindMethod(
Function
Search for a specific method in a array of methods.
Inputs
methods -- array of methods; may be NULL searchmethodid -- method to search for
Result
Pointer to method table entry or NULL if the method wasn't found.
See also
GetDTMethods CopyDTMethods
FindToolNodeA
struct ToolNode * FindToolNodeA(
struct ToolNode * FindToolNode(
Function
Search for a specific tool in a list of given tool nodes.
Inputs
toollist -- a list or a struct ToolNode * (which will be skipped) to
attrs -- search tags; if NULL, the result of the function will
Tags
TOOLA_Program -- name of the program to search for
TOOLA_Which -- one of the TW_#? types
TOOLA_LaunchType -- launch mode: TF_SHELL, TF_WORKBENCH or TF_RX
Result
A pointer to a ToolNode describing the search result (NULL for failure).
Notes
The entries in dt->dtn_ToolList are valid as long as a lock is kept on the data type 'dt' (ObtainDataTypeA or LockDataType).
See also LaunchToolA
FindTriggerMethod
struct DTMethod * FindTriggerMethod(
Function
Search for a specific trigger method in a array of trigger methods (check if either 'command' or 'method' matches).
Inputs
methods -- array of trigger methods; may be NULL command -- name of trigger method (may be NULL; if so, 'command'
method -- id of trigger method to search for (may be ~0; if so, don't
Result
Pointer to trigger method table entry (struct DTMethod *) or NULL if the method wasn't found.
See also GetDTTriggerMethods CopyDTTriggerMethods
FreeDTMethods
VOID FreeDTMethods(
Function
Free array obtained from CopyDTMethods or CopyDTTriggerMethods.
Inputs
methods -- array of methods; may be NULL
See also
CopyDTMethods CopyDTTriggerMethods GetDTAttrsA Synopsis
ULONG GetDTAttrsA(
ULONG GetDTAttrs(
Function
Get the attributes of a specific data type object.
Inputs
o -- pointer to a data type object; may be NULL attrs -- the attributes to get terminated with TAG_DONE; each Tag's
Result
The number of attributes obtained.
Notes
(#1) - On AROS, the "DataType" an object returns may be a clone of
See also SetDTAttrsA intuition.library/GetAttr
GetDTMethods
ULONG * GetDTMethods(
Function
Get a list of the methods an object supports.
Inputs
object -- pointer to a data type object
Result
Pointer to a ULONG array which is terminated ~0; the array is only valid until the object is disposed of.
See also GetDTTriggerMethods
GetDTString
CONST_STRPTR GetDTString(
Function
Get a pointer to a localized datatypes string.
Inputs
id -- ID of the string to get
Result
Pointer to a NULL terminated string.
GetDTTriggerMethodDataFlags
ULONG GetDTTriggerMethodDataFlags(
Function
Get the kind of data that may be attached to the stt_Data field in the dtTrigger method body. The data type can be specified by or:ing the method id (within the STMF_METHOD_MASK value) with one of the STMD_ identifiers.
STMD_VOID -- stt_Data must be NULL STMD_ULONG -- stt_Data contains an unsigned value STMD_STRPTR -- stt_Data is a pointer to a string STMD_TAGLIST -- stt_Data points to an array of struct TagItem terminated
The trigger methods below STM_USER are explicitly handled as described in <datatypes/datatypesclass.h>.
Inputs
method -- dtt_Method ID from struct DTMethod
Result
One of the STMD_ identifiers defined in <datatypes/datatypesclass.h>
See also CopyDTTriggerMethods FindTriggerMethod
GetDTTriggerMethods
struct DTMethod * GetDTTriggerMethods(
Function
Get a list of the trigger methods an object supports.
Inputs
object -- pointer to a data type object
Result
A pointer to a STM_DONE terminated DTMethod list. This list in only valid until the object is disposed of.
Example
To call the specific method, do the following:
DoMethod(object, DTM_TRIGGER, myMethod);
Notes
Some trigger methods requires an argument (calling these with a NULL argument is wrong). Use GetDTTriggerMethodDataFlags to obtain the type of the requested argument.
See also GetDTMethods
LaunchToolA
ULONG LaunchToolA(
ULONG LaunchTool(
Function
Launch an application with a particular project.
Inputs
tool -- tool to use (may be NULL in which case this function
project -- name of the project to execute or NULL attrs -- additional attributes
Tags
NP_Priority (BYTE) -- priority of the launched tool (default is the
NP_Synchronous (BOOL) -- don't return until launched application process
Result
Zero for failure, non-zero otherwise.
See also NewDTObjectA
LockDataType
VOID LockDataType(
Function
Lock a DataType structure obtained from ObtainDataTypeA or a data type object (DTA_DataType).
Inputs
dt -- DataType structure; may be NULL
Notes
Calls to LockDataType and ObtainDataTypeA must have a corresponding ReleaseDataType call or else problems will arise.
See also ObtainDataTypeA ReleaseDataType
NewDTObjectA
Object * NewDTObjectA(
Object * NewDTObject(
Function
Create a data type object from a BOOPSI class.
Inputs
name -- name of the data source; generally an existing file name attrs -- pointer to a TagList specifying additional arguments
Tags
DTA_SourceType -- The type of source data (defaults to DTST_FILE).
DTA_Handle -- Can be used instead of the 'name' field. If the
DTA_DataType -- The class of the data. Data is a pointer to a valid
DTA_GroupID -- If the object isn't of this type, fail with an IoErr
GA_Left GA_RelRight GA_Top GA_RelBottom GA_Width GA_RelWidth GA_Height GA_RelHeight -- Specify the position of the object relative to the
GA_ID -- ID of the object.
GA_UserData -- Application specific data for the object.
GA_Previous -- Previous object / gadget in the list.
Result
A BOOPSI object. This may be used in different contexts such as a gadget or image. NULL indicates failure -- in that case IoErr gives more information:
ERROR_REQUIRED_ARG_MISSING -- A required attribute wasn't specified.
ERROR_BAD_NUMBER -- The group ID specified was invalid.
ERROR_OBJECT_WRONG_TYPE -- Object data type doesn't match DTA_GroupID.
Notes
This function invokes the method OM_NEW for the specified class.
The object should (eventually) be freed by DisposeDTObject when no longer needed.
See also AddDTObject DisposeDTObject RemoveDTObject intuition.library/NewObjectA
ObtainDataTypeA
struct DataType * ObtainDataTypeA(
struct DataType * ObtainDataType(
Function
Examine the data pointed to by 'handle'.
Inputs
type -- specifies the stream-type of 'handle', using one of the following types;
handle -- handle to return a datatype for. attrs -- additional attributes.
Result
A pointer to a DataType or NULL if failure. IoErr gives more information in the latter case:
ERROR_NO_FREE_STORE -- Not enough memory available ERROR_OBJECT_NOT_FOUND -- Unable to open the data type object ERROR_NOT_IMPLEMENTED -- Unknown handle type
See also ReleaseDataType
ObtainDTDrawInfoA
APTR ObtainDTDrawInfoA(
APTR ObtainDTDrawInfo(
Function
Prepare a data type object for drawing into a RastPort; this function will send the DTM_OBTAINDRAWINFO method the object using an opSet message.
Inputs
o -- pointer to the data type object to obtain the drawinfo for;
attrs -- additional attributes
Tags
None defined so far.
Result
A private handle that must be passed to ReleaseDTDrawInfo when the application is done drawing the object, or NULL if failure.
See also DrawDTObjectA ReleaseDTDrawInfo
PrintDTObjectA
ULONG PrintDTObjectA(
ULONG PrintDTObject(
Function
Perform an object's DTM_PRINT method in an asynchronous manner.
Inputs
object -- pointer to the data type object window -- pointer to the window the object has been added to requester -- pointer to the requester the object has been added to
Result
TRUE on success, FALSE otherwise.
Notes
When an application has called PrintDTObjectA it must not touch the printerIO union until a IDCMP_IDCMPUPDATE is received which contains the DTA_PrinterStatus tag.
This will signal the print process with a SIGBREAK_CTRL_C.
RefreshDTObjectA
void RefreshDTObjectA(
void RefreshDTObject(
Function
Refresh a specified object sending the GM_RENDER message to the object.
Inputs
object -- pointer to the data type object to refresh; may be NULL window -- pointer to the window; may be NULL req -- must be NULL attrs -- additional attributes (currently none defined)
See also AddDTObject RemoveDTObject intuition.library/RefreshGList
ReleaseDataType
VOID ReleaseDataType(
Function
Release a DataType structure aquired by ObtainDataTypeA.
Inputs
dt -- DataType structure as returned by ObtainDataTypeA; NULL is
See also
ObtainDataTypeA ReleaseDTDrawInfo Synopsis
VOID ReleaseDTDrawInfo(
Function
Release the handle obtained from ObtainDTDrawInfoA; invokes the object's DTM_RELEASEDRAWINFO method sending the dtReleaseDrawInfo message.
Inputs
o -- pointer to the data type object the drawinfo of which to
handle -- handle got from ObtainDTDrawInfoA
Result
A private handle that must be passed to ReleaseDTDrawInfo when the application is done drawing the object, or NULL if failure.
See also DrawDTObjectA ObtainDTDrawInfoA
RemoveDTObject
LONG RemoveDTObject(
Function
Remove an object from the specified window's object list; this will wait until the AsyncLayout process is ready. The object will receive a message of type DTM_REMOVEDTOBJECT as a sign of it having been removed.
Inputs
window -- pointer to the window in question object -- pointer to the object to remove
Result
The position of the object in the list before it was removed; if the object wasn't found -1 is returned.
See also AddDTObject intuition.library/RemoveGList
SaveDTObjectA
ULONG SaveDTObjectA(
ULONG SaveDTObject(
Function
Save the contents of an object to a file using DTM_WRITE.
Inputs
o -- data type object to write to a file win -- window the object is attached to req -- requester the object is attached to file -- name of the file to save the object to mode -- save mode (RAW, IFF etc.), one of the DTWM_ identifiers saveicon -- should an icon be saved together with the file attrs -- additional attributes (these are subclass specific)
Result
The return value of DTM_WRITE.
Notes
If DTM_WRITE returns 0, the file will be deleted.
SetDTAttrsA
ULONG SetDTAttrsA(
ULONG SetDTAttrs(
Function
Set the attributes of a data type object.
Inputs
o -- pointer to the data type object the attributes of which to set win -- window that the object has been added to attrs -- attributes to set (terminated with TAG_DONE)
See also GetDTAttrsA intuition.library/SetGadgetAttrsA datatypes/datatypesclass.h
StartDragSelect
ULONG StartDragSelect(
Function
Start drag-selection by the user; the drag selection will only start if the object in question supports DTM_SELECT, is in a window or requester and no layout-process is working on the object.
Inputs
o -- data type object in question; may be NULL
Result
TRUE if all went OK, FALSE otherwise. If FALSE, IoErr gives further information:
ERROR_ACTION_NOT_KNOWN -- the object doesn't support DTM_SELECT ERROR_OBJECT_IN_USE -- the object is currently occupied

### animation.class

Implement the animation.datatype (including boopsi control gadget). Must also provide a child datatype (ie avi, mpeg, divx or any other usable format) and a basic application to demonstrate functionality animation.datatype -- root data type for animations. The animation.datatype is the super-class for any animation related classes.
This class creates the controls, scaling, remapping and synchronization.
Draw a data type object into a RastPort. You must have successfully called ObtainDTDrawInfoA before calling this function; it invokes the object's DTM_DRAW method.
ADTA_Frame Tag for animationclass objects (selects the frame that should be drawn.
TRUE if rendering went OK, FALSE if failure. The RastPort in question must support clipping, i.e. have a valid layer structure attached to it; if not, some datatypes can't draw and FALSE will be returned.

## Examples

that's code of diskobjpngio.c.read

### sound function

assume you are trying to manipulate images? Load images using datatypes but read image data to ARGB array using ReadPixelArray methods and dispose source object. For images, to get the raw data use PDTM_READPIXELARRAY (that's the uncompressed data).