1 |
|
/* |
2 |
|
* main_x.h - Main program, Unix specific stuff |
3 |
|
* |
4 |
< |
* Frodo (C) 1994-1997,2002-2003 Christian Bauer |
4 |
> |
* Frodo (C) 1994-1997,2002-2004 Christian Bauer |
5 |
|
* |
6 |
|
* This program is free software; you can redistribute it and/or modify |
7 |
|
* it under the terms of the GNU General Public License as published by |
20 |
|
|
21 |
|
#include "Version.h" |
22 |
|
|
23 |
+ |
#ifdef HAVE_GLADE |
24 |
+ |
#include <gnome.h> |
25 |
+ |
#endif |
26 |
+ |
|
27 |
+ |
#ifdef QTOPIA |
28 |
+ |
extern "C" int main(int argc, char *argv[]); |
29 |
+ |
#include <SDL.h> |
30 |
+ |
#endif |
31 |
|
|
32 |
|
extern int init_graphics(void); |
33 |
|
|
42 |
|
|
43 |
|
int main(int argc, char **argv) |
44 |
|
{ |
45 |
< |
Frodo *the_app; |
45 |
> |
#ifdef HAVE_GLADE |
46 |
> |
gnome_program_init(PACKAGE_NAME, PACKAGE_VERSION, LIBGNOMEUI_MODULE, argc, argv, |
47 |
> |
GNOME_PARAM_APP_DATADIR, DATADIR, NULL); |
48 |
> |
#endif |
49 |
|
|
50 |
|
timeval tv; |
51 |
|
gettimeofday(&tv, NULL); |
53 |
|
|
54 |
|
printf("%s by Christian Bauer\n", VERSION_STRING); |
55 |
|
if (!init_graphics()) |
56 |
< |
return 0; |
56 |
> |
return 1; |
57 |
|
fflush(stdout); |
58 |
|
|
59 |
< |
the_app = new Frodo(); |
59 |
> |
Frodo *the_app = new Frodo(); |
60 |
|
the_app->ArgvReceived(argc, argv); |
61 |
|
the_app->ReadyToRun(); |
62 |
|
delete the_app; |
105 |
|
} |
106 |
|
ThePrefs.Load(prefs_path); |
107 |
|
|
108 |
+ |
// Show preferences editor |
109 |
+ |
#ifdef HAVE_GLADE |
110 |
+ |
if (!ThePrefs.ShowEditor(true, prefs_path)) |
111 |
+ |
return; |
112 |
+ |
#endif |
113 |
+ |
|
114 |
|
// Create and start C64 |
115 |
|
TheC64 = new C64; |
116 |
< |
if (load_rom_files()) |
117 |
< |
TheC64->Run(); |
116 |
> |
load_rom_files(); |
117 |
> |
TheC64->Run(); |
118 |
|
delete TheC64; |
119 |
|
} |
120 |
|
|
125 |
|
newprefs.Load(prefs_path); |
126 |
|
return &newprefs; |
127 |
|
} |
128 |
+ |
|
129 |
+ |
|
130 |
+ |
/* |
131 |
+ |
* Determine whether path name refers to a directory |
132 |
+ |
*/ |
133 |
+ |
|
134 |
+ |
bool IsDirectory(const char *path) |
135 |
+ |
{ |
136 |
+ |
struct stat st; |
137 |
+ |
return stat(path, &st) == 0 && S_ISDIR(st.st_mode); |
138 |
+ |
} |