--- Frodo4/Src/main_x.h 2004/01/12 15:13:20 1.4 +++ Frodo4/Src/main_x.h 2005/06/27 19:55:48 1.9 @@ -1,7 +1,7 @@ /* * main_x.h - Main program, Unix specific stuff * - * Frodo (C) 1994-1997,2002-2004 Christian Bauer + * Frodo (C) 1994-1997,2002-2005 Christian Bauer * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,6 +20,15 @@ #include "Version.h" +#ifdef HAVE_GLADE +#include +#endif + +// Qtopia Windowing System +#ifdef QWS +extern "C" int main(int argc, char *argv[]); +#include +#endif extern int init_graphics(void); @@ -34,18 +43,27 @@ char Frodo::prefs_path[256] = ""; int main(int argc, char **argv) { - Frodo *the_app; +#ifdef HAVE_GLADE + gnome_program_init(PACKAGE_NAME, PACKAGE_VERSION, LIBGNOMEUI_MODULE, argc, argv, + GNOME_PARAM_APP_DATADIR, DATADIR, NULL); +#endif timeval tv; gettimeofday(&tv, NULL); srand(tv.tv_usec); - printf("%s by Christian Bauer\n", VERSION_STRING); +#ifndef HAVE_GLADE + printf( + "%s Copyright (C) 1994-1997,2002-2005 Christian Bauer\n" + "This is free software with ABSOLUTELY NO WARRANTY.\n" + , VERSION_STRING + ); +#endif if (!init_graphics()) - return 0; + return 1; fflush(stdout); - the_app = new Frodo(); + Frodo *the_app = new Frodo(); the_app->ArgvReceived(argc, argv); the_app->ReadyToRun(); delete the_app; @@ -94,6 +112,12 @@ void Frodo::ReadyToRun(void) } ThePrefs.Load(prefs_path); + // Show preferences editor +#ifdef HAVE_GLADE + if (!ThePrefs.ShowEditor(true, prefs_path)) + return; +#endif + // Create and start C64 TheC64 = new C64; load_rom_files(); @@ -108,3 +132,14 @@ Prefs *Frodo::reload_prefs(void) newprefs.Load(prefs_path); return &newprefs; } + + +/* + * Determine whether path name refers to a directory + */ + +bool IsDirectory(const char *path) +{ + struct stat st; + return stat(path, &st) == 0 && S_ISDIR(st.st_mode); +}