revert between 56095 -> 55830 in arch
[AROS.git] / workbench / prefs / input / main.c
blob209ebc5108e971b656e95711a2ac9fdad6a73d14
1 /*
2 Copyright 2003-2017, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 // #define MUIMASTER_YES_INLINE_STDARG
8 #include <proto/alib.h>
9 #include <proto/dos.h>
10 #include <proto/intuition.h>
11 #include <proto/muimaster.h>
12 #include <proto/utility.h>
14 #include <libraries/mui.h>
15 #include <prefs/input.h>
17 #include <zune/systemprefswindow.h>
19 #include "locale.h"
20 #include "args.h"
21 #include "ipeditor.h"
22 #include "prefs.h"
24 #include <aros/debug.h>
26 #define VERSION "$VER: Input 1.1 ("ADATE") AROS Dev Team"
28 /*********************************************************************************************/
30 int main(int argc, char **argv)
32 Object *application, *window;
34 Locale_Initialize();
36 if (ReadArguments(argc, argv))
38 if (ARG(USE) || ARG(SAVE))
40 Prefs_HandleArgs((STRPTR)ARG(FROM), ARG(USE), ARG(SAVE));
42 else
44 Prefs_Default();
46 NewList(&keymap_list);
48 mempool = CreatePool(MEMF_PUBLIC | MEMF_CLEAR, 2048, 2048);
49 if (mempool != 0)
51 Prefs_ScanDirectory("DEVS:Keymaps/#?_~(#?.info)", &keymap_list, sizeof(struct KeymapEntry));
53 application = ApplicationObject,
54 MUIA_Application_Title, __(MSG_NAME),
55 MUIA_Application_Version, (IPTR) VERSION,
56 MUIA_Application_Description, __(MSG_NAME),
57 MUIA_Application_SingleTask, TRUE,
58 MUIA_Application_Base, (IPTR) "INPUTPREF",
59 SubWindow, (IPTR) (window = SystemPrefsWindowObject,
60 MUIA_Window_ID, MAKE_ID('I','W','I','N'),
61 WindowContents, (IPTR) IPEditorObject,
62 TAG_DONE),
63 End),
64 End;
66 if (application != NULL)
68 SET(window, MUIA_Window_Open, TRUE);
69 DoMethod(application, MUIM_Application_Execute);
70 SET(window, MUIA_Window_Open, FALSE);
72 MUI_DisposeObject(application);
75 DeletePool((APTR)mempool);
78 FreeArguments();
81 Locale_Deinitialize();
83 return 0;