dillo  3.0.5
About: dillo is a small, fast, extensible Web browser particularly suitable for older or smaller computers and embedded systems (but only limited or no support for frames, CSS, JavaScript, Java).
  Fossies Dox: dillo-3.0.5.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

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 
20 #include <stdio.h>
21 #include <unistd.h>
22 #include <stdlib.h>
23 #include <time.h>
24 #include <sys/types.h>
25 #include <sys/wait.h>
26 #include <signal.h>
27 #include <locale.h>
28 #include <errno.h>
29 
30 #include <FL/Fl.H>
31 #include <FL/Fl_Window.H>
32 #include <FL/fl_ask.H>
33 #include <FL/fl_draw.H>
34 
35 #include "msg.h"
36 #include "paths.hh"
37 #include "uicmd.hh"
38 
39 #include "prefs.h"
40 #include "prefsparser.hh"
41 #include "keys.hh"
42 #include "bw.h"
43 #include "misc.h"
44 #include "history.h"
45 
46 #include "dns.h"
47 #include "web.hh"
48 #include "IO/Url.h"
49 #include "IO/mime.h"
50 #include "capi.h"
51 #include "dicache.h"
52 #include "cookies.h"
53 #include "domain.h"
54 #include "auth.h"
55 #include "styleengine.hh"
56 
57 #include "lout/debug.hh"
58 #include "dw/fltkcore.hh"
59 #include "dw/textblock.hh"
60 
61 /*
62  * Command line options structure
63  */
64 typedef enum {
66  DILLO_CLI_XID = 1 << 0,
68  DILLO_CLI_HELP = 1 << 2,
70  DILLO_CLI_LOCAL = 1 << 4,
72  DILLO_CLI_ERROR = 1 << 15,
73 } OptID;
74 
75 typedef struct {
76  const char *shortopt;
77  const char *longopt;
78  int opt_argc; /* positive: mandatory, negative: optional */
80  const char *help;
81 } CLI_options;
82 
83 static const CLI_options Options[] = {
84  {"-f", "--fullwindow", 0, DILLO_CLI_FULLWINDOW,
85  " -f, --fullwindow Start in full window mode: hide address bar,\n"
86  " navigation buttons, menu, and status bar."},
87  {"-g", "-geometry", 1, DILLO_CLI_GEOMETRY,
88  " -g, -geometry GEO Set initial window position where GEO is\n"
89  " WxH[{+-}X{+-}Y]"},
90  {"-h", "--help", 0, DILLO_CLI_HELP,
91  " -h, --help Display this help text and exit."},
92  {"-l", "--local", 0, DILLO_CLI_LOCAL,
93  " -l, --local Don't load images or stylesheets, or follow\n"
94  " redirections, for these FILEs or URLs."},
95  {"-v", "--version", 0, DILLO_CLI_VERSION,
96  " -v, --version Display version info and exit."},
97  {"-x", "--xid", 1, DILLO_CLI_XID,
98  " -x, --xid XID Open first Dillo window in an existing\n"
99  " window whose window ID is XID."},
100  {NULL, NULL, 0, DILLO_CLI_NONE, NULL}
101 };
102 
103 
104 /*
105  * SIGCHLD handling ----------------------------------------------------------
106  */
107 
108 /*
109  * Avoid our children (Dpid) to become zombies. :-)
110  * Notes:
111  * . We let sigaction block SIGCHLD while in the handler.
112  * . Portability is not simple. e.g.
113  * http://www.faqs.org/faqs/unix-faq/faq/part3/section-13.html
114  * man sigaction, waitpid
115  */
116 static void raw_sigchld2(int signum)
117 {
118  pid_t pid;
119  int status;
120 
121  while (1) {
122  pid = waitpid(-1, &status, WNOHANG);
123  if (pid > 0) {
124  if (WIFEXITED(status)) /* normal exit */
125  printf("[dpid]: terminated normally (%d)\n", WEXITSTATUS(status));
126  else if (WIFSIGNALED(status)) /* terminated by signal */
127  printf("[dpid]: terminated by signal %d\n", WTERMSIG(status));
128  } else if (pid == 0 || errno == ECHILD) {
129  break;
130  } else {
131  if (errno == EINTR)
132  continue;
133  perror("waitpid");
134  break;
135  }
136  }
137  ++signum; /* compiler happiness */
138 }
139 
140 /*
141  * Establish SIGCHLD handler
142  */
143 static void est_sigchld(void)
144 {
145  struct sigaction sigact;
146  sigset_t set;
147 
148  (void) sigemptyset(&set);
149  sigact.sa_handler = raw_sigchld2; /* our custom handler */
150  sigact.sa_mask = set; /* no aditional signal blocks */
151  sigact.sa_flags = SA_NOCLDSTOP; /* ignore stop/resume states */
152  if (sigaction(SIGCHLD, &sigact, NULL) == -1) {
153  perror("sigaction");
154  exit(1);
155  }
156 }
157 
158 //----------------------------------------------------------------------------
159 
160 /*
161  * Print help text generated from the options structure
162  */
163 static void printHelp(const char *cmdname, const CLI_options *options)
164 {
165  printf("Usage: %s [OPTION]... [--] [URL|FILE]...\n"
166  "Options:\n", cmdname);
167  while (options && options->help) {
168  printf("%s\n", options->help);
169  options++;
170  }
171  printf(" URL URL to browse.\n"
172  " FILE Local FILE to view.\n"
173  "\n");
174 }
175 
176 /*
177  * Return the maximum number of option arguments
178  */
179 static int numOptions(const CLI_options *options)
180 {
181  int i, max;
182 
183  for (i = 0, max = 0; options[i].shortopt; i++)
184  if (abs(options[i].opt_argc) > max)
185  max = abs(options[i].opt_argc);
186  return max;
187 }
188 
189 /*
190  * Get next command line option.
191  */
192 static OptID getCmdOption(const CLI_options *options, int argc, char **argv,
193  char **opt_argv, int *idx)
194 {
195  typedef enum { O_SEARCH, O_FOUND, O_NOTFOUND, O_DONE } State;
196  OptID opt_id = DILLO_CLI_NONE;
197  int i = 0;
198  State state = O_SEARCH;
199 
200  if (*idx >= argc) {
201  state = O_DONE;
202  } else {
203  state = O_NOTFOUND;
204  for (i = 0; options[i].shortopt; i++) {
205  if (strcmp(options[i].shortopt, argv[*idx]) == 0 ||
206  strcmp(options[i].longopt, argv[*idx]) == 0) {
207  state = O_FOUND;
208  ++*idx;
209  break;
210  }
211  }
212  }
213  if (state == O_FOUND) {
214  int n_arg = options[i].opt_argc;
215  opt_id = options[i].id;
216  /* Find the required/optional arguments of the option */
217  for (i = 0; *idx < argc && i < abs(n_arg) && argv[*idx][0] != '-'; i++)
218  opt_argv[i] = argv[(*idx)++];
219  opt_argv[i] = NULL;
220 
221  /* Optional arguments have opt_argc < 0 */
222  if (i < n_arg) {
223  fprintf(stderr, "Option %s requires %d argument%s\n",
224  argv[*idx-i-1], n_arg, (n_arg == 1) ? "" : "s");
225  opt_id = DILLO_CLI_ERROR;
226  }
227  }
228  if (state == O_NOTFOUND) {
229  if (strcmp(argv[*idx], "--") == 0)
230  (*idx)++;
231  else if (argv[*idx][0] == '-') {
232  fprintf(stderr, "Command line option \"%s\" not recognized.\n",
233  argv[*idx]);
234  opt_id = DILLO_CLI_ERROR;
235  }
236  }
237  return opt_id;
238 }
239 
240 /*
241  * Set FL_NORMAL_LABEL to interpret neither symbols (@) nor shortcuts (&),
242  * and FL_FREE_LABELTYPE to interpret shortcuts.
243  */
244 static void custLabelDraw(const Fl_Label* o, int X, int Y, int W, int H,
245  Fl_Align align)
246 {
247  const int interpret_symbols = 0;
248 
249  fl_draw_shortcut = 0;
250  fl_font(o->font, o->size);
251  fl_color((Fl_Color)o->color);
252  fl_draw(o->value, X, Y, W, H, align, o->image, interpret_symbols);
253 }
254 
255 static void custLabelMeasure(const Fl_Label* o, int& W, int& H)
256 {
257  const int interpret_symbols = 0;
258 
259  fl_draw_shortcut = 0;
260  fl_font(o->font, o->size);
261  fl_measure(o->value, W, H, interpret_symbols);
262 }
263 
264 static void custMenuLabelDraw(const Fl_Label* o, int X, int Y, int W, int H,
265  Fl_Align align)
266 {
267  const int interpret_symbols = 0;
268 
269  fl_draw_shortcut = 1;
270  fl_font(o->font, o->size);
271  fl_color((Fl_Color)o->color);
272  fl_draw(o->value, X, Y, W, H, align, o->image, interpret_symbols);
273 }
274 
275 static void custMenuLabelMeasure(const Fl_Label* o, int& W, int& H)
276 {
277  const int interpret_symbols = 0;
278 
279  fl_draw_shortcut = 1;
280  fl_font(o->font, o->size);
281  fl_measure(o->value, W, H, interpret_symbols);
282 }
283 
284 /*
285  * Tell the user if default/pref fonts can't be found.
286  */
287 static void checkFont(const char *name, const char *type)
288 {
289  if (! dw::fltk::FltkFont::fontExists(name))
290  MSG_WARN("preferred %s font \"%s\" not found.\n", type, name);
291 }
292 
293 static void checkPreferredFonts()
294 {
295  checkFont(prefs.font_sans_serif, "sans-serif");
296  checkFont(prefs.font_serif, "serif");
297  checkFont(prefs.font_monospace, "monospace");
298  checkFont(prefs.font_cursive, "cursive");
299  checkFont(prefs.font_fantasy, "fantasy");
300 }
301 
302 /*
303  * Set UI color. 'color' is an 0xrrggbb value, whereas 'default_val' is a fltk
304  * color (index 0-0xFF, or 0xrrggbb00).
305  */
306 static void setUIColorWdef(Fl_Color idx, int32_t color, Fl_Color default_val)
307 {
308  if (color != -1)
309  Fl::set_color(idx, color << 8);
310  else if (default_val != 0xFFFFFFFF)
311  Fl::set_color(idx, default_val);
312 }
313 
314 static void setColors()
315 {
316  /* The main background is a special case because Fl::background() will
317  * set the "gray ramp", which is a set of lighter and darker colors based
318  * on the main background and used for box edges and such.
319  */
320  if (prefs.ui_main_bg_color != -1) {
321  uchar r = prefs.ui_main_bg_color >> 16,
322  g = prefs.ui_main_bg_color >> 8 & 0xff,
323  b = prefs.ui_main_bg_color & 0xff;
324 
325  Fl::background(r, g, b);
326  }
327 
328  setUIColorWdef(FL_BACKGROUND2_COLOR, prefs.ui_text_bg_color, 0xFFFFFFFF);
329  setUIColorWdef(FL_FOREGROUND_COLOR, prefs.ui_fg_color, 0xFFFFFFFF);
330  setUIColorWdef(FL_SELECTION_COLOR, prefs.ui_selection_color,
331  fl_contrast(FL_SELECTION_COLOR, FL_BACKGROUND2_COLOR));
334  fl_lighter(FL_BACKGROUND_COLOR));
336  Fl::get_color(FL_BACKGROUND2_COLOR));
338  Fl::get_color(FL_BACKGROUND_COLOR));
340  Fl::get_color(FL_FOREGROUND_COLOR));
342  Fl::get_color(FL_FOREGROUND_COLOR));
343 }
344 
345 /*
346  * Given a command line argument, build a DilloUrl for it.
347  */
348 static DilloUrl *makeStartUrl(char *str, bool local)
349 {
350  char *url_str, *p;
351  DilloUrl *start_url;
352 
353  /* Relative path to a local file? */
354  p = (*str == '/') ? dStrdup(str) :
355  dStrconcat(Paths::getOldWorkingDir(), "/", str, NULL);
356 
357  if (access(p, F_OK) == 0) {
358  /* absolute path may have non-URL characters */
359  url_str = a_Misc_escape_chars(p, "% #");
360  start_url = a_Url_new(url_str + 1, "file:/");
361  } else {
362  /* Not a file, filter URL string */
363  url_str = a_Url_string_strip_delimiters(str);
364  start_url = a_Url_new(url_str, NULL);
365  }
366  dFree(p);
367  dFree(url_str);
368 
369  if (local)
370  a_Url_set_flags(start_url, URL_FLAGS(start_url) | URL_SpamSafe);
371 
372  return start_url;
373 }
374 
375 /*
376  * MAIN
377  */
378 int main(int argc, char **argv)
379 {
380  DBG_OBJ_COLOR("#c0ff80", "dw::*");
381  DBG_OBJ_COLOR("#c0c0ff", "dw::fltk::*");
382  DBG_OBJ_COLOR("#ffa0a0", "dw::core::*");
383  DBG_OBJ_COLOR("#ffe0a0", "dw::core::style::*");
384 
385  uint_t opt_id;
386  uint_t options_got = 0;
387  uint32_t xid = 0;
388  int idx = 1;
392  char **opt_argv;
393  FILE *fp;
394 
395  srand((uint_t)(time(0) ^ getpid()));
396 
397  // Some OSes exit dillo without this (not GNU/Linux).
398  signal(SIGPIPE, SIG_IGN);
399  // Establish our custom SIGCHLD handler
400  est_sigchld();
401 
402  /* Handle command line options */
403  opt_argv = dNew0(char*, numOptions(Options) + 1);
404  while ((opt_id = getCmdOption(Options, argc, argv, opt_argv, &idx))) {
405  options_got |= opt_id;
406  switch (opt_id) {
408  case DILLO_CLI_LOCAL:
409  break;
410  case DILLO_CLI_XID:
411  {
412  char *end;
413  xid = strtol(opt_argv[0], &end, 0);
414  if (*end) {
415  fprintf(stderr, "XID argument \"%s\" not valid.\n",opt_argv[0]);
416  return 2;
417  }
418  break;
419  }
420  case DILLO_CLI_GEOMETRY:
421  if (!a_Misc_parse_geometry(opt_argv[0],&xpos,&ypos,&width,&height)){
422  fprintf(stderr, "geometry argument \"%s\" not valid. Must be of "
423  "the form WxH[{+-}X{+-}Y].\n", opt_argv[0]);
424  return 2;
425  }
426  break;
427  case DILLO_CLI_VERSION:
428  puts("Dillo version " VERSION);
429  return 0;
430  case DILLO_CLI_HELP:
431  printHelp(argv[0], Options);
432  return 0;
433  default:
434  printHelp(argv[0], Options);
435  return 2;
436  }
437  }
438  dFree(opt_argv);
439 
440  // set the default values for the preferences
441  a_Prefs_init();
442 
443  // create ~/.dillo if not present
444  Paths::init();
445 
446  // initialize default key bindings
447  Keys::init();
448 
449  // parse dillorc
450  if ((fp = Paths::getPrefsFP(PATHS_RC_PREFS))) {
451  PrefsParser::parse(fp);
452  }
453  // parse keysrc
454  if ((fp = Paths::getPrefsFP(PATHS_RC_KEYS))) {
455  Keys::parse(fp);
456  }
457  // parse domainrc
458  if ((fp = Paths::getPrefsFP(PATHS_RC_DOMAIN))) {
459  a_Domain_parse(fp);
460  fclose(fp);
461  }
463 
464  // initialize internal modules
465  a_Dpi_init();
466  a_Dns_init();
467  a_Web_init();
468  a_Http_init();
469  a_Mime_init();
470  a_Capi_init();
471  a_Dicache_init();
472  a_Bw_init();
473  a_Cookies_init();
474  a_Auth_init();
475  a_UIcmd_init();
477 
484 
485  /* command line options override preferences */
486  if (options_got & DILLO_CLI_FULLWINDOW)
488  if (options_got & DILLO_CLI_GEOMETRY) {
489  prefs.width = width;
490  prefs.height = height;
491  prefs.xpos = xpos;
492  prefs.ypos = ypos;
493  }
494 
495  // Sets WM_CLASS hint on X11
496  Fl_Window::default_xclass("dillo");
497 
498  Fl::scheme(prefs.theme);
499 
500  // Disable drag and drop as it crashes on MacOSX
501  Fl::dnd_text_ops(0);
502 
503  setColors();
504 
505  if (!prefs.show_ui_tooltip) {
506  Fl::option(Fl::OPTION_SHOW_TOOLTIPS, false);
507  }
508 
509  // Disable '@' and '&' interpretation in normal labels.
510  Fl::set_labeltype(FL_NORMAL_LABEL, custLabelDraw, custLabelMeasure);
511 
512  // Use to permit '&' interpretation.
513  Fl::set_labeltype(FL_FREE_LABELTYPE,custMenuLabelDraw,custMenuLabelMeasure);
514 
516 
517  /* use preferred font for UI */
518  Fl_Font defaultFont = dw::fltk::FltkFont::get (prefs.font_sans_serif, 0);
519  Fl::set_font(FL_HELVETICA, defaultFont); // this seems to be the
520  // only way to set the
521  // default font in fltk1.3
522 
523  fl_message_title_default("Dillo: Message");
524 
525  // Create a new UI/bw pair
526  BrowserWindow *bw = a_UIcmd_browser_window_new(0, 0, xid, NULL);
527 
528  /* We need this so that fl_text_extents() in dw/fltkplatform.cc can
529  * work when FLTK is configured without XFT and Dillo is opening
530  * immediately-available URLs from the cmdline (e.g. about:splash).
531  */
532  ((Fl_Widget *)bw->ui)->window()->make_current();
533 
534  /* Proxy authentication */
536  const char *passwd = a_UIcmd_get_passwd(prefs.http_proxyuser);
537  if (passwd) {
538  a_Http_set_proxy_passwd(passwd);
539  } else {
540  MSG_WARN("Not using proxy authentication.\n");
541  }
542  }
543 
544  /* Open URLs/files */
545  const bool local = options_got & DILLO_CLI_LOCAL;
546 
547  if (idx == argc) {
548  /* No URLs/files on cmdline. Send startup screen */
549  if (dStrAsciiCasecmp(URL_SCHEME(prefs.start_page), "about") == 0 &&
550  strcmp(URL_PATH(prefs.start_page), "blank") == 0)
551  a_UIcmd_open_url(bw, NULL); // NULL URL focuses location
552  else {
555  }
556  } else {
557  for (int i = idx; i < argc; i++) {
558  DilloUrl *start_url = makeStartUrl(argv[i], local);
559 
560  if (i > idx) {
562  /* user must prefer tabs */
563  const int focus = 1;
564  a_UIcmd_open_url_nt(bw, start_url, focus);
565  } else {
566  a_UIcmd_open_url_nw(bw, start_url);
567  }
568  } else {
569  a_UIcmd_open_url(bw, start_url);
570  a_UIcmd_set_location_text(bw, URL_STR(start_url));
571  }
572  a_Url_free(start_url);
573  }
574  }
575 
576  Fl::run();
577 
578  /*
579  * Memory deallocating routines
580  * (This can be left to the OS, but we'll do it, with a view to test
581  * and fix our memory management)
582  */
585  a_Cache_freeall();
587  a_Http_freeall();
588  a_Dns_freeall();
590  a_Prefs_freeall();
591  Keys::free();
592  Paths::free();
595  /* TODO: auth, css */
596 
597  //a_Dpi_dillo_exit();
598  MSG("Dillo: normal exit!\n");
599  return 0;
600 }
DilloPrefs::height
int height
Definition: prefs.h:38
dw::Textblock::setPenaltyEmDashRight2
static void setPenaltyEmDashRight2(int penaltyRightEmDash2)
Definition: textblock.cc:213
custLabelMeasure
static void custLabelMeasure(const Fl_Label *o, int &W, int &H)
Definition: dillo.cc:255
Paths::getPrefsFP
static FILE * getPrefsFP(const char *rcFile)
Definition: paths.cc:80
Keys::parse
static void parse(FILE *fp)
Definition: keys.cc:374
raw_sigchld2
static void raw_sigchld2(int signum)
Definition: dillo.cc:116
a_Cookies_init
void a_Cookies_init(void)
Definition: cookies.c:114
DilloPrefs::fullwindow_start
bool_t fullwindow_start
Definition: prefs.h:89
fltkcore.hh
PREFS_GEOMETRY_DEFAULT_XPOS
#define PREFS_GEOMETRY_DEFAULT_XPOS
Definition: prefs.h:23
DILLO_CLI_XID
Definition: dillo.cc:66
a_Url_free
void a_Url_free(DilloUrl *url)
Definition: url.c:192
PREFS_UI_TAB_ACTIVE_FG_COLOR
#define PREFS_UI_TAB_ACTIVE_FG_COLOR
Definition: prefs.h:29
history.h
cookies.h
DILLO_CLI_ERROR
Definition: dillo.cc:72
a_Cookies_freeall
void a_Cookies_freeall()
Definition: cookies.c:132
TRUE
#define TRUE
Definition: dlib.h:23
BrowserWindow
Definition: bw.h:15
MSG
#define MSG(...)
Definition: bookmarks.c:45
paths.hh
PREFS_GEOMETRY_DEFAULT_YPOS
#define PREFS_GEOMETRY_DEFAULT_YPOS
Definition: prefs.h:24
DilloPrefs::font_fantasy
char * font_fantasy
Definition: prefs.h:98
DilloPrefs::ui_selection_color
int32_t ui_selection_color
Definition: prefs.h:56
Keys::free
static void free()
Definition: keys.cc:169
DilloPrefs::ui_tab_bg_color
int32_t ui_tab_bg_color
Definition: prefs.h:59
a_Mime_init
void a_Mime_init()
Definition: mime.c:96
DILLO_CLI_VERSION
Definition: dillo.cc:69
DilloPrefs::ui_tab_fg_color
int32_t ui_tab_fg_color
Definition: prefs.h:60
a_Url_string_strip_delimiters
char * a_Url_string_strip_delimiters(const char *str)
Definition: url.c:616
PREFS_UI_TAB_BG_COLOR
#define PREFS_UI_TAB_BG_COLOR
Definition: prefs.h:30
CLI_options::longopt
const char * longopt
Definition: dillo.cc:77
msg.h
OptID
OptID
Definition: dillo.cc:64
dFree
void dFree(void *mem)
Definition: dlib.c:66
dStrconcat
char * dStrconcat(const char *s1,...)
Definition: dlib.c:100
setColors
static void setColors()
Definition: dillo.cc:314
a_Prefs_freeall
void a_Prefs_freeall(void)
Definition: prefs.c:128
a_UIcmd_browser_window_new
BrowserWindow * a_UIcmd_browser_window_new(int ww, int wh, uint32_t xid, const void *vbw)
Definition: uicmd.cc:531
DILLO_CLI_HELP
Definition: dillo.cc:68
DilloPrefs::penalty_em_dash_right_2
int penalty_em_dash_right_2
Definition: prefs.h:110
DilloPrefs::theme
char * theme
Definition: prefs.h:65
custMenuLabelMeasure
static void custMenuLabelMeasure(const Fl_Label *o, int &W, int &H)
Definition: dillo.cc:275
a_UIcmd_init
void a_UIcmd_init(void)
Definition: uicmd.cc:912
dw::Textblock::setPenaltyHyphen2
static void setPenaltyHyphen2(int penaltyHyphen2)
Definition: textblock.cc:197
checkFont
static void checkFont(const char *name, const char *type)
Definition: dillo.cc:287
DBG_OBJ_COLOR
#define DBG_OBJ_COLOR(klass, color)
Definition: debug.hh:187
dw::fltk::FltkFont::get
static Fl_Font get(const char *name, int attrs)
Definition: fltkplatform.cc:186
H
#define H(x, y, z)
prefs.h
URL_SpamSafe
#define URL_SpamSafe
Definition: url.h:41
a_Bw_init
void a_Bw_init(void)
Definition: bw.c:33
DILLO_CLI_GEOMETRY
Definition: dillo.cc:71
DilloPrefs::ui_button_highlight_color
int32_t ui_button_highlight_color
Definition: prefs.h:53
URL_FLAGS
#define URL_FLAGS(u)
Definition: url.h:82
DILLO_CLI_NONE
Definition: dillo.cc:65
Paths::init
static void init(void)
Definition: paths.cc:31
a_Domain_parse
void a_Domain_parse(FILE *fp)
Definition: domain.c:31
lout::misc::max
T max(T a, T b)
Definition: misc.hh:20
est_sigchld
static void est_sigchld(void)
Definition: dillo.cc:143
debug.hh
styleengine.hh
PREFS_UI_TAB_FG_COLOR
#define PREFS_UI_TAB_FG_COLOR
Definition: prefs.h:31
textblock.hh
CLI_options::id
OptID id
Definition: dillo.cc:79
DilloPrefs::start_page
DilloUrl * start_page
Definition: prefs.h:48
Url.h
makeStartUrl
static DilloUrl * makeStartUrl(char *str, bool local)
Definition: dillo.cc:348
misc.h
dw::fltk::freeall
void freeall()
Definition: fltkcore.hh:26
a_Domain_freeall
void a_Domain_freeall(void)
Definition: domain.c:79
DilloPrefs::penalty_hyphen_2
int penalty_hyphen_2
Definition: prefs.h:109
DilloPrefs::xpos
int xpos
Definition: prefs.h:39
DilloPrefs::ui_fg_color
int32_t ui_fg_color
Definition: prefs.h:54
dStrAsciiCasecmp
int dStrAsciiCasecmp(const char *s1, const char *s2)
Definition: dlib.c:201
DilloPrefs::show_ui_tooltip
bool_t show_ui_tooltip
Definition: prefs.h:64
dLib_show_messages
void dLib_show_messages(bool_t show)
Definition: dlib.c:874
dw::fltk::FltkFont::fontExists
static bool fontExists(const char *name)
Definition: fltkplatform.cc:177
DilloPrefs::font_monospace
char * font_monospace
Definition: prefs.h:99
checkPreferredFonts
static void checkPreferredFonts()
Definition: dillo.cc:293
dw::Textblock::setStretchabilityFactor
static void setStretchabilityFactor(int stretchabilityFactor)
Definition: textblock.cc:218
a_Url_new
DilloUrl * a_Url_new(const char *url_str, const char *base_url)
Definition: url.c:359
getCmdOption
static OptID getCmdOption(const CLI_options *options, int argc, char **argv, char **opt_argv, int *idx)
Definition: dillo.cc:192
DilloPrefs::ui_main_bg_color
int32_t ui_main_bg_color
Definition: prefs.h:55
a_Http_proxy_auth
int a_Http_proxy_auth(void)
Definition: http.c:136
uicmd.hh
DILLO_CLI_LOCAL
Definition: dillo.cc:70
URL_PATH
#define URL_PATH(u)
Definition: url.h:74
a_UIcmd_open_url
void a_UIcmd_open_url(BrowserWindow *bw, const DilloUrl *url)
Definition: uicmd.cc:743
CLI_options::opt_argc
int opt_argc
Definition: dillo.cc:78
a_Http_init
int a_Http_init(void)
Definition: http.c:107
a_Dns_freeall
void a_Dns_freeall(void)
Definition: dns.c:501
dw::Textblock::setPenaltyEmDashRight
static void setPenaltyEmDashRight(int penaltyRightEmDash)
Definition: textblock.cc:208
keys.hh
a_Http_freeall
void a_Http_freeall(void)
Definition: http.c:754
prefsparser.hh
StyleEngine::init
static void init()
Create the user agent style.
Definition: styleengine.cc:951
dw::Textblock::setPenaltyHyphen
static void setPenaltyHyphen(int penaltyHyphen)
Definition: textblock.cc:192
a_Prefs_init
void a_Prefs_init(void)
Definition: prefs.c:37
dw::Textblock::setPenaltyEmDashLeft
static void setPenaltyEmDashLeft(int penaltyLeftEmDash)
Definition: textblock.cc:202
prefs
DilloPrefs prefs
Definition: prefs.c:31
CLI_options
Definition: dillo.cc:75
a_UIcmd_open_url_nt
void a_UIcmd_open_url_nt(void *vbw, const DilloUrl *url, int focus)
Definition: uicmd.cc:787
a_Misc_parse_geometry
int a_Misc_parse_geometry(char *str, int *x, int *y, int *w, int *h)
Definition: misc.c:360
DilloPrefs::font_cursive
char * font_cursive
Definition: prefs.h:97
numOptions
static int numOptions(const CLI_options *options)
Definition: dillo.cc:179
a_Auth_init
void a_Auth_init(void)
Definition: auth.c:58
DilloPrefs::font_sans_serif
char * font_sans_serif
Definition: prefs.h:96
a_Cache_freeall
void a_Cache_freeall(void)
Definition: cache.c:1386
PREFS_UI_TAB_ACTIVE_BG_COLOR
#define PREFS_UI_TAB_ACTIVE_BG_COLOR
Definition: prefs.h:28
a_Dpi_init
void a_Dpi_init(void)
Definition: dpi.c:83
DilloPrefs::penalty_em_dash_right
int penalty_em_dash_right
Definition: prefs.h:110
Paths::getOldWorkingDir
static char * getOldWorkingDir(void)
Definition: paths.cc:64
CLI_options::help
const char * help
Definition: dillo.cc:80
a_UIcmd_get_passwd
const char * a_UIcmd_get_passwd(const char *user)
Definition: uicmd.cc:1097
main
int main(int argc, char **argv)
Definition: dillo.cc:378
domain.h
DilloPrefs::middle_click_opens_new_tab
bool_t middle_click_opens_new_tab
Definition: prefs.h:101
DilloPrefs::ui_tab_active_bg_color
int32_t ui_tab_active_bg_color
Definition: prefs.h:57
Paths::free
static void free(void)
Definition: paths.cc:72
PATHS_RC_PREFS
#define PATHS_RC_PREFS
Definition: paths.hh:15
dicache.h
URL_STR
#define URL_STR(u)
Definition: url.h:80
a_Url_set_flags
void a_Url_set_flags(DilloUrl *u, int flags)
Definition: url.c:473
PATHS_RC_KEYS
#define PATHS_RC_KEYS
Definition: paths.hh:16
auth.h
DilloPrefs::ypos
int ypos
Definition: prefs.h:40
Keys::init
static void init()
Definition: keys.cc:148
Options
static const CLI_options Options[]
Definition: dillo.cc:83
DilloPrefs::penalty_hyphen
int penalty_hyphen
Definition: prefs.h:109
a_History_freeall
void a_History_freeall()
Definition: history.c:152
DilloPrefs::show_msg
bool_t show_msg
Definition: prefs.h:106
DilloPrefs::http_proxyuser
char * http_proxyuser
Definition: prefs.h:44
a_Web_init
void a_Web_init(void)
Definition: web.cc:37
CLI_options::shortopt
const char * shortopt
Definition: dillo.cc:76
URL_SCHEME
#define URL_SCHEME(u)
Definition: url.h:72
capi.h
bw.h
DILLO_CLI_FULLWINDOW
Definition: dillo.cc:67
mime.h
web.hh
custLabelDraw
static void custLabelDraw(const Fl_Label *o, int X, int Y, int W, int H, Fl_Align align)
Definition: dillo.cc:244
a_UIcmd_open_url_nw
void a_UIcmd_open_url_nw(BrowserWindow *bw, const DilloUrl *url)
Definition: uicmd.cc:773
DilloPrefs::width
int width
Definition: prefs.h:37
dStrdup
char * dStrdup(const char *s)
Definition: dlib.c:75
dns.h
a_Capi_init
void a_Capi_init(void)
Definition: capi.c:76
MSG_WARN
#define MSG_WARN(...)
Definition: msg.h:27
a_Http_set_proxy_passwd
void a_Http_set_proxy_passwd(const char *str)
Definition: http.c:144
dw::core::freeall
void freeall()
Definition: core.hh:30
a_UIcmd_set_location_text
void a_UIcmd_set_location_text(void *vbw, const char *text)
Definition: uicmd.cc:1375
PREFS_GEOMETRY_DEFAULT_HEIGHT
#define PREFS_GEOMETRY_DEFAULT_HEIGHT
Definition: prefs.h:22
DilloPrefs::penalty_em_dash_left
int penalty_em_dash_left
Definition: prefs.h:110
uint_t
unsigned int uint_t
Definition: d_size.h:20
PREFS_UI_BUTTON_HIGHLIGHT_COLOR
#define PREFS_UI_BUTTON_HIGHLIGHT_COLOR
Definition: prefs.h:27
a_Dicache_freeall
void a_Dicache_freeall(void)
Definition: dicache.c:533
DilloPrefs::stretchability_factor
int stretchability_factor
Definition: prefs.h:111
PREFS_GEOMETRY_DEFAULT_WIDTH
#define PREFS_GEOMETRY_DEFAULT_WIDTH
Definition: prefs.h:21
DilloPrefs::ui_tab_active_fg_color
int32_t ui_tab_active_fg_color
Definition: prefs.h:58
a_Misc_escape_chars
char * a_Misc_escape_chars(const char *str, const char *esc_set)
Definition: misc.c:26
DilloUrl
Definition: url.h:91
BrowserWindow::ui
void * ui
Definition: bw.h:17
PATHS_RC_DOMAIN
#define PATHS_RC_DOMAIN
Definition: paths.hh:17
dNew0
#define dNew0(type, count)
Definition: dlib.h:51
DilloPrefs::font_serif
char * font_serif
Definition: prefs.h:95
printHelp
static void printHelp(const char *cmdname, const CLI_options *options)
Definition: dillo.cc:163
DilloPrefs::ui_text_bg_color
int32_t ui_text_bg_color
Definition: prefs.h:61
a_Dicache_init
void a_Dicache_init(void)
Definition: dicache.c:62
a_Dns_init
void a_Dns_init(void)
Definition: dns.c:177
setUIColorWdef
static void setUIColorWdef(Fl_Color idx, int32_t color, Fl_Color default_val)
Definition: dillo.cc:306
custMenuLabelDraw
static void custMenuLabelDraw(const Fl_Label *o, int X, int Y, int W, int H, Fl_Align align)
Definition: dillo.cc:264