2 Copyright © 1995-2016, The AROS Development Team. All rights reserved.
9 /*********************************************************************************************/
13 #include <prefs/prefhdr.h>
14 #include <prefs/icontrol.h>
15 #include <intuition/iprefs.h>
20 #include <aros/debug.h>
22 /*********************************************************************************************/
24 struct FileIControlPrefs
35 UBYTE ic_VDragModes
[2][2];
38 /*********************************************************************************************/
40 static LONG stopchunks
[] =
45 /*********************************************************************************************/
47 static void SetIControlPrefs(struct FileIControlPrefs
*prefs
)
49 struct IIControlPrefs i
;
51 D(bug("[IcontrolPrefs_Handler: VDragModes: 0x%04X\n", prefs
->ic_VDragModes
[0][1]));
53 #define GETBYTE(x) i.ic_ ## x = prefs->ic_ ## x
54 #define GETWORD(x) i.ic_ ## x = ((prefs->ic_ ## x[0] << 8) + prefs->ic_ ## x[1])
55 #define GETLONG(x) i.ic_ ## x = ((prefs->ic_ ## x[0] << 24) + \
56 (prefs->ic_ ## x[1] << 16) + \
57 (prefs->ic_ ## x[2] << 8) + \
67 GETWORD(VDragModes
[0]);
69 SetIPrefs(&i
, sizeof(i
), IPREFS_TYPE_ICONTROL
);
72 /*********************************************************************************************/
74 void IControlPrefs_Handler(STRPTR filename
)
76 struct IFFHandle
*iff
;
78 D(bug("In IPrefs:IControlPrefs_Handler\n"));
80 if ((iff
= CreateIFF(filename
, stopchunks
, 1)))
82 while(ParseIFF(iff
, IFFPARSE_SCAN
) == 0)
84 struct FileIControlPrefs
*icontrolprefs
;
86 icontrolprefs
= LoadChunk(iff
, 0, MEMF_ANY
);
88 D(bug("IControlPrefs_Handler: ID_ICTL chunk successfully loaded.\n"));
89 SetIControlPrefs(icontrolprefs
);
90 FreeVec(icontrolprefs
);
93 } /* while(ParseIFF(iff, IFFPARSE_SCAN) == 0) */
97 } /* if ((iff = CreateIFF(filename))) */
100 D(bug("In IPrefs:IControlPrefs_Handler. Done.\n", filename
));
103 /*********************************************************************************************/