r13531 vince - in /branches/vince/netsurf-options/atari: ctxmenu.c download.c global_evnt.c hotlist.c plot.c plot/font_freetype.c settings.c system_colour.c

netsurf at semichrome.net netsurf at semichrome.net
Sun Mar 18 23:19:30 GMT 2012


Author: vince
Date: Sun Mar 18 18:19:30 2012
New Revision: 13531

URL: http://source.netsurf-browser.org?rev=13531&view=rev
Log:
almost complete atari conversion

Modified:
    branches/vince/netsurf-options/atari/ctxmenu.c
    branches/vince/netsurf-options/atari/download.c
    branches/vince/netsurf-options/atari/global_evnt.c
    branches/vince/netsurf-options/atari/hotlist.c
    branches/vince/netsurf-options/atari/plot.c
    branches/vince/netsurf-options/atari/plot/font_freetype.c
    branches/vince/netsurf-options/atari/settings.c
    branches/vince/netsurf-options/atari/system_colour.c

Modified: branches/vince/netsurf-options/atari/ctxmenu.c
URL: http://source.netsurf-browser.org/branches/vince/netsurf-options/atari/ctxmenu.c?rev=13531&r1=13530&r2=13531&view=diff
==============================================================================
--- branches/vince/netsurf-options/atari/ctxmenu.c (original)
+++ branches/vince/netsurf-options/atari/ctxmenu.c Sun Mar 18 18:19:30 2012
@@ -245,7 +245,7 @@
 		break;
 
 		case POP_CTX_VIEW_SOURCE:
