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