TODO: add entries for centralizing licensing and authorship information and incorpora...
[Ale.git] / ui / ui.cc
blob7c428745e80c45880de4fd4d68659731a4db888b
1 // Copyright 2004 David Hilvert <dhilvert@auricle.dyndns.org>,
2 // <dhilvert@ugcs.caltech.edu>
4 /* This file is part of the Anti-Lamenessing Engine.
6 The Anti-Lamenessing Engine is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 The Anti-Lamenessing Engine is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with the Anti-Lamenessing Engine; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #include "ui_wo.h"
22 #include "ui_tty.h"
23 #include "input.h"
24 #include "ui.h"
27 * See ui.h for details on these variables.
30 ui *ui::singleton = NULL;
31 int ui::type = 1; /* TTY is default */
33 ui *ui::get() {
34 if (singleton == NULL) {
35 switch (type) {
36 case 0:
37 singleton = new ui_wo();
38 break;
39 case 1:
40 try {
41 singleton = new ui_tty();
42 } catch (...) {
43 singleton = new ui_wo();
45 break;
46 default:
47 assert(0);
51 return singleton;
54 void ui::handle_input(int argc, const char *argv[], const char *package, const char *short_version, const char *version) {
55 input::handle(argc, argv, package, short_version, version);