r13530 vince - in /branches/vince/netsurf-options/atari: gui.c options.h

netsurf at semichrome.net netsurf at semichrome.net
Sun Mar 18 22:47:47 GMT 2012


Author: vince
Date: Sun Mar 18 17:47:47 2012
New Revision: 13530

URL: http://source.netsurf-browser.org?rev=13530&view=rev
Log:
make a start on atari option conversion

Modified:
    branches/vince/netsurf-options/atari/gui.c
    branches/vince/netsurf-options/atari/options.h

Modified: branches/vince/netsurf-options/atari/gui.c
URL: http://source.netsurf-browser.org/branches/vince/netsurf-options/atari/gui.c?rev=13530&r1=13529&r2=13530&view=diff
==============================================================================
--- branches/vince/netsurf-options/atari/gui.c (original)
+++ branches/vince/netsurf-options/atari/gui.c Sun Mar 18 17:47:47 2012
@@ -823,8 +823,8 @@
 
 	hotlist_destroy();
 
-	urldb_save_cookies(option_cookie_file);
-	urldb_save(option_url_file);
+	urldb_save_cookies(nsoption_charp(cookie_file));
+	urldb_save(nsoption_charp(url_file));
 
 	RsrcXtype( 0, rsc_trindex, rsc_ntree);
 	unbind_global_events();
@@ -851,9 +851,9 @@
 
 	LOG(("argc %d, argv %p", argc, argv));
 
-	if ((option_window_width != 0) && (option_window_height != 0)) {
-		cfg_width = option_window_width;
-		cfg_height = option_window_height;
+	if ((nsoption_int(window_width) != 0) && (nsoption_int(window_height) != 0)) {
+		cfg_width = nsoption_int(window_width);
+		cfg_height = nsoption_int(window_height);
 	} else {
 		if( sys_type() == SYS_TOS ){
 			/* on single tasking OS, start as fulled window: */
@@ -865,8 +865,8 @@
 		}
 	}
 
-	if (option_homepage_url != NULL && option_homepage_url[0] != '\0')
-		cfg_homepage_url = option_homepage_url;
+	if (nsoption_charp(homepage_url) != NULL)
+		cfg_homepage_url = nsoption_charp(homepage_url);
 	else
 		cfg_homepage_url = NETSURF_HOMEPAGE;
 
@@ -963,21 +963,21 @@
 		cursors, &gem_cursors.help);
 
 	LOG(("Enabling core select menu"));
-	option_core_select_menu = true;
-
-	if( strlen(option_url_file) ){
-		urldb_load(option_url_file);
-	}
-	if( strlen(option_cookie_file) ){
-		urldb_load_cookies(option_cookie_file);
-		LOG(("Loading cookies from: %s", option_cookie_file ));
+	nsoption_set_bool(core_select_menu, true);
+
+	if( strlen(nsoption_charp(url_file)) ){
+		urldb_load(nsoption_charp(url_file));
+	}
+	if( strlen(nsoption_charp(cookie_file)) ){
+		urldb_load_cookies(nsoption_charp(cookie_file));
+		LOG(("Loading cookies from: %s", nsoption_charp(cookie_file) ));
 	}
 
 	if (process_cmdline(argc,argv) != true)
 		die("unable to process command line.\n");
 
 	nkc_init();
-	atari_plotter_init( option_atari_screen_driver, option_atari_font_driver );
+	atari_plotter_init( nsoption_charp(atari_screen_driver), nsoption_charp(atari_font_driver) );
 }
 
 static char *theapp = (char*)"NetSurf";
@@ -989,7 +989,7 @@
 	if (sys_type() & (SYS_MAGIC|SYS_NAES|SYS_XAAES)) {
 		menu_register( _AESapid, (char*)"  NetSurf ");
 	}
- 	tree_set_icon_dir( option_tree_icons_path );
+	tree_set_icon_dir( nsoption_charp(tree_icons_path) );
 	hotlist_init();
 }
 

Modified: branches/vince/netsurf-options/atari/options.h
URL: http://source.netsurf-browser.org/branches/vince/netsurf-options/atari/options.h?rev=13530&r1=13529&r2=13530&view=diff
==============================================================================
--- branches/vince/netsurf-options/atari/options.h (original)
+++ branches/vince/netsurf-options/atari/options.h Sun Mar 18 17:47:47 2012
@@ -23,70 +23,72 @@
 #ifndef NS_ATARI_OPTIONS_H_
 #define NS_ATARI_OPTIONS_H_
 
