4 License: GNU General Public License (GPL) version 2
5 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt)
9 This file is part of J-Ben.
11 J-Ben is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License version 2
13 as published by the Free Software Foundation.
15 J-Ben is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program. If not, see <http://www.gnu.org/licenses/>
33 /* The application entry point */
40 edict
= (Edict
*)NULL
;
41 kdict
= (KanjiDic
*)NULL
;
42 kanjiList
= (KanjiList
*)NULL
;
43 vocabList
= (VocabList
*)NULL
;
44 gui
= (MainGUI
*)NULL
;
46 /* Start our random number generator */
48 for(int i
=0;i
<50;i
++) rand(); /* On some platforms I've seen rand() behave
49 fairly predictably for the first iteration or so.
50 That's why I spin off a few iterations of rand()
51 before really using it. */
53 /* DictionaryLoader was intended to be a splash screen for loading the dictionaries. However,
54 currently this is a fast enough operation that I decided it was unnecessary. */
56 /* Display splash screen which shows progress bars while loading
57 dictionaries. (Yes, this is fluff.) */
58 DictionaryLoader
*d
= new DictionaryLoader();
61 result
= d
->LoadDictionaries();
64 /* For now, DictionaryLoader is a non-GUI class. Just make the object, run the function, and be done with it. */
65 DictionaryLoader
*d
= new DictionaryLoader();
66 result
= d
->LoadDictionaries();
69 if(result
==DL_SUCCESS
) {
70 kanjiList
= new KanjiList(kdict
->GetHashTable());
71 vocabList
= new VocabList();
72 prefs
= new Preferences(_T("jben.cfg"));
73 /* Show the main GUI. */
75 /* On Linux, for some reason there's a placeholder "loading" mini-window which pops up during creation of this object. Why??*/
80 wxMessageBox(wxString::Format(_T("Error during startup, DictionaryLoader result = 0x%X\n"), result
),
81 _T("DictionaryLoader error"), wxOK
| wxICON_ERROR
);
88 printf("JBen::OnExit being processed...\n");
90 if(prefs
) delete prefs
;
91 if(edict
) delete edict
;
92 if(kanjiList
) delete kanjiList
;
93 if(kdict
) delete kdict
;
95 printf("Terminating program.\n");