-			if( option_atari_editor != NULL ) {
+			if( nsoption_charp(atari_editor) != NULL ) {
 				data = content_get_source_data( gw->browser->bw->current_content, &size );
 				if( size > 0 && data != NULL ){
 					tempfile = tmpnam( NULL );
@@ -255,11 +255,12 @@
 						fclose( fp_tmpfile );
 
 						// TODO: check if app is runnin, if not, use pexec or such.
-						/*sprintf((char*)&cmdline, "%s \"%s\"", option_atari_editor, tempfile );
-						system( (char*)&cmdline );
+						/*
+						  sprintf((char*)&cmdline, "%s \"%s\"", nsoption_charp(atari_editor), tempfile );
+						  system( (char*)&cmdline );
 						*/
-						err = ShelWrite( option_atari_editor, tempfile , option_atari_editor, 1, 0);
-						LOG(("Launched: %s %s (%d)\n", option_atari_editor, tempfile, err ));
+						err = ShelWrite( nsoption_charp(atari_editor), tempfile , nsoption_charp(atari_editor), 1, 0);
+						LOG(("Launched: %s %s (%d)\n", nsoption_charp(atari_editor), tempfile, err ));
 					} else {
 						printf("Could not open temp file: %s!\n", tempfile );
 					}

Modified: branches/vince/netsurf-options/atari/download.c
URL: http://source.netsurf-browser.org/branches/vince/netsurf-options/atari/download.c?rev=13531&r1=13530&r2=13531&view=diff
==============================================================================
--- branches/vince/netsurf-options/atari/download.c (original)
+++ branches/vince/netsurf-options/atari/download.c Sun Mar 18 18:19:30 2012
@@ -134,7 +134,7 @@
 
 	char *filename;
 	char *destination;
-	const char * path = option_downloads_path;
+	const char * path = nsoption_charp(downloads_path);
 	const char * url;
 	struct gui_download_window * gdw;
 

Modified: branches/vince/netsurf-options/atari/global_evnt.c
URL: http://source.netsurf-browser.org/branches/vince/netsurf-options/atari/global_evnt.c?rev=13531&r1=13530&r2=13531&view=diff
==============================================================================
--- branches/vince/netsurf-options/atari/global_evnt.c (original)
+++ branches/vince/netsurf-options/atari/global_evnt.c Sun Mar 18 18:19:30 2012
@@ -279,14 +279,14 @@
 
 static void __CDECL menu_fg_images(WINDOW *win, int item, int title, void *data)
 {
-	option_foreground_images = !option_foreground_images;
-	MenuIcheck( NULL, MAINMENU_M_FG_IMAGES, (option_foreground_images) ? 1 : 0);
+	nsoption_set_bool(foreground_images, !nsoption_bool(foreground_images));
+	MenuIcheck( NULL, MAINMENU_M_FG_IMAGES, (nsoption_bool(foreground_images)) ? 1 : 0);
 }
 
 static void __CDECL menu_bg_images(WINDOW *win, int item, int title, void *data)
 {
-	option_background_images = !option_background_images;
-	MenuIcheck( NULL, MAINMENU_M_BG_IMAGES, (option_background_images) ? 1 : 0);
+	nsoption_set_bool(background_images, !nsoption_bool(background_images));
+	MenuIcheck( NULL, MAINMENU_M_BG_IMAGES, (nsoption_bool(background_images)) ? 1 : 0);
 }
 
 static void __CDECL menu_back(WINDOW *win, int item, int title, void *data)
@@ -325,7 +325,7 @@
 	LOG(("%s", __FUNCTION__));
 	char buf[PATH_MAX];
 	strcpy((char*)&buf, "file://");
-	strncat((char*)&buf, option_url_file, PATH_MAX - (strlen("file://")+1) );
+	strncat((char*)&buf, nsoption_charp(url_file), PATH_MAX - (strlen("file://")+1) );
 	browser_window_create((char*)&buf, 0, 0, true, false);
 }
 
@@ -677,8 +677,8 @@
 void main_menu_update( void )
 {
 	MenuIcheck( NULL, MAINMENU_M_DEBUG_RENDER, (html_redraw_debug) ? 1 : 0);
-	MenuIcheck( NULL, MAINMENU_M_FG_IMAGES, (option_foreground_images) ? 1 : 0);
-	MenuIcheck( NULL, MAINMENU_M_BG_IMAGES, (option_background_images) ? 1 : 0);
+	MenuIcheck( NULL, MAINMENU_M_FG_IMAGES, (nsoption_bool(foreground_images)) ? 1 : 0);
+	MenuIcheck( NULL, MAINMENU_M_BG_IMAGES, (nsoption_bool(background_images)) ? 1 : 0);
 }
 
 

Modified: branches/vince/netsurf-options/atari/hotlist.c
URL: http://source.netsurf-browser.org/branches/vince/netsurf-options/atari/hotlist.c?rev=13531&r1=13530&r2=13531&view=diff
==============================================================================
--- branches/vince/netsurf-options/atari/hotlist.c (original)
+++ branches/vince/netsurf-options/atari/hotlist.c Sun Mar 18 18:19:30 2012
@@ -85,10 +85,10 @@
 
 void hotlist_init(void)
 {
-	if( strcmp(option_hotlist_file, "") == 0 ){
+	if( strcmp(nsoption_charp(hotlist_file), "") == 0 ){
 		atari_find_resource( (char*)&hl.path, "hotlist", "hotlist" );
 	} else {
-		strncpy( (char*)&hl.path, option_hotlist_file, PATH_MAX-1 );
+		strncpy( (char*)&hl.path, nsoption_charp(hotlist_file), PATH_MAX-1 );
 	}
 
 	LOG(("Hotlist: %s",  (char*)&hl.path ));

Modified: branches/vince/netsurf-options/atari/plot.c
URL: http://source.netsurf-browser.org/branches/vince/netsurf-options/atari/plot.c?rev=13531&r1=13530&r2=13531&view=diff
==============================================================================
--- branches/vince/netsurf-options/atari/plot.c (original)
+++ branches/vince/netsurf-options/atari/plot.c Sun Mar 18 18:19:30 2012
@@ -56,11 +56,11 @@
 	int flags = 0;
 	unsigned long font_flags = 0;
 
-	if( option_atari_dither == 1)
+	if( nsoption_int(atari_dither) == 1)
 		flags |= PLOT_FLAG_DITHER;
-	if( option_atari_transparency == 1 )
+	if( nsoption_int(atari_transparency) == 1 )
 		flags |= PLOT_FLAG_TRANS;
-	if( option_atari_font_monochrom == 1 )
+	if( nsoption_int(atari_font_monochrom) == 1 )
 		font_flags |= FONTPLOT_FLAG_MONOGLYPH;
 
 	vdih = app.graf.handle;

Modified: branches/vince/netsurf-options/atari/plot/font_freetype.c
URL: http://source.netsurf-browser.org/branches/vince/netsurf-options/atari/plot/font_freetype.c?rev=13531&r1=13530&r2=13531&view=diff
==============================================================================
--- branches/vince/netsurf-options/atari/plot/font_freetype.c (original)
+++ branches/vince/netsurf-options/atari/plot/font_freetype.c Sun Mar 18 18:19:30 2012
@@ -223,7 +223,7 @@
 
 	font_faces[FONT_FACE_SANS_SERIF] = NULL;
 	font_faces[FONT_FACE_SANS_SERIF] = ft_new_face(
-											option_atari_face_sans_serif,
+											nsoption_charp(atari_face_sans_serif),
                             				"fonts/ss.ttf",
                             				DEJAVU_PATH"DejaVuSans.ttf"
 										);
@@ -235,47 +235,47 @@
 	}
 
 	font_faces[FONT_FACE_SANS_SERIF_BOLD] =
-		ft_new_face(option_atari_face_sans_serif_bold,
+			ft_new_face(nsoption_charp(atari_face_sans_serif_bold),
                             "fonts/ssb.ttf",
                             DEJAVU_PATH"DejaVuSans-Bold.ttf");
 
 	font_faces[FONT_FACE_SANS_SERIF_ITALIC] =
-		ft_new_face(option_atari_face_sans_serif_italic,
+			ft_new_face(nsoption_charp(atari_face_sans_serif_italic),
                             "fonts/ssi.ttf",
                             DEJAVU_PATH"DejaVuSans-Oblique.ttf");
 
 	font_faces[FONT_FACE_SANS_SERIF_ITALIC_BOLD] =
-		ft_new_face(option_atari_face_sans_serif_italic_bold,
+			ft_new_face(nsoption_charp(atari_face_sans_serif_italic_bold),
                             "fonts/ssib.ttf",
                             DEJAVU_PATH"DejaVuSans-BoldOblique.ttf");
 
 	font_faces[FONT_FACE_MONOSPACE] =
-		ft_new_face(option_atari_face_monospace,
+			ft_new_face(nsoption_charp(atari_face_monospace),
                             "fonts/mono.ttf",
                             DEJAVU_PATH"DejaVuSansMono.ttf");
 
 	font_faces[FONT_FACE_MONOSPACE_BOLD] =
-		ft_new_face(option_atari_face_monospace_bold,
+			ft_new_face(nsoption_charp(atari_face_monospace_bold),
                             "fonts/monob.ttf",
                             DEJAVU_PATH"DejaVuSansMono-Bold.ttf");
 
 	font_faces[FONT_FACE_SERIF] =
-		ft_new_face(option_atari_face_serif,
+			ft_new_face(nsoption_charp(atari_face_serif),
                             "fonts/s.ttf",
                             DEJAVU_PATH"DejaVuSerif.ttf");
 
 	font_faces[FONT_FACE_SERIF_BOLD] =
-		ft_new_face(option_atari_face_serif_bold,
+			ft_new_face(nsoption_charp(atari_face_serif_bold),
                             "fonts/sb.ttf",
                             DEJAVU_PATH"DejaVuSerif-Bold.ttf");
 
 	font_faces[FONT_FACE_CURSIVE] =
-		ft_new_face(option_atari_face_cursive,
+			ft_new_face(nsoption_charp(atari_face_cursive),
                             "fonts/cursive.ttf",
                             DEJAVU_PATH"DejaVuSansMono-Oblique.ttf");
 
 	font_faces[FONT_FACE_FANTASY] =
-		ft_new_face(option_atari_face_fantasy,
+			ft_new_face(nsoption_charp(atari_face_fantasy),
                             "fonts/fantasy.ttf",
                             DEJAVU_PATH"DejaVuSerifCondensed-Bold.ttf");
 

Modified: branches/vince/netsurf-options/atari/settings.c
URL: http://source.netsurf-browser.org/branches/vince/netsurf-options/atari/settings.c?rev=13531&r1=13530&r2=13531&view=diff
==============================================================================
--- branches/vince/netsurf-options/atari/settings.c (original)
+++ branches/vince/netsurf-options/atari/settings.c Sun Mar 18 18:19:30 2012
@@ -478,48 +478,48 @@
 	// read current settings and display them
 
 	/* "Browser" tab: */
-	set_text( CHOICES_EDIT_HOMEPAGE, option_homepage_url,
+	set_text( CHOICES_EDIT_HOMEPAGE, nsoption_charp(homepage_url),
 			INPUT_HOMEPAGE_URL_MAX_LEN );
 
-	if( option_block_ads ){
+	if( nsoption_bool(block_ads) ){
 		OBJ_CHECK( CHOICES_CB_HIDE_ADVERTISEMENT );
 	} else {
 		OBJ_UNCHECK( CHOICES_CB_HIDE_ADVERTISEMENT );
 	}
-	if( option_target_blank ){
+	if( nsoption_bool(target_blank) ){
 		OBJ_UNCHECK( CHOICES_CB_DISABLE_POPUP_WINDOWS );
 	} else {
 		OBJ_CHECK( CHOICES_CB_DISABLE_POPUP_WINDOWS );
 	}
-	if( option_send_referer ){
+	if( nsoption_bool(send_referer) ){
 		OBJ_CHECK( CHOICES_CB_SEND_HTTP_REFERRER );
 	} else {
 		OBJ_UNCHECK( CHOICES_CB_SEND_HTTP_REFERRER );
 	}
 
 	set_text( CHOICES_BT_SEL_LOCALE,
-			option_accept_language ? option_accept_language : (char*)"en",
+		  nsoption_charp(accept_language) ? nsoption_charp(accept_language) : (char*)"en",
 			INPUT_LOCALE_MAX_LEN );
 
-	tmp_option_expire_url = option_expire_url;
-	sprintf( spare, "%02d", option_expire_url );
+	tmp_option_expire_url = nsoption_int(expire_url);
+	sprintf( spare, "%02d", nsoption_int(expire_url) );
 	set_text( CHOICES_EDIT_HISTORY_AGE, spare, 2 );
 
 	/* "Cache" tab: */
-	tmp_option_memory_cache_size = option_memory_cache_size / 100000;
+	tmp_option_memory_cache_size = nsoption_int(memory_cache_size) / 100000;
 	sprintf( spare, "%03.1f", tmp_option_memory_cache_size );
 	set_text( CHOICES_STR_MAX_MEM_CACHE, spare, 5 );
 
 	/* "Paths" tab: */
-	set_text( CHOICES_EDIT_DOWNLOAD_PATH, option_downloads_path,
+	set_text( CHOICES_EDIT_DOWNLOAD_PATH, nsoption_charp(downloads_path),
 			LABEL_PATH_MAX_LEN );
-	set_text( CHOICES_EDIT_HOTLIST_FILE, option_hotlist_file,
+	set_text( CHOICES_EDIT_HOTLIST_FILE, nsoption_charp(hotlist_file),
 			LABEL_PATH_MAX_LEN );
-	set_text( CHOICES_EDIT_CA_BUNDLE, option_ca_bundle,
+	set_text( CHOICES_EDIT_CA_BUNDLE, nsoption_charp(ca_bundle),
 			LABEL_PATH_MAX_LEN );
-	set_text( CHOICES_EDIT_CA_CERTS_PATH, option_ca_path,
+	set_text( CHOICES_EDIT_CA_CERTS_PATH, nsoption_charp(ca_path),
 			LABEL_PATH_MAX_LEN );
-	set_text( CHOICES_EDIT_EDITOR, option_atari_editor,
+	set_text( CHOICES_EDIT_EDITOR, nsoption_charp(atari_editor),
 			LABEL_PATH_MAX_LEN );
 
 	/* "Rendering" tab: */

Modified: branches/vince/netsurf-options/atari/system_colour.c
URL: http://source.netsurf-browser.org/branches/vince/netsurf-options/atari/system_colour.c?rev=13531&r1=13530&r2=13531&view=diff
==============================================================================
--- branches/vince/netsurf-options/atari/system_colour.c (original)
+++ branches/vince/netsurf-options/atari/system_colour.c Sun Mar 18 18:19:30 2012
@@ -44,170 +44,170 @@
 		"ActiveBorder", 
 		SLEN("ActiveBorder"), 
 		0xff000000, 
-		&option_sys_colour_ActiveBorder, 
+		&nsoption_colour(sys_colour_ActiveBorder), 
 		NULL 
 	}, { 
 		"ActiveCaption", 
 		SLEN("ActiveCaption"), 
 		0xffdddddd, 
-		&option_sys_colour_ActiveCaption, 
+		&nsoption_colour(sys_colour_ActiveCaption), 
 		NULL 
 	}, { 
 		"AppWorkspace", 
 		SLEN("AppWorkspace"), 
 		0xffeeeeee, 
-		&option_sys_colour_AppWorkspace, 
+		&nsoption_colour(sys_colour_AppWorkspace), 
 		NULL 
 	}, { 
 		"Background", 
 		SLEN("Background"), 
 		0xff0000aa, 
-		&option_sys_colour_Background, 
+		&nsoption_colour(sys_colour_Background), 
 		NULL 
 	}, {
 		"ButtonFace", 
 		SLEN("ButtonFace"), 
 		0xffaaaaaa, 
-		&option_sys_colour_ButtonFace, 
+		&nsoption_colour(sys_colour_ButtonFace), 
 		NULL 
 	}, {
 		"ButtonHighlight", 
 		SLEN("ButtonHighlight"), 
 		0xffdddddd, 
-		&option_sys_colour_ButtonHighlight, 
+		&nsoption_colour(sys_colour_ButtonHighlight), 
 		NULL
 	}, {
 		"ButtonShadow", 
 		SLEN("ButtonShadow"), 
 		0xffbbbbbb, 
-		&option_sys_colour_ButtonShadow, 
+		&nsoption_colour(sys_colour_ButtonShadow), 
 		NULL 
 	}, {
 		"ButtonText", 
 		SLEN("ButtonText"), 
 		0xff000000, 
-		&option_sys_colour_ButtonText, 
+		&nsoption_colour(sys_colour_ButtonText), 
 		NULL 
 	}, {
 		"CaptionText", 
 		SLEN("CaptionText"), 
 		0xff000000, 
-		&option_sys_colour_CaptionText, 
+		&nsoption_colour(sys_colour_CaptionText), 
 		NULL 
 	}, {
 		"GrayText", 
 		SLEN("GrayText"), 
 		0xffcccccc, 
-		&option_sys_colour_GrayText, 
+		&nsoption_colour(sys_colour_GrayText), 
 		NULL 
 	}, {
 		"Highlight", 
 		SLEN("Highlight"), 
 		0xff0000ee, 
-		&option_sys_colour_Highlight, 
+		&nsoption_colour(sys_colour_Highlight), 
 		NULL 
 	}, {
 		"HighlightText", 
 		SLEN("HighlightText"), 
 		0xff000000, 
-		&option_sys_colour_HighlightText, 
+		&nsoption_colour(sys_colour_HighlightText), 
 		NULL 
 	}, {
 		"InactiveBorder", 
 		SLEN("InactiveBorder"), 
 		0xffffffff, 
-		&option_sys_colour_InactiveBorder, 
+		&nsoption_colour(sys_colour_InactiveBorder), 
 		NULL 
 	}, {
 		"InactiveCaption", 
 		SLEN("InactiveCaption"), 
 		0xffffffff, 
-		&option_sys_colour_InactiveCaption, 
+		&nsoption_colour(sys_colour_InactiveCaption), 
 		NULL 
 	}, {
 		"InactiveCaptionText", 
 		SLEN("InactiveCaptionText"), 
 		0xffcccccc, 
-		&option_sys_colour_InactiveCaptionText, 
+		&nsoption_colour(sys_colour_InactiveCaptionText), 
 		NULL 
 	}, {
 		"InfoBackground", 
 		SLEN("InfoBackground"), 
 		0xffaaaaaa, 
-		&option_sys_colour_InfoBackground, 
+		&nsoption_colour(sys_colour_InfoBackground), 
 		NULL 
 	}, {
 		"InfoText", 
 		SLEN("InfoText"), 
 		0xff000000, 
-		&option_sys_colour_InfoText, 
+		&nsoption_colour(sys_colour_InfoText), 
 		NULL 
 	}, {
 		"Menu", 
 		SLEN("Menu"), 
 		0xffaaaaaa, 
-		&option_sys_colour_Menu, 
+		&nsoption_colour(sys_colour_Menu), 
 		NULL 
 	}, {
 		"MenuText", 
 		SLEN("MenuText"), 
 		0xff000000, 
-		&option_sys_colour_MenuText, 
+		&nsoption_colour(sys_colour_MenuText), 
 		NULL 
 	}, {
 		"Scrollbar", 
 		SLEN("Scrollbar"), 
 		0xffaaaaaa, 
-		&option_sys_colour_Scrollbar, 
+		&nsoption_colour(sys_colour_Scrollbar), 
 		NULL 
 	}, {
 		"ThreeDDarkShadow", 
 		SLEN("ThreeDDarkShadow"), 
 		0xff555555, 
-		&option_sys_colour_ThreeDDarkShadow, 
+		&nsoption_colour(sys_colour_ThreeDDarkShadow), 
 		NULL 
 	}, {
 		"ThreeDFace", 
 		SLEN("ThreeDFace"), 
 		0xffdddddd, 
-		&option_sys_colour_ThreeDFace, 
+		&nsoption_colour(sys_colour_ThreeDFace), 
 		NULL 
 	}, {
 		"ThreeDHighlight", 
 		SLEN("ThreeDHighlight"), 
 		0xffaaaaaa, 
-		&option_sys_colour_ThreeDHighlight, 
+		&nsoption_colour(sys_colour_ThreeDHighlight), 
 		NULL 
 	}, {
 		"ThreeDLightShadow", 
 		SLEN("ThreeDLightShadow"), 
 		0xff999999, 
-		&option_sys_colour_ThreeDLightShadow, 
+		&nsoption_colour(sys_colour_ThreeDLightShadow), 
 		NULL 
 	}, {
 		"ThreeDShadow", 
 		SLEN("ThreeDShadow"), 
 		0xff777777, 
-		&option_sys_colour_ThreeDShadow, 
+		&nsoption_colour(sys_colour_ThreeDShadow), 
 		NULL 
 	}, {
 		"Window", 
 		SLEN("Window"), 
 		0xffaaaaaa, 
-		&option_sys_colour_Window, 
+		&nsoption_colour(sys_colour_Window), 
 		NULL 
 	}, {
 		"WindowFrame", 
 		SLEN("WindowFrame"), 
 		0xff000000, 
-		&option_sys_colour_WindowFrame, 
+		&nsoption_colour(sys_colour_WindowFrame), 
 		NULL 
 	}, {
 		
 		"WindowText", 
 		SLEN("WindowText"), 
 		0xff000000, 
-		&option_sys_colour_WindowText, 
+		&nsoption_colour(sys_colour_WindowText), 
 		NULL 
 	},
 




More information about the netsurf-commits mailing list