-extern char * option_atari_screen_driver;
-extern char * option_atari_font_driver;
-extern int option_atari_font_monochrom;
-extern int option_atari_dither;
-extern int option_atari_transparency;
-extern char *option_atari_face_sans_serif; /* default sans face */
-extern char *option_atari_face_sans_serif_bold; /* bold sans face */
-extern char *option_atari_face_sans_serif_italic; /* bold sans face */
-extern char *option_atari_face_sans_serif_italic_bold; /* bold sans face */
-extern char *option_atari_face_monospace; /* monospace face */
-extern char *option_atari_face_monospace_bold; /* monospace face */
-extern char *option_atari_face_serif; /* serif face */
-extern char *option_atari_face_serif_bold; /* bold serif face */
-extern char *option_atari_face_cursive;
-extern char *option_atari_face_fantasy;
-extern char *option_atari_editor;
-extern char *option_downloads_path;
-extern char *option_url_file;
-extern char *option_hotlist_file;
-extern char *option_tree_icons_path;
 
+#define NSOPTION_EXTRA_DEFINE						\
+	char *atari_screen_driver;					\
+	char *atari_font_driver;					\
+	int atari_font_monochrom;					\
+	int atari_dither;						\
+	int atari_transparency;						\
+	char *atari_face_sans_serif; /* default sans face */		\
+	char *atari_face_sans_serif_bold; /* bold sans face */		\
+	char *atari_face_sans_serif_italic; /* bold sans face */	\
+	char *atari_face_sans_serif_italic_bold; /* bold sans face */	\
+	char *atari_face_monospace; /* monospace face */		\
+	char *atari_face_monospace_bold; /* monospace face */		\
+	char *atari_face_serif; /* serif face */			\
+	char *atari_face_serif_bold; /* bold serif face */		\
+	char *atari_face_cursive;					\
+	char *atari_face_fantasy;					\
+	char *atari_editor;						\
+	char *downloads_path;						\
+	char *url_file;							\
+	char *hotlist_file;						\
+	char *tree_icons_path;
 
-#define EXTRA_OPTION_DEFINE \
-char * option_atari_screen_driver = (char*)"vdi";\
-char * option_atari_font_driver = (char*)"vdi";\
-int option_atari_font_monochrom = 0;\
-int option_atari_dither = 1;\
-int option_atari_transparency = 1;\
-char *option_atari_face_sans_serif;\
-char *option_atari_face_sans_serif_bold;\
-char *option_atari_face_sans_serif_italic;\
-char *option_atari_face_sans_serif_italic_bold;\
-char *option_atari_face_monospace;\
-char *option_atari_face_monospace_bold;\
-char *option_atari_face_serif;\
-char *option_atari_face_serif_bold;\
-char *option_atari_face_cursive; \
-char *option_atari_face_fantasy; \
-char *option_atari_editor = (char*)"";\
-char *option_downloads_path = (char*)""; \
-char *option_url_file = (char*)"url.db";\
-char *option_hotlist_file = (char*)"hotlist";\
-char *option_tree_icons_path = (char*)"./res/icons";
+#define NSOPTION_EXTRA_DEFAULTS					\
+	.atari_screen_driver = (char*)"vdi",			\
+	.atari_font_driver = (char*)"vdi",			\
+	.atari_font_monochrom = 0,				\
+	.atari_dither = 1,					\
+	.atari_transparency = 1,					\
+	.atari_face_sans_serif = NULL,					\
+	.atari_face_sans_serif_bold = NULL,				\
+	.atari_face_sans_serif_italic = NULL,				\
+	.atari_face_sans_serif_italic_bold = NULL,			\
+	.atari_face_monospace = NULL,					\
+	.atari_face_monospace_bold = NULL,				\
+	.atari_face_serif = NULL,					\
+	.atari_face_serif_bold = NULL,					\
+	.atari_face_cursive = NULL,					\
+	.atari_face_fantasy = NULL,					\
+	.atari_editor = (char*)"",					\
+	.downloads_path = (char*)"",					\
+	.url_file = (char*)"url.db",					\
+	.hotlist_file = (char*)"hotlist",				\
+	.tree_icons_path = (char*)"./res/icons",
 
