Documented GVF_SAVE_VAR alongside other flags, and removed a query/doubt
[AROS.git] / rom / usb / classes / ptp / ptp.h
blobee1b4898153c7c0ad38cd0ebc449fb4582d4fa06
1 #ifndef PTP_H
2 #define PTP_H
4 #include <intuition/intuition.h>
5 #include <intuition/intuitionbase.h>
6 #include <libraries/mui.h>
7 #include <libraries/gadtools.h>
9 #if defined(__GNUC__)
10 # pragma pack(2)
11 #endif
13 #define ID_ABOUT 0x55555555
14 #define ID_STORE_CONFIG 0xaaaaaaaa
15 #define ID_DEF_CONFIG 0xaaaaaaab
17 struct ClsDevCfg
19 ULONG cdc_ChunkID;
20 ULONG cdc_Length;
21 ULONG cdc_EnableMTP;
22 char cdc_DOSName[32];
23 ULONG cdc_NoPartObj;
26 struct ObjectFmtMapping
28 UWORD ofm_ID;
29 STRPTR ofm_Suffix;
32 /* Container Types */
33 #define PCT_COMMAND 1
34 #define PCT_DATA 2
35 #define PCT_RESPONSE 3
36 #define PCT_EVENT 4
38 struct PTPEvent
40 ULONG pe_Length; /* Interrupt Data Length */
41 UWORD pe_ContainerType; /* Container Type == Event */
42 UWORD pe_EventCode; /* The PIMA 15740 Event Code */
43 ULONG pe_TransID; /* Transaction ID */
44 ULONG pe_EventParam[3]; /* Event Parameters */
47 struct PTPOp
49 ULONG po_Length; /* Length of request */
50 UWORD po_ContainerType; /* Container Type */
51 UWORD po_OpCode; /* Operation Code */
52 //ULONG po_SessionID; /* Session ID */
53 ULONG po_TransID; /* Transaction ID */
54 ULONG po_Param[5]; /* Parameters */
56 ULONG po_NumParam;
59 struct PTPResponse
61 ULONG pr_Length; /* Length of request */
62 UWORD pr_ContainerType; /* Container Type */
63 UWORD pr_RespCode; /* Response Code */
64 //ULONG pr_SessionID; /* Session ID */
65 ULONG pr_TransID; /* Transaction ID */
66 ULONG pr_Param[5]; /* Parameters */
68 LONG pr_IOErr;
69 ULONG pr_NumParam;
71 ULONG pr_DataLength;
75 /* PTP Operation Codes */
76 #define POC_UNDEFINED 0x1000
77 #define POC_GETDEVICEINFO 0x1001
78 #define POC_OPENSESSION 0x1002
79 #define POC_CLOSESESSION 0x1003
80 #define POC_GETSTORAGEIDS 0x1004
81 #define POC_GETSTORAGEINFO 0x1005
82 #define POC_GETNUMOBJECTS 0x1006
83 #define POC_GETOBJECTHANDLES 0x1007
84 #define POC_GETOBJECTINFO 0x1008
85 #define POC_GETOBJECT 0x1009
86 #define POC_GETTHUMB 0x100A
87 #define POC_DELETEOBJECT 0x100B
88 #define POC_SENDOBJECTINFO 0x100C
89 #define POC_SENDOBJECT 0x100D
90 #define POC_INITIATECAPTURE 0x100E
91 #define POC_FORMATSTORE 0x100F
92 #define POC_RESETDEVICE 0x1010
93 #define POC_SELFTEST 0x1011
94 #define POC_SETOBJECTPROTECTION 0x1012
95 #define POC_POWERDOWN 0x1013
96 #define POC_GETDEVICEPROPDESC 0x1014
97 #define POC_GETDEVICEPROPVALUE 0x1015
98 #define POC_SETDEVICEPROPVALUE 0x1016
99 #define POC_RESETDEVICEPROPVALUE 0x1017
100 #define POC_TERMINATEOPENCAPTURE 0x1018
101 #define POC_MOVEOBJECT 0x1019
102 #define POC_COPYOBJECT 0x101A
103 #define POC_GETPARTIALOBJECT 0x101B
104 #define POC_INITIATEOPENCAPTURE 0x101C
106 /* PTP Result Codes */
107 #define PRC_UNDEFINED 0x2000
108 #define PRC_OK 0x2001
109 #define PRC_GENERALERROR 0x2002
110 #define PRC_SESSIONNOTOPEN 0x2003
111 #define PRC_INVALIDTRANSACTIONID 0x2004
112 #define PRC_OPERATIONNOTSUPPORTED 0x2005
113 #define PRC_PARAMETERNOTSUPPORTED 0x2006
114 #define PRC_INCOMPLETETRANSFER 0x2007
115 #define PRC_INVALIDSTORAGEID 0x2008
116 #define PRC_INVALIDOBJECTHANDLE 0x2009
117 #define PRC_DEVICEPROPNOTSUPPORTED 0x200A
118 #define PRC_INVALIDOBJECTFORMATCODE 0x200B
119 #define PRC_STOREFULL 0x200C
120 #define PRC_OBJECTWRITEPROTECTED 0x200D
121 #define PRC_STOREREADONLY 0x200E
122 #define PRC_ACCESSDENIED 0x200F
123 #define PRC_NOTHUMBNAILPRESENT 0x2010
124 #define PRC_SELFTESTFAILED 0x2011
125 #define PRC_PARTIALDELETION 0x2012
126 #define PRC_STORENOTAVAILABLE 0x2013
127 #define PRC_SPECIFICATIONBYFORMATUNSUPPORTED 0x2014
128 #define PRC_NOVALIDOBJECTINFO 0x2015
129 #define PRC_INVALIDCODEFORMAT 0x2016
130 #define PRC_UNKNOWNVENDORCODE 0x2017
131 #define PRC_CAPTUREALREADYTERMINATED 0x2018
132 #define PRC_DEVICEBUSY 0x2019
133 #define PRC_INVALIDPARENTOBJECT 0x201A
134 #define PRC_INVALIDDEVICEPROPFORMAT 0x201B
135 #define PRC_INVALIDDEVICEPROPVALUE 0x201C
136 #define PRC_INVALIDPARAMETER 0x201D
137 #define PRC_SESSIONALREADYOPEN 0x201E
138 #define PRC_TRANSACTIONCANCELLED 0x201F
139 #define PRC_SPECIFICATIONOFDESTINATIONUNSUPPORTED 0x2020
141 /* PTP Object Format Codes */
142 #define POF_UNDEFINED 0x3000
143 #define POF_ASSOCIATION 0x3001
144 #define POF_SCRIPT 0x3002
145 #define POF_EXECUTABLE 0x3003
146 #define POF_TEXT 0x3004
147 #define POF_HTML 0x3005
148 #define POF_DPOF 0x3006
149 #define POF_AIFF 0x3007
150 #define POF_WAV 0x3008
151 #define POF_MP3 0x3009
152 #define POF_AVI 0x300A
153 #define POF_MPEG 0x300B
154 #define POF_ASF 0x300C
155 #define POF_UNDEFINED2 0x3800
156 #define POF_EXIF_JPEG 0x3801
157 #define POF_TIFF_EP 0x3802
158 #define POF_FLASHPIX 0x3803
159 #define POF_BMP 0x3804
160 #define POF_CIFF 0x3805
161 #define POF_UNDEFINED3 0x3806
162 #define POF_GIF 0x3807
163 #define POF_JFIF 0x3808
164 #define POF_PCD 0x3809
165 #define POF_PICT 0x380A
166 #define POF_PNG 0x380B
167 #define POF_UNDEFINED4 0x380C
168 #define POF_TIFF 0x380D
169 #define POF_TIFF_IT 0x380E
170 #define POF_JP2 0x380F
171 #define POF_JPX 0x3810
173 /* PTP Event Codes */
174 #define PEC_UNDEFINED 0x4000
175 #define PEC_CANCELTRANSACTION 0x4001
176 #define PEC_OBJECTADDED 0x4002
177 #define PEC_OBJECTREMOVED 0x4003
178 #define PEC_STOREADDED 0x4004
179 #define PEC_STOREREMOVED 0x4005
180 #define PEC_DEVICEPROPCHANGED 0x4006
181 #define PEC_OBJECTINFOCHANGED 0x4007
182 #define PEC_DEVICEINFOCHANGED 0x4008
183 #define PEC_REQUESTOBJECTTRANSFER 0x4009
184 #define PEC_STOREFULL 0x400A
185 #define PEC_DEVICERESET 0x400B
186 #define PEC_STORAGEINFOCHANGED 0x400C
187 #define PEC_CAPTURECOMPLETE 0x400D
188 #define PEC_UNREPORTEDSTATUS 0x400E
190 /* PTP Device Property Codes */
191 #define PDP_UNDEFINED 0x5000
192 #define PDP_BATTERYLEVEL 0x5001
193 #define PDP_FUNCTIONALMODE 0x5002
194 #define PDP_IMAGESIZE 0x5003
195 #define PDP_COMPRESSIONSETTING 0x5004
196 #define PDP_WHITEBALANCE 0x5005
197 #define PDP_RGBGAIN 0x5006
198 #define PDP_FNUMBER 0x5007
199 #define PDP_FOCALLENGTH 0x5008
200 #define PDP_FOCUSDISTANCE 0x5009
201 #define PDP_FOCUSMODE 0x500A
202 #define PDP_EXPOSUREMETERINGMODE 0x500B
203 #define PDP_FLASHMODE 0x500C
204 #define PDP_EXPOSURETIME 0x500D
205 #define PDP_EXPOSUREPROGRAMMODE 0x500E
206 #define PDP_EXPOSUREINDEX 0x500F
207 #define PDP_EXPOSUREBIASCOMPENSATION 0x5010
208 #define PDP_DATETIME 0x5011
209 #define PDP_CAPTUREDELAY 0x5012
210 #define PDP_STILLCAPTUREMODE 0x5013
211 #define PDP_CONTRAST 0x5014
212 #define PDP_SHARPNESS 0x5015
213 #define PDP_DIGITALZOOM 0x5016
214 #define PDP_EFFECTMODE 0x5017
215 #define PDP_BURSTNUMBER 0x5018
216 #define PDP_BURSTINTERVAL 0x5019
217 #define PDP_TIMELAPSENUMBER 0x501A
218 #define PDP_TIMELAPSEINTERVAL 0x501B
219 #define PDP_FOCUSMETERINGMODE 0x501C
220 #define PDP_UPLOADURL 0x501D
221 #define PDP_ARTIST 0x501E
222 #define PDP_COPYRIGHTINFO 0x501F
224 #if defined(__GNUC__)
225 # pragma pack()
226 #endif
228 #define PTPF_SHARED_LOCK 0x0001 /* Is shared locked */
229 #define PTPF_EXCL_LOCK 0x0002 /* Is exclusively locked */
230 #define PTPF_FETCHED 0x4000 /* Directory contents have been fetched */
231 #define PTPF_NOPURGE 0x8000 /* Don't ever purge this entry */
233 // quit flags
234 #define PTPF_DEVNODE 0x0001
235 #define PTPF_VOLNODE 0x0002
236 #define PTPF_LOCKS 0x0004
237 #define PTPF_FHS 0x0008
239 struct PTPObjectInfo
241 struct MinNode poi_Node; /* Linkage */
242 struct PTPObjectInfo *poi_Parent; /* Up Linkage */
244 UWORD poi_Flags; /* State flags */
245 UWORD poi_NameHash; /* Name Hash */
246 UWORD poi_ReadLocks; /* Number of read locks on this file */
248 ULONG poi_Handle; /* ObjectHandle */
249 ULONG poi_ParentHandle; /* Parent Object */
250 STRPTR poi_Name; /* Filename */
252 ULONG poi_StorageID; /* Storage ID */
253 UWORD poi_ObjectFmt; /* Object Format Code */
254 UWORD poi_ProtFlags; /* Protection Flags */
255 ULONG poi_Size; /* Object Compressed Size */
257 ULONG poi_ThumbSize; /* Thumb Compressed Sized */
258 UWORD poi_ThumbFmt; /* Object Format Code of Thumb */
259 UWORD poi_ThumbWidth; /* Thumb Pix Width */
260 UWORD poi_ThumbHeight; /* Thumb Pix Height */
261 UWORD poi_ImageWidth; /* Image Pix Width */
262 UWORD poi_ImageHeight; /* Image Pix Height */
263 UWORD poi_ImageDepth; /* Image Bit Depth */
265 //UWORD poi_AssType; /* Association Type */
266 //ULONG poi_AssDesc; /* Association Desc */
267 //ULONG poi_SeqNumber; /* Sequence Number */
269 STRPTR poi_Keywords; /* Keywords -> comments field */
271 struct DateStamp poi_CapDate; /* Capture Date */
272 struct DateStamp poi_ModDate; /* Modifcation Date */
274 struct MinList poi_Children; /* Child objects */
277 struct PTPStorageInfo
279 struct Node psi_Node; /* Node linkage */
280 ULONG psi_StorageID; /* Storage ID */
282 UWORD psi_StorageType; /* Storage Type */
283 UWORD psi_FSType; /* Filesystem Type */
284 UWORD psi_AccessCaps; /* Access Capability */
285 ULONG psi_MaxCapacityH; /* Maximum capacity (HIGH 32-bits) */
286 ULONG psi_MaxCapacityL; /* Maximum capacity (LOW 32-bits) */
287 ULONG psi_FreeH; /* Free Space in Bytes (HIGH 32-bits) */
288 ULONG psi_FreeL; /* Free Space in Bytes (LOW 32-bits) */
289 ULONG psi_FreeImgs; /* Free Space in Images */
290 STRPTR psi_StorageDesc; /* Storage Description */
291 STRPTR psi_VolumeName; /* Volume Label */
293 struct PTPObjectInfo *psi_ObjectInfo; /* Linked ObjectInfo */
296 // file handle flags
297 #define PTPF_NEWFILE 0x0001
298 #define PTPF_OLDLOADED 0x0002
299 #define PTPF_MODIFIED 0x0004
301 struct PTPFileHandle
303 struct Node pfh_Node; /* Node linkage */
304 struct PTPObjectInfo *pfh_ObjectInfo; /* Object Info */
305 UBYTE *pfh_Buffer; /* Buffer of whole file */
306 ULONG pfh_BufferLen; /* Size of buffer */
307 ULONG pfh_SeekPos; /* Current Seeking Position (LOW 32-bits) */
308 UWORD pfh_Flags; /* Flags */
311 #define PTPF_SENDOBJ 0x0001 /* Send Object possible */
312 #define PTPF_PARTIAL 0x0002 /* GetPartialObject possible */
313 #define PTPF_DELETEOBJ 0x0004 /* DeleteObject available */
314 #define PTPF_PROTOBJ 0x0008 /* SetObjectProtection available */
315 #define PTPF_MOVEOBJ 0x0010 /* Move Object */
316 #define PTPF_FORMAT 0x0020 /* Format Store */
318 struct NepClassPTP
320 struct Node nch_Node; /* Node linkage */
321 struct NepPTPBase *nch_ClsBase; /* Up linkage */
322 struct Library *nch_Base; /* Poseidon base */
323 struct Library *nch_DOSBase; /* DOS Base */
324 struct PsdDevice *nch_Device; /* Up linkage */
325 struct PsdConfig *nch_Config; /* Up linkage */
326 struct PsdInterface *nch_Interface; /* Up linkage */
327 struct PsdEndpoint *nch_EPIn; /* IN Endpoint */
328 struct PsdEndpoint *nch_EPOut; /* OUT Endpoint */
329 struct PsdEndpoint *nch_EPInt; /* INT Endpoint */
330 IPTR nch_EPInPktSize; /* Size of EP IN packets */
331 struct PsdPipe *nch_EP0Pipe; /* Endpoint 0 pipe */
332 struct PsdPipe *nch_EPInPipe; /* Endpoint In pipe */
333 struct PsdPipe *nch_EPOutPipe; /* Endpoint Out pipe */
334 struct PsdPipe *nch_EPIntPipe; /* Endpoint Int pipe */
335 struct Task *nch_ReadySigTask; /* Task to send ready signal to */
336 LONG nch_ReadySignal; /* Signal to send when ready */
337 struct Task *nch_Task; /* Subtask */
338 struct MsgPort *nch_TaskMsgPort; /* Message Port for Pipe */
339 struct MsgPort *nch_DOSMsgPort; /* DOS "task" for DOS Packets */
340 IPTR nch_IfNum; /* Interface number */
342 APTR nch_MemPool; /* Private Memory Pool */
344 BOOL nch_ShallExit; /* shall go down */
345 UWORD nch_ResFlags; /* Resource flags */
347 struct DosList *nch_DevEntry; /* DOS List Entry for Device */
348 struct DosList *nch_VolEntry; /* DOS List Entry for Volume */
350 struct List nch_Storages; /* ROOT: List of storages */
351 struct PTPObjectInfo nch_RootObject; /* ROOT object */
353 struct List nch_FHs; /* List of FileHandles */
355 struct PTPObjectInfo *nch_LastObject; /* Last object loaded */
356 UBYTE *nch_LastBuffer; /* Pointer to last loaded object */
357 ULONG nch_LastBufferLen; /* Length of buffer */
359 ULONG nch_SessionID; /* Session ID */
360 ULONG nch_TransID; /* Transaction ID */
361 UWORD nch_DevCaps; /* Device support flags */
362 UWORD nch_NoDestMode; /* Specification of Destination unsupported */
364 STRPTR nch_DevIDString; /* Device ID String */
365 STRPTR nch_IfIDString; /* Interface ID String */
367 BOOL nch_UsingDefaultCfg;
368 struct ClsDevCfg *nch_CDC;
370 struct Library *nch_MUIBase; /* MUI master base */
371 struct Library *nch_PsdBase; /* Poseidon base */
372 struct Library *nch_IntBase; /* Intuition base */
373 struct Task *nch_GUITask; /* GUI Task */
374 struct NepClassPTP *nch_GUIBinding; /* Window of binding that's open */
376 Object *nch_App;
377 Object *nch_MainWindow;
378 Object *nch_DOSNameObj;
379 Object *nch_EnableMTPObj;
380 Object *nch_NoPartObjObj;
382 Object *nch_UseObj;
383 Object *nch_SetDefaultObj;
384 Object *nch_CloseObj;
386 Object *nch_AboutMI;
387 Object *nch_UseMI;
388 Object *nch_SetDefaultMI;
389 Object *nch_MUIPrefsMI;
391 UBYTE nch_InBuf[512]; /* Buffer for reading in first USB packet */
392 UBYTE nch_OutBuf[1024]; /* Buffer for writing of send object info */
393 UBYTE nch_VolumeName[32]; /* Volume Name */
394 UBYTE nch_LowCharMap[256]; /* International Mapping to lower case */
397 struct NepPTPBase
399 struct Library nh_Library; /* standard */
400 UWORD nh_Flags; /* various flags */
402 struct Library *nh_UtilityBase; /* Utility base */
404 struct List nh_Bindings; /* List of bindings created */
406 struct NepClassPTP nh_DummyNCH; /* Dummy NCH for default config */
409 #endif /* PTP_H */