Dillo v3.1.1-111-gd4f56d0d
Loading...
Searching...
No Matches
dillo.cc
Go to the documentation of this file.
1/*
2 * Dillo web browser
3 *
4 * Copyright 1999-2007 Jorge Arellano Cid <jcid@dillo.org>
5 * Copyright 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 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
25#include <stdio.h>
26#include <unistd.h>
27#include <stdlib.h>
28#include <time.h>
29#include <sys/types.h>
30#include <sys/wait.h>
31#include <signal.h>
32#include <locale.h>
33#include <errno.h>
34
35#include <FL/Fl.H>
36#include <FL/Fl_Window.H>
37#include <FL/fl_ask.H>
38#include <FL/fl_draw.H>
39
40#include "msg.h"
41#include "paths.hh"
42#include "uicmd.hh"
43
44#include "prefs.h"
45#include "prefsparser.hh"
46#include "keys.hh"
47#include "bw.h"
48#include "misc.h"
49#include "history.h"
50#include "version.hh"
51
52#include "dns.h"
53#include "web.hh"
54#include "IO/tls.h"
55#include "IO/Url.h"
56#include "IO/mime.h"
57#include "capi.h"
58#include "dicache.h"
59#include "cookies.h"
60#include "hsts.h"
61#include "domain.h"
62#include "auth.h"
63#include "styleengine.hh"
64
65#include "dw/fltkcore.hh"
66#include "dw/widget.hh"
67#include "dw/textblock.hh"
68#include "dw/table.hh"
69
70static volatile sig_atomic_t sig_reload = 0;
71
85
86typedef struct {
87 const char *shortopt;
88 const char *longopt;
89 int opt_argc; /* positive: mandatory, negative: optional */
90 OptID id;
91 const char *help;
92} CLI_options;
93
94static const CLI_options Options[] = {
95 {"-f", "--fullwindow", 0, DILLO_CLI_FULLWINDOW,
96 " -f, --fullwindow Start in full window mode: hide address bar,\n"
97 " navigation buttons, menu, and status bar."},
98 {"-g", "-geometry", 1, DILLO_CLI_GEOMETRY,
99 " -g, -geometry GEO Set initial window position where GEO is\n"
100 " WxH[{+-}X{+-}Y]"},
101 {"-h", "--help", 0, DILLO_CLI_HELP,
102 " -h, --help Display this help text and exit."},
103 {"-l", "--local", 0, DILLO_CLI_LOCAL,
104 " -l, --local Don't load images or stylesheets, or follow\n"
105 " redirections, for these FILEs or URLs."},
106 {"-v", "--version", 0, DILLO_CLI_VERSION,
107 " -v, --version Display version info and exit."},
108 {"-x", "--xid", 1, DILLO_CLI_XID,
109 " -x, --xid XID Open first Dillo window in an existing\n"
110 " window whose window ID is XID."},
111 {NULL, NULL, 0, DILLO_CLI_NONE, NULL}
112};
113
114
115/*
116 * SIGCHLD handling ----------------------------------------------------------
117 */
118
127static void raw_sigchld2(int signum)
128{
129 pid_t pid;
130 int status;
131
132 (void) signum; /* Unused */
133
134 while (1) {
135 pid = waitpid(-1, &status, WNOHANG);
136 if (pid > 0) {
137 if (WIFEXITED(status)) /* normal exit */
138 printf("[dpid]: terminated normally (%d)\n", WEXITSTATUS(status));
139 else if (WIFSIGNALED(status)) /* terminated by signal */
140 printf("[dpid]: terminated by signal %d\n", WTERMSIG(status));
141 } else if (pid == 0 || errno == ECHILD) {
142 break;
143 } else {
144 if (errno == EINTR)
145 continue;
146 perror("waitpid");
147 break;
148 }
149 }
150}
151
152static void handler_usr1(int signum)
153{
154 sig_reload = 1;
155}
156
160static void est_sigchld(void)
161{
162 struct sigaction sigact;
163 sigset_t set;
164
165 (void) sigemptyset(&set);
166 sigact.sa_handler = raw_sigchld2; /* our custom handler */
167 sigact.sa_mask = set; /* no aditional signal blocks */
168 sigact.sa_flags = SA_NOCLDSTOP; /* ignore stop/resume states */
169 if (sigaction(SIGCHLD, &sigact, NULL) == -1) {
170 perror("sigaction");
171 exit(1);
172 }
173
174 if (signal(SIGUSR1, handler_usr1) == SIG_ERR) {
175 perror("signal failed");
176 exit(1);
177 }
178}
179
180//----------------------------------------------------------------------------
181
185static void printHelp(const char *cmdname, const CLI_options *options)
186{
187 printf("Usage: %s [OPTION]... [--] [URL|FILE]...\n"
188 "Options:\n", cmdname);
189 while (options && options->help) {
190 printf("%s\n", options->help);
191 options++;
192 }
193 printf(" URL URL to browse.\n"
194 " FILE Local FILE to view.\n"
195 "\n");
196}
197
201static int numOptions(const CLI_options *options)
202{
203 int i, max;
204
205 for (i = 0, max = 0; options[i].shortopt; i++)
206 if (abs(options[i].opt_argc) > max)
207 max = abs(options[i].opt_argc);
208 return max;
209}
210
214static OptID getCmdOption(const CLI_options *options, int argc, char **argv,
215 char **opt_argv, int *idx)
216{
217 typedef enum { O_SEARCH, O_FOUND, O_NOTFOUND, O_DONE } State;
218 OptID opt_id = DILLO_CLI_NONE;
219 int i = 0;
220 State state = O_SEARCH;
221
222 if (*idx >= argc) {
223 state = O_DONE;
224 } else {
225 state = O_NOTFOUND;
226 for (i = 0; options[i].shortopt; i++) {
227 if (strcmp(options[i].shortopt, argv[*idx]) == 0 ||
228 strcmp(options[i].longopt, argv[*idx]) == 0) {
229 state = O_FOUND;
230 ++*idx;
231 break;
232 }
233 }
234 }
235 if (state == O_FOUND) {
236 int n_arg = options[i].opt_argc;
237 opt_id = options[i].id;
238 /* Find the required/optional arguments of the option */
239 for (i = 0; *idx < argc && i < abs(n_arg) && argv[*idx][0] != '-'; i++)
240 opt_argv[i] = argv[(*idx)++];
241 opt_argv[i] = NULL;
242
243 /* Optional arguments have opt_argc < 0 */
244 if (i < n_arg) {
245 fprintf(stderr, "Option %s requires %d argument%s\n",
246 argv[*idx-i-1], n_arg, (n_arg == 1) ? "" : "s");
247 opt_id = DILLO_CLI_ERROR;
248 }
249 }
250 if (state == O_NOTFOUND) {
251 if (strcmp(argv[*idx], "--") == 0)
252 (*idx)++;
253 else if (argv[*idx][0] == '-') {
254 fprintf(stderr, "Command line option \"%s\" not recognized.\n",
255 argv[*idx]);
256 opt_id = DILLO_CLI_ERROR;
257 }
258 }
259 return opt_id;
260}
261
266static void custLabelDraw(const Fl_Label* o, int X, int Y, int W, int H,
267 Fl_Align align)
268{
269 const int interpret_symbols = 0;
270
271 fl_draw_shortcut = 0;
272 fl_font(o->font, o->size);
273 fl_color((Fl_Color)o->color);
274 fl_draw(o->value, X, Y, W, H, align, o->image, interpret_symbols);
275}
276
277static void custLabelMeasure(const Fl_Label* o, int& W, int& H)
278{
279 const int interpret_symbols = 0;
280
281 fl_draw_shortcut = 0;
282 fl_font(o->font, o->size);
283 fl_measure(o->value, W, H, interpret_symbols);
284}
285
286static void custMenuLabelDraw(const Fl_Label* o, int X, int Y, int W, int H,
287 Fl_Align align)
288{
289 const int interpret_symbols = 0;
290
291 fl_draw_shortcut = 1;
292 fl_font(o->font, o->size);
293 fl_color((Fl_Color)o->color);
294 fl_draw(o->value, X, Y, W, H, align, o->image, interpret_symbols);
295}
296
297static void custMenuLabelMeasure(const Fl_Label* o, int& W, int& H)
298{
299 const int interpret_symbols = 0;
300
301 fl_draw_shortcut = 1;
302 fl_font(o->font, o->size);
303 fl_measure(o->value, W, H, interpret_symbols);
304}
305
309static void checkFont(const char *name, const char *type)
310{
312 MSG_WARN("preferred %s font \"%s\" not found.\n", type, name);
313}
314
316{
317 checkFont(prefs.font_sans_serif, "sans-serif");
318 checkFont(prefs.font_serif, "serif");
319 checkFont(prefs.font_monospace, "monospace");
320 checkFont(prefs.font_cursive, "cursive");
321 checkFont(prefs.font_fantasy, "fantasy");
322}
323
328static void setUIColorWdef(Fl_Color idx, int32_t color, Fl_Color default_val)
329{
330 if (color != -1)
331 Fl::set_color(idx, color << 8);
332 else if (default_val != 0xFFFFFFFF)
333 Fl::set_color(idx, default_val);
334}
335
336static void setColors()
337{
338 /* The main background is a special case because Fl::background() will
339 * set the "gray ramp", which is a set of lighter and darker colors based
340 * on the main background and used for box edges and such.
341 */
342 if (prefs.ui_main_bg_color != -1) {
343 uchar r = prefs.ui_main_bg_color >> 16,
344 g = prefs.ui_main_bg_color >> 8 & 0xff,
345 b = prefs.ui_main_bg_color & 0xff;
346
347 Fl::background(r, g, b);
348 }
349
350 setUIColorWdef(FL_BACKGROUND2_COLOR, prefs.ui_text_bg_color, 0xFFFFFFFF);
351 setUIColorWdef(FL_FOREGROUND_COLOR, prefs.ui_fg_color, 0xFFFFFFFF);
352 setUIColorWdef(FL_SELECTION_COLOR, prefs.ui_selection_color,
353 fl_contrast(FL_SELECTION_COLOR, FL_BACKGROUND2_COLOR));
356 fl_lighter(FL_BACKGROUND_COLOR));
358 Fl::get_color(FL_BACKGROUND2_COLOR));
360 Fl::get_color(FL_BACKGROUND_COLOR));
362 Fl::get_color(FL_FOREGROUND_COLOR));
364 Fl::get_color(FL_FOREGROUND_COLOR));
365}
366
370static DilloUrl *makeStartUrl(char *str, bool local)
371{
372 char *url_str, *p;
373 DilloUrl *start_url;
374
375 /* Relative path to a local file? */
376 p = (*str == '/') ? dStrdup(str) :
377 dStrconcat(Paths::getOldWorkingDir(), "/", str, NULL);
378
379 if (access(p, F_OK) == 0) {
380 /* absolute path may have non-URL characters */
381 url_str = a_Misc_escape_chars(p, "% #");
382 start_url = a_Url_new(url_str + 1, "file:/");
383 } else {
384 /* Not a file, filter URL string */
385 url_str = a_Url_string_strip_delimiters(str);
386 start_url = a_Url_new(url_str, NULL);
387 }
388 dFree(p);
389 dFree(url_str);
390
391 if (local)
392 a_Url_set_flags(start_url, URL_FLAGS(start_url) | URL_SpamSafe);
393
394 return start_url;
395}
396
397/*
398 * MAIN
399 */
400int main(int argc, char **argv)
401{
402 uint_t opt_id;
403 uint_t options_got = 0;
404 uint32_t xid = 0;
405 int idx = 1;
409 char **opt_argv;
410 FILE *fp;
411
412 srand((uint_t)(time(0) ^ getpid()));
413
414 // Some OSes exit dillo without this (not GNU/Linux).
415 signal(SIGPIPE, SIG_IGN);
416 // Establish our custom SIGCHLD handler
417 est_sigchld();
418
419 /* Handle command line options */
420 opt_argv = dNew0(char*, numOptions(Options) + 1);
421 while ((opt_id = getCmdOption(Options, argc, argv, opt_argv, &idx))) {
422 options_got |= opt_id;
423 switch (opt_id) {
425 case DILLO_CLI_LOCAL:
426 break;
427 case DILLO_CLI_XID:
428 {
429 char *end;
430 xid = strtol(opt_argv[0], &end, 0);
431 if (*end) {
432 fprintf(stderr, "XID argument \"%s\" not valid.\n",opt_argv[0]);
433 return 2;
434 }
435 break;
436 }
438 if (!a_Misc_parse_geometry(opt_argv[0],&xpos,&ypos,&width,&height)){
439 fprintf(stderr, "geometry argument \"%s\" not valid. Must be of "
440 "the form WxH[{+-}X{+-}Y].\n", opt_argv[0]);
441 return 2;
442 }
443 break;
446 return 0;
447 case DILLO_CLI_HELP:
448 printHelp(argv[0], Options);
449 return 0;
450 default:
451 printHelp(argv[0], Options);
452 return 2;
453 }
454 }
455 dFree(opt_argv);
456
457 // set the default values for the preferences
458 a_Prefs_init();
459
460 // create ~/.dillo if not present
461 Paths::init();
462
463 // initialize default key bindings
464 Keys::init();
465
466 // parse dillorc
467 if ((fp = Paths::getPrefsFP(PATHS_RC_PREFS))) {
468 PrefsParser::parse(fp);
469 }
470 // parse keysrc
471 if ((fp = Paths::getPrefsFP(PATHS_RC_KEYS))) {
472 Keys::parse(fp);
473 }
474 // parse domainrc
476 a_Domain_parse(fp);
477 fclose(fp);
478 }
480
481 // initialize internal modules
482 a_Dpi_init();
483 a_Dns_init();
484 a_Web_init();
485 a_Http_init();
486 a_Tls_init();
487 a_Mime_init();
488 a_Capi_init();
490 a_Bw_init();
493 a_Auth_init();
494 a_UIcmd_init();
496
505
506 /* command line options override preferences */
507 if (options_got & DILLO_CLI_FULLWINDOW)
509 if (options_got & DILLO_CLI_GEOMETRY) {
510 prefs.width = width;
511 prefs.height = height;
512 prefs.xpos = xpos;
513 prefs.ypos = ypos;
514 }
515
516 // Sets WM_CLASS hint on X11
517 Fl_Window::default_xclass("dillo");
518
519 Fl::scheme(prefs.theme);
520
521 // Disable drag and drop as it crashes on MacOSX
522 Fl::dnd_text_ops(0);
523
524 setColors();
525
526 if (!prefs.show_ui_tooltip) {
527 Fl::option(Fl::OPTION_SHOW_TOOLTIPS, false);
528 }
529
530 // Disable '@' and '&' interpretation in normal labels.
531 Fl::set_labeltype(FL_NORMAL_LABEL, custLabelDraw, custLabelMeasure);
532
533 // Use to permit '&' interpretation.
534 Fl::set_labeltype(FL_FREE_LABELTYPE,custMenuLabelDraw,custMenuLabelMeasure);
535
537
538 /* use preferred font for UI */
539 Fl_Font defaultFont = dw::fltk::FltkFont::get (prefs.font_sans_serif, 0);
540 Fl::set_font(FL_HELVETICA, defaultFont); // this seems to be the
541 // only way to set the
542 // default font in fltk1.3
543
544 fl_message_title_default("Dillo: Message");
545
546 // Create a new UI/bw pair
547 BrowserWindow *bw = a_UIcmd_browser_window_new(0, 0, xid, NULL);
548
549 /* We need this so that fl_text_extents() in dw/fltkplatform.cc can
550 * work when FLTK is configured without XFT and Dillo is opening
551 * immediately-available URLs from the cmdline (e.g. about:splash).
552 */
553 ((Fl_Widget *)bw->ui)->window()->make_current();
554
555 /* Proxy authentication */
557 const char *passwd = a_UIcmd_get_passwd(prefs.http_proxyuser);
558 if (passwd) {
560 } else {
561 MSG_WARN("Not using proxy authentication.\n");
562 }
563 }
564
565 /* Open URLs/files */
566 const bool local = options_got & DILLO_CLI_LOCAL;
567
568 if (idx == argc) {
569 /* No URLs/files on cmdline. Send startup screen */
570 if (dStrAsciiCasecmp(URL_SCHEME(prefs.start_page), "about") == 0 &&
571 strcmp(URL_PATH(prefs.start_page), "blank") == 0)
572 a_UIcmd_open_url(bw, NULL); // NULL URL focuses location
573 else {
576 }
577 } else {
578 for (int i = idx; i < argc; i++) {
579 DilloUrl *start_url = makeStartUrl(argv[i], local);
580
581 if (i > idx) {
583 /* user must prefer tabs */
584 const int focus = 1;
585 a_UIcmd_open_url_nt(bw, start_url, focus);
586 } else {
587 a_UIcmd_open_url_nw(bw, start_url);
588 }
589 } else {
590 a_UIcmd_open_url(bw, start_url);
591 a_UIcmd_set_location_text(bw, URL_STR(start_url));
592 }
593 a_Url_free(start_url);
594 }
595 }
596
597 /* Don't use, as it can be free()'d */
598 bw = NULL;
599
600 while (Fl::wait() > 0) {
601 if (sig_reload) {
602 sig_reload = 0;
604 }
605 }
606
607 /*
608 * Memory deallocating routines
609 * (This can be left to the OS, but we'll do it, with a view to test
610 * and fix our memory management)
611 */
622 Keys::free();
623 Paths::free();
626 /* TODO: auth, css */
627
628 //a_Dpi_dillo_exit();
629 MSG("Dillo: normal exit!\n");
630 return 0;
631}
void a_Auth_init(void)
Initialize the auth module.
Definition auth.c:59
#define MSG(...)
Definition bookmarks.c:46
int main(void)
Definition bookmarks.c:1613
void a_Bw_init(void)
Initialize global data.
Definition bw.c:36
void a_Cache_freeall(void)
Memory deallocator (only called at exit time)
Definition cache.c:1448
void a_Capi_init(void)
Initialize capi&cache data.
Definition capi.c:80
static void parse(FILE *fp)
Parse the keysrc.
Definition keys.cc:379
static void init()
Initialize the bindings list.
Definition keys.cc:153
static void free()
Free data.
Definition keys.cc:174
static char * getOldWorkingDir(void)
Return the initial current working directory in a string.
Definition paths.cc:64
static void init(void)
Changes current working directory to /tmp and creates ~/.dillo if not exists.
Definition paths.cc:31
static FILE * getPrefsFP(const char *rcFile)
Examines the path for "rcFile" and assign its file pointer to "fp".
Definition paths.cc:80
static void free(void)
Free memory.
Definition paths.cc:72
static void init()
Create the user agent style.
static void setAdjustTableMinWidth(bool adjustTableMinWidth)
Definition table.hh:497
static void setStretchabilityFactor(int stretchabilityFactor)
Definition textblock.cc:201
static void setPenaltyHyphen(int penaltyHyphen)
Definition textblock.cc:175
static void setPenaltyEmDashLeft(int penaltyLeftEmDash)
Definition textblock.cc:185
static void setPenaltyHyphen2(int penaltyHyphen2)
Definition textblock.cc:180
static void setPenaltyEmDashRight2(int penaltyRightEmDash2)
Definition textblock.cc:196
static void setPenaltyEmDashRight(int penaltyRightEmDash)
Definition textblock.cc:191
static void setAdjustMinWidth(bool adjustMinWidth)
Definition widget.hh:463
static bool fontExists(const char *name)
static Fl_Font get(const char *name, int attrs)
unsigned int uint_t
Definition d_size.h:20
void a_Dicache_init(void)
Initialize dicache data.
Definition dicache.c:66
void a_Dicache_freeall(void)
Deallocate memory used by dicache module (Call this one at exit time, with no cache clients queued)
Definition dicache.c:562
static void custLabelMeasure(const Fl_Label *o, int &W, int &H)
Definition dillo.cc:277
static void raw_sigchld2(int signum)
Avoid our children (Dpid) to become zombies.
Definition dillo.cc:127
static void est_sigchld(void)
Establish SIGCHLD handler.
Definition dillo.cc:160
static OptID getCmdOption(const CLI_options *options, int argc, char **argv, char **opt_argv, int *idx)
Get next command line option.
Definition dillo.cc:214
static const CLI_options Options[]
Definition dillo.cc:94
static void custLabelDraw(const Fl_Label *o, int X, int Y, int W, int H, Fl_Align align)
Set FL_NORMAL_LABEL to interpret neither symbols (@) nor shortcuts (&), and FL_FREE_LABELTYPE to inte...
Definition dillo.cc:266
static void handler_usr1(int signum)
Definition dillo.cc:152
static DilloUrl * makeStartUrl(char *str, bool local)
Given a command line argument, build a DilloUrl for it.
Definition dillo.cc:370
OptID
Command line options structure.
Definition dillo.cc:75
@ DILLO_CLI_XID
Definition dillo.cc:77
@ DILLO_CLI_LOCAL
Definition dillo.cc:81
@ DILLO_CLI_NONE
Definition dillo.cc:76
@ DILLO_CLI_FULLWINDOW
Definition dillo.cc:78
@ DILLO_CLI_HELP
Definition dillo.cc:79
@ DILLO_CLI_VERSION
Definition dillo.cc:80
@ DILLO_CLI_GEOMETRY
Definition dillo.cc:82
@ DILLO_CLI_ERROR
Definition dillo.cc:83
static void checkPreferredFonts()
Definition dillo.cc:315
static void printHelp(const char *cmdname, const CLI_options *options)
Print help text generated from the options structure.
Definition dillo.cc:185
static void checkFont(const char *name, const char *type)
Tell the user if default/pref fonts can't be found.
Definition dillo.cc:309
static void setUIColorWdef(Fl_Color idx, int32_t color, Fl_Color default_val)
Set UI color.
Definition dillo.cc:328
static volatile sig_atomic_t sig_reload
Definition dillo.cc:70
static void setColors()
Definition dillo.cc:336
static void custMenuLabelMeasure(const Fl_Label *o, int &W, int &H)
Definition dillo.cc:297
static void custMenuLabelDraw(const Fl_Label *o, int X, int Y, int W, int H, Fl_Align align)
Definition dillo.cc:286
static int numOptions(const CLI_options *options)
Return the maximum number of option arguments.
Definition dillo.cc:201
char * dStrconcat(const char *s1,...)
Concatenate a NULL-terminated list of strings.
Definition dlib.c:102
void dFree(void *mem)
Definition dlib.c:68
int dStrAsciiCasecmp(const char *s1, const char *s2)
Definition dlib.c:203
void dLib_show_messages(bool_t show)
Definition dlib.c:876
char * dStrdup(const char *s)
Definition dlib.c:77
#define dNew0(type, count)
Definition dlib.h:51
#define TRUE
Definition dlib.h:23
void a_Dns_init(void)
Initializer function.
Definition dns.c:177
void a_Dns_freeall(void)
Dns memory-deallocation.
Definition dns.c:480
void a_Domain_freeall(void)
Definition domain.c:79
void a_Domain_parse(FILE *fp)
Parse domainrc.
Definition domain.c:31
void a_History_freeall(void)
Free all the memory used by this module.
Definition history.c:152
void a_Hsts_freeall(void)
Definition hsts.c:55
void a_Hsts_init(FILE *preload_file)
Definition hsts.c:357
void a_Http_set_proxy_passwd(const char *str)
Activate entered proxy password for HTTP.
Definition http.c:156
int a_Http_init(void)
Initialize proxy vars and Accept-Language header.
Definition http.c:118
void a_Http_freeall(void)
Deallocate memory used by http module.
Definition http.c:1127
int a_Http_proxy_auth(void)
Tell whether the proxy auth is already set (user:password).
Definition http.c:148
#define MSG_WARN(...)
Definition msg.h:26
#define H(x, y, z)
void a_Mime_init(void)
Initializes Mime module and, sets the supported Mime types.
Definition mime.c:97
int a_Misc_parse_geometry(char *str, int *x, int *y, int *w, int *h)
Parse a geometry string.
Definition misc.c:360
char * a_Misc_escape_chars(const char *str, const char *esc_set)
Escape characters as XX sequences.
Definition misc.c:26
void freeall()
Definition core.hh:34
void freeall()
Definition fltkcore.hh:26
#define PATHS_RC_KEYS
Definition paths.hh:16
#define PATHS_RC_PREFS
Definition paths.hh:15
#define PATHS_HSTS_PRELOAD
Definition paths.hh:18
#define PATHS_RC_DOMAIN
Definition paths.hh:17
DilloPrefs prefs
Global Data.
Definition prefs.c:33
void a_Prefs_freeall(void)
memory-deallocation.
Definition prefs.c:143
void a_Prefs_init(void)
Sets the default settings.
Definition prefs.c:39
#define PREFS_GEOMETRY_DEFAULT_XPOS
Definition prefs.h:24
#define PREFS_GEOMETRY_DEFAULT_YPOS
Definition prefs.h:25
#define PREFS_GEOMETRY_DEFAULT_WIDTH
Definition prefs.h:22
#define PREFS_UI_TAB_ACTIVE_BG_COLOR
Definition prefs.h:29
#define PREFS_UI_TAB_ACTIVE_FG_COLOR
Definition prefs.h:30
#define PREFS_UI_TAB_FG_COLOR
Definition prefs.h:32
#define PREFS_UI_TAB_BG_COLOR
Definition prefs.h:31
#define PREFS_UI_BUTTON_HIGHLIGHT_COLOR
Definition prefs.h:28
#define PREFS_GEOMETRY_DEFAULT_HEIGHT
Definition prefs.h:23
void a_Dpi_init(void)
Definition dpi.c:84
void a_Cookies_init(void)
Initialize the cookies module (The 'disabled' variable is writable only within a_Cookies_init)
Definition cookies.c:117
void a_Cookies_freeall(void)
Flush cookies to disk and free all the memory allocated.
Definition cookies.c:135
Contains the specific data for a single window.
Definition bw.h:27
void * ui
Pointer to the UI object this bw belongs to.
Definition bw.h:29
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
int32_t ui_button_highlight_color
Definition prefs.h:55
char * font_fantasy
Definition prefs.h:110
int penalty_hyphen_2
Definition prefs.h:123
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
int width
Definition prefs.h:38
char * http_proxyuser
Definition prefs.h:45
int ypos
Definition prefs.h:41
char * font_serif
Definition prefs.h:107
int32_t ui_selection_color
Definition prefs.h:58
int32_t ui_fg_color
Definition prefs.h:56
int penalty_em_dash_right
Definition prefs.h:124
int32_t ui_tab_active_fg_color
Definition prefs.h:60
int32_t ui_tab_bg_color
Definition prefs.h:61
int32_t ui_text_bg_color
Definition prefs.h:64
int32_t ui_main_bg_color
Definition prefs.h:57
bool_t adjust_table_min_width
Definition prefs.h:73
DilloUrl * start_page
Definition prefs.h:49
bool_t show_ui_tooltip
Definition prefs.h:67
bool_t adjust_min_width
Definition prefs.h:72
int penalty_em_dash_right_2
Definition prefs.h:124
bool_t show_msg
Definition prefs.h:120
int stretchability_factor
Definition prefs.h:125
char * theme
Definition prefs.h:68
char * font_cursive
Definition prefs.h:109
bool_t middle_click_opens_new_tab
Definition prefs.h:113
int height
Definition prefs.h:39
int penalty_hyphen
Definition prefs.h:123
int penalty_em_dash_left
Definition prefs.h:124
Definition url.h:88
void a_Tls_init(void)
Initialize TLS library.
Definition tls.c:47
void a_Tls_freeall(void)
Clean up the TLS library.
Definition tls.c:117
const char * a_UIcmd_get_passwd(const char *user)
Definition uicmd.cc:1222
void a_UIcmd_reload_all_active()
Definition uicmd.cc:913
BrowserWindow * a_UIcmd_browser_window_new(int ww, int wh, uint32_t xid, const void *vbw)
Definition uicmd.cc:559
void a_UIcmd_open_url_nw(BrowserWindow *bw, const DilloUrl *url)
Definition uicmd.cc:836
void a_UIcmd_open_url(BrowserWindow *bw, const DilloUrl *url)
Definition uicmd.cc:801
void a_UIcmd_set_location_text(void *vbw, const char *text)
Definition uicmd.cc:1500
void a_UIcmd_open_url_nt(void *vbw, const DilloUrl *url, int focus)
Definition uicmd.cc:852
void a_UIcmd_init(void)
Definition uicmd.cc:1037
char * a_Url_string_strip_delimiters(const char *str)
RFC-3986 suggests this stripping when "importing" URLs from other media.
Definition url.c:658
void a_Url_set_flags(DilloUrl *u, int flags)
Set DilloUrl flags.
Definition url.c:527
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
#define URL_PATH(u)
Definition url.h:72
#define URL_SpamSafe
Definition url.h:40
#define URL_FLAGS(u)
Definition url.h:79
#define URL_STR(u)
Definition url.h:76
#define URL_SCHEME(u)
Definition url.h:70
void a_Version_print_info(void)
Definition version.cc:111
void a_Web_init(void)
Definition web.cc:38