2003-06-30 16:44:03 +04:00
|
|
|
/*
|
|
|
|
* This file is part of NetSurf, http://netsurf.sourceforge.net/
|
|
|
|
* Licensed under the GNU General Public License,
|
|
|
|
* http://www.opensource.org/licenses/gpl-license
|
|
|
|
* Copyright 2003 Phil Mellor <monkeyson@users.sourceforge.net>
|
|
|
|
* Copyright 2003 James Bursa <bursa@users.sourceforge.net>
|
2002-09-11 18:24:02 +04:00
|
|
|
*/
|
|
|
|
|
2003-06-02 03:02:56 +04:00
|
|
|
#include "netsurf/desktop/options.h"
|
2002-09-11 18:24:02 +04:00
|
|
|
#include "netsurf/desktop/netsurf.h"
|
|
|
|
#include "netsurf/desktop/browser.h"
|
|
|
|
#include "netsurf/desktop/gui.h"
|
2003-02-09 15:58:15 +03:00
|
|
|
#include "netsurf/content/cache.h"
|
|
|
|
#include "netsurf/content/fetch.h"
|
|
|
|
#include "netsurf/utils/log.h"
|
2002-09-11 18:24:02 +04:00
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
int netsurf_quit = 0;
|
|
|
|
gui_window* netsurf_gui_windows = NULL;
|
|
|
|
|
2003-03-04 14:59:36 +03:00
|
|
|
static void netsurf_init(int argc, char** argv);
|
|
|
|
static void netsurf_exit(void);
|
|
|
|
|
2002-09-11 18:24:02 +04:00
|
|
|
|
|
|
|
void netsurf_poll(void)
|
|
|
|
{
|
|
|
|
gui_poll();
|
2003-02-09 15:58:15 +03:00
|
|
|
fetch_poll();
|
2002-09-11 18:24:02 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void netsurf_init(int argc, char** argv)
|
|
|
|
{
|
2002-10-08 13:38:29 +04:00
|
|
|
stdout = stderr;
|
2003-06-02 03:02:56 +04:00
|
|
|
options_init(&OPTIONS);
|
|
|
|
options_read(&OPTIONS, NULL);
|
2002-09-11 18:24:02 +04:00
|
|
|
gui_init(argc, argv);
|
2003-02-09 15:58:15 +03:00
|
|
|
fetch_init();
|
2002-11-03 12:39:53 +03:00
|
|
|
cache_init();
|
2003-05-10 15:15:49 +04:00
|
|
|
nspng_init();
|
2003-06-05 17:17:55 +04:00
|
|
|
nsgif_init();
|
2002-11-03 12:39:53 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void netsurf_exit(void)
|
|
|
|
{
|
|
|
|
cache_quit();
|
2003-02-09 15:58:15 +03:00
|
|
|
fetch_quit();
|
2002-09-11 18:24:02 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int main(int argc, char** argv)
|
|
|
|
{
|
|
|
|
netsurf_init(argc, argv);
|
|
|
|
|
|
|
|
while (netsurf_quit == 0)
|
|
|
|
netsurf_poll();
|
|
|
|
|
2003-02-09 15:58:15 +03:00
|
|
|
LOG(("Netsurf quit!"));
|
2002-11-03 12:39:53 +03:00
|
|
|
netsurf_exit();
|
2002-10-15 14:41:12 +04:00
|
|
|
|
2002-09-11 18:24:02 +04:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|