Dillo v3.1.1-111-gd4f56d0d
Loading...
Searching...
No Matches
prefs.c
Go to the documentation of this file.
1/*
2 * Preferences
3 *
4 * Copyright (C) 2006-2009 Jorge Arellano Cid <jcid@dillo.org>
5 * Copyright (C) 2024 Rodrigo Arias Mallo <rodarima@gmail.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3 of the License, or
10 * (at your option) any later version.
11 */
12
13#include "prefs.h"
14
15#define PREFS_START_PAGE "about:splash"
16#define PREFS_HOME "https://dillo-browser.github.io/"
17#define PREFS_NEW_TAB_PAGE "about:blank"
18#define PREFS_FONT_SERIF "DejaVu Serif"
19#define PREFS_FONT_SANS_SERIF "DejaVu Sans"
20#define PREFS_FONT_CURSIVE "DejaVu Sans"
21#define PREFS_FONT_FANTASY "DejaVu Sans" /* TODO: find good default */
22#define PREFS_FONT_MONOSPACE "DejaVu Sans Mono"
23#define PREFS_SEARCH_URL "dd http://duckduckgo.com/lite/?kp=-1&kd=-1&q=%s"
24#define PREFS_NO_PROXY "localhost 127.0.0.1"
25#define PREFS_SAVE_DIR "/tmp/"
26#define PREFS_HTTP_REFERER "host"
27#define PREFS_HTTP_USER_AGENT "Dillo/" VERSION
28#define PREFS_THEME "none"
29
30/*-----------------------------------------------------------------------------
31 * Global Data
32 *---------------------------------------------------------------------------*/
34
39void a_Prefs_init(void)
40{
42 prefs.white_bg_replacement = 0xe0e0a3; // 0xdcd1ba;
43 prefs.bg_color = 0xdcd1ba;
49 prefs.font_factor = 1.0;
50 prefs.zoom_factor = 1.0;
51 prefs.font_max_size = 100;
58
59 /* these four constitute the geometry */
64
66 prefs.http_language = NULL;
67 prefs.http_proxy = NULL;
70 prefs.http_proxyuser = NULL;
90 prefs.scroll_step = 100;
121 prefs.ui_fg_color = -1;
127 prefs.ui_tab_height = 20;
130
131 prefs.penalty_hyphen = 100;
137}
138
void dFree(void *mem)
Definition dlib.c:68
char * dStrdup(const char *s)
Definition dlib.c:77
Dlist * dList_new(int size)
Create a new empty list.
Definition dlib.c:548
int dList_length(Dlist *lp)
For completing the ADT.
Definition dlib.c:613
void * dList_nth_data(Dlist *lp, int n0)
Return the nth data item, NULL when not found or 'n0' is out of range.
Definition dlib.c:662
void dList_append(Dlist *lp, void *data)
Append a data item to the list.
Definition dlib.c:597
void dList_free(Dlist *lp)
Free a list (not its elements)
Definition dlib.c:564
#define TRUE
Definition dlib.h:23
#define FALSE
Definition dlib.h:19
DilloPrefs prefs
Global Data.
Definition prefs.c:33
#define PREFS_HTTP_USER_AGENT
Definition prefs.c:27
#define PREFS_FONT_CURSIVE
Definition prefs.c:20
#define PREFS_NEW_TAB_PAGE
Definition prefs.c:17
void a_Prefs_freeall(void)
memory-deallocation.
Definition prefs.c:143
#define PREFS_FONT_MONOSPACE
Definition prefs.c:22
#define PREFS_HTTP_REFERER
Definition prefs.c:26
void a_Prefs_init(void)
Sets the default settings.
Definition prefs.c:39
#define PREFS_FONT_FANTASY
Definition prefs.c:21
#define PREFS_THEME
Definition prefs.c:28
#define PREFS_NO_PROXY
Definition prefs.c:24
#define PREFS_FONT_SERIF
Definition prefs.c:18
#define PREFS_SAVE_DIR
Definition prefs.c:25
#define PREFS_HOME
Definition prefs.c:16
#define PREFS_SEARCH_URL
Definition prefs.c:23
#define PREFS_FONT_SANS_SERIF
Definition prefs.c:19
#define PREFS_START_PAGE
Definition prefs.c:15
#define PREFS_GEOMETRY_DEFAULT_XPOS
Definition prefs.h:24
@ P_medium
Definition prefs.h:35
#define PREFS_GEOMETRY_DEFAULT_YPOS
Definition prefs.h:25
#define PREFS_GEOMETRY_DEFAULT_WIDTH
Definition prefs.h:22
#define PREFS_GEOMETRY_DEFAULT_HEIGHT
Definition prefs.h:23
bool_t http_persistent_conns
Definition prefs.h:103
bool_t enterpress_forces_submit
Definition prefs.h:112
bool_t show_progress_box
Definition prefs.h:96
int32_t ui_tab_fg_color
Definition prefs.h:62
char * font_sans_serif
Definition prefs.h:108
char * font_monospace
Definition prefs.h:111
bool_t parse_embedded_css
Definition prefs.h:102
bool_t show_reload
Definition prefs.h:86
bool_t show_filemenu
Definition prefs.h:91
bool_t small_icons
Definition prefs.h:70
int32_t ui_button_highlight_color
Definition prefs.h:55
char * font_fantasy
Definition prefs.h:110
bool_t load_images
Definition prefs.h:99
bool_t show_tooltip
Definition prefs.h:66
char * http_user_agent
Definition prefs.h:47
int penalty_hyphen_2
Definition prefs.h:123
int32_t http_max_conns
Definition prefs.h:43
char * no_proxy
Definition prefs.h:48
int xpos
Definition prefs.h:40
int32_t ui_tab_active_bg_color
Definition prefs.h:59
bool_t fullwindow_start
Definition prefs.h:98
bool_t show_help
Definition prefs.h:95
int width
Definition prefs.h:38
char * http_proxyuser
Definition prefs.h:45
DilloUrl * http_proxy
Definition prefs.h:44
int ypos
Definition prefs.h:41
int32_t font_min_size
Definition prefs.h:78
bool_t limit_text_width
Definition prefs.h:71
char * font_serif
Definition prefs.h:107
bool_t focus_new_tab
Definition prefs.h:74
int32_t ui_selection_color
Definition prefs.h:58
int32_t bg_color
Definition prefs.h:54
int32_t ui_fg_color
Definition prefs.h:56
int32_t white_bg_replacement
Definition prefs.h:53
bool_t show_extra_warnings
Definition prefs.h:121
bool_t load_background_images
Definition prefs.h:100
bool_t load_stylesheets
Definition prefs.h:101
bool_t show_tools
Definition prefs.h:90
int penalty_em_dash_right
Definition prefs.h:124
int32_t ui_tab_active_fg_color
Definition prefs.h:60
int32_t buffered_drawing
Definition prefs.h:106
bool_t show_search
Definition prefs.h:94
bool_t allow_white_bg
Definition prefs.h:52
bool_t show_stop
Definition prefs.h:88
int32_t ui_tab_bg_color
Definition prefs.h:61
int panel_size
Definition prefs.h:69
int32_t ui_text_bg_color
Definition prefs.h:64
bool_t middle_click_drags_page
Definition prefs.h:122
bool_t right_click_closes_tab
Definition prefs.h:114
int32_t ui_main_bg_color
Definition prefs.h:57
bool_t adjust_table_min_width
Definition prefs.h:73
bool_t show_quit_dialog
Definition prefs.h:97
bool_t http_strict_transport_security
Definition prefs.h:104
bool_t scrollbar_on_left
Definition prefs.h:81
bool_t scrollbar_page_mode
Definition prefs.h:82
int32_t scroll_page_overlap
Definition prefs.h:80
bool_t show_home
Definition prefs.h:85
DilloUrl * start_page
Definition prefs.h:49
bool_t http_force_https
Definition prefs.h:105
int32_t scroll_step
Definition prefs.h:79
bool_t show_ui_tooltip
Definition prefs.h:67
DilloUrl * new_tab_page
Definition prefs.h:51
bool_t adjust_min_width
Definition prefs.h:72
bool_t show_save
Definition prefs.h:87
bool_t contrast_visited_color
Definition prefs.h:65
bool_t scroll_switches_tabs
Definition prefs.h:115
int penalty_em_dash_right_2
Definition prefs.h:124
bool_t show_clear_url
Definition prefs.h:92
bool_t show_msg
Definition prefs.h:120
int stretchability_factor
Definition prefs.h:125
bool_t show_back
Definition prefs.h:83
bool_t scroll_switches_tabs_reverse
Definition prefs.h:116
bool_t show_bookmarks
Definition prefs.h:89
double zoom_factor
Definition prefs.h:76
Dlist * search_urls
Definition prefs.h:118
double font_factor
Definition prefs.h:75
char * http_referer
Definition prefs.h:46
char * theme
Definition prefs.h:68
char * font_cursive
Definition prefs.h:109
char * save_dir
Definition prefs.h:119
int32_t font_max_size
Definition prefs.h:77
bool_t middle_click_opens_new_tab
Definition prefs.h:113
bool_t show_url
Definition prefs.h:93
int32_t ui_tab_height
Definition prefs.h:63
int height
Definition prefs.h:39
int penalty_hyphen
Definition prefs.h:123
char * http_language
Definition prefs.h:42
DilloUrl * home
Definition prefs.h:50
bool_t search_url_idx
Definition prefs.h:117
bool_t show_forw
Definition prefs.h:84
int penalty_em_dash_left
Definition prefs.h:124
void a_Url_free(DilloUrl *url)
Free a DilloUrl.
Definition url.c:208
DilloUrl * a_Url_new(const char *url_str, const char *base_url)
Transform (and resolve) an URL string into the respective DilloURL.
Definition url.c:371