revert between 56095 -> 55830 in arch
[AROS.git] / workbench / prefs / input / prefs.h
blob6768568127c847a3e3b5e741dfd72c093c848030
1 #ifndef _PREFS_H_
2 #define _PREFS_H_
4 /*
5 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
6 $Id$
8 Desc:
9 Lang: English
12 /*********************************************************************************************/
14 #include <aros/macros.h>
16 #include <dos/dos.h>
17 #include <prefs/prefhdr.h>
18 #include <prefs/input.h>
20 #include <stdio.h>
21 #include <string.h>
22 #include <stdlib.h>
24 /*********************************************************************************************/
26 #define ARRAY_TO_LONG(x) ( ((x)[0] << 24UL) + ((x)[1] << 16UL) + ((x)[2] << 8UL) + ((x)[3]) )
27 #define ARRAY_TO_WORD(x) ( ((x)[0] << 8UL) + ((x)[1]) )
29 #define LONG_TO_ARRAY(x,y) (y)[0] = (UBYTE)(ULONG)((x) >> 24UL); \
30 (y)[1] = (UBYTE)(ULONG)((x) >> 16UL); \
31 (y)[2] = (UBYTE)(ULONG)((x) >> 8UL); \
32 (y)[3] = (UBYTE)(ULONG)((x));
34 #define WORD_TO_ARRAY(x,y) (y)[0] = (UBYTE)(ULONG)((x) >> 8UL); \
35 (y)[1] = (UBYTE)(ULONG)((x));
37 /* Name of default keymap, the same as on AmigaOS, for compatibility */
38 #define DEFAULT_KEYMAP "usa"
40 /*********************************************************************************************/
42 struct FilePrefHeader
44 UBYTE ph_Version;
45 UBYTE ph_Type;
46 UBYTE ph_Flags[4];
49 struct FileInputPrefs
51 char ip_Keymap[16];
52 UBYTE ip_PointerTicks[2];
53 UBYTE ip_DoubleClick_secs[4];
54 UBYTE ip_DoubleClick_micro[4];
55 UBYTE ip_KeyRptDelay_secs[4];
56 UBYTE ip_KeyRptDelay_micro[4];
57 UBYTE ip_KeyRptSpeed_secs[4];
58 UBYTE ip_KeyRptSpeed_micro[4];
59 UBYTE ip_MouseAccel[2];
60 UBYTE ip_ClassicKeyboard[4];
61 char ip_KeymapName[64];
62 UBYTE ip_SwitchMouseButtons[4];
65 struct FileKMSPrefs
67 UBYTE kms_Enabled;
68 UBYTE kms_Reserved;
69 UBYTE kms_SwitchQual[2];
70 UBYTE kms_SwitchCode[2];
71 char kms_AltKeymap[64];
74 struct nameexp
76 STRPTR shortname;
77 STRPTR longname;
78 STRPTR flag;
81 struct typeexp
83 STRPTR shortname;
84 STRPTR longname;
87 #define KEYMAP_NAME_LEN 30
88 #define KEYMAP_FLAG_LEN 128
90 struct ListviewEntry
92 struct Node node;
93 UBYTE layoutname[KEYMAP_NAME_LEN];
94 UBYTE realname[30];
95 UBYTE displayflag[KEYMAP_FLAG_LEN];
98 struct KeymapEntry
100 struct ListviewEntry lve;
103 /*********************************************************************************************/
105 void Prefs_ScanDirectory(STRPTR pattern, struct List *list, LONG entrysize);
106 BOOL Prefs_ImportFH(BPTR fh);
107 BOOL Prefs_ExportFH(BPTR fh);
108 BOOL Prefs_Default(void);
109 BOOL Prefs_HandleArgs(STRPTR from, BOOL use, BOOL save);
111 /*********************************************************************************************/
113 extern struct timerequest *InputIO;
114 extern APTR mempool;
115 extern struct List keymap_list;
116 extern struct InputPrefs inputprefs;
117 extern struct KMSPrefs kmsprefs;
119 #endif