Dillo v3.1.1-98-g318d1f14
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
51#include "dns.h"
52#include "web.hh"
53#include "IO/tls.h"
54#include "IO/Url.h"
55#include "IO/mime.h"
56#include "capi.h"
57#include "dicache.h"
58#include "cookies.h"
59#include "hsts.h"
60#include "domain.h"
61#include "auth.h"
62#include "styleengine.hh"
63
64#include "dw/fltkcore.hh"
65#include "dw/widget.hh"
66#include "dw/textblock.hh"
67#include "dw/table.hh"
68
69static volatile sig_atomic_t sig_reload = 0;
70
84
85typedef struct {
86 const char *shortopt;
87 const char *longopt;
88 int opt_argc; /* positive: mandatory, negative: optional */
89 OptID id;
90 const char *help;
91} CLI_options;
92
93static const CLI_options Options[] = {
94 {"-f", "--fullwindow", 0, DILLO_CLI_FULLWINDOW,
95 " -f, --fullwindow Start in full window mode: hide address bar,\n"
96 " navigation buttons, menu, and status bar."},
97 {"-g", "-geometry", 1, DILLO_CLI_GEOMETRY,
98 " -g, -geometry GEO Set initial window position where GEO is\n"
99 " WxH[{+-}X{+-}Y]"},
100 {"-h", "--help", 0, DILLO_CLI_HELP,
101 " -h, --help Display this help text and exit."},
102 {"-l", "--local", 0, DILLO_CLI_LOCAL,
103 " -l, --local Don't load images or stylesheets, or follow\n"
104 " redirections, for these FILEs or URLs."},
105 {"-v", "--version", 0, DILLO_CLI_VERSION,
106 " -v, --version Display version info and exit."},
107 {"-x", "--xid", 1, DILLO_CLI_XID,
108 " -x, --xid XID Open first Dillo window in an existing\n"
109 " window whose window ID is XID."},
110 {NULL, NULL, 0, DILLO_CLI_NONE, NULL}
111};
112
113
114/*
115 * SIGCHLD handling ----------------------------------------------------------
116 */
117
126static void raw_sigchld2(int signum)
127{
128 pid_t pid;
129 int status;
130
131 (void) signum; /* Unused */
132
133 while (1) {
134 pid = waitpid(-1, &status, WNOHANG);
135 if (pid > 0) {
136 if (WIFEXITED(status)) /* normal exit */
137 printf("[dpid]: terminated normally (%d)\n", WEXITSTATUS(status));
138 else if (WIFSIGNALED(status)) /* terminated by signal */
139 printf("[dpid]: terminated by signal %d\n", WTERMSIG(status));
140 } else if (pid == 0 || errno == ECHILD) {
141 break;
142 } else {
143 if (errno == EINTR)
144 continue;
145 perror("waitpid");
146 break;
147 }
148 }
149}
150
151static void handler_usr1(int signum)
152{
153 sig_reload = 1;
154}
155
159static void est_sigchld(void)
160{
161 struct sigaction sigact;
162 sigset_t set;
163
164 (void) sigemptyset(&set);
165 sigact.sa_handler = raw_sigchld2; /* our custom handler */
166 sigact.sa_mask = set; /* no aditional signal blocks */
167 sigact.sa_flags = SA_NOCLDSTOP; /* ignore stop/resume states */
168 if (sigaction(SIGCHLD, &sigact, NULL) == -1) {
169 perror("sigaction");
170 exit(1);
171 }
172
173 if (signal(SIGUSR1, handler_usr1) == SIG_ERR) {
174 perror("signal failed");
175 exit(1);
176 }
177}
178
179//----------------------------------------------------------------------------
180
184static void printHelp(const char *cmdname, const CLI_options *options)
185{
186 printf("Usage: %s [OPTION]... [--] [URL|FILE]...\n"
187 "Options:\n", cmdname);
188 while (options && options->help) {
189 printf("%s\n", options->help);
190 options++;
191 }
192 printf(" URL URL to browse.\n"
193 " FILE Local FILE to view.\n"
194 "\n");
195}
196
200static int numOptions(const CLI_options *options)
201{
202 int i, max;
203
204 for (i = 0, max = 0; options[i].shortopt; i++)
205 if (abs(options[i].opt_argc) > max)
206 max = abs(options[i].opt_argc);
207 return max;
208}
209
213static OptID getCmdOption(const CLI_options *options, int argc, char **argv,
214 char **opt_argv, int *idx)
215{
216 typedef enum { O_SEARCH, O_FOUND, O_NOTFOUND, O_DONE } State;
217 OptID opt_id = DILLO_CLI_NONE;
218 int i = 0;
219 State state = O_SEARCH;
220
221 if (*idx >= argc) {
222 state = O_DONE;
223 } else {
224 state = O_NOTFOUND;
225 for (i = 0; options[i].shortopt; i++) {
226 if (strcmp(options[i].shortopt, argv[*idx]) == 0 ||
227 strcmp(options[i].longopt, argv[*idx]) == 0) {
228 state = O_FOUND;
229 ++*idx;
230 break;
231 }
232 }
233 }
234 if (state == O_FOUND) {
235 int n_arg = options[i].opt_argc;
236 opt_id = options[i].id;
237 /* Find the required/optional arguments of the option */
238 for (i = 0; *idx < argc && i < abs(n_arg) && argv[*idx][0] != '-'; i++)
239 opt_argv[i] = argv[(*idx)++];
240 opt_argv[i] = NULL;
241
242 /* Optional arguments have opt_argc < 0 */
243 if (i < n_arg) {
244 fprintf(stderr, "Option %s requires %d argument%s\n",
245 argv[*idx-i-1], n_arg, (n_arg == 1) ? "" : "s");
246 opt_id = DILLO_CLI_ERROR;
247 }
248 }
249 if (state == O_NOTFOUND) {
250 if (strcmp(argv[*idx], "--") == 0)
251 (*idx)++;
252 else if (argv[*idx][0] == '-') {
253 fprintf(stderr, "Command line option \"%s\" not recognized.\n",
254 argv[*idx]);
255 opt_id = DILLO_CLI_ERROR;
256 }
257 }
258 return opt_id;
259}
260
265static void custLabelDraw(const Fl_Label* o, int X, int Y, int W, int H,
266 Fl_Align align)
267{
268 const int interpret_symbols = 0;
269
270 fl_draw_shortcut = 0;
271 fl_font(o->font, o->size);
272 fl_color((Fl_Color)o->color);
273 fl_draw(o->value, X, Y, W, H, align, o->image, interpret_symbols);
274}
275
276static void custLabelMeasure(const Fl_Label* o, int& W, int& H)
277{
278 const int interpret_symbols = 0;
279
280 fl_draw_shortcut = 0;
281 fl_font(o->font, o->size);
282 fl_measure(o->value, W, H, interpret_symbols);
283}
284
285static void custMenuLabelDraw(const Fl_Label* o, int X, int Y, int W, int H,
286 Fl_Align align)
287{
288 const int interpret_symbols = 0;
289
290 fl_draw_shortcut = 1;
291 fl_font(o->font, o->size);
292 fl_color((Fl_Color)o->color);
293 fl_draw(o->value, X, Y, W, H, align, o->image, interpret_symbols);
294}
295
296static void custMenuLabelMeasure(const Fl_Label* o, int& W, int& H)
297{
298 const int interpret_symbols = 0;
299
300 fl_draw_shortcut = 1;
301 fl_font(o->font, o->size);
302 fl_measure(o->value, W, H, interpret_symbols);
303}
304
308static void checkFont(const char *name, const char *type)
309{
311 MSG_WARN("preferred %s font \"%s\" not found.\n", type, name);
312}
313
315{
316 checkFont(prefs.font_sans_serif, "sans-serif");
317 checkFont(prefs.font_serif, "serif");
318 checkFont(prefs.font_monospace, "monospace");
319 checkFont(prefs.font_cursive, "cursive");
320 checkFont(prefs.font_fantasy, "fantasy");
321}
322
327static void setUIColorWdef(Fl_Color idx, int32_t color, Fl_Color default_val)
328{
329 if (color != -1)
330 Fl::set_color(idx, color << 8);
331 else if (default_val != 0xFFFFFFFF)
332 Fl::set_color(idx, default_val);
333}
334
335static void setColors()
336{
337 /* The main background is a special case because Fl::background() will
338 * set the "gray ramp", which is a set of lighter and darker colors based
339 * on the main background and used for box edges and such.
340 */
341 if (prefs.ui_main_bg_color != -1) {
342 uchar r = prefs.ui_main_bg_color >> 16,
343 g = prefs.ui_main_bg_color >> 8 & 0xff,
344 b = prefs.ui_main_bg_color & 0xff;
345
346 Fl::background(r, g, b);
347 }
348
349 setUIColorWdef(FL_BACKGROUND2_COLOR, prefs.ui_text_bg_color, 0xFFFFFFFF);
350 setUIColorWdef(FL_FOREGROUND_COLOR, prefs.ui_fg_color, 0xFFFFFFFF);
351 setUIColorWdef(FL_SELECTION_COLOR, prefs.ui_selection_color,
352 fl_contrast(FL_SELECTION_COLOR, FL_BACKGROUND2_COLOR));
355 fl_lighter(FL_BACKGROUND_COLOR));
357 Fl::get_color(FL_BACKGROUND2_COLOR));
359 Fl::get_color(FL_BACKGROUND_COLOR));
361 Fl::get_color(FL_FOREGROUND_COLOR));
363 Fl::get_color(FL_FOREGROUND_COLOR));
364}
365
369static DilloUrl *makeStartUrl(char *str, bool local)
370{
371 char *url_str, *p;
372 DilloUrl *start_url;
373
374 /* Relative path to a local file? */
375 p = (*str == '/') ? dStrdup(str) :
376 dStrconcat(Paths::getOldWorkingDir(), "/", str, NULL);
377
378 if (access(p, F_OK) == 0) {
379 /* absolute path may have non-URL characters */
380 url_str = a_Misc_escape_chars(p, "% #");
381 start_url = a_Url_new(url_str + 1, "file:/");
382 } else {
383 /* Not a file, filter URL string */
384 url_str = a_Url_string_strip_delimiters(str);
385 start_url = a_Url_new(url_str, NULL);
386 }
387 dFree(p);
388 dFree(url_str);
389
390 if (local)
391 a_Url_set_flags(start_url, URL_FLAGS(start_url) | URL_SpamSafe);
392
393 return start_url;
394}
395
396/*
397 * MAIN
398 */
399int main(int argc, char **argv)
400{
401 uint_t opt_id;
402 uint_t options_got = 0;
403 uint32_t xid = 0;
404 int idx = 1;
408 char **opt_argv;
409 FILE *fp;
410
411 srand((uint_t)(time(0) ^ getpid()));
412
413 // Some OSes exit dillo without this (not GNU/Linux).
414 signal(SIGPIPE, SIG_IGN);
415 // Establish our custom SIGCHLD handler
416 est_sigchld();
417
418 /* Handle command line options */
419 opt_argv = dNew0(char*, numOptions(Options) + 1);
420 while ((opt_id = getCmdOption(Options, argc, argv, opt_argv, &idx))) {
421 options_got |= opt_id;
422 switch (opt_id) {
424 case DILLO_CLI_LOCAL:
425 break;
426 case DILLO_CLI_XID:
427 {
428 char *end;
429 xid = strtol(opt_argv[0], &end, 0);
430 if (*end) {
431 fprintf(stderr, "XID argument \"%s\" not valid.\n",opt_argv[0]);
432 return 2;
433 }
434 break;
435 }
437 if (!a_Misc_parse_geometry(opt_argv[0],&xpos,&ypos,&width,&height)){
438 fprintf(stderr, "geometry argument \"%s\" not valid. Must be of "
439 "the form WxH[{+-}X{+-}Y].\n", opt_argv[0]);
440 return 2;
441 }
442 break;
444 puts("Dillo version " VERSION);
445 return 0;
446 case DILLO_CLI_HELP:
447 printHelp(argv[0], Options);
448 return 0;
449 default:
450 printHelp(argv[0], Options);
451 return 2;
452 }
453 }
454 dFree(opt_argv);
455
456 // set the default values for the preferences
457 a_Prefs_init();
458
459 // create ~/.dillo if not present
460 Paths::init();
461
462 // initialize default key bindings
463 Keys::init();
464
465 // parse dillorc
466 if ((fp = Paths::getPrefsFP(PATHS_RC_PREFS))) {
467 PrefsParser::parse(fp);
468 }
469 // parse keysrc
470 if ((fp = Paths::getPrefsFP(PATHS_RC_KEYS))) {
471 Keys::parse(fp);
472 }
473 // parse domainrc
475 a_Domain_parse(fp);
476 fclose(fp);
477 }
479
480 // initialize internal modules
481 a_Dpi_init();
482 a_Dns_init();
483 a_Web_init();
484 a_Http_init();
485 a_Tls_init();
486 a_Mime_init();
487 a_Capi_init();
489 a_Bw_init();
492 a_Auth_init();
493 a_UIcmd_init();
495
504
505 /* command line options override preferences */
506 if (options_got & DILLO_CLI_FULLWINDOW)
508 if (options_got & DILLO_CLI_GEOMETRY) {
509 prefs.width = width;
510 prefs.height = height;
511 prefs.xpos = xpos;
512 prefs.ypos = ypos;
513 }
514
515 // Sets WM_CLASS hint on X11
516 Fl_Window::default_xclass("dillo");
517
518 Fl::scheme(prefs.theme);
519
520 // Disable drag and drop as it crashes on MacOSX
521 Fl::dnd_text_ops(0);
522
523 setColors();
524
525 if (!prefs.show_ui_tooltip) {
526 Fl::option(Fl::OPTION_SHOW_TOOLTIPS, false);
527 }
528
529 // Disable '@' and '&' interpretation in normal labels.
530 Fl::set_labeltype(FL_NORMAL_LABEL, custLabelDraw, custLabelMeasure);
531
532 // Use to permit '&' interpretation.
533 Fl::set_labeltype(FL_FREE_LABELTYPE,custMenuLabelDraw,custMenuLabelMeasure);
534
536
537 /* use preferred font for UI */
538 Fl_Font defaultFont = dw::fltk::FltkFont::get (prefs.font_sans_serif, 0);
539 Fl::set_font(FL_HELVETICA, defaultFont); // this seems to be the
540 // only way to set the
541 // default font in fltk1.3
542
543 fl_message_title_default("Dillo: Message");
544
545 // Create a new UI/bw pair
546 BrowserWindow *bw = a_UIcmd_browser_window_new(0, 0, xid, NULL);
547
548 /* We need this so that fl_text_extents() in dw/fltkplatform.cc can
549 * work when FLTK is configured without XFT and Dillo is opening
550 * immediately-available URLs from the cmdline (e.g. about:splash).
551 */
552 ((Fl_Widget *)bw->ui)->window()->make_current();
553
554 /* Proxy authentication */
556 const char *passwd = a_UIcmd_get_passwd(prefs.http_proxyuser);
557 if (passwd) {
559 } else {
560 MSG_WARN("Not using proxy authentication.\n");
561 }
562 }
563
564 /* Open URLs/files */
565 const bool local = options_got & DILLO_CLI_LOCAL;
566
567 if (idx == argc) {
568 /* No URLs/files on cmdline. Send startup screen */
569 if (dStrAsciiCasecmp(URL_SCHEME(prefs.start_page), "about") == 0 &&
570 strcmp(URL_PATH(prefs.start_page), "blank") == 0)
571 a_UIcmd_open_url(bw, NULL); // NULL URL focuses location
572 else {
575 }
576 } else {
577 for (int i = idx; i < argc; i++) {
578 DilloUrl *start_url = makeStartUrl(argv[i], local);
579
580 if (i > idx) {
582 /* user must prefer tabs */
583 const int focus = 1;
584 a_UIcmd_open_url_nt(bw, start_url, focus);
585 } else {
586 a_UIcmd_open_url_nw(bw, start_url);
587 }
588 } else {
589 a_UIcmd_open_url(bw, start_url);
590 a_UIcmd_set_location_text(bw, URL_STR(start_url));
591 }
592 a_Url_free(start_url);
593 }
594 }
595
596 /* Don't use, as it can be free()'d */
597 bw = NULL;
598
599 while (Fl::wait() > 0) {
600 if (sig_reload) {
601 sig_reload = 0;
603 }
604 }
605
606 /*
607 * Memory deallocating routines
608 * (This can be left to the OS, but we'll do it, with a view to test
609 * and fix our memory management)
610 */
621 Keys::free();
622 Paths::free();
625 /* TODO: auth, css */
626
627 //a_Dpi_dillo_exit();
628 MSG("Dillo: normal exit!\n");
629 return 0;
630}
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:65
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:548
static void custLabelMeasure(const Fl_Label *o, int &W, int &H)
Definition dillo.cc:276
static void raw_sigchld2(int signum)
Avoid our children (Dpid) to become zombies.
Definition dillo.cc:126
static void est_sigchld(void)
Establish SIGCHLD handler.
Definition dillo.cc:159
static OptID getCmdOption(const CLI_options *options, int argc, char **argv, char **opt_argv, int *idx)
Get next command line option.
Definition dillo.cc:213
static const CLI_options Options[]
Definition dillo.cc:93
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:265
static void handler_usr1(int signum)
Definition dillo.cc:151
static DilloUrl * makeStartUrl(char *str, bool local)
Given a command line argument, build a DilloUrl for it.
Definition dillo.cc:369
OptID
Command line options structure.
Definition dillo.cc:74
@ DILLO_CLI_XID
Definition dillo.cc:76
@ DILLO_CLI_LOCAL
Definition dillo.cc:80
@ DILLO_CLI_NONE
Definition dillo.cc:75
@ DILLO_CLI_FULLWINDOW
Definition dillo.cc:77
@ DILLO_CLI_HELP
Definition dillo.cc:78
@ DILLO_CLI_VERSION
Definition dillo.cc:79
@ DILLO_CLI_GEOMETRY
Definition dillo.cc:81
@ DILLO_CLI_ERROR
Definition dillo.cc:82
static void checkPreferredFonts()
Definition dillo.cc:314
static void printHelp(const char *cmdname, const CLI_options *options)
Print help text generated from the options structure.
Definition dillo.cc:184
static void checkFont(const char *name, const char *type)
Tell the user if default/pref fonts can't be found.
Definition dillo.cc:308
static void setUIColorWdef(Fl_Color idx, int32_t color, Fl_Color default_val)
Set UI color.
Definition dillo.cc:327
static volatile sig_atomic_t sig_reload
Definition dillo.cc:69
static void setColors()
Definition dillo.cc:335
static void custMenuLabelMeasure(const Fl_Label *o, int &W, int &H)
Definition dillo.cc:296
static void custMenuLabelDraw(const Fl_Label *o, int X, int Y, int W, int H, Fl_Align align)
Definition dillo.cc:285
static int numOptions(const CLI_options *options)
Return the maximum number of option arguments.
Definition dillo.cc:200
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:1128
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:31
void a_Tls_freeall(void)
Clean up the TLS library.
Definition tls.c:101
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_Web_init(void)
Definition web.cc:38