d2/image_rw: Disable code (copy() and close*()) to be replaced.
[Ale.git] / ui / ui.cc
blob8a44d22a47182351049086a8f22752f510910b90
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 3 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 "ui_log.h"
24 #include "ui_quiet.h"
25 #include "input.h"
26 #include "ui.h"
27 #include "d2.h"
30 * See ui.h for details on these variables.
33 ui *ui::singleton = NULL;
34 int ui::type = 1; /* tty is default */
35 int ui::output_performance_data = 0;
37 ui *ui::get() {
38 if (singleton == NULL) {
39 switch (type) {
40 case 0:
41 singleton = new ui_wo();
42 break;
43 case 1:
44 try {
45 singleton = new ui_tty();
46 } catch (...) {
47 singleton = new ui_wo();
49 break;
50 case 2:
51 singleton = new ui_log();
52 break;
53 case 3:
54 singleton = new ui_quiet();
55 break;
56 default:
57 assert(0);
61 return singleton;
64 void ui::handle_input(int argc, const char *argv[], const char *package, const char *short_version, const char *version) {
65 input::handle(argc, argv, package, short_version, version);
68 void ui::set_offset(d2::trans_single offset) {
70 void ui::set_offset(d2::transformation offset) {