grub2: bring back build of aros-side grub2 tools
[AROS.git] / workbench / prefs / input / main.c
blob7ba53a21ee4d966788abd94f7ed53c2513506a0d
1 /*
2 Copyright 2003-2014, 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 0.6 ("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_DESCRIPTION),
57 MUIA_Application_Base, (IPTR) "INPUTPREF",
58 SubWindow, (IPTR) (window = SystemPrefsWindowObject,
59 MUIA_Window_ID, MAKE_ID('I','W','I','N'),
60 WindowContents, (IPTR) IPEditorObject,
61 TAG_DONE),
62 End),
63 End;
65 if (application != NULL)
67 SET(window, MUIA_Window_Open, TRUE);
68 DoMethod(application, MUIM_Application_Execute);
69 SET(window, MUIA_Window_Open, FALSE);
71 MUI_DisposeObject(application);
74 DeletePool((APTR)mempool);
77 FreeArguments();
80 Locale_Deinitialize();
82 return 0;