-#define EXTRA_OPTION_TABLE \
-	{ "atari_screen_driver", OPTION_STRING, &option_atari_screen_driver },\
-	{ "atari_font_driver", OPTION_STRING, &option_atari_font_driver },\
-	{ "atari_font_monochrom", OPTION_INTEGER, &option_atari_font_monochrom },\
-	{ "atari_transparency", OPTION_INTEGER, &option_atari_transparency },\
-	{ "atari_dither", OPTION_INTEGER, &option_atari_dither },\
-	{ "atari_editor", OPTION_STRING, &option_atari_editor },\
-	{ "font_face_sans_serif", OPTION_STRING, &option_atari_face_sans_serif },\
-	{ "font_face_sans_serif_bold", OPTION_STRING, &option_atari_face_sans_serif_bold },\
-	{ "font_face_sans_serif_italic", OPTION_STRING, &option_atari_face_sans_serif_italic },\
-	{ "font_face_sans_serif_italic_bold", OPTION_STRING, &option_atari_face_sans_serif_italic_bold },\
-	{ "font_face_monospace", OPTION_STRING, &option_atari_face_monospace },\
-	{ "font_face_monospace_bold", OPTION_STRING, &option_atari_face_monospace_bold },\
-	{ "font_face_serif", OPTION_STRING, &option_atari_face_serif },\
-	{ "font_face_serif_bold", OPTION_STRING, &option_atari_face_serif_bold },\
-	{ "font_face_cursive", OPTION_STRING, &option_atari_face_cursive },\
-	{ "font_face_fantasy", OPTION_STRING, &option_atari_face_fantasy },\
-	{ "downloads_path", OPTION_STRING, &option_downloads_path },\
-	{ "url_file", OPTION_STRING, &option_url_file },\
-	{ "hotlist_file", OPTION_STRING, &option_hotlist_file },\
-	{ "tree_icons_path", OPTION_STRING, &option_tree_icons_path }
+#define NSOPTION_EXTRA_TABLE \
+	{ "atari_screen_driver", OPTION_STRING, &nsoptions.atari_screen_driver },\
+	{ "atari_font_driver", OPTION_STRING, &nsoptions.atari_font_driver },\
+	{ "atari_font_monochrom", OPTION_INTEGER, &nsoptions.atari_font_monochrom },\
+	{ "atari_transparency", OPTION_INTEGER, &nsoptions.atari_transparency },\
+	{ "atari_dither", OPTION_INTEGER, &nsoptions.atari_dither },\
+	{ "atari_editor", OPTION_STRING, &nsoptions.atari_editor },\
+	{ "font_face_sans_serif", OPTION_STRING, &nsoptions.atari_face_sans_serif },\
+	{ "font_face_sans_serif_bold", OPTION_STRING, &nsoptions.atari_face_sans_serif_bold },\
+	{ "font_face_sans_serif_italic", OPTION_STRING, &nsoptions.atari_face_sans_serif_italic },\
+	{ "font_face_sans_serif_italic_bold", OPTION_STRING, &nsoptions.atari_face_sans_serif_italic_bold },\
+	{ "font_face_monospace", OPTION_STRING, &nsoptions.atari_face_monospace },\
+	{ "font_face_monospace_bold", OPTION_STRING, &nsoptions.atari_face_monospace_bold },\
+	{ "font_face_serif", OPTION_STRING, &nsoptions.atari_face_serif },\
+	{ "font_face_serif_bold", OPTION_STRING, &nsoptions.atari_face_serif_bold },\
+	{ "font_face_cursive", OPTION_STRING, &nsoptions.atari_face_cursive },\
+	{ "font_face_fantasy", OPTION_STRING, &nsoptions.atari_face_fantasy },\
+	{ "downloads_path", OPTION_STRING, &nsoptions.downloads_path },\
+	{ "url_file", OPTION_STRING, &nsoptions.url_file },\
+	{ "hotlist_file", OPTION_STRING, &nsoptions.hotlist_file },\
+	{ "tree_icons_path", OPTION_STRING, &nsoptions.tree_icons_path }
+
 #endif
 




More information about the netsurf-commits mailing list