Switch pref init to ctor.
This commit is contained in:
@@ -345,9 +345,6 @@ int main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
// set the default values for the preferences
|
||||
a_Prefs_init();
|
||||
|
||||
// create ~/.flenser if not present
|
||||
Paths::init();
|
||||
|
||||
|
||||
+89
-89
@@ -36,98 +36,98 @@ DilloPrefs prefs;
|
||||
* Sets the default settings.
|
||||
*/
|
||||
|
||||
void a_Prefs_init(void)
|
||||
DilloPrefs::DilloPrefs()
|
||||
{
|
||||
prefs.allow_white_bg = TRUE;
|
||||
prefs.white_bg_replacement = 0xe0e0a3; // 0xdcd1ba;
|
||||
prefs.bg_color = 0xdcd1ba;
|
||||
prefs.buffered_drawing = 1;
|
||||
prefs.contrast_visited_color = TRUE;
|
||||
prefs.enterpress_forces_submit = FALSE;
|
||||
prefs.focus_new_tab = FALSE;
|
||||
prefs.font_cursive = (PREFS_FONT_CURSIVE);
|
||||
prefs.font_factor = 1.0;
|
||||
prefs.zoom_factor = 1.0;
|
||||
prefs.font_max_size = 100;
|
||||
prefs.font_min_size = 6;
|
||||
prefs.font_fantasy = (PREFS_FONT_FANTASY);
|
||||
prefs.font_monospace = (PREFS_FONT_MONOSPACE);
|
||||
prefs.font_sans_serif = (PREFS_FONT_SANS_SERIF);
|
||||
prefs.font_serif = (PREFS_FONT_SERIF);
|
||||
prefs.fullwindow_start = FALSE;
|
||||
allow_white_bg = TRUE;
|
||||
white_bg_replacement = 0xe0e0a3; // 0xdcd1ba;
|
||||
bg_color = 0xdcd1ba;
|
||||
buffered_drawing = 1;
|
||||
contrast_visited_color = TRUE;
|
||||
enterpress_forces_submit = FALSE;
|
||||
focus_new_tab = FALSE;
|
||||
font_cursive = (PREFS_FONT_CURSIVE);
|
||||
font_factor = 1.0;
|
||||
zoom_factor = 1.0;
|
||||
font_max_size = 100;
|
||||
font_min_size = 6;
|
||||
font_fantasy = (PREFS_FONT_FANTASY);
|
||||
font_monospace = (PREFS_FONT_MONOSPACE);
|
||||
font_sans_serif = (PREFS_FONT_SANS_SERIF);
|
||||
font_serif = (PREFS_FONT_SERIF);
|
||||
fullwindow_start = FALSE;
|
||||
|
||||
/* these four constitute the geometry */
|
||||
prefs.width = PREFS_GEOMETRY_DEFAULT_WIDTH;
|
||||
prefs.height = PREFS_GEOMETRY_DEFAULT_HEIGHT;
|
||||
prefs.xpos = PREFS_GEOMETRY_DEFAULT_XPOS;
|
||||
prefs.ypos = PREFS_GEOMETRY_DEFAULT_YPOS;
|
||||
width = PREFS_GEOMETRY_DEFAULT_WIDTH;
|
||||
height = PREFS_GEOMETRY_DEFAULT_HEIGHT;
|
||||
xpos = PREFS_GEOMETRY_DEFAULT_XPOS;
|
||||
ypos = PREFS_GEOMETRY_DEFAULT_YPOS;
|
||||
|
||||
prefs.home = a_Url_new(PREFS_HOME, NULL);
|
||||
prefs.http_max_conns = 6;
|
||||
prefs.http_persistent_conns = TRUE;
|
||||
prefs.http_referer = PREFS_HTTP_REFERER;
|
||||
prefs.http_strict_transport_security = TRUE;
|
||||
prefs.http_force_https = FALSE;
|
||||
prefs.http_user_agent = PREFS_HTTP_USER_AGENT;
|
||||
prefs.limit_text_width = FALSE;
|
||||
prefs.adjust_min_width = TRUE;
|
||||
prefs.adjust_table_min_width = TRUE;
|
||||
prefs.load_images=TRUE;
|
||||
prefs.load_background_images=FALSE;
|
||||
prefs.load_stylesheets=TRUE;
|
||||
prefs.middle_click_drags_page = TRUE;
|
||||
prefs.middle_click_opens_new_tab = TRUE;
|
||||
prefs.right_click_closes_tab = TRUE;
|
||||
prefs.scroll_switches_tabs = TRUE;
|
||||
prefs.scroll_switches_tabs_reverse = FALSE;
|
||||
prefs.no_proxy = PREFS_NO_PROXY;
|
||||
prefs.panel_size = P_medium;
|
||||
prefs.parse_embedded_css=TRUE;
|
||||
prefs.save_dir = PREFS_SAVE_DIR;
|
||||
prefs.scroll_step = 100;
|
||||
prefs.scroll_page_overlap = 50;
|
||||
prefs.search_urls.push_back(PREFS_SEARCH_URL);
|
||||
prefs.search_url_idx = 0;
|
||||
prefs.scrollbar_on_left = FALSE;
|
||||
prefs.scrollbar_page_mode = FALSE;
|
||||
prefs.show_back = TRUE;
|
||||
prefs.show_bookmarks = TRUE;
|
||||
prefs.show_clear_url = TRUE;
|
||||
prefs.show_extra_warnings = FALSE;
|
||||
prefs.show_filemenu=TRUE;
|
||||
prefs.show_forw = TRUE;
|
||||
prefs.show_help = TRUE;
|
||||
prefs.show_home = TRUE;
|
||||
prefs.show_msg = TRUE;
|
||||
prefs.show_progress_box = TRUE;
|
||||
prefs.show_quit_dialog = FALSE;
|
||||
prefs.show_reload = TRUE;
|
||||
prefs.show_save = TRUE;
|
||||
prefs.show_url = TRUE;
|
||||
prefs.show_search = TRUE;
|
||||
prefs.show_stop = TRUE;
|
||||
prefs.show_tools = TRUE;
|
||||
prefs.show_tooltip = TRUE;
|
||||
prefs.show_ui_tooltip = TRUE;
|
||||
prefs.small_icons = FALSE;
|
||||
prefs.start_page = a_Url_new(PREFS_START_PAGE, NULL);
|
||||
prefs.new_tab_page = a_Url_new(PREFS_NEW_TAB_PAGE, NULL);
|
||||
prefs.theme = PREFS_THEME;
|
||||
prefs.ui_button_highlight_color = -1;
|
||||
prefs.ui_fg_color = -1;
|
||||
prefs.ui_main_bg_color = -1;
|
||||
prefs.ui_selection_color = -1;
|
||||
prefs.ui_tab_active_bg_color = -1;
|
||||
prefs.ui_tab_bg_color = -1;
|
||||
prefs.ui_tab_active_fg_color = -1;
|
||||
prefs.ui_tab_height = 20;
|
||||
prefs.ui_tab_fg_color = -1;
|
||||
prefs.ui_text_bg_color = -1;
|
||||
home = a_Url_new(PREFS_HOME, NULL);
|
||||
http_max_conns = 6;
|
||||
http_persistent_conns = TRUE;
|
||||
http_referer = PREFS_HTTP_REFERER;
|
||||
http_strict_transport_security = TRUE;
|
||||
http_force_https = FALSE;
|
||||
http_user_agent = PREFS_HTTP_USER_AGENT;
|
||||
limit_text_width = FALSE;
|
||||
adjust_min_width = TRUE;
|
||||
adjust_table_min_width = TRUE;
|
||||
load_images=TRUE;
|
||||
load_background_images=FALSE;
|
||||
load_stylesheets=TRUE;
|
||||
middle_click_drags_page = TRUE;
|
||||
middle_click_opens_new_tab = TRUE;
|
||||
right_click_closes_tab = TRUE;
|
||||
scroll_switches_tabs = TRUE;
|
||||
scroll_switches_tabs_reverse = FALSE;
|
||||
no_proxy = PREFS_NO_PROXY;
|
||||
panel_size = P_medium;
|
||||
parse_embedded_css=TRUE;
|
||||
save_dir = PREFS_SAVE_DIR;
|
||||
scroll_step = 100;
|
||||
scroll_page_overlap = 50;
|
||||
search_urls.push_back(PREFS_SEARCH_URL);
|
||||
search_url_idx = 0;
|
||||
scrollbar_on_left = FALSE;
|
||||
scrollbar_page_mode = FALSE;
|
||||
show_back = TRUE;
|
||||
show_bookmarks = TRUE;
|
||||
show_clear_url = TRUE;
|
||||
show_extra_warnings = FALSE;
|
||||
show_filemenu=TRUE;
|
||||
show_forw = TRUE;
|
||||
show_help = TRUE;
|
||||
show_home = TRUE;
|
||||
show_msg = TRUE;
|
||||
show_progress_box = TRUE;
|
||||
show_quit_dialog = FALSE;
|
||||
show_reload = TRUE;
|
||||
show_save = TRUE;
|
||||
show_url = TRUE;
|
||||
show_search = TRUE;
|
||||
show_stop = TRUE;
|
||||
show_tools = TRUE;
|
||||
show_tooltip = TRUE;
|
||||
show_ui_tooltip = TRUE;
|
||||
small_icons = FALSE;
|
||||
start_page = a_Url_new(PREFS_START_PAGE, NULL);
|
||||
new_tab_page = a_Url_new(PREFS_NEW_TAB_PAGE, NULL);
|
||||
theme = PREFS_THEME;
|
||||
ui_button_highlight_color = -1;
|
||||
ui_fg_color = -1;
|
||||
ui_main_bg_color = -1;
|
||||
ui_selection_color = -1;
|
||||
ui_tab_active_bg_color = -1;
|
||||
ui_tab_bg_color = -1;
|
||||
ui_tab_active_fg_color = -1;
|
||||
ui_tab_height = 20;
|
||||
ui_tab_fg_color = -1;
|
||||
ui_text_bg_color = -1;
|
||||
|
||||
prefs.penalty_hyphen = 100;
|
||||
prefs.penalty_hyphen_2 = 800;
|
||||
prefs.penalty_em_dash_left = 800;
|
||||
prefs.penalty_em_dash_right = 100;
|
||||
prefs.penalty_em_dash_right_2 = 800;
|
||||
prefs.stretchability_factor = 100;
|
||||
penalty_hyphen = 100;
|
||||
penalty_hyphen_2 = 800;
|
||||
penalty_em_dash_left = 800;
|
||||
penalty_em_dash_right = 100;
|
||||
penalty_em_dash_right_2 = 800;
|
||||
stretchability_factor = 100;
|
||||
}
|
||||
|
||||
@@ -131,6 +131,8 @@ struct DilloPrefs
|
||||
int penalty_em_dash_left, penalty_em_dash_right, penalty_em_dash_right_2;
|
||||
int stretchability_factor;
|
||||
std::vector< char * > link_actions;
|
||||
|
||||
DilloPrefs();
|
||||
};
|
||||
|
||||
/** Global Data */
|
||||
|
||||
Reference in New Issue
Block a user