Dillo v3.1.1-46-g8a360e32
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 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
24#include <stdio.h>
25#include <unistd.h>
26#include <stdlib.h>
27#include <time.h>
28#include <sys/types.h>
29#include <sys/wait.h>
30#include <signal.h>
31#include <locale.h>
32#include <errno.h>
33
34#include <FL/Fl.H>
35#include <FL/Fl_Window.H>
36#include <FL/fl_ask.H>
37#include <FL/fl_draw.H>
38
39#include "msg.h"
40#include "paths.hh"
41#include "uicmd.hh"
42
43#include "prefs.h"
44#include "prefsparser.hh"
45#include "keys.hh"
46#include "bw.h"
47#include "misc.h"
48#include "history.h"
49
50#include "dns.h"
51#include "web.hh"
52#include "IO/tls.h"
53#include "IO/Url.h"
54#include "IO/mime.h"
55#include "capi.h"
56#include "dicache.h"
57#include "cookies.h"
58#include "hsts.h"
59#include "domain.h"
60#include "auth.h"
61#include "styleengine.hh"
62
63#include "dw/fltkcore.hh"
64#include "dw/widget.hh"
65#include "dw/textblock.hh"
66#include "dw/table.hh"
67
81
82typedef struct {
83 const char *shortopt;
84 const char *longopt;
85 int opt_argc; /* positive: mandatory, negative: optional */
86 OptID id;
87 const char *help;
88} CLI_options;
89
90static const CLI_options Options[] = {
91 {"-f", "--fullwindow", 0, DILLO_CLI_FULLWINDOW,
92 " -f, --fullwindow Start in full window mode: hide address bar,\n"
93 " navigation buttons, menu, and status bar."},
94 {"-g", "-geometry", 1, DILLO_CLI_GEOMETRY,
95 " -g, -geometry GEO Set initial window position where GEO is\n"
96 " WxH[{+-}X{+-}Y]"},
97 {"-h", "--help", 0, DILLO_CLI_HELP,
98 " -h, --help Display this help text and exit."},
99 {"-l", "--local", 0, DILLO_CLI_LOCAL,
100 " -l, --local Don't load images or stylesheets, or follow\n"
101 " redirections, for these FILEs or URLs."},
102 {"-v", "--version", 0, DILLO_CLI_VERSION,
103 " -v, --version Display version info and exit."},
104 {"-x", "--xid", 1, DILLO_CLI_XID,
105 " -x, --xid XID Open first Dillo window in an existing\n"
106 " window whose window ID is XID."},
107 {NULL, NULL, 0, DILLO_CLI_NONE, NULL}
108};
109
110
111/*
112 * SIGCHLD handling ----------------------------------------------------------
113 */
114
123static void raw_sigchld2(int signum)
124{
125 pid_t pid;
126 int status;
127
128 (void) signum; /* Unused */
129
130 while (1) {
131 pid = waitpid(-1, &status, WNOHANG);
132 if (pid > 0) {
133 if (WIFEXITED(status)) /* normal exit */
134 printf("[dpid]: terminated normally (%d)\n", WEXITSTATUS(status));
135 else if (WIFSIGNALED(status)) /* terminated by signal */
136 printf("[dpid]: terminated by signal %d\n", WTERMSIG(status));
137 } else if (pid == 0 || errno == ECHILD) {
138 break;
139 } else {
140 if (errno == EINTR)
141 continue;
142 perror("waitpid");
143 break;
144 }
145 }
146}
147
151static void est_sigchld(void)
152{
153 struct sigaction sigact;
154 sigset_t set;
155
156 (void) sigemptyset(&set);
157 sigact.sa_handler = raw_sigchld2; /* our custom handler */
158 sigact.sa_mask = set; /* no aditional signal blocks */
159 sigact.sa_flags = SA_NOCLDSTOP; /* ignore stop/resume states */
160 if (sigaction(SIGCHLD, &sigact, NULL) == -1) {
161 perror("sigaction");
162 exit(1);
163 }
164}
165
166//----------------------------------------------------------------------------
167
171static void printHelp(const char *cmdname, const CLI_options *options)
172{
173 printf("Usage: %s [OPTION]... [--] [URL|FILE]...\n"
174 "Options:\n", cmdname);
175 while (options && options->help) {
176 printf("%s\n", options->help);
177 options++;
178 }
179 printf(" URL URL to browse.\n"
180 " FILE Local FILE to view.\n"
181 "\n");
182}
183
187static int numOptions(const CLI_options *options)
188{
189 int i, max;
190
191 for (i = 0, max = 0; options[i].shortopt; i++)
192 if (abs(options[i].opt_argc) > max)
193 max = abs(options[i].opt_argc);
194 return max;
195}
196
200static OptID getCmdOption(const CLI_options *options, int argc, char **argv,
201 char **opt_argv, int *idx)
202{
203 typedef enum { O_SEARCH, O_FOUND, O_NOTFOUND, O_DONE } State;
204 OptID opt_id = DILLO_CLI_NONE;
205 int i = 0;
206 State state = O_SEARCH;
207
208 if (*idx >= argc) {
209 state = O_DONE;
210 } else {
211 state = O_NOTFOUND;
212 for (i = 0; options[i].shortopt; i++) {
213 if (strcmp(options[i].shortopt, argv[*idx]) == 0 ||
214 strcmp(options[i].longopt, argv[*idx]) == 0) {
215 state = O_FOUND;
216 ++*idx;
217 break;
218 }
219 }
220 }
221 if (state == O_FOUND) {
222 int n_arg = options[i].opt_argc;
223 opt_id = options[i].id;
224 /* Find the required/optional arguments of the option */
225 for (i = 0; *idx < argc && i < abs(n_arg) && argv[*idx][0] != '-'; i++)
226 opt_argv[i] = argv[(*idx)++];
227 opt_argv[i] = NULL;
228
229 /* Optional arguments have opt_argc < 0 */
230 if (i < n_arg) {
231 fprintf(stderr, "Option %s requires %d argument%s\n",
232 argv[*idx-i-1], n_arg, (n_arg == 1) ? "" : "s");
233 opt_id = DILLO_CLI_ERROR;
234 }
235 }
236 if (state == O_NOTFOUND) {
237 if (strcmp(argv[*idx], "--") == 0)
238 (*idx)++;
239 else if (argv[*idx][0] == '-') {
240 fprintf(stderr, "Command line option \"%s\" not recognized.\n",
241 argv[*idx]);
242 opt_id = DILLO_CLI_ERROR;
243 }
244 }
245 return opt_id;
246}
247
252static void custLabelDraw(const Fl_Label* o, int X, int Y, int W, int H,
253 Fl_Align align)
254{
255 const int interpret_symbols = 0;
256
257 fl_draw_shortcut = 0;
258 fl_font(o->font, o->size);
259 fl_color((Fl_Color)o->color);
260 fl_draw(o->value, X, Y, W, H, align, o->image, interpret_symbols);
261}
262
263static void custLabelMeasure(const Fl_Label* o, int& W, int& H)
264{
265 const int interpret_symbols = 0;
266
267 fl_draw_shortcut = 0;
268 fl_font(o->font, o->size);
269 fl_measure(o->value, W, H, interpret_symbols);
270}
271
272static void custMenuLabelDraw(const Fl_Label* o, int X, int Y, int W, int H,
273 Fl_Align align)
274{
275 const int interpret_symbols = 0;
276
277 fl_draw_shortcut = 1;
278 fl_font(o->font, o->size);
279 fl_color((Fl_Color)o->color);
280 fl_draw(o->value, X, Y, W, H, align, o->image, interpret_symbols);
281}
282
283static void custMenuLabelMeasure(const Fl_Label* o, int& W, int& H)
284{
285 const int interpret_symbols = 0;
286
287 fl_draw_shortcut = 1;
288 fl_font(o->font, o->size);
289 fl_measure(o->value, W, H, interpret_symbols);
290}
291
295static void checkFont(const char *name, const char *type)
296{
298 MSG_WARN("preferred %s font \"%s\" not found.\n", type, name);
299}
300
302{
303 checkFont(prefs.font_sans_serif, "sans-serif");
304 checkFont(prefs.font_serif, "serif");
305 checkFont(prefs.font_monospace, "monospace");
306 checkFont(prefs.font_cursive, "cursive");
307 checkFont(prefs.font_fantasy, "fantasy");
308}
309
314static void setUIColorWdef(Fl_Color idx, int32_t color, Fl_Color default_val)
315{
316 if (color != -1)
317 Fl::set_color(idx, color << 8);
318 else if (default_val != 0xFFFFFFFF)
319 Fl::set_color(idx, default_val);
320}
321
322static void setColors()
323{
324 /* The main background is a special case because Fl::background() will
325 * set the "gray ramp", which is a set of lighter and darker colors based
326 * on the main background and used for box edges and such.
327 */
328 if (prefs.ui_main_bg_color != -1) {
329 uchar r = prefs.ui_main_bg_color >> 16,
330 g = prefs.ui_main_bg_color >> 8 & 0xff,
331 b = prefs.ui_main_bg_color & 0xff;
332
333 Fl::background(r, g, b);
334 }
335
336 setUIColorWdef(FL_BACKGROUND2_COLOR, prefs.ui_text_bg_color, 0xFFFFFFFF);
337 setUIColorWdef(FL_FOREGROUND_COLOR, prefs.ui_fg_color, 0xFFFFFFFF);
338 setUIColorWdef(FL_SELECTION_COLOR, prefs.ui_selection_color,
339 fl_contrast(FL_SELECTION_COLOR, FL_BACKGROUND2_COLOR));
342 fl_lighter(FL_BACKGROUND_COLOR));
344 Fl::get_color(FL_BACKGROUND2_COLOR));
346 Fl::get_color(FL_BACKGROUND_COLOR));
348 Fl::get_color(FL_FOREGROUND_COLOR));
350 Fl::get_color(FL_FOREGROUND_COLOR));
351}
352
356static DilloUrl *makeStartUrl(char *str, bool local)
357{
358 char *url_str, *p;
359 DilloUrl *start_url;
360
361 /* Relative path to a local file? */
362 p = (*str == '/') ? dStrdup(str) :
363 dStrconcat(Paths::getOldWorkingDir(), "/", str, NULL);
364
365 if (access(p, F_OK) == 0) {
366 /* absolute path may have non-URL characters */
367 url_str = a_Misc_escape_chars(p, "% #");
368 start_url = a_Url_new(url_str + 1, "file:/");
369 } else {
370 /* Not a file, filter URL string */
371 url_str = a_Url_string_strip_delimiters(str);
372 start_url = a_Url_new(url_str, NULL);
373 }
374 dFree(p);
375 dFree(url_str);
376
377 if (local)
378 a_Url_set_flags(start_url, URL_FLAGS(start_url) | URL_SpamSafe);
379
380 return start_url;
381}
382
383/*
384 * MAIN
385 */
386int main(int argc, char **argv)
387{
388 uint_t opt_id;
389 uint_t options_got = 0;
390 uint32_t xid = 0;
391 int idx = 1;
395 char **opt_argv;
396 FILE *fp;
397
398 srand((uint_t)(time(0) ^ getpid()));
399
400 // Some OSes exit dillo without this (not GNU/Linux).
401 signal(SIGPIPE, SIG_IGN);
402 // Establish our custom SIGCHLD handler
403 est_sigchld();
404
405 /* Handle command line options */
406 opt_argv = dNew0(char*, numOptions(Options) + 1);
407 while ((opt_id = getCmdOption(Options, argc, argv, opt_argv, &idx))) {
408 options_got |= opt_id;
409 switch (opt_id) {
411 case DILLO_CLI_LOCAL:
412 break;
413 case DILLO_CLI_XID:
414 {
415 char *end;
416 xid = strtol(opt_argv[0], &end, 0);
417 if (*end) {
418 fprintf(stderr, "XID argument \"%s\" not valid.\n",opt_argv[0]);
419 return 2;
420 }
421 break;
422 }
424 if (!a_Misc_parse_geometry(opt_argv[0],&xpos,&ypos,&width,&height)){
425 fprintf(stderr, "geometry argument \"%s\" not valid. Must be of "
426 "the form WxH[{+-}X{+-}Y].\n", opt_argv[0]);
427 return 2;
428 }
429 break;
431 puts("Dillo version " VERSION);
432 return 0;
433 case DILLO_CLI_HELP:
434 printHelp(argv[0], Options);
435 return 0;
436 default:
437 printHelp(argv[0], Options);
438 return 2;
439 }
440 }
441 dFree(opt_argv);
442
443 // set the default values for the preferences
444 a_Prefs_init();
445
446 // create ~/.dillo if not present
447 Paths::init();
448
449 // initialize default key bindings
450 Keys::init();
451
452 // parse dillorc
453 if ((fp = Paths::getPrefsFP(PATHS_RC_PREFS))) {
454 PrefsParser::parse(fp);
455 }
456 // parse keysrc
457 if ((fp = Paths::getPrefsFP(PATHS_RC_KEYS))) {
458 Keys::parse(fp);
459 }
460 // parse domainrc
462 a_Domain_parse(fp);
463 fclose(fp);
464 }
466
467 // initialize internal modules
468 a_Dpi_init();
469 a_Dns_init();
470 a_Web_init();
471 a_Http_init();
472 a_Tls_init();
473 a_Mime_init();
474 a_Capi_init();
476 a_Bw_init();
479 a_Auth_init();
480 a_UIcmd_init();
482
491
492 /* command line options override preferences */
493 if (options_got & DILLO_CLI_FULLWINDOW)
495 if (options_got & DILLO_CLI_GEOMETRY) {
496 prefs.width = width;
497 prefs.height = height;
498 prefs.xpos = xpos;
499 prefs.ypos = ypos;
500 }
501
502 // Sets WM_CLASS hint on X11
503 Fl_Window::default_xclass("dillo");
504
505 Fl::scheme(prefs.theme);
506
507 // Disable drag and drop as it crashes on MacOSX
508 Fl::dnd_text_ops(0);
509
510 setColors();
511
512 if (!prefs.show_ui_tooltip) {
513 Fl::option(Fl::OPTION_SHOW_TOOLTIPS, false);
514 }
515
516 // Disable '@' and '&' interpretation in normal labels.
517 Fl::set_labeltype(FL_NORMAL_LABEL, custLabelDraw, custLabelMeasure);
518
519 // Use to permit '&' interpretation.
520 Fl::set_labeltype(FL_FREE_LABELTYPE,custMenuLabelDraw,custMenuLabelMeasure);
521
523
524 /* use preferred font for UI */
525 Fl_Font defaultFont = dw::fltk::FltkFont::get (prefs.font_sans_serif, 0);
526 Fl::set_font(FL_HELVETICA, defaultFont); // this seems to be the
527 // only way to set the
528 // default font in fltk1.3
529
530 fl_message_title_default("Dillo: Message");
531
532 // Create a new UI/bw pair
533 BrowserWindow *bw = a_UIcmd_browser_window_new(0, 0, xid, NULL);
534
535 /* We need this so that fl_text_extents() in dw/fltkplatform.cc can
536 * work when FLTK is configured without XFT and Dillo is opening
537 * immediately-available URLs from the cmdline (e.g. about:splash).
538 */
539 ((Fl_Widget *)bw->ui)->window()->make_current();
540
541 /* Proxy authentication */
543 const char *passwd = a_UIcmd_get_passwd(prefs.http_proxyuser);
544 if (passwd) {
546 } else {
547 MSG_WARN("Not using proxy authentication.\n");
548 }
549 }
550
551 /* Open URLs/files */
552 const bool local = options_got & DILLO_CLI_LOCAL;
553
554 if (idx == argc) {
555 /* No URLs/files on cmdline. Send startup screen */
556 if (dStrAsciiCasecmp(URL_SCHEME(prefs.start_page), "about") == 0 &&
557 strcmp(URL_PATH(prefs.start_page), "blank") == 0)
558 a_UIcmd_open_url(bw, NULL); // NULL URL focuses location
559 else {
562 }
563 } else {
564 for (int i = idx; i < argc; i++) {
565 DilloUrl *start_url = makeStartUrl(argv[i], local);
566
567 if (i > idx) {
569 /* user must prefer tabs */
570 const int focus = 1;
571 a_UIcmd_open_url_nt(bw, start_url, focus);
572 } else {
573 a_UIcmd_open_url_nw(bw, start_url);
574 }
575 } else {
576 a_UIcmd_open_url(bw, start_url);
577 a_UIcmd_set_location_text(bw, URL_STR(start_url));
578 }
579 a_Url_free(start_url);
580 }
581 }
582
583 Fl::run();
584
585 /*
586 * Memory deallocating routines
587 * (This can be left to the OS, but we'll do it, with a view to test
588 * and fix our memory management)
589 */
600 Keys::free();
601 Paths::free();
604 /* TODO: auth, css */
605
606 //a_Dpi_dillo_exit();
607 MSG("Dillo: normal exit!\n");
608 return 0;
609}
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:449
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:263
static void raw_sigchld2(int signum)
Avoid our children (Dpid) to become zombies.
Definition dillo.cc:123
static void est_sigchld(void)
Establish SIGCHLD handler.
Definition dillo.cc:151
static OptID getCmdOption(const CLI_options *options, int argc, char **argv, char **opt_argv, int *idx)
Get next command line option.
Definition dillo.cc:200
static const CLI_options Options[]
Definition dillo.cc:90
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:252
static DilloUrl * makeStartUrl(char *str, bool local)
Given a command line argument, build a DilloUrl for it.
Definition dillo.cc:356
OptID
Command line options structure.
Definition dillo.cc:71
@ DILLO_CLI_XID
Definition dillo.cc:73
@ DILLO_CLI_LOCAL
Definition dillo.cc:77
@ DILLO_CLI_NONE
Definition dillo.cc:72
@ DILLO_CLI_FULLWINDOW
Definition dillo.cc:74
@ DILLO_CLI_HELP
Definition dillo.cc:75
@ DILLO_CLI_VERSION
Definition dillo.cc:76
@ DILLO_CLI_GEOMETRY
Definition dillo.cc:78
@ DILLO_CLI_ERROR
Definition dillo.cc:79
static void checkPreferredFonts()
Definition dillo.cc:301
static void printHelp(const char *cmdname, const CLI_options *options)
Print help text generated from the options structure.
Definition dillo.cc:171
static void checkFont(const char *name, const char *type)
Tell the user if default/pref fonts can't be found.
Definition dillo.cc:295
static void setUIColorWdef(Fl_Color idx, int32_t color, Fl_Color default_val)
Set UI color.
Definition dillo.cc:314
static void setColors()
Definition dillo.cc:322
static void custMenuLabelMeasure(const Fl_Label *o, int &W, int &H)
Definition dillo.cc:283
static void custMenuLabelDraw(const Fl_Label *o, int X, int Y, int W, int H, Fl_Align align)
Definition dillo.cc:272
static int numOptions(const CLI_options *options)
Return the maximum number of option arguments.
Definition dillo.cc:187
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:1126
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:140
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:105
char * font_monospace
Definition prefs.h:108
int32_t ui_button_highlight_color
Definition prefs.h:55
char * font_fantasy
Definition prefs.h:107
int penalty_hyphen_2
Definition prefs.h:120
int xpos
Definition prefs.h:40
int32_t ui_tab_active_bg_color
Definition prefs.h:59
bool_t fullwindow_start
Definition prefs.h:95
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:104
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:121
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:121
bool_t show_msg
Definition prefs.h:117
int stretchability_factor
Definition prefs.h:122
char * theme
Definition prefs.h:68
char * font_cursive
Definition prefs.h:106
bool_t middle_click_opens_new_tab
Definition prefs.h:110
int height
Definition prefs.h:39
int penalty_hyphen
Definition prefs.h:120
int penalty_em_dash_left
Definition prefs.h:121
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:1172
BrowserWindow * a_UIcmd_browser_window_new(int ww, int wh, uint32_t xid, const void *vbw)
Definition uicmd.cc:550
void a_UIcmd_open_url_nw(BrowserWindow *bw, const DilloUrl *url)
Definition uicmd.cc:799
void a_UIcmd_open_url(BrowserWindow *bw, const DilloUrl *url)
Definition uicmd.cc:764
void a_UIcmd_set_location_text(void *vbw, const char *text)
Definition uicmd.cc:1450
void a_UIcmd_open_url_nt(void *vbw, const DilloUrl *url, int focus)
Definition uicmd.cc:815
void a_UIcmd_init(void)
Definition uicmd.cc:987
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