int main(void) { Object *application, *window; Locale_Initialize(); if (ReadArguments()) { /* FIXME: handle arguments... */ // FROM - import prefs from this file at start // USE - 'use' the loaded prefs immediately, don't open window. // SAVE - 'save' the lodaed prefs immediately, don't open window. FreeArguments(); } application = (Object *)ApplicationObject, MUIA_Application_Title, __(MSG_NAME), MUIA_Application_Version, (IPTR) VERSION, MUIA_Application_Description, __(MSG_DESCRIPTION), MUIA_Application_Base, (IPTR) "FONTPREF", SubWindow, (IPTR) (window = (Object *)SystemPrefsWindowObject, MUIA_Window_ID, MAKE_ID('F','W','I','N'), WindowContents, (IPTR) FPEditorObject, End, End), End; if (application != NULL) { SET(window, MUIA_Window_Open, TRUE); DoMethod(application, MUIM_Application_Execute); SET(window, MUIA_Window_Open, FALSE); MUI_DisposeObject(application); } Locale_Deinitialize(); return 0; }
void Cleanup(STRPTR msg) { if (msg) { if (IntuitionBase && !((struct Process *)FindTask(NULL))->pr_CLI) { ShowMessage("IControl", msg, MSG(MSG_OK)); } else { printf("IControl: %s\n", msg); } } KillGUI(); FreeArguments(); CloseLibs(); CleanupLocale(); exit(prog_exitcode); }