├── bm.txt ├── AUTHORS ├── ChangeLog ├── dw ├── view.hh ├── preview.xbm ├── fltkmisc.hh ├── regardingborder.hh ├── oofposabsmgr.hh ├── oofposfixedmgr.hh ├── listitem.hh ├── fltkcore.hh ├── bullet.hh ├── fltkflatview.hh ├── outofflowmgr.cc ├── regardingborder.cc ├── fltkmisc.cc ├── simpletablecell.hh ├── ruler.hh ├── core.hh ├── oofposfixedmgr.cc ├── alignedtablecell.hh ├── oofposrelmgr.hh ├── alignedtextblock.hh ├── tablecell.hh ├── events.hh ├── tools.hh ├── fltkcomplexbutton.hh ├── oofposabsmgr.cc ├── imgrenderer.cc ├── oofposabslikemgr.hh ├── listitem.cc ├── findtext.hh ├── imgrenderer.hh ├── fltkviewport.hh ├── stackingcontextmgr.hh ├── fltkflatview.cc ├── fltkpreview.hh └── table_iterator.cc ├── dpi ├── cookies.c └── dpiutil.h ├── src ├── cookies.c ├── dpiapi.h ├── domain.h ├── dgif.h ├── djpeg.h ├── dpng.h ├── colors.h ├── hsts.h ├── bookmark.h ├── IO │ ├── proto.c │ ├── IO.h │ ├── iowatch.hh │ ├── iowatch.cc │ ├── Url.h │ ├── tls.h │ ├── Makefile │ └── mime.h ├── timeout.hh ├── digest.h ├── chg ├── xembed.hh ├── html.hh ├── history.h ├── prefsparser.hh ├── cookies.h ├── imgbuf.hh ├── srch ├── dns.h ├── findbar.hh ├── klist.h ├── msg.h ├── bitvec.h ├── paths.hh ├── utf8.hh ├── menu.hh ├── misc.h ├── table.hh ├── domainrc ├── dialog.hh ├── timeout.cc ├── auth.h ├── binaryconst.h ├── list.h ├── decode.h ├── bitvec.c ├── capi.h ├── web.hh ├── nav.h ├── tipwin.hh ├── keys.hh ├── chain.h ├── form.hh ├── cssparser.hh ├── image.hh ├── dpiapi.c ├── bookmark.c └── doctree.hh ├── devdoc ├── Cache.txt ├── dw-floats-01.png ├── dw-size-of-widget.png ├── dw-style-box-model.png ├── dw-example-screenshot.png ├── dw-size-request-pos-01.png ├── not-so-simple-container.png ├── dw-interrupted-drawing-1.png ├── dw-interrupted-drawing-2.png ├── dw-style-length-absolute.png ├── dw-style-length-percentage.png ├── dw-style-length-relative.png ├── dw-viewport-with-scrollbar.png ├── dw-viewport-without-scrollbar.png ├── dw-textblock-collapsing-spaces-1-1.png ├── dw-textblock-collapsing-spaces-1-2.png ├── dw-textblock-collapsing-spaces-2-1.png ├── dw-textblock-collapsing-spaces-2-2.png ├── rounding-errors.doc ├── dw-size-request-pos-01.html ├── index.doc ├── README ├── dw-fixed-positions.doc └── dw-map.doc ├── doc ├── Cookies.txt ├── README └── Makefile ├── screenshots ├── epub1.png ├── epub2.png ├── gemini.png ├── gopher.png ├── main.png └── media_playing.png ├── test ├── hyphenate-nbsp.html ├── table-narrow.html ├── trie.cc ├── KHM1c.html ├── white-space.html ├── table-thead-tfoot.html ├── KHM1b.html ├── floats5.html ├── floats2.html ├── floats3.html ├── table-1.html ├── shapes.cc ├── floats-table.html ├── lang.html ├── unicode_test.cc ├── notsosimplevector.cc ├── floats-worm.html ├── identity.cc ├── dw_simple_container.hh ├── table-h1.html ├── floats-and-margins.html ├── floats-and-absolute.html ├── floats4.html ├── hyphens-etc.html └── KHM1.html ├── dist ├── icons │ └── dillo-plus.png ├── dillo-plus.desktop └── Makefile ├── pkgs └── obsd │ ├── +REQUIRING │ ├── Makefile │ └── +DESC ├── dpid ├── misc_new.h ├── dpidrc.in ├── dpi_socket_dir.h ├── TODO ├── dpi.h ├── dpid_common.c ├── dpid_common.h └── Makefile ├── dlib └── Makefile ├── dpip └── Makefile ├── style.css ├── d_size.h ├── lout ├── unicode.hh ├── Makefile ├── msg.h └── debug.hh ├── install-dpi-local ├── style_reader_mode.css ├── NEWS ├── test_files └── page.gmi ├── style.css.orig.full ├── Makefile.options.OpenBSD ├── Makefile.options ├── Makefile.options.Linux ├── Makefile.options.Linux.Wayland ├── README └── Makefile.options.MacOS /bm.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crossbowerbt/dillo-plus/HEAD/AUTHORS -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crossbowerbt/dillo-plus/HEAD/ChangeLog -------------------------------------------------------------------------------- /dw/view.hh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crossbowerbt/dillo-plus/HEAD/dw/view.hh -------------------------------------------------------------------------------- /dpi/cookies.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crossbowerbt/dillo-plus/HEAD/dpi/cookies.c -------------------------------------------------------------------------------- /src/cookies.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crossbowerbt/dillo-plus/HEAD/src/cookies.c -------------------------------------------------------------------------------- /devdoc/Cache.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crossbowerbt/dillo-plus/HEAD/devdoc/Cache.txt -------------------------------------------------------------------------------- /doc/Cookies.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crossbowerbt/dillo-plus/HEAD/doc/Cookies.txt -------------------------------------------------------------------------------- /src/dpiapi.h: -------------------------------------------------------------------------------- 1 | 2 | void a_Dpiapi_dialog(BrowserWindow *bw, char *server, char *dpip_tag); 3 | 4 | -------------------------------------------------------------------------------- /screenshots/epub1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crossbowerbt/dillo-plus/HEAD/screenshots/epub1.png -------------------------------------------------------------------------------- /screenshots/epub2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crossbowerbt/dillo-plus/HEAD/screenshots/epub2.png -------------------------------------------------------------------------------- /screenshots/gemini.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crossbowerbt/dillo-plus/HEAD/screenshots/gemini.png -------------------------------------------------------------------------------- /screenshots/gopher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crossbowerbt/dillo-plus/HEAD/screenshots/gopher.png -------------------------------------------------------------------------------- /screenshots/main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crossbowerbt/dillo-plus/HEAD/screenshots/main.png -------------------------------------------------------------------------------- /devdoc/dw-floats-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crossbowerbt/dillo-plus/HEAD/devdoc/dw-floats-01.png -------------------------------------------------------------------------------- /test/hyphenate-nbsp.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crossbowerbt/dillo-plus/HEAD/test/hyphenate-nbsp.html -------------------------------------------------------------------------------- /dist/icons/dillo-plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crossbowerbt/dillo-plus/HEAD/dist/icons/dillo-plus.png -------------------------------------------------------------------------------- /devdoc/dw-size-of-widget.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crossbowerbt/dillo-plus/HEAD/devdoc/dw-size-of-widget.png -------------------------------------------------------------------------------- /devdoc/dw-style-box-model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crossbowerbt/dillo-plus/HEAD/devdoc/dw-style-box-model.png -------------------------------------------------------------------------------- /pkgs/obsd/+REQUIRING: -------------------------------------------------------------------------------- 1 | fltk-1.3.3p3 2 | desktop-file-utils-0.26 3 | jpeg-2.1.5.1v0 4 | png-1.6.39 5 | libiconv-1.17 6 | -------------------------------------------------------------------------------- /screenshots/media_playing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crossbowerbt/dillo-plus/HEAD/screenshots/media_playing.png -------------------------------------------------------------------------------- /devdoc/dw-example-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crossbowerbt/dillo-plus/HEAD/devdoc/dw-example-screenshot.png -------------------------------------------------------------------------------- /devdoc/dw-size-request-pos-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crossbowerbt/dillo-plus/HEAD/devdoc/dw-size-request-pos-01.png -------------------------------------------------------------------------------- /devdoc/not-so-simple-container.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crossbowerbt/dillo-plus/HEAD/devdoc/not-so-simple-container.png -------------------------------------------------------------------------------- /devdoc/dw-interrupted-drawing-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crossbowerbt/dillo-plus/HEAD/devdoc/dw-interrupted-drawing-1.png -------------------------------------------------------------------------------- /devdoc/dw-interrupted-drawing-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crossbowerbt/dillo-plus/HEAD/devdoc/dw-interrupted-drawing-2.png -------------------------------------------------------------------------------- /devdoc/dw-style-length-absolute.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crossbowerbt/dillo-plus/HEAD/devdoc/dw-style-length-absolute.png -------------------------------------------------------------------------------- /devdoc/dw-style-length-percentage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crossbowerbt/dillo-plus/HEAD/devdoc/dw-style-length-percentage.png -------------------------------------------------------------------------------- /devdoc/dw-style-length-relative.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crossbowerbt/dillo-plus/HEAD/devdoc/dw-style-length-relative.png -------------------------------------------------------------------------------- /devdoc/dw-viewport-with-scrollbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crossbowerbt/dillo-plus/HEAD/devdoc/dw-viewport-with-scrollbar.png -------------------------------------------------------------------------------- /devdoc/dw-viewport-without-scrollbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crossbowerbt/dillo-plus/HEAD/devdoc/dw-viewport-without-scrollbar.png -------------------------------------------------------------------------------- /devdoc/dw-textblock-collapsing-spaces-1-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crossbowerbt/dillo-plus/HEAD/devdoc/dw-textblock-collapsing-spaces-1-1.png -------------------------------------------------------------------------------- /devdoc/dw-textblock-collapsing-spaces-1-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crossbowerbt/dillo-plus/HEAD/devdoc/dw-textblock-collapsing-spaces-1-2.png -------------------------------------------------------------------------------- /devdoc/dw-textblock-collapsing-spaces-2-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crossbowerbt/dillo-plus/HEAD/devdoc/dw-textblock-collapsing-spaces-2-1.png -------------------------------------------------------------------------------- /devdoc/dw-textblock-collapsing-spaces-2-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crossbowerbt/dillo-plus/HEAD/devdoc/dw-textblock-collapsing-spaces-2-2.png -------------------------------------------------------------------------------- /pkgs/obsd/Makefile: -------------------------------------------------------------------------------- 1 | all: +CONTENTS 2 | pkg_create -f +CONTENTS 3 | 4 | +CONTENTS: 5 | sh gen_contents.sh 6 | 7 | clean: 8 | rm -rf +CONTENTS *.tgz 9 | 10 | -------------------------------------------------------------------------------- /pkgs/obsd/+DESC: -------------------------------------------------------------------------------- 1 | fast and light graphical web browser with additional features 2 | Dillo Plus is a multi-platform graphical web browser known for its speed and 3 | small size. It is written in C and C++ and based on FLTK. 4 | -------------------------------------------------------------------------------- /doc/README: -------------------------------------------------------------------------------- 1 | Last update: June 2015 2 | 3 | This directory contains user documentation. Developer documentation is 4 | only stored in the Hg repository at , in 5 | the directory "devdoc", but not part of the tarball. 6 | -------------------------------------------------------------------------------- /dw/preview.xbm: -------------------------------------------------------------------------------- 1 | #define preview_width 11 2 | #define preview_height 11 3 | static unsigned char preview_bits[] = { 4 | 0x20, 0x00, 0x70, 0x00, 0x20, 0x00, 0x20, 0x00, 0x22, 0x02, 0xff, 0x07, 5 | 0x22, 0x02, 0x20, 0x00, 0x20, 0x00, 0x70, 0x00, 0x20, 0x00}; 6 | -------------------------------------------------------------------------------- /dpid/misc_new.h: -------------------------------------------------------------------------------- 1 | #ifndef MISC_NEW_H 2 | #define MISC_NEW_H 3 | 4 | Dstr *a_Misc_rdtag(int socket); 5 | char *a_Misc_readtag(int sock); 6 | char *a_Misc_mkdtemp(char *template); 7 | char *a_Misc_mkfname(char *template); 8 | char *a_Misc_mksecret(int nchar); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /dlib/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.options 2 | 3 | libDlib.a: dlib.o 4 | $(AR) $(ARFLAGS) libDlib.a dlib.o 5 | $(RANLIB) libDlib.a 6 | 7 | dlib.o: dlib.h dlib.c 8 | $(COMPILE) -c dlib.c 9 | 10 | all: libDlib.a 11 | 12 | clean: 13 | rm -f *.o *.a 14 | 15 | install: 16 | uninstall: 17 | -------------------------------------------------------------------------------- /dpid/dpidrc.in: -------------------------------------------------------------------------------- 1 | dpi_dir=@libdir@/@binname@/dpi 2 | 3 | proto.file=file/file.dpi 4 | proto.zip=zip/zip.dpi 5 | proto.man=man/man.dpi 6 | proto.ftp=ftp/ftp.filter.dpi 7 | proto.gemini=gemini/gemini.filter.dpi 8 | proto.gopher=gopher/gopher.filter.dpi 9 | proto.data=datauri/datauri.filter.dpi 10 | -------------------------------------------------------------------------------- /dpip/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.options 2 | 3 | libDpip.a: dpip.o 4 | $(AR) $(ARFLAGS) libDpip.a dpip.o 5 | $(RANLIB) libDpip.a 6 | 7 | dpip.o: dpip.h dpip.c 8 | $(COMPILE) -DBINNAME='"$(BINNAME)"' -c dpip.c 9 | 10 | all: libDpip.a 11 | 12 | clean: 13 | rm -f *.o *.a 14 | 15 | install: 16 | uninstall: 17 | -------------------------------------------------------------------------------- /test/table-narrow.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
W daaaaaaaaaaaa*
4 |
WW daaaaaaaaaaaa*
5 |
WWW daaaaaaaaaaaa*
6 |
WWWW daaaaaaaaaaaa*
7 |
WWWWW daaaaaaaaaaaa*
8 |
WWWWWW daaaaaaaaaaaa*
9 |
10 | -------------------------------------------------------------------------------- /dist/dillo-plus.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | GenericName=Web Browser 3 | GenericName[lt]=Web naršyklė 4 | Name=Dillo Plus 5 | Comment=Lightweight browser 6 | Comment[lt]=Labai paprasta naršyklė 7 | MimeType=text/html;text/xml;application/xhtml+xml; 8 | Exec=dillo-plus 9 | Terminal=false 10 | Type=Application 11 | Categories=X-Internet-browser 12 | Icon=dillo-plus.png 13 | -------------------------------------------------------------------------------- /dpid/dpi_socket_dir.h: -------------------------------------------------------------------------------- 1 | /*! \file 2 | * Create a per user temporary directory for dpi sockets 3 | */ 4 | 5 | #ifndef DPI_SOCKET_DIR_H 6 | #define DPI_SOCKET_DIR_H 7 | 8 | 9 | int w_dpi_socket_dir(char *dirname, char *sockdir); 10 | 11 | int tst_dir(char *dir); 12 | 13 | char *mk_sockdir(void); 14 | 15 | char *init_sockdir(char *dpi_socket_dir); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /src/domain.h: -------------------------------------------------------------------------------- 1 | #ifndef __DOMAIN_H__ 2 | #define __DOMAIN_H__ 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | #include "url.h" 10 | 11 | void a_Domain_parse(FILE *fp); 12 | void a_Domain_freeall(void); 13 | bool_t a_Domain_permit(const DilloUrl *source, const DilloUrl *dest); 14 | 15 | #ifdef __cplusplus 16 | } 17 | #endif 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /test/trie.cc: -------------------------------------------------------------------------------- 1 | #include "../dw/hyphenator.hh" 2 | 3 | int main (int argc, char *argv[]) 4 | { 5 | if (argc < 2) { 6 | fprintf(stderr, "Usage: trie \n"); 7 | exit (1); 8 | } 9 | 10 | /* Use pack = 1024 to create a really small trie - can take a while. 11 | */ 12 | dw::Hyphenator hyphenator (argv[1], NULL, 1024); 13 | hyphenator.saveTrie (stdout); 14 | } 15 | -------------------------------------------------------------------------------- /dist/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.options 2 | 3 | all: 4 | 5 | clean: 6 | 7 | install: 8 | $(INSTALL_SH) -c -d "$(APP_PATH)" 9 | $(INSTALL_SH) -c -d "$(ICON_PATH)" 10 | $(INSTALL) -c -m 644 dillo-plus.desktop "$(APP_PATH)" 11 | $(INSTALL) -c -m 644 icons/dillo-plus.png "$(ICON_PATH)" 12 | 13 | uninstall: 14 | rm -f "$(APP_PATH)/dillo-plus.desktop" 15 | rm -f "$(ICON_PATH)/dillo-plus.png" 16 | -------------------------------------------------------------------------------- /src/dgif.h: -------------------------------------------------------------------------------- 1 | #ifndef __GIF_H__ 2 | #define __GIF_H__ 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif /* __cplusplus */ 7 | 8 | #include "url.h" 9 | #include "image.hh" 10 | 11 | 12 | void *a_Gif_new(DilloImage *Image, DilloUrl *url, int version); 13 | void a_Gif_callback(int Op, void *data); 14 | 15 | 16 | #ifdef __cplusplus 17 | } 18 | #endif /* __cplusplus */ 19 | #endif /* !__GIF_H__ */ 20 | -------------------------------------------------------------------------------- /src/djpeg.h: -------------------------------------------------------------------------------- 1 | #ifndef __JPEG_H__ 2 | #define __JPEG_H__ 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif /* __cplusplus */ 7 | 8 | #include "url.h" 9 | #include "image.hh" 10 | 11 | 12 | void *a_Jpeg_new(DilloImage *Image, DilloUrl *url, int version); 13 | void a_Jpeg_callback(int Op, void *data); 14 | 15 | 16 | #ifdef __cplusplus 17 | } 18 | #endif /* __cplusplus */ 19 | #endif /* !__JPEG_H__ */ 20 | -------------------------------------------------------------------------------- /src/dpng.h: -------------------------------------------------------------------------------- 1 | #ifndef __PNG_H__ 2 | #define __PNG_H__ 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif /* __cplusplus */ 7 | 8 | #include "url.h" 9 | #include "image.hh" 10 | 11 | 12 | void *a_Png_new(DilloImage *Image, DilloUrl *url, int version); 13 | void a_Png_callback(int Op, CacheClient_t *Client); 14 | 15 | 16 | #ifdef __cplusplus 17 | } 18 | #endif /* __cplusplus */ 19 | #endif /* !__PNG_H__ */ 20 | -------------------------------------------------------------------------------- /dw/fltkmisc.hh: -------------------------------------------------------------------------------- 1 | #ifndef __FLTKMISC_HH__ 2 | #define __FLTKMISC_HH__ 3 | 4 | namespace dw { 5 | namespace fltk { 6 | 7 | /** 8 | * \brief Miscellaneous FLTK stuff. 9 | */ 10 | namespace misc { 11 | 12 | int screenWidth (); 13 | int screenHeight (); 14 | 15 | void warpPointer (int x, int y); 16 | 17 | } // namespace misc 18 | } // namespace fltk 19 | } // namespace dw 20 | 21 | 22 | #endif // __FLTKMISC_HH__ 23 | -------------------------------------------------------------------------------- /src/colors.h: -------------------------------------------------------------------------------- 1 | #ifndef __COLORS_H__ 2 | #define __COLORS_H__ 3 | 4 | #include "config.h" 5 | #include 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif /* __cplusplus */ 10 | 11 | int32_t a_Color_parse (const char *str, int32_t default_color, int *err); 12 | int32_t a_Color_vc(int32_t candidate, int32_t c1, int32_t c2, int32_t c3); 13 | 14 | #ifdef __cplusplus 15 | } 16 | #endif /* __cplusplus */ 17 | 18 | #endif /* __COLORS_H__ */ 19 | -------------------------------------------------------------------------------- /src/hsts.h: -------------------------------------------------------------------------------- 1 | #ifndef __HSTS_H__ 2 | #define __HSTS_H__ 3 | 4 | #include "d_size.h" 5 | #include "url.h" 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif /* __cplusplus */ 10 | 11 | void a_Hsts_init(FILE *fp); 12 | void a_Hsts_set(const char *header, const DilloUrl *url); 13 | bool_t a_Hsts_require_https(const char *host); 14 | void a_Hsts_freeall( void ); 15 | 16 | #ifdef __cplusplus 17 | } 18 | #endif /* __cplusplus */ 19 | #endif /* !__HSTS_H__ */ 20 | -------------------------------------------------------------------------------- /src/bookmark.h: -------------------------------------------------------------------------------- 1 | #ifndef __BOOKMARK_H__ 2 | #define __BOOKMARK_H__ 3 | 4 | #include "bw.h" 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif /* __cplusplus */ 9 | 10 | void a_Bookmarks_add(BrowserWindow *bw, const DilloUrl *url); 11 | 12 | /* TODO: this is for testing purposes */ 13 | void a_Bookmarks_chat_add(BrowserWindow *Bw, char *Cmd, char *answer); 14 | 15 | #ifdef __cplusplus 16 | } 17 | #endif /* __cplusplus */ 18 | 19 | #endif /* __BOOKMARK_H__ */ 20 | -------------------------------------------------------------------------------- /src/IO/proto.c: -------------------------------------------------------------------------------- 1 | /* 2 | * File: proto.c 3 | * 4 | * Copyright (C) 2003-2007 Jorge Arellano Cid , 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 | 12 | /* This module may be programmed to manage dpi-programs. */ 13 | 14 | -------------------------------------------------------------------------------- /src/timeout.hh: -------------------------------------------------------------------------------- 1 | #ifndef __TIMEOUT_HH__ 2 | #define __TIMEOUT_HH__ 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif /* __cplusplus */ 7 | 8 | typedef void (*TimeoutCb_t)(void *data); 9 | 10 | void a_Timeout_add(float t, TimeoutCb_t cb, void *cbdata); 11 | void a_Timeout_repeat(float t, TimeoutCb_t cb, void *cbdata); 12 | void a_Timeout_remove(); 13 | 14 | 15 | #ifdef __cplusplus 16 | } 17 | #endif /* __cplusplus */ 18 | 19 | #endif /* __TIMEOUT_HH__ */ 20 | 21 | -------------------------------------------------------------------------------- /style.css: -------------------------------------------------------------------------------- 1 | h1, h2, h3, h4, h5, h6, h7, h8, h9 { 2 | color: black; 3 | line-height:1.2 4 | } 5 | 6 | a { 7 | color: #004b6b; 8 | text-decoration: none; 9 | } 10 | 11 | a:hover { 12 | color: #6d4100; 13 | } 14 | 15 | blockquote { 16 | font-style: italic; 17 | } 18 | 19 | body { 20 | font-family: 'Garamond', 'Georgia', serif; 21 | font-size: 17px; 22 | background-color: #fff; 23 | color: #3e4349; 24 | margin: 0 15px 0 15px; 25 | padding: 0; 26 | } 27 | -------------------------------------------------------------------------------- /src/digest.h: -------------------------------------------------------------------------------- 1 | #ifndef __DIGEST_H__ 2 | #define __DIGEST_H__ 3 | 4 | #include "auth.h" 5 | #include "../dlib/dlib.h" 6 | 7 | 8 | char *a_Digest_create_cnonce(void); 9 | int a_Digest_compute_digest(AuthRealm_t *realm, 10 | const char *username, 11 | const char *passwd); 12 | char *a_Digest_authorization_hdr(AuthRealm_t *realm, 13 | const DilloUrl *url, 14 | const char *uri); 15 | 16 | #endif /* !__DIGEST_H__ */ 17 | -------------------------------------------------------------------------------- /d_size.h: -------------------------------------------------------------------------------- 1 | #ifndef __D_SIZE_H__ 2 | #define __D_SIZE_H__ 3 | 4 | 5 | #include "config.h" 6 | 7 | #ifdef HAVE_STDINT_H 8 | #include 9 | #else 10 | #ifdef HAVE_INTTYPES_H 11 | #include 12 | #else 13 | /* config.h defines {int,uint}*_t */ 14 | #endif /* HAVE_INTTYPES_H */ 15 | #endif /*HAVE_STDINT_H */ 16 | 17 | typedef unsigned char uchar_t; 18 | typedef unsigned short ushort_t; 19 | typedef unsigned long ulong_t; 20 | typedef unsigned int uint_t; 21 | typedef unsigned char bool_t; 22 | 23 | 24 | #endif /* __D_SIZE_H__ */ 25 | -------------------------------------------------------------------------------- /doc/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.options 2 | 3 | all: manpage.1.in 4 | sed "s/%BINNAME%/$(BINNAME)/g" manpage.1.in > $(BINNAME).1 5 | 6 | clean: 7 | rm -f $(BINNAME).1 8 | 9 | install: all 10 | $(INSTALL_SH) -c -d "$(DOC_PATH)" 11 | $(INSTALL) -c -m 644 user_help.html "$(DOC_PATH)" 12 | $(INSTALL) -c -m 644 Cookies.txt "$(DOC_PATH)" 13 | $(INSTALL_SH) -c -d "$(MAN_PATH)" 14 | $(INSTALL) -c -m 644 $(BINNAME).1 "$(MAN_PATH)" 15 | 16 | uninstall: 17 | rm -f "$(DOC_PATH)/*.html" 18 | rm -f "$(DOC_PATH)/*.txt" 19 | rm -f "$(MAN_PATH)/$(BINNAME).1" 20 | -------------------------------------------------------------------------------- /src/chg: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Shell script for name changing source code 4 | # 5 | 6 | if [ ! $# = 3 ]; then 7 | echo "Usage: chg " 8 | echo " (this script changes directly)" 9 | exit 1 10 | fi 11 | 12 | if [ ! -r $1 ]; then 13 | echo "source file ->$1<- doesn't exist..." 14 | exit 1 15 | fi 16 | 17 | if [ ! -r $1.BAK ]; then 18 | echo "creating backup file: $1.BAK" 19 | cp $1 $1.BAK 20 | fi 21 | 22 | sed "s/$2/$3/g" $1 > out 23 | #sed s/$2/$3/ $1 > out 24 | rm $1 25 | mv out $1 26 | echo "done!" 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/xembed.hh: -------------------------------------------------------------------------------- 1 | #ifndef __XEMBED_HH__ 2 | #define __XEMBED_HH__ 3 | 4 | #include 5 | 6 | #include "d_size.h" 7 | 8 | class Xembed : public Fl_Window { 9 | private: 10 | uint32_t xid; 11 | void createInternal(uint32_t parent); 12 | void setXembedInfo(unsigned long flags); 13 | void sendXembedEvent(uint32_t message); 14 | 15 | public: 16 | Xembed(uint32_t xid, int _w, int _h) : Fl_Window(_w, _h) { 17 | this->xid = xid; 18 | }; 19 | void show(); 20 | int handle(int event); 21 | }; 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /dw/regardingborder.hh: -------------------------------------------------------------------------------- 1 | #ifndef __DW_REGARDINGBORDER_HH__ 2 | #define __DW_REGARDINGBORDER_HH__ 3 | 4 | #include "oofawarewidget.hh" 5 | 6 | namespace dw { 7 | 8 | /** 9 | * \brief Base class (rather a tag interface) for those widgets 10 | * regarding borders defined by floats, and so allocated on the 11 | * full width. 12 | */ 13 | class RegardingBorder: public oof::OOFAwareWidget 14 | { 15 | public: 16 | static int CLASS_ID; 17 | 18 | RegardingBorder (); 19 | ~RegardingBorder (); 20 | }; 21 | 22 | } // namespace dw 23 | 24 | #endif // __DW_REGARDINGBORDER_HH__ 25 | -------------------------------------------------------------------------------- /src/html.hh: -------------------------------------------------------------------------------- 1 | #ifndef __HTML_HH__ 2 | #define __HTML_HH__ 3 | 4 | #include "url.h" // for DilloUrl 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif /* __cplusplus */ 9 | 10 | /* 11 | * Exported functions 12 | */ 13 | void a_Html_load_images(void *v_html, DilloUrl *pattern); 14 | void a_Html_form_submit(void *v_html, void *v_form); 15 | void a_Html_form_reset(void *v_html, void *v_form); 16 | void a_Html_form_display_hiddens(void *v_html, void *v_form, bool_t display); 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif /* __cplusplus */ 21 | 22 | 23 | #endif /* __HTML_HH__ */ 24 | -------------------------------------------------------------------------------- /dw/oofposabsmgr.hh: -------------------------------------------------------------------------------- 1 | #ifndef __DW_OOFPOSABSMGR_HH__ 2 | #define __DW_OOFPOSABSMGR_HH__ 3 | 4 | #include "oofposabslikemgr.hh" 5 | 6 | namespace dw { 7 | 8 | namespace oof { 9 | 10 | class OOFPosAbsMgr: public OOFPosAbsLikeMgr 11 | { 12 | protected: 13 | int containerBoxOffsetX (); 14 | int containerBoxOffsetY (); 15 | int containerBoxRestWidth (); 16 | int containerBoxRestHeight (); 17 | 18 | public: 19 | OOFPosAbsMgr (OOFAwareWidget *container); 20 | ~OOFPosAbsMgr (); 21 | }; 22 | 23 | } // namespace oof 24 | 25 | } // namespace dw 26 | 27 | #endif // __DW_OOFPOSABSMGR_HH__ 28 | -------------------------------------------------------------------------------- /dw/oofposfixedmgr.hh: -------------------------------------------------------------------------------- 1 | #ifndef __DW_OOFPOSFIXEDMGR_HH__ 2 | #define __DW_OOFPOSFIXEDMGR_HH__ 3 | 4 | #include "oofposabslikemgr.hh" 5 | 6 | namespace dw { 7 | 8 | namespace oof { 9 | 10 | class OOFPosFixedMgr: public OOFPosAbsLikeMgr 11 | { 12 | protected: 13 | int containerBoxOffsetX (); 14 | int containerBoxOffsetY (); 15 | int containerBoxRestWidth (); 16 | int containerBoxRestHeight (); 17 | 18 | public: 19 | OOFPosFixedMgr (OOFAwareWidget *container); 20 | ~OOFPosFixedMgr (); 21 | }; 22 | 23 | } // namespace oof 24 | 25 | } // namespace dw 26 | 27 | #endif // __DW_OOFPOSFIXEDMGR_HH__ 28 | -------------------------------------------------------------------------------- /src/IO/IO.h: -------------------------------------------------------------------------------- 1 | #ifndef __IO_H__ 2 | #define __IO_H__ 3 | 4 | #include "d_size.h" 5 | #include "../../dlib/dlib.h" 6 | #include "../chain.h" 7 | 8 | /* 9 | * IO Operations 10 | */ 11 | #define IORead 0 12 | #define IOWrite 1 13 | #define IOClose 2 14 | #define IOAbort 3 15 | 16 | /* 17 | * IO constants 18 | */ 19 | #define IOBufLen 8192 20 | 21 | 22 | /* 23 | * Exported functions 24 | */ 25 | /* Note: a_IO_ccc() is defined in Url.h together with the *_ccc() set */ 26 | 27 | 28 | /* 29 | * Exported data 30 | */ 31 | extern const char *AboutSplash; 32 | 33 | 34 | #endif /* __IO_H__ */ 35 | 36 | -------------------------------------------------------------------------------- /src/IO/iowatch.hh: -------------------------------------------------------------------------------- 1 | #ifndef __IO_WATCH_H__ 2 | #define __IO_WATCH_H__ 3 | 4 | /* 5 | * BUG: enum {READ = 1, WRITE = 4, EXCEPT = 8} borrowed from FL/Enumerations.H 6 | */ 7 | #define DIO_READ 1 8 | #define DIO_WRITE 4 9 | #define DIO_EXCEPT 8 10 | 11 | typedef void (*CbFunction_t)(int fd, void *data); 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif /* __cplusplus */ 16 | 17 | void a_IOwatch_add_fd(int fd,int when,CbFunction_t Callback,void *usr_data); 18 | void a_IOwatch_remove_fd(int fd,int when); 19 | 20 | #ifdef __cplusplus 21 | } 22 | #endif /* __cplusplus */ 23 | 24 | #endif /* __IO_WATCH_H__ */ 25 | 26 | -------------------------------------------------------------------------------- /src/history.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __DILLO_HISTORY_H__ 3 | #define __DILLO_HISTORY_H__ 4 | 5 | #include "url.h" 6 | 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif /* __cplusplus */ 11 | 12 | int a_History_add_url(DilloUrl *url); 13 | void a_History_set_title_by_url(const DilloUrl *url, const char *title); 14 | const DilloUrl *a_History_get_url(int idx); 15 | const char *a_History_get_title(int idx, int force); 16 | const char *a_History_get_title_by_url(const DilloUrl *url, int force); 17 | void a_History_freeall(void); 18 | 19 | 20 | #ifdef __cplusplus 21 | } 22 | #endif /* __cplusplus */ 23 | 24 | #endif /* __DILLO_HISTORY_H__ */ 25 | -------------------------------------------------------------------------------- /lout/unicode.hh: -------------------------------------------------------------------------------- 1 | #ifndef __UNICODE_HH__ 2 | #define __UNICODE_HH__ 3 | 4 | namespace lout { 5 | 6 | /** 7 | * \brief Stuff dealing with Unicode characters: UTF-8, character classes etc. 8 | * 9 | */ 10 | namespace unicode { 11 | 12 | bool isAlpha (int ch); 13 | 14 | int decodeUtf8 (const char *s); 15 | 16 | int decodeUtf8 (const char *s, int len); 17 | 18 | const char *nextUtf8Char (const char *s); 19 | 20 | const char *nextUtf8Char (const char *s, int len); 21 | 22 | int numUtf8Chars (const char *s); 23 | 24 | int numUtf8Chars (const char *s, int len); 25 | 26 | } // namespace lout 27 | 28 | } // namespace unicode 29 | 30 | #endif // __UNICODE_HH__ 31 | -------------------------------------------------------------------------------- /src/prefsparser.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Preferences parser 3 | * 4 | * Copyright (C) 2006-2009 Jorge Arellano Cid 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 | 12 | #ifndef __PREFS_HH__ 13 | #define __PREFS_HH__ 14 | 15 | #ifdef __cplusplus 16 | class PrefsParser { 17 | public: 18 | static int parseLine(char *line, char *name, char *value); 19 | static void parse(FILE *fp); 20 | }; 21 | #endif /* __cplusplus */ 22 | 23 | #endif /* __PREFS_HH__ */ 24 | -------------------------------------------------------------------------------- /dw/listitem.hh: -------------------------------------------------------------------------------- 1 | #ifndef __DW_LISTITEM_HH__ 2 | #define __DW_LISTITEM_HH__ 3 | 4 | #include "core.hh" 5 | #include "alignedtextblock.hh" 6 | 7 | namespace dw { 8 | 9 | class ListItem: public AlignedTextblock 10 | { 11 | protected: 12 | int getValue (); 13 | void setMaxValue (int maxValue, int value); 14 | 15 | public: 16 | static int CLASS_ID; 17 | 18 | ListItem(ListItem *ref, bool limitTextWidth); 19 | ~ListItem(); 20 | 21 | bool usesMaxGeneratorWidth (); 22 | 23 | void initWithWidget (core::Widget *widget, core::style::Style *style); 24 | void initWithText (const char *text, core::style::Style *style); 25 | }; 26 | 27 | } // namespace dw 28 | 29 | #endif // __DW_LISTITEM_HH__ 30 | -------------------------------------------------------------------------------- /test/KHM1c.html: -------------------------------------------------------------------------------- 1 |

In den alten Zeiten, wo das Wünschen 2 | noch geholfen hat, lebte ein König, dessen Töchter waren alle schön, 3 | aber die jüngste war so schön, daß die Sonne selber, die doch so 4 | vieles gesehen hat, sich verwunderte so oft sie ihr ins Gesicht 5 | schien. Nahe bei dem Schlosse des Königs lag ein großer dunkler Wald, 6 | und in dem Walde unter einer alten Linde war ein Brunnen: wenn nun der 7 | Tag recht heiß war, so ging das Königskind hinaus in den Wald und 8 | setzte sich an den Rand des kühlen Brunnens: und wenn sie Langeweile 9 | hatte, so nahm sie eine goldene Kugel, warf sie in die Höhe und fieng 10 | sie wieder; und das war ihr liebstes Spielwerk.

11 | -------------------------------------------------------------------------------- /dw/fltkcore.hh: -------------------------------------------------------------------------------- 1 | #ifndef __DW_FLTK_CORE_HH__ 2 | #define __DW_FLTK_CORE_HH__ 3 | 4 | #define __INCLUDED_FROM_DW_FLTK_CORE_HH__ 5 | 6 | namespace dw { 7 | namespace fltk { 8 | namespace ui { 9 | 10 | class FltkResource; 11 | 12 | } // namespace ui 13 | } // namespace fltk 14 | } // namespace dw 15 | 16 | #include 17 | 18 | #include "core.hh" 19 | #include "fltkimgbuf.hh" 20 | #include "fltkplatform.hh" 21 | #include "fltkui.hh" 22 | 23 | namespace dw { 24 | namespace fltk { 25 | 26 | inline void freeall () 27 | { 28 | FltkImgbuf::freeall (); 29 | } 30 | 31 | } // namespace fltk 32 | } // namespace dw 33 | 34 | #undef __INCLUDED_FROM_DW_FLTK_CORE_HH__ 35 | 36 | #endif // __DW_FLTK_CORE_HH__ 37 | -------------------------------------------------------------------------------- /src/cookies.h: -------------------------------------------------------------------------------- 1 | #ifndef __COOKIES_H__ 2 | #define __COOKIES_H__ 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif /* __cplusplus */ 7 | 8 | void a_Cookies_init( void ); 9 | 10 | #ifdef DISABLE_COOKIES 11 | # define a_Cookies_get_query(url, requester) dStrdup("") 12 | # define a_Cookies_set() ; 13 | # define a_Cookies_freeall() ; 14 | #else 15 | char *a_Cookies_get_query(const DilloUrl *query_url, 16 | const DilloUrl *requester); 17 | void a_Cookies_set(Dlist *cookie_string, const DilloUrl *set_url, 18 | const char *server_date); 19 | void a_Cookies_freeall( void ); 20 | #endif 21 | 22 | 23 | #ifdef __cplusplus 24 | } 25 | #endif /* __cplusplus */ 26 | #endif /* !__COOKIES_H__ */ 27 | -------------------------------------------------------------------------------- /lout/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.options 2 | 3 | all: liblout.a 4 | 5 | liblout.a: container.o identity.o misc.o object.o signal.o unicode.o 6 | $(AR) $(ARFLAGS) liblout.a container.o identity.o misc.o object.o signal.o unicode.o 7 | $(RANLIB) liblout.a 8 | 9 | container.o: container.cc container.hh 10 | $(CXXCOMPILE) -c container.cc 11 | 12 | identity.o: identity.cc identity.hh 13 | $(CXXCOMPILE) -c identity.cc 14 | 15 | misc.o: misc.cc misc.hh 16 | $(CXXCOMPILE) -c misc.cc 17 | 18 | object.o: object.cc object.hh 19 | $(CXXCOMPILE) -c object.cc 20 | 21 | signal.o: signal.cc signal.hh 22 | $(CXXCOMPILE) -c signal.cc 23 | 24 | unicode.o: unicode.cc unicode.hh 25 | $(CXXCOMPILE) -c unicode.cc 26 | 27 | clean: 28 | rm -f *.o *.a 29 | 30 | install: 31 | uninstall: 32 | -------------------------------------------------------------------------------- /test/white-space.html: -------------------------------------------------------------------------------- 1 |

nowrap

2 |
3 | hallo dillo hallo dillo hallo dillo hallo dillo 4 | hallo dillo hallo dillo hallo dillo hallo dillo 5 |
6 | 7 |

pre

8 | 9 |
10 | hallo dillo hallo dillo hallo dillo hallo dillo 11 | hallo dillo hallo dillo hallo dillo hallo dillo 12 |
13 | 14 |

pre-wrap

15 |
16 | hallo dillo hallo dillo hallo dillo hallo dillo 17 | hallo dillo hallo dillo hallo dillo hallo dillo 18 |
19 | 20 |

pre-line

21 |
22 | hallo dillo hallo dillo hallo dillo hallo dillo 23 | hallo dillo hallo dillo hallo dillo hallo dillo 24 |
25 | -------------------------------------------------------------------------------- /src/imgbuf.hh: -------------------------------------------------------------------------------- 1 | #ifndef __IMGBUF_HH__ 2 | #define __IMGBUF_HH__ 3 | 4 | // Imgbuf wrappers 5 | 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif /* __cplusplus */ 10 | 11 | 12 | #include "image.hh" 13 | 14 | /* 15 | * Function prototypes 16 | */ 17 | void a_Imgbuf_ref(void *v_imgbuf); 18 | void a_Imgbuf_unref(void *v_imgbuf); 19 | void *a_Imgbuf_new(void *v_ir, int img_type, uint_t width, uint_t height, 20 | double gamma); 21 | int a_Imgbuf_last_reference(void *v_imgbuf); 22 | void a_Imgbuf_update(void *v_imgbuf, const uchar_t *buf, DilloImgType type, 23 | uchar_t *cmap, uint_t width, uint_t height, uint_t y); 24 | void a_Imgbuf_new_scan(void *v_imgbuf); 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif /* __cplusplus */ 29 | 30 | #endif /* __IMGBUF_HH__ */ 31 | 32 | -------------------------------------------------------------------------------- /src/srch: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Find a token within source files ( *.[ch] ) 4 | # Enjoy! 5 | # Jorge.- 6 | 7 | if [ $# = 1 ]; then 8 | FLAGS="-H" 9 | elif [ $# = 2 ]; then 10 | FLAGS="-H $1" 11 | shift 1 12 | else 13 | echo "Usage:" 14 | echo " srch [-options] " 15 | exit 0 16 | fi 17 | 18 | # find "./" -name "*.[ch]" -print -exec grep $1 {} \; 19 | egrep $FLAGS "$1" *.[ch][ch] 20 | egrep $FLAGS "$1" *.[ch] 21 | egrep $FLAGS "$1" IO/*.[ch][ch]* 22 | egrep $FLAGS "$1" IO/*.[ch] 23 | egrep $FLAGS "$1" ../dpi/*.[ch] 24 | egrep $FLAGS "$1" ../dpi/*.[ch][ch] 25 | egrep $FLAGS "$1" ../dpid/*.[ch] 26 | egrep $FLAGS "$1" ../dpip/*.[ch] 27 | egrep $FLAGS "$1" ../dlib/*.[ch] 28 | 29 | #egrep $FLAGS "$1" dw/*[ch] 30 | #egrep $FLAGS "$1" lout/*[ch] 31 | egrep $FLAGS "$1" ../dw/*[ch] 32 | egrep $FLAGS "$1" ../lout/*[ch] 33 | 34 | -------------------------------------------------------------------------------- /src/dns.h: -------------------------------------------------------------------------------- 1 | #ifndef __DNS_H__ 2 | #define __DNS_H__ 3 | 4 | #include 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif /* __cplusplus */ 9 | 10 | 11 | typedef void (*DnsCallback_t)(int status, Dlist *addr_list, void *data); 12 | 13 | void a_Dns_init (void); 14 | void a_Dns_freeall(void); 15 | void a_Dns_resolve(const char *hostname, DnsCallback_t cb_func, void *cb_data); 16 | 17 | #ifdef ENABLE_IPV6 18 | # define DILLO_ADDR_MAX sizeof(struct in6_addr) 19 | #else 20 | # define DILLO_ADDR_MAX sizeof(struct in_addr) 21 | #endif 22 | 23 | typedef struct { 24 | int af; 25 | int alen; 26 | char data[DILLO_ADDR_MAX]; 27 | } DilloHost; 28 | 29 | void a_Dns_dillohost_to_string(DilloHost *host, char *dst, size_t size); 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif /* __cplusplus */ 34 | 35 | #endif /* __DNS_H__ */ 36 | -------------------------------------------------------------------------------- /dw/bullet.hh: -------------------------------------------------------------------------------- 1 | #ifndef __BULLET_HH__ 2 | #define __BULLET_HH__ 3 | 4 | #include "core.hh" 5 | 6 | namespace dw { 7 | 8 | /** 9 | * \brief Displays different kind of bullets. 10 | * 11 | * Perhaps, in the future, Unicode characters are used for bullets, so this 12 | * widget is not used anymore. 13 | */ 14 | class Bullet: public core::Widget 15 | { 16 | protected: 17 | void sizeRequestSimpl (core::Requisition *requisition); 18 | void getExtremesSimpl (core::Extremes *extremes); 19 | void containerSizeChangedForChildren (); 20 | void draw (core::View *view, core::Rectangle *area, 21 | core::DrawingContext *context); 22 | core::Iterator *iterator (core::Content::Type mask, bool atEnd); 23 | 24 | public: 25 | Bullet (); 26 | ~Bullet (); 27 | }; 28 | 29 | } // namespace dw 30 | 31 | #endif // __BULLET_HH__ 32 | -------------------------------------------------------------------------------- /src/findbar.hh: -------------------------------------------------------------------------------- 1 | #ifndef __FINDBAR_HH__ 2 | #define __FINDBAR_HH__ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #include "tipwin.hh" 12 | 13 | /* 14 | * Searchbar to find text in page. 15 | */ 16 | class Findbar : public Fl_Group { 17 | CustButton *hide_btn, *next_btn, *prev_btn; 18 | Fl_Check_Button *check_btn; 19 | Fl_Pixmap *hideImg; 20 | Fl_Input *i; 21 | 22 | static void search_cb (Fl_Widget *, void *); 23 | static void searchBackwards_cb (Fl_Widget *, void *); 24 | static void hide_cb (Fl_Widget *, void *); 25 | 26 | public: 27 | Findbar(int width, int height); 28 | ~Findbar(); 29 | int handle(int event); 30 | void show(); 31 | }; 32 | 33 | #endif // __FINDBAR_HH__ 34 | -------------------------------------------------------------------------------- /src/klist.h: -------------------------------------------------------------------------------- 1 | #ifndef __KLIST_H__ 2 | #define __KLIST_H__ 3 | 4 | #include "../dlib/dlib.h" 5 | 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif /* __cplusplus */ 10 | 11 | typedef struct { 12 | int Key; /* primary key */ 13 | void *Data; /* data reference */ 14 | } KlistNode_t; 15 | 16 | typedef struct { 17 | Dlist *List; 18 | int Clean; /* check flag */ 19 | int Counter; /* counter (for making keys) */ 20 | } Klist_t; 21 | 22 | 23 | /* 24 | * Function prototypes 25 | */ 26 | void* a_Klist_get_data(Klist_t *Klist, int Key); 27 | int a_Klist_insert(Klist_t **Klist, void *Data); 28 | void a_Klist_remove(Klist_t *Klist, int Key); 29 | int a_Klist_length(Klist_t *Klist); 30 | void a_Klist_free(Klist_t **Klist); 31 | 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif /* __cplusplus */ 36 | 37 | #endif /* __KLIST_H__ */ 38 | -------------------------------------------------------------------------------- /test/table-thead-tfoot.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Test thead, tbody and tfoot 5 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 |
MonthSavings
January$100
February$80
Sum$180
40 | 41 | 42 | -------------------------------------------------------------------------------- /src/msg.h: -------------------------------------------------------------------------------- 1 | #ifndef __MSG_H__ 2 | #define __MSG_H__ 3 | 4 | #include 5 | #include "prefs.h" 6 | 7 | /* 8 | * You can disable any MSG* macro by adding the '_' prefix. 9 | */ 10 | #define _MSG(...) 11 | #define _MSG_WARN(...) 12 | #define _MSG_HTTP(...) 13 | 14 | #define MSG_INNARDS(prefix, ...) \ 15 | D_STMT_START { \ 16 | if (prefs.show_msg){ \ 17 | printf(prefix __VA_ARGS__); \ 18 | fflush (stdout); \ 19 | } \ 20 | } D_STMT_END 21 | 22 | #define MSG(...) MSG_INNARDS("", __VA_ARGS__) 23 | #define MSG_WARN(...) MSG_INNARDS("** WARNING **: ", __VA_ARGS__) 24 | #define MSG_ERR(...) MSG_INNARDS("** ERROR **: ", __VA_ARGS__) 25 | #define MSG_HTTP(...) MSG_INNARDS("HTTP warning: ", __VA_ARGS__) 26 | 27 | #endif /* __MSG_H__ */ 28 | -------------------------------------------------------------------------------- /src/bitvec.h: -------------------------------------------------------------------------------- 1 | #ifndef __BITVEC_H__ 2 | #define __BITVEC_H__ 3 | 4 | #include "d_size.h" 5 | 6 | #define BVEC_TYPE uchar_t 7 | #define BVEC_SIZE sizeof(BVEC_TYPE) 8 | 9 | typedef struct { 10 | BVEC_TYPE *vec; 11 | int len; /* number of bits [1 based] */ 12 | } bitvec_t; 13 | 14 | 15 | /* 16 | * Function prototypes 17 | */ 18 | bitvec_t *a_Bitvec_new(int bits); 19 | void a_Bitvec_free(bitvec_t *bvec); 20 | int a_Bitvec_get_bit(bitvec_t *bvec, int pos); 21 | void a_Bitvec_set_bit(bitvec_t *bvec, int pos); 22 | void a_Bitvec_clear(bitvec_t *bvec); 23 | 24 | /* 25 | #define a_Bitvec_get_bit(bvec,pos) \ 26 | ((bvec)->vec[(pos)/BVEC_SIZE] & 1 << (pos) % BVEC_SIZE) 27 | 28 | #define a_Bitvec_set_bit(bvec,pos) \ 29 | ((bvec)->vec[(pos)/BVEC_SIZE] |= 1 << (pos) % BVEC_SIZE) 30 | */ 31 | #define a_Bitvec_clear_bit(bvec,pos) \ 32 | ((bvec)->vec[(pos)/BVEC_SIZE] &= ~(1 << (pos) % BVEC_SIZE)) 33 | 34 | 35 | #endif /* __BITVEC_H__ */ 36 | -------------------------------------------------------------------------------- /test/KHM1b.html: -------------------------------------------------------------------------------- 1 |

In den al­ten Zei­ten, wo das 2 | Wün­schen noch ge­hol­fen hat, leb­te ein Kö­nig, 3 | des­sen Töch­ter wa­ren al­le schön, aber die 4 | jüng­ste war so schön, daß die Son­ne sel­ber, die doch so 5 | vie­les ge­se­hen hat, sich ver­wun­der­te so 6 | oft sie ihr ins Ge­sicht schien. Na­he bei dem Schlos­se 7 | des Kö­nigs lag ein gro­ßer dunk­ler Wald, und in dem 8 | Wal­de un­ter ei­ner al­ten Lin­de war ein 9 | Brun­nen: wenn nun der Tag recht heiß war, so ging das 10 | Kö­nigs­kind hin­aus in den Wald und setz­te sich an 11 | den Rand des küh­len Brun­nens: und wenn sie 12 | Lan­ge­wei­le hat­te, so nahm sie eine 13 | gol­de­ne Ku­gel, warf sie in die Hö­he und fieng sie 14 | wie­der; und das war ihr liebs­tes Spiel­werk.

15 | -------------------------------------------------------------------------------- /src/paths.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * File: paths.hh 3 | * 4 | * Copyright 2006-2009 Jorge Arellano Cid 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 | 12 | #ifndef __PATHS_HH__ 13 | #define __PATHS_HH__ 14 | 15 | #define PATHS_RC_PREFS "dillorc" 16 | #define PATHS_RC_KEYS "keysrc" 17 | #define PATHS_RC_DOMAIN "domainrc" 18 | #define PATHS_HSTS_PRELOAD "hsts_preload" 19 | #define PATHS_BM "bm.txt" 20 | #define BUFFERSIZE 4096 21 | #define COPYMODE 0644 22 | 23 | class Paths { 24 | public: 25 | static void init(void); 26 | static void free(void); 27 | static char *getOldWorkingDir(void); 28 | static FILE *getPrefsFP(const char *rcFile); 29 | static void copy_file(char *, char*); 30 | }; 31 | 32 | #endif /* __PATHS_HH__ */ 33 | -------------------------------------------------------------------------------- /install-dpi-local: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Install the dpi framework programs inside the user's account. 4 | # 5 | 6 | BASE="$HOME/.dillo" 7 | BASE2="$BASE/dpi" 8 | 9 | if [ -r $BASE/dpi_socket_dir ] ; then 10 | rm -r `cat $BASE/dpi_socket_dir` 11 | rm $BASE/dpi_socket_dir 12 | fi 13 | 14 | if [ ! -x dpid/dpid-plus ] ; then 15 | echo "This script may only be run AFTER make." 16 | exit 1 17 | fi 18 | 19 | # Try to communicate with any currently-running dpid to tell it 20 | # to stop itself and the dpi programs. 21 | dpidc-plus stop 22 | 23 | if [ ! -d $BASE ] ; then 24 | mkdir $BASE 25 | fi 26 | if [ ! -d $BASE2 ] ; then 27 | mkdir $BASE2 28 | fi 29 | 30 | cp dpid/dpid-plus dpid/dpidc-plus dpid/dpidrc $BASE 31 | strip $BASE/dpid-plus $BASE/dpidc-plus 32 | 33 | cd dpi 34 | for F in *.dpi ; do 35 | D="`echo $F | sed 's/\..*$//'`" 36 | if [ ! -d $BASE2/$D ] ; then 37 | mkdir $BASE2/$D 38 | fi 39 | cp $F $BASE2/$D 40 | strip $BASE2/$D/$F 41 | done 42 | cd .. 43 | 44 | -------------------------------------------------------------------------------- /src/IO/iowatch.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * File: iowatch.cc 3 | * 4 | * Copyright (C) 2005-2007 Jorge Arellano Cid 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 | 12 | // Simple ADT for watching file descriptor activity 13 | 14 | #include 15 | #include "iowatch.hh" 16 | 17 | // 18 | // Hook a Callback for a certain activities in a FD 19 | // 20 | void a_IOwatch_add_fd(int fd, int when, Fl_FD_Handler Callback, 21 | void *usr_data = 0) 22 | { 23 | if (fd >= 0) 24 | Fl::add_fd(fd, when, Callback, usr_data); 25 | } 26 | 27 | // 28 | // Remove a Callback for a given FD (or just remove some events) 29 | // 30 | void a_IOwatch_remove_fd(int fd, int when) 31 | { 32 | if (fd >= 0) 33 | Fl::remove_fd(fd, when); 34 | } 35 | 36 | -------------------------------------------------------------------------------- /dpid/TODO: -------------------------------------------------------------------------------- 1 | Todo List 2 | 3 | File dpi_service.c 4 | This module should be removed because its original functions 5 | have been removed or modified. Put these functions in dpid.c 6 | 7 | File dpi_service.h 8 | This module should be removed because its original functions 9 | have been removed or modified. Put these functions in dpid.c 10 | 11 | Add other file types, but first we need to add files associated 12 | with a dpi to the design. 13 | 14 | Global SRS_NAME 15 | Should read this from dillorc 16 | 17 | File dpid_common.h 18 | The dpid error codes will be used in the next patch 19 | 20 | Global main() 21 | + add new plugins when they become available 22 | __________________________________________________________ 23 | 24 | Remove global variables. 25 | 26 | Use a singly linked list for dpi_attr_list 27 | 28 | Allow dpis to be registered one at a time 29 | 30 | Only run dpis listed in users dillorc 31 | 32 | MAYBE Have dpid accept all connections to dpis (fixes inf loop if dpi crashes before accept) 33 | -------------------------------------------------------------------------------- /dw/fltkflatview.hh: -------------------------------------------------------------------------------- 1 | #ifndef __DW_FLTKFLATVIEW_HH__ 2 | #define __DW_FLTKFLATVIEW_HH__ 3 | 4 | #include "core.hh" 5 | #include "fltkcore.hh" 6 | #include "fltkviewbase.hh" 7 | 8 | namespace dw { 9 | namespace fltk { 10 | 11 | class FltkFlatView: public FltkWidgetView 12 | { 13 | protected: 14 | int translateViewXToCanvasX (int x); 15 | int translateViewYToCanvasY (int y); 16 | int translateCanvasXToViewX (int x); 17 | int translateCanvasYToViewY (int y); 18 | 19 | public: 20 | FltkFlatView (int x, int y, int w, int h, const char *label = 0); 21 | ~FltkFlatView (); 22 | 23 | void setCanvasSize (int width, int ascent, int descent); 24 | 25 | bool usesViewport (); 26 | int getHScrollbarThickness (); 27 | int getVScrollbarThickness (); 28 | void scrollTo (int x, int y); 29 | void setViewportSize (int width, int height, 30 | int hScrollbarThickness, int vScrollbarThickness); 31 | }; 32 | 33 | } // namespace fltk 34 | } // namespace dw 35 | 36 | #endif // __DW_FLTKFLATVIEW_HH__ 37 | 38 | -------------------------------------------------------------------------------- /src/utf8.hh: -------------------------------------------------------------------------------- 1 | #ifndef __UTF8_HH__ 2 | #define __UTF8_HH__ 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif /* __cplusplus */ 7 | 8 | 9 | #include "d_size.h" 10 | 11 | /* 12 | * Unicode replacement character U+FFFD 13 | * "used to replace an incoming character whose value is unknown or otherwise 14 | * unrepresentable in Unicode" 15 | */ 16 | static const char utf8_replacement_char[] = "\xEF\xBF\xBD"; 17 | 18 | /* Unicode zero width space U+200B */ 19 | static const char utf8_zero_width_space[] = "\xE2\x80\x8B"; 20 | 21 | uint_t a_Utf8_end_of_char(const char *str, uint_t i); 22 | uint_t a_Utf8_decode(const char*, const char* end, int* len); 23 | int a_Utf8_encode(unsigned int ucs, char *buf); 24 | int a_Utf8_test(const char* src, unsigned int srclen); 25 | bool_t a_Utf8_ideographic(const char *s, const char *end, int *len); 26 | bool_t a_Utf8_combining_char(int unicode); 27 | int a_Utf8_char_count(const char *str, int len); 28 | 29 | #ifdef __cplusplus 30 | } 31 | #endif /* __cplusplus */ 32 | 33 | #endif /* __UTF8_HH__ */ 34 | 35 | -------------------------------------------------------------------------------- /src/menu.hh: -------------------------------------------------------------------------------- 1 | #ifndef __MENU_HH__ 2 | #define __MENU_HH__ 3 | 4 | #include "bw.h" 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif /* __cplusplus */ 9 | 10 | void a_Menu_page_popup(BrowserWindow *bw, const DilloUrl *url, 11 | bool_t has_bugs, void *v_cssUrls); 12 | void a_Menu_link_popup(BrowserWindow *bw, const DilloUrl *url); 13 | void a_Menu_image_popup(BrowserWindow *bw, const DilloUrl *url, 14 | bool_t loaded_img, DilloUrl *page_url, 15 | DilloUrl *link_url); 16 | void a_Menu_form_popup(BrowserWindow *bw, const DilloUrl *page_url, 17 | void *vform, bool_t showing_hiddens); 18 | void a_Menu_file_popup(BrowserWindow *bw, void *v_wid); 19 | void a_Menu_bugmeter_popup(BrowserWindow *bw, const DilloUrl *url); 20 | void a_Menu_history_popup(BrowserWindow *bw, int x, int y, int direction); 21 | void a_Menu_tools_popup(BrowserWindow *bw, int x, int y); 22 | 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif /* __cplusplus */ 27 | 28 | #endif /* MENU_HH */ 29 | 30 | -------------------------------------------------------------------------------- /test/floats5.html: -------------------------------------------------------------------------------- 1 | Sed ut perspiciatis, unde omnis iste natus error sit voluptatem 2 | accusantium doloremque laudantium, totam rem aperiam eaque ipsa, quae 3 | ab illo inventore veritatis et quasi architecto beatae vitae dicta 4 | sunt, explicabo. 5 |
6 | nemo enim ipsam voluptatem, quia voluptas sit, 7 | aspernatur aut odit aut fugit, sed quia consequuntur magni dolores 8 | eos, qui ratione voluptatem sequi nesciunt, neque porro quisquam est, 9 | qui dolorem ipsum, quia dolor sit, amet, consectetur, adipisci velit, 10 | sed quia non numquam eius modi tempora incidunt, ut labore et dolore 11 | magnam aliquam quaerat voluptatem. ut enim ad minima veniam, quis 12 | nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut 13 | aliquid ex ea commodi consequatur? quis autem vel eum iure 14 | reprehenderit, qui in ea voluptate velit esse, quam nihil molestiae 15 | consequatur, vel illum, qui dolorem eum fugiat, quo voluptas nulla 16 | pariatur? 17 | -------------------------------------------------------------------------------- /src/misc.h: -------------------------------------------------------------------------------- 1 | #ifndef __DILLO_MISC_H__ 2 | #define __DILLO_MISC_H__ 3 | 4 | #include /* for size_t */ 5 | 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif /* __cplusplus */ 10 | 11 | 12 | char *a_Misc_escape_chars(const char *str, const char *esc_set); 13 | int a_Misc_expand_tabs(char **start, char *end, char *buf, int buflen); 14 | int a_Misc_get_content_type_from_data(void *Data, size_t Size,const char **PT); 15 | int a_Misc_content_type_check(const char *EntryType, const char *DetectedType); 16 | void a_Misc_parse_content_type(const char *str, char **major, char **minor, 17 | char **charset); 18 | int a_Misc_content_type_cmp(const char* ct1, const char *ct2); 19 | int a_Misc_parse_geometry(char *geom, int *x, int *y, int *w, int *h); 20 | int a_Misc_parse_search_url(char *source, char **label, char **urlstr); 21 | char *a_Misc_encode_base64(const char *in); 22 | Dstr *a_Misc_file2dstr(const char *filename); 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif /* __cplusplus */ 27 | 28 | #endif /* __DILLO_MISC_H__ */ 29 | 30 | -------------------------------------------------------------------------------- /devdoc/rounding-errors.doc: -------------------------------------------------------------------------------- 1 | /** \page rounding-errors How to Avoid Rounding Errors 2 | 3 | (Probably, this is a standard algorithm, so if someone knows the name, 4 | drop me a note.) 5 | 6 | If something like 7 | 8 | \f[y_i = {x_i a \over b}\f] 9 | 10 | is to be calculated, and all numbers are integers, a naive 11 | implementation would result in something, for which 12 | 13 | \f[\sum y_i \ne {(\sum x_i) a \over b}\f] 14 | 15 | because of rounding errors, due to the integer division. This can be 16 | avoided by transforming the formula into 17 | 18 | \f[y_i = {(\sum_{j=0}^{j=i} x_j) a \over b} - \sum_{j=0}^{j=i-1} y_j\f] 19 | 20 | Of corse, when all \f$y_i\f$ are calculated in a sequence, 21 | \f$\sum_{j=0}^{j=i} x_j\f$ and \f$\sum_{j=0}^{j=i-1} y_j\f$ can be 22 | accumulated in the same loop. Regard this as sample: 23 | 24 | \code 25 | int n, x[n], a, b; // Should all be initialized. 26 | int y[n], cumX = 0, cumY = 0; 27 | 28 | for (int i = 0; i < n; i++) { 29 | cumX += x[i] 30 | y[i] = (cumX * a) / b - cumY; 31 | cumY += y[i]; 32 | } 33 | \endcode 34 | 35 | */ 36 | -------------------------------------------------------------------------------- /src/IO/Url.h: -------------------------------------------------------------------------------- 1 | #ifndef __IO_URL_H__ 2 | #define __IO_URL_H__ 3 | 4 | #include "../chain.h" 5 | #include "../url.h" 6 | #include "../../dlib/dlib.h" 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif /* __cplusplus */ 11 | 12 | /* 13 | * External functions 14 | */ 15 | extern void a_Http_freeall(void); 16 | int a_Http_init(void); 17 | int a_Http_proxy_auth(void); 18 | void a_Http_set_proxy_passwd(const char *str); 19 | void a_Http_connect_done(int fd, bool_t success); 20 | 21 | void a_Http_ccc (int Op, int Branch, int Dir, ChainLink *Info, 22 | void *Data1, void *Data2); 23 | void a_IO_ccc (int Op, int Branch, int Dir, ChainLink *Info, 24 | void *Data1, void *Data2); 25 | void a_Dpi_ccc (int Op, int Branch, int Dir, ChainLink *Info, 26 | void *Data1, void *Data2); 27 | 28 | char *a_Dpi_send_blocking_cmd(const char *server_name, const char *cmd); 29 | void a_Dpi_dillo_exit(void); 30 | void a_Dpi_init(void); 31 | 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif /* __cplusplus */ 36 | 37 | #endif /* __IO_URL_H__ */ 38 | 39 | -------------------------------------------------------------------------------- /style_reader_mode.css: -------------------------------------------------------------------------------- 1 | html { 2 | text-align: center !important; 3 | } 4 | 5 | body { 6 | display: inline-block !important; 7 | font-size: 19px !important; 8 | max-width: 800px !important; 9 | } 10 | 11 | button, input, div, pre, ul, dl, ol, table, main, section, header, article, aside, footer, nav, span, em, b, a, form, h1, h2, h3, h4, h5, h6, h7, h8, h9 { 12 | text-align: left !important; 13 | max-width: 800px !important; 14 | margin: auto !important; 15 | } 16 | 17 | button, input, label { 18 | display: inline !important; 19 | } 20 | 21 | button *, input *, label * { 22 | display: inline !important; 23 | } 24 | 25 | h1, h2, h3, h4, h5, h6, h7, h8, h9 { 26 | padding: 16px 0 16px 0; 27 | } 28 | 29 | p, q, blockquote { 30 | text-align: justify !important; 31 | max-width: 800px !important; 32 | margin: auto !important; 33 | padding: 10px 0 10px 0; 34 | } 35 | 36 | img, figure, figcaption { 37 | max-width: 800px !important; 38 | max-height: auto !important; 39 | width: auto !important; 40 | height: auto !important; 41 | margin: auto !important; 42 | } 43 | -------------------------------------------------------------------------------- /test/floats2.html: -------------------------------------------------------------------------------- 1 | Sed ut perspiciatis, unde omnis iste natus error sit voluptatem 2 | accusantium doloremque laudantium, totam rem aperiam eaque ipsa, quae 3 | ab illo inventore veritatis et quasi architecto beatae vitae dicta 4 | sunt, explicabo. 5 |
Some text in a 6 | float.
7 | nemo enim ipsam voluptatem, quia voluptas sit, 8 | aspernatur aut odit aut fugit, sed quia consequuntur magni dolores 9 | eos, qui ratione voluptatem sequi nesciunt, neque porro quisquam est, 10 | qui dolorem ipsum, quia dolor sit, amet, consectetur, adipisci velit, 11 | sed quia non numquam eius modi tempora incidunt, ut labore et dolore 12 | magnam aliquam quaerat voluptatem. ut enim ad minima veniam, quis 13 | nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut 14 | aliquid ex ea commodi consequatur? quis autem vel eum iure 15 | reprehenderit, qui in ea voluptate velit esse, quam nihil molestiae 16 | consequatur, vel illum, qui dolorem eum fugiat, quo voluptas nulla 17 | pariatur? 18 | -------------------------------------------------------------------------------- /test/floats3.html: -------------------------------------------------------------------------------- 1 |

Sed ut perspiciatis, unde omnis iste natus error sit voluptatem 2 | accusantium doloremque laudantium, totam rem aperiam eaque ipsa, quae 3 | ab illo inventore veritatis et quasi architecto beatae vitae dicta 4 | sunt, explicabo.

5 |
Some text in a 6 | float.
7 |

nemo enim ipsam voluptatem, quia voluptas sit, aspernatur aut odit 8 | aut fugit, sed quia consequuntur magni dolores eos, qui ratione 9 | voluptatem sequi nesciunt, neque porro quisquam est, qui dolorem 10 | ipsum, quia dolor sit, amet, consectetur, adipisci velit, sed quia non 11 | numquam eius modi tempora incidunt, ut labore et dolore magnam aliquam 12 | quaerat voluptatem. ut enim ad minima veniam, quis nostrum 13 | exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex 14 | ea commodi consequatur? quis autem vel eum iure reprehenderit, qui in 15 | ea voluptate velit esse, quam nihil molestiae consequatur, vel illum, 16 | qui dolorem eum fugiat, quo voluptas nulla pariatur?

17 | -------------------------------------------------------------------------------- /src/table.hh: -------------------------------------------------------------------------------- 1 | #ifndef __TABLE_HH__ 2 | #define __TABLE_HH__ 3 | 4 | /* 5 | * Classes 6 | */ 7 | 8 | class DilloHtml; 9 | 10 | /* 11 | * Table parsing functions 12 | */ 13 | 14 | void Html_tag_open_table(DilloHtml *html, const char *tag, int tagsize); 15 | void Html_tag_content_table(DilloHtml *html, const char *tag, int tagsize); 16 | void Html_tag_open_tr(DilloHtml *html, const char *tag, int tagsize); 17 | void Html_tag_content_tr(DilloHtml *html, const char *tag, int tagsize); 18 | void Html_tag_open_td(DilloHtml *html, const char *tag, int tagsize); 19 | void Html_tag_content_td(DilloHtml *html, const char *tag, int tagsize); 20 | void Html_tag_open_tbody(DilloHtml *html, const char *tag, int tagsize); 21 | void Html_tag_content_tbody(DilloHtml *html, const char *tag, int tagsize); 22 | void Html_tag_open_tfoot(DilloHtml *html, const char *tag, int tagsize); 23 | void Html_tag_open_thead(DilloHtml *html, const char *tag, int tagsize); 24 | void Html_tag_open_th(DilloHtml *html, const char *tag, int tagsize); 25 | void Html_tag_content_th(DilloHtml *html, const char *tag, int tagsize); 26 | 27 | #endif /* __TABLE_HH__ */ 28 | -------------------------------------------------------------------------------- /dw/outofflowmgr.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Dillo Widget 3 | * 4 | * Copyright 2013-2014 Sebastian Geerken 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 . 18 | */ 19 | 20 | 21 | #include "outofflowmgr.hh" 22 | #include "oofawarewidget.hh" 23 | #include "../lout/debug.hh" 24 | 25 | 26 | namespace dw { 27 | 28 | namespace oof { 29 | 30 | OutOfFlowMgr::OutOfFlowMgr () 31 | { 32 | } 33 | 34 | OutOfFlowMgr::~OutOfFlowMgr () 35 | { 36 | } 37 | 38 | } // namespace oof 39 | 40 | } // namespace dw 41 | -------------------------------------------------------------------------------- /src/domainrc: -------------------------------------------------------------------------------- 1 | # domainrc - Dillo cross-domain request rules file. 2 | # 3 | # Here you can tell Dillo what to do when one site wants to retrieve resources 4 | # (e.g., images, style sheets, redirection) from a different site. 5 | # 6 | # Lines that begin with a '#' are comments. 7 | 8 | # Default rule can be "accept" or "deny". 9 | 10 | default accept 11 | 12 | 13 | # Now we list exceptions to the default. The format is: 14 | # 15 | # source destination 16 | # 17 | # There are three ways that you can specify a source or destination domain: 18 | # 19 | # 1. * - wildcard will match any domain 20 | # 2. example.com - match the specific host example.com 21 | # 3. .example.com - match example.com and any of its subdomains 22 | 23 | # Let's block some of the most notorious ad sites and trackers. 24 | 25 | * .2o7.net 26 | * .admt.com 27 | * .adnxs.com 28 | * .atdmt.com 29 | * .collective-media.net 30 | * .crwdcntrl.com 31 | * .doubleclick.net 32 | * .effectivemeasure.net 33 | * .googleadservices.com 34 | * .imrworldwide.com 35 | * .quantserve.com 36 | * .revsci.net 37 | * .scorecardresearch.com 38 | * .webtrendslive.com 39 | * .yieldmanager.com 40 | -------------------------------------------------------------------------------- /test/table-1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 |
Short, then some more text, 4 | which must not be broken. 5 | This is a rather long text to increase the maximal paragraph 6 | width. Sed ut perspiciatis, unde omnis iste natus error sit voluptatem 7 | accusantium doloremque laudantium, totam rem aperiam eaque ipsa, quae 8 | ab illo inventore veritatis et quasi architecto beatae vitae dicta 9 | sunt, explicabo. nemo enim ipsam voluptatem, quia voluptas sit, 10 | aspernatur aut odit aut fugit, sed quia consequuntur magni dolores 11 | eos, qui ratione voluptatem sequi nesciunt, neque porro quisquam est, 12 | qui dolorem ipsum, quia dolor sit, amet, consectetur, adipisci velit, 13 | sed quia non numquam eius modi tempora incidunt, ut labore et dolore 14 | magnam aliquam quaerat voluptatem. ut enim ad minima veniam, quis 15 | nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut 16 | aliquid ex ea commodi consequatur? quis autem vel eum iure 17 | reprehenderit, qui in ea voluptate velit esse, quam nihil molestiae 18 | consequatur, vel illum, qui dolorem eum fugiat, quo voluptas nulla 19 | pariatur? 20 |
22 | -------------------------------------------------------------------------------- /src/dialog.hh: -------------------------------------------------------------------------------- 1 | #ifndef __DIALOG_HH__ 2 | #define __DIALOG_HH__ 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif /* __cplusplus */ 7 | 8 | typedef void (*UserPasswordCB)(const char *user, const char *password, 9 | void *vp); 10 | 11 | void a_Dialog_msg(const char *title, const char *msg); 12 | int a_Dialog_choice(const char *title, const char *msg, ...); 13 | int a_Dialog_user_password(const char *title, const char *msg, 14 | UserPasswordCB cb, void *vp); 15 | const char *a_Dialog_input(const char *title, const char *msg); 16 | const char *a_Dialog_passwd(const char *title, const char *msg); 17 | const char *a_Dialog_save_file(const char *title, 18 | const char *pattern, const char *fname); 19 | const char *a_Dialog_select_file(const char *title, 20 | const char *pattern, const char *fname); 21 | char *a_Dialog_open_file(const char *title, 22 | const char *pattern, const char *fname); 23 | void a_Dialog_text_window(const char *title, const char *txt); 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif /* __cplusplus */ 28 | 29 | #endif // __DIALOG_HH__ 30 | -------------------------------------------------------------------------------- /src/timeout.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * File: timeout.cc 3 | * 4 | * Copyright (C) 2005-2007 Jorge Arellano Cid 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 | 12 | // Simple ADT for timeout functions 13 | 14 | #include 15 | #include "timeout.hh" 16 | 17 | // C++ functions with C linkage ---------------------------------------------- 18 | 19 | /* 20 | * Hook a one-time timeout function 'cb' after 't' seconds 21 | * with 'cbdata" as its data. 22 | */ 23 | void a_Timeout_add(float t, TimeoutCb_t cb, void *cbdata) 24 | { 25 | Fl::add_timeout(t, cb, cbdata); 26 | } 27 | 28 | /* 29 | * To be called from inside the 'cb' function when it wants to keep running 30 | */ 31 | void a_Timeout_repeat(float t, TimeoutCb_t cb, void *cbdata) 32 | { 33 | Fl::add_timeout(t, cb, cbdata); 34 | } 35 | 36 | /* 37 | * Stop running a timeout function 38 | */ 39 | void a_Timeout_remove() 40 | { 41 | /* in FLTK, timeouts run one time by default */ 42 | } 43 | 44 | -------------------------------------------------------------------------------- /dw/regardingborder.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Dillo Widget 3 | * 4 | * Copyright 2015 Sebastian Geerken 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 . 18 | */ 19 | 20 | #include "regardingborder.hh" 21 | 22 | #include 23 | 24 | namespace dw { 25 | 26 | int RegardingBorder::CLASS_ID = -1; 27 | 28 | RegardingBorder::RegardingBorder () 29 | { 30 | DBG_OBJ_CREATE ("dw::RegardingBorder"); 31 | registerName ("dw::RegardingBorder", &CLASS_ID); 32 | } 33 | 34 | RegardingBorder::~RegardingBorder () 35 | { 36 | DBG_OBJ_DELETE (); 37 | } 38 | 39 | } // namespace dw 40 | -------------------------------------------------------------------------------- /lout/msg.h: -------------------------------------------------------------------------------- 1 | #ifndef __MSG_H__ 2 | #define __MSG_H__ 3 | 4 | #include 5 | 6 | #define prefs_show_msg 1 7 | 8 | #define D_STMT_START do 9 | #define D_STMT_END while (0) 10 | 11 | /* 12 | * You can disable any MSG* macro by adding the '_' prefix. 13 | */ 14 | #define _MSG(...) 15 | #define _MSG_WARN(...) 16 | 17 | 18 | #define MSG(...) \ 19 | D_STMT_START { \ 20 | if (prefs_show_msg){ \ 21 | printf(__VA_ARGS__); \ 22 | fflush (stdout); \ 23 | } \ 24 | } D_STMT_END 25 | 26 | #define MSG_WARN(...) \ 27 | D_STMT_START { \ 28 | if (prefs_show_msg) \ 29 | printf("** WARNING **: " __VA_ARGS__); \ 30 | } D_STMT_END 31 | 32 | #define MSG_ERR(...) \ 33 | D_STMT_START { \ 34 | if (prefs_show_msg) \ 35 | printf("** ERROR **: " __VA_ARGS__); \ 36 | } D_STMT_END 37 | 38 | #endif /* __MSG_H__ */ 39 | -------------------------------------------------------------------------------- /src/auth.h: -------------------------------------------------------------------------------- 1 | #ifndef __AUTH_H__ 2 | #define __AUTH_H__ 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif /* __cplusplus */ 7 | 8 | #include "url.h" 9 | 10 | enum AuthParseHTTPAuthType_t { TYPENOTSET, BASIC, DIGEST }; 11 | enum AuthParseDigestAlgorithm_t { ALGORITHMNOTSET, MD5, MD5SESS }; 12 | enum AuthParseDigestQOP_t { QOPNOTSET, AUTH, AUTHINT }; 13 | 14 | typedef struct { 15 | enum AuthParseHTTPAuthType_t type; 16 | char *name; 17 | Dlist *paths; /* stripped of any trailing '/', so the root path is "" */ 18 | char *authorization; /* BASIC: the authorization request header */ 19 | /* DIGEST: the hexdigest of A1 */ 20 | /* digest state ahead */ 21 | char *username; 22 | char *cnonce; 23 | unsigned int nonce_count; 24 | char *nonce; 25 | char *opaque; 26 | enum AuthParseDigestAlgorithm_t algorithm; 27 | char *domain; /* NOT USED */ 28 | enum AuthParseDigestQOP_t qop; 29 | } AuthRealm_t; 30 | 31 | 32 | char *a_Auth_get_auth_str(const DilloUrl *url, const char *request_uri); 33 | int a_Auth_do_auth(Dlist *auth_string, const DilloUrl *url); 34 | void a_Auth_init(void); 35 | 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif /* __cplusplus */ 40 | #endif /* !__AUTH_H__ */ 41 | -------------------------------------------------------------------------------- /NEWS: -------------------------------------------------------------------------------- 1 | ---- 2 | NEWS 3 | ---- 4 | 5 | Nov 2000: 6 | 7 | Introduced a new design layer between the IO and the Dw. 8 | 9 | March 2001: 10 | 11 | Finally the new dillo widget is ready! (dillo >= 0.4.0). 12 | 0.4.0 is able to cope with low resolution depths. 13 | 14 | Apr 2002: 15 | 16 | We moved to: http://dillo.cipsga.org.br/ 17 | 18 | Dec 2002 19 | 20 | We moved to: http://dillo.auriga.wearlab.de/ 21 | 22 | Jun 2003 23 | 24 | http://www.dillo.org/ (hosted at the wearlab!) 25 | 26 | Sep 2007 27 | 28 | The new FLTK2-based dillo code is released! (under GPL3) 29 | 30 | Jul 2011 31 | 32 | Dillo switches to fltk-1.3.0. 33 | dillo-2.2.1, the last of the 2.x series is released. 34 | 35 | Sep 2011 36 | 37 | dillo-3.0, the first of the 3.x series is released. 38 | 39 | dillo-3.0.1, a bugfix release for the new 3.x series is out. 40 | 41 | Mar 2013 42 | 43 | dillo-3.0.3, a new release for the new 3.x series is out. 44 | 45 | Apr 2014 46 | 47 | dillo-3.0.4, a new release for the new 3.x series is out. 48 | 49 | Dec 2014 50 | 51 | dillo-3.0.4.1, a new release for the new 3.x series is out. 52 | 53 | 54 | Jorge.- 55 | jcid@dillo.org 56 | Project maintainer, core developer, patcher, you name it! :-) 57 | 58 | -------------------------------------------------------------------------------- /src/binaryconst.h: -------------------------------------------------------------------------------- 1 | #ifndef __BINARYCONST_H__ 2 | #define __BINARYCONST_H__ 3 | 4 | /* binaryconst.h was integrated into the Dillo project in April 2004, and 5 | * presumably comes from the ancestor of the code found at 6 | * http://cprog.tomsweb.net/binconst.txt 7 | */ 8 | 9 | /* Macros for allowing binary constants in C 10 | * By Tom Torfs - donated to the public domain */ 11 | 12 | #define HEX__(n) 0x##n##LU 13 | 14 | /* 8-bit conversion function */ 15 | #define B8__(x) ((x&0x0000000FLU)?1:0) \ 16 | +((x&0x000000F0LU)?2:0) \ 17 | +((x&0x00000F00LU)?4:0) \ 18 | +((x&0x0000F000LU)?8:0) \ 19 | +((x&0x000F0000LU)?16:0) \ 20 | +((x&0x00F00000LU)?32:0) \ 21 | +((x&0x0F000000LU)?64:0) \ 22 | +((x&0xF0000000LU)?128:0) 23 | 24 | 25 | /* 26 | * *** USER MACROS *** 27 | */ 28 | 29 | /* for upto 8-bit binary constants */ 30 | #define B8(d) ((unsigned char)B8__(HEX__(d))) 31 | 32 | /* for upto 16-bit binary constants, MSB first */ 33 | #define B16(dmsb,dlsb) (((unsigned short)B8(dmsb)<<8) + B8(dlsb)) 34 | 35 | /* 36 | * Sample usage: 37 | * B8(01010101) = 85 38 | * B16(10101010,01010101) = 43605 39 | */ 40 | 41 | 42 | #endif /* __BINARYCONST_H__ */ 43 | 44 | -------------------------------------------------------------------------------- /src/list.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Fast list methods 3 | * Feb 2000 --Jcid 4 | * 5 | */ 6 | 7 | #ifndef __LIST_H__ 8 | #define __LIST_H__ 9 | 10 | /* 11 | * a_List_resize() 12 | * 13 | * Make sure there's space for 'num_items' items within the list 14 | * (First, allocate an 'alloc_step' sized chunk, after that, double the 15 | * list size --to make it faster) 16 | */ 17 | #define a_List_resize(list,num_items,alloc_step) \ 18 | if (!list) { \ 19 | list = dMalloc(alloc_step * sizeof(*list)); \ 20 | } \ 21 | if (num_items >= alloc_step){ \ 22 | while ( num_items >= alloc_step ) \ 23 | alloc_step <<= 1; \ 24 | list = dRealloc(list, alloc_step * sizeof(*list)); \ 25 | } 26 | 27 | 28 | /* 29 | * a_List_add() 30 | * 31 | * Make sure there's space for one more item within the list. 32 | */ 33 | #define a_List_add(list,num_items,alloc_step) \ 34 | a_List_resize(list,num_items,alloc_step) 35 | 36 | 37 | /* 38 | * a_List_remove() 39 | * 40 | * Quickly remove an item from the list 41 | * ==> We preserve relative position, but not the element index <== 42 | */ 43 | #define a_List_remove(list, item, num_items) \ 44 | if (list && item < num_items) { \ 45 | list[item] = list[--num_items]; \ 46 | } 47 | 48 | 49 | #endif /* __LIST_H__ */ 50 | -------------------------------------------------------------------------------- /devdoc/dw-size-request-pos-01.html: -------------------------------------------------------------------------------- 1 |

This is the source of the image 2 | dw-size-request-pos-01.png.

3 | 4 | 5 | 16 | 24 | 35 |
6 |

7 |

8 | 9 |

A GNU

10 |
11 | Short. 12 |

13 |

A longer paragraph, into which a float extends, which has been 14 | defined in the previous paragraph.

15 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |             
25 |

26 |

27 | 28 |

A GNU

29 |
30 | Short. 31 |

32 |

A longer paragraph, into which a float extends, which has been 33 | defined in the previous paragraph.

34 |
36 | -------------------------------------------------------------------------------- /src/IO/tls.h: -------------------------------------------------------------------------------- 1 | #ifndef __TLS_H__ 2 | #define __TLS_H__ 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include "../url.h" 9 | 10 | #define TLS_CONNECT_NEVER -1 11 | #define TLS_CONNECT_NOT_YET 0 12 | #define TLS_CONNECT_READY 1 13 | 14 | void a_Tls_init(); 15 | 16 | 17 | #ifdef ENABLE_SSL 18 | int a_Tls_certificate_is_clean(const DilloUrl *url); 19 | int a_Tls_connect_ready(const DilloUrl *url); 20 | void a_Tls_reset_server_state(const DilloUrl *url); 21 | 22 | /* Use to initiate a TLS connection. */ 23 | void a_Tls_connect(int fd, const DilloUrl *url); 24 | 25 | void *a_Tls_connection(int fd); 26 | 27 | void a_Tls_freeall(); 28 | 29 | void a_Tls_close_by_fd(int fd); 30 | int a_Tls_read(void *conn, void *buf, size_t len); 31 | int a_Tls_write(void *conn, void *buf, size_t len); 32 | #else 33 | 34 | #define a_Tls_certificate_is_clean(host) 0 35 | #define a_Tls_connect_ready(url) TLS_CONNECT_NEVER 36 | #define a_Tls_reset_server_state(url) ; 37 | #define a_Tls_handshake(fd, url) ; 38 | #define a_Tls_connect(fd, url) ; 39 | #define a_Tls_connection(fd) NULL 40 | #define a_Tls_freeall() ; 41 | #define a_Tls_close_by_fd(fd) ; 42 | #define a_Tls_read(conn, buf, len) 0 43 | #define a_Tls_write(conn, buf, len) 0 44 | #endif 45 | #ifdef __cplusplus 46 | } 47 | #endif 48 | 49 | #endif /* __TLS_H__ */ 50 | 51 | -------------------------------------------------------------------------------- /test/shapes.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Dillo Widget 3 | * 4 | * Copyright 2005-2007 Sebastian Geerken 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 . 18 | */ 19 | 20 | 21 | 22 | #include "../dw/core.hh" 23 | 24 | using namespace dw::core; 25 | using namespace lout::misc; 26 | 27 | int main() 28 | { 29 | Polygon poly; 30 | poly.addPoint (50, 10); 31 | poly.addPoint (90, 90); 32 | poly.addPoint (10, 90); 33 | 34 | printf("first test\n"); 35 | assert (poly.isPointWithin (50, 50)); 36 | printf("second test\n"); 37 | assert (!poly.isPointWithin (10, 10)); 38 | printf("third test\n"); 39 | assert (!poly.isPointWithin (90, 50)); 40 | } 41 | -------------------------------------------------------------------------------- /src/decode.h: -------------------------------------------------------------------------------- 1 | #ifndef __DECODE_H__ 2 | #define __DECODE_H__ 3 | 4 | #include "../dlib/dlib.h" 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif /* __cplusplus */ 9 | 10 | typedef struct Decode { 11 | char *buffer; 12 | Dstr *leftover; 13 | void *state; 14 | Dstr *(*decode) (struct Decode *dc, const char *instr, int inlen); 15 | void (*free) (struct Decode *dc); 16 | } Decode; 17 | 18 | /* I'm not going to shoehorn the decoders into the same form anymore. They 19 | * can evolve independently. 20 | */ 21 | typedef struct DecodeTransfer { 22 | Dstr *leftover; 23 | void *state; 24 | bool_t finished; /* has the terminating chunk been seen? */ 25 | } DecodeTransfer; 26 | 27 | DecodeTransfer *a_Decode_transfer_init(const char *format); 28 | Dstr *a_Decode_transfer_process(DecodeTransfer *dc, const char *instr, 29 | int inlen); 30 | bool_t a_Decode_transfer_finished(DecodeTransfer *dc); 31 | void a_Decode_transfer_free(DecodeTransfer *dc); 32 | 33 | Decode *a_Decode_content_init(const char *format); 34 | Decode *a_Decode_charset_init(const char *format); 35 | Dstr *a_Decode_process(Decode *dc, const char *instr, int inlen); 36 | void a_Decode_free(Decode *dc); 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif /* __cplusplus */ 41 | 42 | #endif /* __DECODE_H__ */ 43 | -------------------------------------------------------------------------------- /dw/fltkmisc.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Dillo Widget 3 | * 4 | * Copyright 2005-2007 Sebastian Geerken 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 . 18 | */ 19 | 20 | 21 | #include "../lout/msg.h" 22 | #include "fltkmisc.hh" 23 | 24 | #include 25 | #include 26 | 27 | namespace dw { 28 | namespace fltk { 29 | namespace misc { 30 | 31 | int screenWidth () 32 | { 33 | return Fl::w (); 34 | } 35 | 36 | int screenHeight () 37 | { 38 | return Fl::h (); 39 | } 40 | 41 | void warpPointer (int x, int y) 42 | { 43 | MSG_ERR("no warpPointer mechanism available.\n"); 44 | } 45 | 46 | } // namespace misc 47 | } // namespace fltk 48 | } // namespace dw 49 | -------------------------------------------------------------------------------- /dpid/dpi.h: -------------------------------------------------------------------------------- 1 | /*! \file 2 | * Access functions for ~/.dillo/dpi_socket_dir. 3 | * The most useful function for dillo is a_Dpi_srs, it returns 4 | * the full path to the dpid service request socket. 5 | */ 6 | 7 | #ifndef DPI_H 8 | #define DPI_H 9 | 10 | #include /* for socklen_t */ 11 | #include /* for socklen_t and AF_LOCAL */ 12 | 13 | /* Some systems may not have this one... */ 14 | #ifndef AF_LOCAL 15 | #define AF_LOCAL AF_UNIX 16 | #endif 17 | 18 | /* This one is tricky, some sources state it should include the byte 19 | * for the terminating NULL, and others say it shouldn't. 20 | * The other way is to only use this one when a native SUN_LEN is not present, 21 | * but as dillo has used this for a long time successfully, here it goes. 22 | */ 23 | # define D_SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) \ 24 | + strlen ((ptr)->sun_path)) 25 | 26 | /*! 27 | * dpi commands 28 | */ 29 | enum { 30 | UNKNOWN_CMD, 31 | AUTH_CMD, /* authentication */ 32 | BYE_CMD, /* "DpiBye" */ 33 | CHECK_SERVER_CMD, /* "check_server" */ 34 | REGISTER_ALL_CMD, /* "register_all" */ 35 | REGISTER_SERVICE_CMD /* "register_service" */ 36 | }; 37 | 38 | 39 | char *a_Dpi_sockdir_file(void); 40 | 41 | char *a_Dpi_rd_dpi_socket_dir(char *dirname); 42 | 43 | char *a_Dpi_srs(void); 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /dw/simpletablecell.hh: -------------------------------------------------------------------------------- 1 | #ifndef __DW_SIMPLETABLECELL_HH__ 2 | #define __DW_SIMPLETABLECELL_HH__ 3 | 4 | #include "textblock.hh" 5 | 6 | namespace dw { 7 | 8 | class SimpleTableCell: public Textblock 9 | { 10 | protected: 11 | int getAvailWidthOfChild (Widget *child, bool forceValue); 12 | int getAvailHeightOfChild (Widget *child, bool forceValue); 13 | 14 | void correctRequisitionOfChild (Widget *child, 15 | core::Requisition *requisition, 16 | void (*splitHeightFun) (int, int*, int*), 17 | bool allowDecreaseWidth, 18 | bool allowDecreaseHeight); 19 | void correctExtremesOfChild (Widget *child, core::Extremes *extremes, 20 | bool useAdjustmentWidth); 21 | 22 | bool getAdjustMinWidth (); 23 | 24 | bool adjustExtraSpaceWhenCorrectingRequisitionByOOF (); 25 | 26 | public: 27 | static int CLASS_ID; 28 | 29 | SimpleTableCell (bool limitTextWidth); 30 | ~SimpleTableCell (); 31 | 32 | int applyPerWidth (int containerWidth, core::style::Length perWidth); 33 | int applyPerHeight (int containerHeight, core::style::Length perHeight); 34 | 35 | bool isBlockLevel (); 36 | 37 | bool usesMaxGeneratorWidth (); 38 | }; 39 | 40 | } // namespace dw 41 | 42 | #endif // __DW_SIMPLETABLECELL_HH__ 43 | -------------------------------------------------------------------------------- /test/floats-table.html: -------------------------------------------------------------------------------- 1 |

Demonstrating how to include floats into witdth extremes. 2 | 3 | 4 | 5 |
6 |
Somelongwordwhichmustnotbebrokensotakingmuchspaceinatablecolumn
7 | Some short text. 8 |
9 | Sed ut perspiciatis, unde omnis iste natus error sit voluptatem 10 | accusantium doloremque laudantium, totam rem aperiam eaque ipsa, 11 | quae ab illo inventore veritatis et quasi architecto beatae 12 | vitae dicta sunt, explicabo. nemo enim ipsam voluptatem, quia 13 | voluptas sit, aspernatur aut odit aut fugit, sed quia 14 | consequuntur magni dolores eos, qui ratione voluptatem sequi 15 | nesciunt, neque porro quisquam est, qui dolorem ipsum, quia 16 | dolor sit, amet, consectetur, adipisci velit, sed quia non 17 | numquam eius modi tempora incidunt, ut labore et dolore magnam 18 | aliquam quaerat voluptatem. ut enim ad minima veniam, quis 19 | nostrum exercitationem ullam corporis suscipit laboriosam, nisi 20 | ut aliquid ex ea commodi consequatur? quis autem vel eum iure 21 | reprehenderit, qui in ea voluptate velit esse, quam nihil 22 | molestiae consequatur, vel illum, qui dolorem eum fugiat, quo 23 | voluptas nulla pariatur? 24 |
25 | -------------------------------------------------------------------------------- /test/lang.html: -------------------------------------------------------------------------------- 1 |

Bla bla bla bla bla bla bla bla bla Bla bla bla bla bla 2 | bla bla bla bla bla: 3 | Grundstücksverkehrsgenehmigungszuständigkeitsübertragungsverordnung

4 |

Bla bla bla bla bla bla bla bla bla Bla bla bla bla bla 5 | bla bla bla bla bla: 6 | Grundstücksverkehrsgenehmigungszuständigkeitsübertragungsverordnung

7 |

Bla bla bla bla bla bla bla bla bla Bla bla bla bla bla 8 | bla bla bla bla bla: 9 | Grundstücksverkehrsgenehmigungszuständigkeitsübertragungsverordnung

10 |

Bla bla bla bla bla bla bla bla bla Bla bla bla bla bla 11 | bla bla bla bla bla: 12 | Grundstücksverkehrsgenehmigungszuständigkeitsübertragungsverordnung

13 | 14 |
15 | 16 |

Bla bla bla bla bla bla bla bla bla Bla bla bla bla bla 17 | bla bla bla bla bla: 18 | Grundstücksverkehrsgenehmigungszuständigkeitsübertragungsverordnung

19 |

Bla bla bla bla bla bla bla bla bla Bla bla bla bla bla 20 | bla bla bla bla bla: 21 | Grundstücksverkehrsgenehmigungszuständigkeitsübertragungsverordnung

22 |

Bla bla bla bla bla bla bla bla bla Bla bla bla bla bla 23 | bla bla bla bla bla: 24 | Grundstücksverkehrsgenehmigungszuständigkeitsübertragungsverordnung

25 |

Bla bla bla bla bla bla bla bla bla Bla bla bla bla bla 26 | bla bla bla bla bla: 27 | Grundstücksverkehrsgenehmigungszuständigkeitsübertragungsverordnung

28 | -------------------------------------------------------------------------------- /src/IO/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.options 2 | 3 | INCLUDES_EXTRA = -I../.. 4 | CXXFLAGS_EXTRA = -DDILLO_BINDIR='"$(DILLO_BINDIR)"' -DCA_CERTS_FILE='"$(CA_CERTS_FILE)"' -DCA_CERTS_DIR='"$(CA_CERTS_DIR)"' -DDOC_PATH='"$(DOC_PATH)"' -DBINNAME='"$(BINNAME)"' 5 | 6 | all: libDiof.a 7 | 8 | libDiof.a: mime.o about.o http.o dpi.o IO.o iowatch.o proto.o tls.o 9 | $(AR) $(ARFLAGS) libDiof.a mime.o about.o http.o dpi.o IO.o iowatch.o proto.o tls.o 10 | $(RANLIB) libDiof.a 11 | 12 | mime.o: mime.c mime.h 13 | $(COMPILE) $(INCLUDES_EXTRA) $(CXXFLAGS_EXTRA) $(LIBFLTK_CFLAGS) -c mime.c 14 | 15 | about.o: about.c ../../config.h 16 | $(COMPILE) $(INCLUDES_EXTRA) $(CXXFLAGS_EXTRA) $(LIBFLTK_CFLAGS) -c about.c 17 | 18 | http.o: http.c 19 | $(COMPILE) $(INCLUDES_EXTRA) $(CXXFLAGS_EXTRA) $(LIBFLTK_CFLAGS) -c http.c 20 | 21 | proto.o: proto.c 22 | $(COMPILE) $(INCLUDES_EXTRA) $(CXXFLAGS_EXTRA) $(LIBFLTK_CFLAGS) -c proto.c 23 | 24 | tls.o: tls.c 25 | $(COMPILE) $(INCLUDES_EXTRA) $(CXXFLAGS_EXTRA) $(LIBFLTK_CFLAGS) -c tls.c 26 | 27 | dpi.o: dpi.c 28 | $(COMPILE) $(INCLUDES_EXTRA) $(CXXFLAGS_EXTRA) $(LIBFLTK_CFLAGS) -c dpi.c 29 | 30 | IO.o: IO.c IO.h 31 | $(COMPILE) $(INCLUDES_EXTRA) $(CXXFLAGS_EXTRA) $(LIBFLTK_CFLAGS) -c IO.c 32 | 33 | iowatch.o: iowatch.cc iowatch.hh 34 | $(CXXCOMPILE) $(INCLUDES_EXTRA) $(CXXFLAGS_EXTRA) $(LIBFLTK_CXXFLAGS) -c iowatch.cc 35 | 36 | clean: 37 | rm -f *.o *.a 38 | 39 | install: 40 | -------------------------------------------------------------------------------- /test/unicode_test.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "../lout/unicode.hh" 5 | 6 | using namespace lout::unicode; 7 | 8 | int main (int argc, char *argv[]) 9 | { 10 | // 0-terminated string 11 | const char *t1 = "abcäöüабв−‐"; 12 | 13 | // not 0-terminated; copy from 0-terminated 14 | int t2len = strlen (t1); 15 | char t2[t2len]; 16 | for (int i = 0; i < t2len; i++) 17 | t2[i] = t1[i]; 18 | 19 | puts ("===== misc::unicode, 0-terminated ====="); 20 | for (const char *s = t1; s; s = nextUtf8Char (s)) 21 | printf ("%3d -> U+%04x ('%s')\n", (int)(s - t1), decodeUtf8(s), s); 22 | 23 | puts ("===== Fltk, 0-terminated ====="); 24 | for (const char *s = t1; *s; s = fl_utf8fwd (s + 1, t1, t1 + strlen (t1))) 25 | printf ("%3d -> U+%04x ('%s')\n", (int)(s - t1), decodeUtf8(s), s); 26 | 27 | puts ("===== misc::unicode, not 0-terminated ====="); 28 | for (const char *s = t2; s; s = nextUtf8Char (s, t2len - (s - t2))) 29 | printf ("%3d -> U+%04x\n", (int)(s - t2), 30 | decodeUtf8(s, t2len - (s - t2))); 31 | 32 | puts ("===== Fltk, not 0-terminated ====="); 33 | for (const char *s = t2; *s; 34 | s - t2 < t2len && (s = fl_utf8fwd (s + 1, t2, t2 + t2len))) 35 | printf ("%3d -> U+%04x\n", (int)(s - t2), 36 | decodeUtf8(s, t2len - (s - t2))); 37 | 38 | return 0; 39 | } 40 | -------------------------------------------------------------------------------- /dw/ruler.hh: -------------------------------------------------------------------------------- 1 | #ifndef __RULER_HH__ 2 | #define __RULER_HH__ 3 | 4 | #include "regardingborder.hh" 5 | 6 | namespace dw { 7 | 8 | /** 9 | * \brief Widget for drawing (horizontal) rules. 10 | * 11 | * This is really an empty widget, the HTML parser puts a border 12 | * around it, and drawing is done in dw::core::Widget::drawWidgetBox. 13 | * 14 | * Ruler implements RegardingBorder; this way, it is simpler to fit 15 | * the ruler exactly within the space between floats. Currently, the 16 | * drawn area of the ruler is too large (but most of the superfluous 17 | * part is hidden by the floats); this problem will soon solved here 18 | * in the "dillo_grows" repository. 19 | */ 20 | class Ruler: public RegardingBorder 21 | { 22 | protected: 23 | void sizeRequestSimpl (core::Requisition *requisition); 24 | void getExtremesSimpl (core::Extremes *extremes); 25 | void containerSizeChangedForChildren (); 26 | bool usesAvailWidth (); 27 | void draw (core::View *view, core::Rectangle *area, 28 | core::DrawingContext *context); 29 | core::Widget *getWidgetAtPoint (int x, int y, 30 | core::GettingWidgetAtPointContext *context); 31 | 32 | public: 33 | static int CLASS_ID; 34 | 35 | Ruler (); 36 | ~Ruler (); 37 | 38 | bool isBlockLevel (); 39 | 40 | core::Iterator *iterator (core::Content::Type mask, bool atEnd); 41 | }; 42 | 43 | } // namespace dw 44 | 45 | #endif // __RULER_HH__ 46 | -------------------------------------------------------------------------------- /test/notsosimplevector.cc: -------------------------------------------------------------------------------- 1 | #include "../lout/misc.hh" 2 | 3 | static void print (lout::misc::NotSoSimpleVector *v) 4 | { 5 | for (int i = 0; i < v->size(); i++) { 6 | // Uncomment for debugging, after making the respective members public. 7 | //if (v->startExtra != -1 && i == v->startExtra + v->numExtra) 8 | // printf (" ]"); 9 | if (i > 0) 10 | printf (", "); 11 | //if (i == v->startExtra) 12 | // printf ("[ "); 13 | 14 | printf ("%d", v->get(i)); 15 | } 16 | 17 | printf (" (%d elements)\n", v->size ()); 18 | } 19 | 20 | int main (int argc, char *argv[]) 21 | { 22 | lout::misc::NotSoSimpleVector v(1); 23 | 24 | for (int i = 1; i <= 10; i++) { 25 | v.increase (); 26 | v.set(v.size () - 1, i); 27 | } 28 | 29 | print (&v); 30 | 31 | v.insert (2, 4); 32 | for (int i = 0; i < 5; i++) 33 | v.set (2 + i, 31 + i); 34 | 35 | print (&v); 36 | 37 | v.insert (8, 4); 38 | for (int i = 0; i < 5; i++) 39 | v.set (8 + i, 51 + i); 40 | 41 | print (&v); 42 | 43 | v.insert (10, 4); 44 | for (int i = 0; i < 5; i++) 45 | v.set (10 + i, 531 + i); 46 | 47 | print (&v); 48 | 49 | v.insert (1, 4); 50 | for (int i = 0; i < 5; i++) 51 | v.set (1 + i, 21 + i); 52 | 53 | print (&v); 54 | 55 | int n = v.size (); 56 | v.insert (n, 5); 57 | for (int i = 0; i < 5; i++) 58 | v.set (n + i, 101 + i); 59 | 60 | print (&v); 61 | 62 | return 0; 63 | } 64 | -------------------------------------------------------------------------------- /dw/core.hh: -------------------------------------------------------------------------------- 1 | #ifndef __DW_CORE_HH__ 2 | #define __DW_CORE_HH__ 3 | 4 | #define __INCLUDED_FROM_DW_CORE_HH__ 5 | 6 | /** 7 | * \brief Dw is in this namespace, or sub namespaces of this one. 8 | * 9 | * The core can be found in dw::core, widgets are defined directly here. 10 | * 11 | * \sa \ref dw-overview 12 | */ 13 | namespace dw { 14 | 15 | /** Used (temporally) for code related to positioned elements. */ 16 | enum { IMPL_POS = false }; 17 | 18 | /** 19 | * \brief The core of Dw is defined in this namespace. 20 | * 21 | * \sa \ref dw-overview 22 | */ 23 | namespace core { 24 | 25 | typedef unsigned char byte; 26 | 27 | class Layout; 28 | class View; 29 | class Widget; 30 | class Iterator; 31 | class StackingContextMgr; 32 | 33 | // Nothing yet to free. 34 | inline void freeall () { } 35 | 36 | namespace ui { 37 | 38 | class ResourceFactory; 39 | 40 | } // namespace ui 41 | } // namespace core 42 | } // namespace dw 43 | 44 | #include "../lout/object.hh" 45 | #include "../lout/container.hh" 46 | #include "../lout/signal.hh" 47 | 48 | #include "tools.hh" 49 | #include "types.hh" 50 | #include "events.hh" 51 | #include "imgbuf.hh" 52 | #include "imgrenderer.hh" 53 | #include "style.hh" 54 | #include "view.hh" 55 | #include "platform.hh" 56 | #include "iterator.hh" 57 | #include "findtext.hh" 58 | #include "selection.hh" 59 | #include "layout.hh" 60 | #include "widget.hh" 61 | #include "stackingcontextmgr.hh" 62 | #include "ui.hh" 63 | 64 | #undef __INCLUDED_FROM_DW_CORE_HH__ 65 | 66 | #endif // __DW_CORE_HH__ 67 | -------------------------------------------------------------------------------- /dw/oofposfixedmgr.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Dillo Widget 3 | * 4 | * Copyright 2014 Sebastian Geerken 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 . 18 | */ 19 | 20 | #include "oofposfixedmgr.hh" 21 | 22 | namespace dw { 23 | 24 | namespace oof { 25 | 26 | OOFPosFixedMgr::OOFPosFixedMgr (OOFAwareWidget *container) : 27 | OOFPosAbsLikeMgr (container) 28 | { 29 | DBG_OBJ_CREATE ("dw::oof::OOFPosFixedMgr"); 30 | } 31 | 32 | OOFPosFixedMgr::~OOFPosFixedMgr () 33 | { 34 | DBG_OBJ_DELETE (); 35 | } 36 | 37 | int OOFPosFixedMgr::containerBoxOffsetX () 38 | { 39 | return 0; 40 | } 41 | 42 | int OOFPosFixedMgr::containerBoxOffsetY () 43 | { 44 | return 0; 45 | } 46 | 47 | int OOFPosFixedMgr::containerBoxRestWidth () 48 | { 49 | return 0; 50 | } 51 | 52 | int OOFPosFixedMgr::containerBoxRestHeight () 53 | { 54 | return 0; 55 | } 56 | 57 | } // namespace oof 58 | 59 | } // namespace dw 60 | -------------------------------------------------------------------------------- /src/bitvec.c: -------------------------------------------------------------------------------- 1 | /* 2 | * File: bitvec.c 3 | * 4 | * Copyright 2001 Jorge Arellano Cid 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 | 12 | /* 13 | * A simple ADT for bit arrays 14 | */ 15 | 16 | #include "../dlib/dlib.h" 17 | #include "bitvec.h" 18 | 19 | 20 | /* 21 | * Create a new bitvec with 'num_bits' size 22 | */ 23 | bitvec_t *a_Bitvec_new(int num_bits) 24 | { 25 | bitvec_t *bvec = dNew(bitvec_t, 1); 26 | 27 | bvec->vec = dNew0(uchar_t, num_bits/BVEC_SIZE + 1); 28 | bvec->len = num_bits; 29 | return bvec; 30 | } 31 | 32 | /* 33 | * Clear a bitvec 34 | */ 35 | void a_Bitvec_clear(bitvec_t *bvec) 36 | { 37 | memset(bvec->vec, 0, sizeof(uchar_t) * bvec->len/BVEC_SIZE + 1); 38 | } 39 | 40 | /* 41 | * Free a bitvec 42 | */ 43 | void a_Bitvec_free(bitvec_t *bvec) 44 | { 45 | if (bvec) { 46 | dFree(bvec->vec); 47 | dFree(bvec); 48 | } 49 | } 50 | 51 | /* 52 | * Get a bit 53 | */ 54 | int a_Bitvec_get_bit(bitvec_t *bvec, int pos) 55 | { 56 | dReturn_val_if_fail (pos < bvec->len, 0); 57 | return (bvec->vec[pos/BVEC_SIZE] & 1 << pos % BVEC_SIZE); 58 | } 59 | 60 | /* 61 | * Set a bit 62 | */ 63 | void a_Bitvec_set_bit(bitvec_t *bvec, int pos) 64 | { 65 | dReturn_if_fail (pos < bvec->len); 66 | bvec->vec[pos/BVEC_SIZE] |= 1 << (pos % BVEC_SIZE); 67 | } 68 | -------------------------------------------------------------------------------- /test_files/page.gmi: -------------------------------------------------------------------------------- 1 | # Title of the page 2 | A paragraph of text, with a normal length line... 3 | Some empty lines to preserve: 4 | 5 | 6 | Another paragraph with a very log line (should be wrapped): I originally designed this foundry with the intent of building a Gingery-style lathe. Over time, I became less interested in the idea, although it still occasionally crosses my mind. Regardless, the ability to melt and cast scrap aluminum has been an indispensible part of my workshop ever since. In essence, the foundry is just a hole in the ground filled with charcoal, with two accessories. First, bricks to line the walls of the hole. These stop the dirt, which dries when heated, from collapsing inward. Second, a steel tube through which air can be blown, to increase the temperature of the fire. 7 | > The same line as a quote string: I originally designed this foundry with the intent of building a Gingery-style lathe. Over time, I became less interested in the idea, although it still occasionally crosses my mind. Regardless, the ability to melt and cast scrap aluminum has been an indispensible part of my workshop ever since. In essence, the foundry is just a hole in the ground filled with charcoal, with two accessories. First, bricks to line the walls of the hole. These stop the dirt, which dries when heated, from collapsing inward. Second, a steel tube through which air can be blown, to increase the temperature of the fire. 8 | => /link.gmi Just a link 9 | * a list 10 | * with 11 | * multiple elems 12 | ```skipped... 13 | a preformatted 14 | test - text 15 | ``` 16 | -------------------------------------------------------------------------------- /src/IO/mime.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File: mime.h 3 | * 4 | * Copyright (C) 2005 Jorge Arellano Cid 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 | 12 | #ifndef __MIME_H__ 13 | #define __MIME_H__ 14 | 15 | #include 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif /* __cplusplus */ 20 | 21 | 22 | #include "../cache.h" 23 | 24 | typedef void* (*Viewer_t) (const char*, void*, CA_Callback_t*, void**); 25 | 26 | /* 27 | * Function prototypes defined elsewhere 28 | */ 29 | void *a_Html_text (const char *Type,void *web, CA_Callback_t *Call, 30 | void **Data); 31 | void *a_Plain_text(const char *Type,void *web, CA_Callback_t *Call, 32 | void **Data); 33 | void *a_Dicache_png_image (const char *Type,void *web, CA_Callback_t *Call, 34 | void **Data); 35 | void *a_Dicache_gif_image(const char *Type, void *Ptr, CA_Callback_t *Call, 36 | void **Data); 37 | void *a_Dicache_jpeg_image(const char *Type, void *Ptr, CA_Callback_t *Call, 38 | void **Data); 39 | 40 | /* 41 | * Functions defined inside Mime module 42 | */ 43 | void a_Mime_init(void); 44 | Viewer_t a_Mime_get_viewer(const char *content_type); 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif /* __cplusplus */ 49 | 50 | #endif /* __MIME_H__ */ 51 | -------------------------------------------------------------------------------- /src/capi.h: -------------------------------------------------------------------------------- 1 | #ifndef __CAPI_H__ 2 | #define __CAPI_H__ 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif /* __cplusplus */ 7 | 8 | 9 | #include "cache.h" 10 | #include "web.hh" 11 | 12 | /* 13 | * Flag defines 14 | */ 15 | #define CAPI_IsCached (0x1) 16 | #define CAPI_IsEmpty (0x2) 17 | #define CAPI_InProgress (0x4) 18 | #define CAPI_Aborted (0x8) 19 | #define CAPI_Completed (0x10) 20 | 21 | /* 22 | * Function prototypes 23 | */ 24 | void a_Capi_init(void); 25 | int a_Capi_open_url(DilloWeb *web, CA_Callback_t Call, void *CbData); 26 | int a_Capi_get_buf(const DilloUrl *Url, char **PBuf, int *BufSize); 27 | void a_Capi_unref_buf(const DilloUrl *Url); 28 | const char *a_Capi_get_content_type(const DilloUrl *url); 29 | const char *a_Capi_set_content_type(const DilloUrl *url, const char *ctype, 30 | const char *from); 31 | int a_Capi_get_flags(const DilloUrl *Url); 32 | int a_Capi_get_flags_with_redirection(const DilloUrl *Url); 33 | int a_Capi_dpi_verify_request(BrowserWindow *bw, DilloUrl *url); 34 | int a_Capi_dpi_send_data(const DilloUrl *url, void *bw, 35 | char *data, int data_sz, char *server, int flags); 36 | int a_Capi_dpi_send_cmd(DilloUrl *url, void *bw, char *cmd, char *server, 37 | int flags); 38 | void a_Capi_set_vsource_url(const DilloUrl *url); 39 | void a_Capi_stop_client(int Key, int force); 40 | void a_Capi_conn_abort_by_url(const DilloUrl *url); 41 | 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif /* __cplusplus */ 46 | 47 | #endif /* __CAPI_H__ */ 48 | 49 | -------------------------------------------------------------------------------- /src/web.hh: -------------------------------------------------------------------------------- 1 | #ifndef __WEB_H__ 2 | #define __WEB_H__ 3 | 4 | #include /* for FILE */ 5 | #include "bw.h" /* for BrowserWindow */ 6 | #include "cache.h" /* for CA_Callback_t */ 7 | #include "image.hh" /* for DilloImage */ 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif /* __cplusplus */ 12 | 13 | /* 14 | * Flag defines 15 | */ 16 | #define WEB_RootUrl 1 17 | #define WEB_Image 2 18 | #define WEB_Stylesheet 4 19 | #define WEB_Download 8 /* Half implemented... */ 20 | 21 | 22 | typedef struct _DilloWeb DilloWeb; 23 | 24 | struct _DilloWeb { 25 | DilloUrl *url; /* Requested URL */ 26 | DilloUrl *requester; /* URL that caused this request, or 27 | * NULL if user-initiated. */ 28 | BrowserWindow *bw; /* The requesting browser window [reference] */ 29 | int flags; /* Additional info */ 30 | 31 | DilloImage *Image; /* For image urls [reference] */ 32 | 33 | int32_t bgColor; /* for image backgrounds */ 34 | char *filename; /* Variables for Local saving */ 35 | FILE *stream; 36 | int SavedBytes; 37 | }; 38 | 39 | void a_Web_init(void); 40 | DilloWeb* a_Web_new (BrowserWindow *bw, const DilloUrl* url, 41 | const DilloUrl *requester); 42 | int a_Web_valid(DilloWeb *web); 43 | void a_Web_free (DilloWeb*); 44 | int a_Web_dispatch_by_type (const char *Type, DilloWeb *web, 45 | CA_Callback_t *Call, void **Data); 46 | 47 | #ifdef __cplusplus 48 | } 49 | #endif /* __cplusplus */ 50 | #endif /* __WEB_H__ */ 51 | -------------------------------------------------------------------------------- /devdoc/index.doc: -------------------------------------------------------------------------------- 1 | /** \mainpage 2 | 3 |

Overview

4 | 5 | This is a list of documents to start with: 6 | 7 |
    8 |
  • \ref lout 9 |
  • \ref dw-overview (map at \ref dw-map) 10 |
11 | 12 | Currently, a document \ref fltk-problems is maintained, ideally, it 13 | will be removed soon. 14 | 15 |

Historical

16 | 17 |

Replacements for GTK+ and GLib

18 | 19 | There are several classes etc., which are used for tasks formerly (in the GTK+ 20 | version of dillo) achieved by GtkObject (in 1.2.x, this is part of Gtk+) and 21 | GLib. For an overview on all this, take a look at \ref lout. 22 | 23 | GtkObject is replaced by the following: 24 | 25 |
    26 |
  • lout::object::Object is a common base class for many classes used 27 | dillo. In the namespace lout::object, there are also some more common 28 | classes and interfaces. 29 | 30 |
  • A sub class of lout::object::Object is 31 | lout::identity::IdentifiableObject, which allows to determine the 32 | class at run-time (equivalent to GTK_CHECK_CAST in GtkObject). 33 | 34 |
  • For signals, there is the namespace lout::signal. 35 |
36 | 37 | Hash tables, linked lists etc. can be found in the lout::container namespace, 38 | several useful macros from GLib have been implemented as inline functions 39 | in the lout::misc namespace. 40 | 41 | As an alternative to the macros defined in list.h, there is also a template 42 | class, lout::misc::SimpleVector, which does the same. 43 | 44 |

Changes in Dw

45 | 46 | If you have been familiar with Dw before, take a look at \ref dw-changes. 47 | 48 | */ 49 | -------------------------------------------------------------------------------- /src/nav.h: -------------------------------------------------------------------------------- 1 | #ifndef __NAV_H__ 2 | #define __NAV_H__ 3 | 4 | #include "bw.h" 5 | 6 | /* 7 | * useful macros for the navigation stack 8 | */ 9 | #define NAV_UIDX(bw, i) a_Nav_get_uidx(bw, i) 10 | #define NAV_TOP_UIDX(bw) a_Nav_get_top_uidx(bw) 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif /* __cplusplus */ 15 | 16 | void a_Nav_redirection0(BrowserWindow *bw, const DilloUrl *new_url); 17 | void a_Nav_push(BrowserWindow *bw, const DilloUrl *url, 18 | const DilloUrl *requester); 19 | void a_Nav_repush(BrowserWindow *bw); 20 | void a_Nav_back(BrowserWindow *bw); 21 | void a_Nav_forw(BrowserWindow *bw); 22 | void a_Nav_home(BrowserWindow *bw); 23 | void a_Nav_reload(BrowserWindow *bw); 24 | void a_Nav_jump(BrowserWindow *bw, int offset, int new_bw); 25 | void a_Nav_free(BrowserWindow *bw); 26 | void a_Nav_cancel_expect (BrowserWindow *bw); 27 | void a_Nav_cancel_expect_if_eq(BrowserWindow *bw, const DilloUrl *url); 28 | void a_Nav_expect_done(BrowserWindow *bw); 29 | int a_Nav_stack_ptr(BrowserWindow *bw); 30 | int a_Nav_stack_size(BrowserWindow *bw); 31 | int a_Nav_get_uidx(BrowserWindow *bw, int i); 32 | int a_Nav_get_top_uidx(BrowserWindow *bw); 33 | 34 | void a_Nav_save_url(BrowserWindow *bw, 35 | const DilloUrl *url, const char *filename); 36 | int a_Nav_get_buf(const DilloUrl *Url, char **PBuf, int *BufSize); 37 | void a_Nav_unref_buf(const DilloUrl *Url); 38 | const char *a_Nav_get_content_type(const DilloUrl *url); 39 | void a_Nav_set_vsource_url(const DilloUrl *Url); 40 | 41 | #ifdef __cplusplus 42 | } 43 | #endif /* __cplusplus */ 44 | 45 | #endif /* __NAV_H__ */ 46 | 47 | 48 | -------------------------------------------------------------------------------- /dpi/dpiutil.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File: dpiutil.h 3 | * 4 | * Copyright 2004-2005 Jorge Arellano Cid 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 | */ 12 | 13 | /* 14 | * This file contains common functions used by dpi programs. 15 | * (i.e. a convenience library). 16 | */ 17 | 18 | #ifndef __DPIUTIL_H__ 19 | #define __DPIUTIL_H__ 20 | 21 | #include 22 | #include "d_size.h" 23 | #include "../dlib/dlib.h" 24 | 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif /* __cplusplus */ 29 | 30 | 31 | /* 32 | * Escape URI characters in 'esc_set' as %XX sequences. 33 | * Return value: New escaped string. 34 | */ 35 | char *Escape_uri_str(const char *str, const char *p_esc_set); 36 | 37 | /* 38 | * Unescape %XX sequences in a string. 39 | * Return value: a new unescaped string 40 | */ 41 | char *Unescape_uri_str(const char *str); 42 | 43 | /* 44 | * Escape unsafe characters as html entities. 45 | * Return value: New escaped string. 46 | */ 47 | char *Escape_html_str(const char *str); 48 | 49 | /* 50 | * Unescape a few HTML entities (inverse of Escape_html_str) 51 | * Return value: New unescaped string. 52 | */ 53 | char *Unescape_html_str(const char *str); 54 | 55 | /* 56 | * Filter an SMTP hack with a FTP URI 57 | */ 58 | char *Filter_smtp_hack(char *url); 59 | 60 | 61 | #ifdef __cplusplus 62 | } 63 | #endif /* __cplusplus */ 64 | 65 | #endif /* __DPIUTIL_H__ */ 66 | 67 | -------------------------------------------------------------------------------- /dpid/dpid_common.c: -------------------------------------------------------------------------------- 1 | /* 2 | * File: dpid_common.c 3 | * 4 | * Copyright 2008 Jorge Arellano Cid 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 | 12 | #include 13 | #include 14 | #include 15 | #include "dpid_common.h" 16 | 17 | /* 18 | * Send a verbose error message. 19 | */ 20 | void errmsg(char *caller, char *called, int errornum, char *file, int line) 21 | { 22 | MSG_ERR("%s:%d: %s: %s\n", file, line, caller, called); 23 | if (errornum > 0) 24 | MSG_ERR("%s\n", dStrerror(errornum)); 25 | } 26 | 27 | /*! 28 | * Provides an error checked write command. 29 | * Call this via the CKD_WRITE macro 30 | * \return write return value 31 | */ 32 | ssize_t ckd_write(int fd, char *msg, char *file, int line) 33 | { 34 | ssize_t ret; 35 | 36 | do { 37 | ret = write(fd, msg, strlen(msg)); 38 | } while (ret == -1 && errno == EINTR); 39 | if (ret == -1) { 40 | MSG_ERR("%s:%d: write: %s\n", file, line, dStrerror(errno)); 41 | } 42 | return (ret); 43 | } 44 | 45 | /*! 46 | * Provides an error checked close() call. 47 | * Call this via the CKD_CLOSE macro 48 | * \return close return value 49 | */ 50 | ssize_t ckd_close(int fd, char *file, int line) 51 | { 52 | ssize_t ret; 53 | 54 | ret = dClose(fd); 55 | if (ret == -1) 56 | MSG_ERR("%s:%d: close: %s\n", file, line, dStrerror(errno)); 57 | return ret; 58 | } 59 | 60 | -------------------------------------------------------------------------------- /dw/alignedtablecell.hh: -------------------------------------------------------------------------------- 1 | #ifndef __DW_ALIGNEDTABLECELL_HH__ 2 | #define __DW_ALIGNEDTABLECELL_HH__ 3 | 4 | #include "core.hh" 5 | #include "alignedtextblock.hh" 6 | 7 | namespace dw { 8 | 9 | class AlignedTableCell: public AlignedTextblock 10 | { 11 | private: 12 | int charWordIndex, charWordPos; 13 | 14 | protected: 15 | int getAvailWidthOfChild (Widget *child, bool forceValue); 16 | int getAvailHeightOfChild (Widget *child, bool forceValue); 17 | 18 | void correctRequisitionOfChild (Widget *child, 19 | core::Requisition *requisition, 20 | void (*splitHeightFun) (int, int*, int*), 21 | bool allowDecreaseWidth, 22 | bool allowDecreaseHeight); 23 | void correctExtremesOfChild (Widget *child, core::Extremes *extremes, 24 | bool useAdjustmentWidth); 25 | 26 | bool getAdjustMinWidth (); 27 | 28 | bool adjustExtraSpaceWhenCorrectingRequisitionByOOF (); 29 | 30 | int wordWrap (int wordIndex, bool wrapAll); 31 | 32 | int getValue (); 33 | void setMaxValue (int maxValue, int value); 34 | 35 | public: 36 | static int CLASS_ID; 37 | 38 | AlignedTableCell(AlignedTableCell *ref, bool limitTextWidth); 39 | ~AlignedTableCell(); 40 | 41 | int applyPerWidth (int containerWidth, core::style::Length perWidth); 42 | int applyPerHeight (int containerHeight, core::style::Length perHeight); 43 | 44 | bool isBlockLevel (); 45 | 46 | bool usesMaxGeneratorWidth (); 47 | }; 48 | 49 | } // namespace dw 50 | 51 | #endif // __DW_ALIGNEDTABLECELL_HH__ 52 | -------------------------------------------------------------------------------- /test/floats-worm.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Floats and iterators: search for "worm" and pay attention 6 | to the order. 7 | 23 | 24 | 25 |
1: apple apple worm apple apple
26 |

2: apple apple apple apple apple apple apple apple apple apple 27 | apple apple apple apple apple apple apple apple apple apple 28 | apple apple apple apple worm apple apple apple apple apple apple 29 | apple apple apple apple apple apple apple apple apple apple 30 | apple apple apple apple apple apple apple apple

31 |
3: apple apple worm apple apple
32 |

4: apple apple apple apple apple apple apple apple apple apple 33 | apple apple apple apple apple apple apple apple apple apple 34 | apple apple apple apple worm apple apple apple apple apple apple 35 | apple apple apple apple apple apple apple apple apple apple 36 | apple apple apple apple apple apple apple apple

37 |
5: apple apple worm apple apple
38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /test/identity.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * This small program tests how IdentifiableObject works with multiple 3 | * inheritance ("diamond" inheritance, more precisely, since all 4 | * classes have there root in IdentifiableObject.) 5 | * 6 | * Current status: With virtual superclasses, you get a class 7 | * hierarchie "root -> A -> B -> C", so that the first part of this 8 | * example works actually (C is a subclass of A and of B), but the 9 | * second fails (it should print "false", but it is erroneously 10 | * assumed that B is a subclass of A.) 11 | */ 12 | 13 | #include "../lout/identity.hh" 14 | 15 | using namespace lout::identity; 16 | 17 | class A: virtual public IdentifiableObject 18 | { 19 | public: 20 | static int CLASS_ID; 21 | inline A () { registerName ("A", &CLASS_ID); } 22 | }; 23 | 24 | class B: virtual public IdentifiableObject 25 | { 26 | public: 27 | static int CLASS_ID; 28 | inline B () { registerName ("B", &CLASS_ID); } 29 | }; 30 | 31 | class C: public A, public B 32 | { 33 | public: 34 | static int CLASS_ID; 35 | inline C () { registerName ("C", &CLASS_ID); } 36 | }; 37 | 38 | int A::CLASS_ID = -1, B::CLASS_ID = -1, C::CLASS_ID = -1; 39 | 40 | int main (int argc, char *argv[]) 41 | { 42 | printf ("A: %d, B: %d, C: %d\n", A::CLASS_ID, B::CLASS_ID, C::CLASS_ID); 43 | 44 | C x; 45 | assert (x.instanceOf (A::CLASS_ID)); 46 | assert (x.instanceOf (B::CLASS_ID)); 47 | assert (x.instanceOf (C::CLASS_ID)); 48 | printf ("x: %d\n", x.getClassId ()); 49 | 50 | B y; 51 | printf ("y: %d; instance of A: %s\n", 52 | y.getClassId (), y.instanceOf (B::CLASS_ID) ? "true" : "false"); 53 | 54 | return 0; 55 | } 56 | -------------------------------------------------------------------------------- /test/dw_simple_container.hh: -------------------------------------------------------------------------------- 1 | #ifndef __DW_SIMPLE_CONTAINER_HH__ 2 | #define __DW_SIMPLE_CONTAINER_HH__ 3 | 4 | #include "dw/core.hh" 5 | 6 | namespace dw { 7 | 8 | /** 9 | * Simple widget used for testing concepts. 10 | */ 11 | class SimpleContainer: public core::Widget 12 | { 13 | private: 14 | class SimpleContainerIterator: public core::Iterator 15 | { 16 | private: 17 | int index (); 18 | 19 | public: 20 | SimpleContainerIterator (SimpleContainer *simpleContainer, 21 | core::Content::Type mask, 22 | bool atEnd); 23 | 24 | lout::object::Object *clone (); 25 | int compareTo (lout::object::Comparable *other); 26 | 27 | bool next (); 28 | bool prev (); 29 | void highlight (int start, int end, core::HighlightLayer layer); 30 | void unhighlight (int direction, core::HighlightLayer layer); 31 | void getAllocation (int start, int end, core::Allocation *allocation); 32 | }; 33 | 34 | Widget *child; 35 | 36 | protected: 37 | void sizeRequestSimpl (core::Requisition *requisition); 38 | void getExtremesSimpl (core::Extremes *extremes); 39 | void sizeAllocateImpl (core::Allocation *allocation); 40 | 41 | public: 42 | static int CLASS_ID; 43 | 44 | SimpleContainer (); 45 | ~SimpleContainer (); 46 | 47 | void draw (core::View *view, core::Rectangle *area, 48 | core::DrawingContext *context); 49 | core::Iterator *iterator (core::Content::Type mask, bool atEnd); 50 | void removeChild (Widget *child); 51 | 52 | void setChild (core::Widget *child); 53 | }; 54 | 55 | } // namespace dw 56 | 57 | #endif // __DW_SIMPLE_CONTAINER_HH__ 58 | -------------------------------------------------------------------------------- /dpid/dpid_common.h: -------------------------------------------------------------------------------- 1 | #ifndef DPID_COMMON_H 2 | #define DPID_COMMON_H 3 | 4 | /*! \file 5 | * Declares common functions, global variables, and types. 6 | * 7 | * \todo 8 | * The dpid error codes will be used in 9 | * the next patch 10 | */ 11 | 12 | #include 13 | 14 | #include "../dlib/dlib.h" 15 | 16 | /* 17 | * Debugging macros 18 | */ 19 | #define _MSG(...) 20 | #define MSG(...) printf("[dpid-plus]: " __VA_ARGS__) 21 | #define MSG_ERR(...) fprintf(stderr, "[dpid]: " __VA_ARGS__) 22 | 23 | #define dotDILLO_DPI "." BINNAME "/dpi" 24 | #define dotDILLO_DPIDRC "." BINNAME "/dpidrc" 25 | #define dotDILLO_DPID_COMM_KEYS "." BINNAME "/dpid_comm_keys" 26 | 27 | #define ERRMSG(CALLER, CALLED, ERR)\ 28 | errmsg(CALLER, CALLED, ERR, __FILE__, __LINE__) 29 | #define _ERRMSG(CALLER, CALLED, ERR) 30 | 31 | 32 | /*! 33 | * Macros for calling ckd_write and ckd_close functions 34 | */ 35 | #define CKD_WRITE(fd, msg) ckd_write(fd, msg, __FILE__, __LINE__) 36 | #define CKD_CLOSE(fd) ckd_close(fd, __FILE__, __LINE__) 37 | 38 | 39 | /*! Error codes for dpid */ 40 | enum dpi_errno_t { 41 | no_errors, 42 | dpid_srs_addrinuse /* dpid service request socket address already in use */ 43 | }; 44 | 45 | extern enum dpi_errno_t dpi_errno; 46 | 47 | /*! Intended for identifying dillo plugins 48 | * and related files 49 | */ 50 | enum file_type { 51 | DPI_FILE, /*! Any file name containing .dpi */ 52 | UNKNOWN_FILE 53 | }; 54 | 55 | 56 | void errmsg(char *caller, char *called, int errornum, char *file, int line); 57 | 58 | ssize_t ckd_write(int fd, char *msg, char *file, int line); 59 | ssize_t ckd_close(int fd, char *file, int line); 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /dw/oofposrelmgr.hh: -------------------------------------------------------------------------------- 1 | #ifndef __DW_OOFPOSRELMGR_HH__ 2 | #define __DW_OOFPOSRELMGR_HH__ 3 | 4 | #include "oofpositionedmgr.hh" 5 | 6 | namespace dw { 7 | 8 | namespace oof { 9 | 10 | class OOFPosRelMgr: public OOFPositionedMgr 11 | { 12 | protected: 13 | void sizeAllocateChildren (); 14 | bool posXAbsolute (Child *child); 15 | bool posYAbsolute (Child *child); 16 | 17 | int getChildPosX (Child *child, int refWidth); 18 | int getChildPosY (Child *child, int refHeight); 19 | int getChildPosDim (core::style::Length posCssValue, 20 | core::style::Length negCssValue, int refPos, 21 | int refLength); 22 | 23 | inline int getChildPosX (Child *child) 24 | { return getChildPosX (child, container->getAvailWidth (true)); } 25 | inline int getChildPosY (Child *child) 26 | { return getChildPosY (child, container->getAvailHeight (true)); } 27 | 28 | public: 29 | OOFPosRelMgr (OOFAwareWidget *container); 30 | ~OOFPosRelMgr (); 31 | 32 | void markSizeChange (int ref); 33 | void markExtremesChange (int ref); 34 | void calcWidgetRefSize (core::Widget *widget, core::Requisition *size); 35 | 36 | void getSize (core::Requisition *containerReq, int *oofWidth, 37 | int *oofHeight); 38 | void getExtremes (core::Extremes *containerExtr, int *oofMinWidth, 39 | int *oofMaxWidth); 40 | 41 | bool dealingWithSizeOfChild (core::Widget *child); 42 | int getAvailWidthOfChild (core::Widget *child, bool forceValue); 43 | int getAvailHeightOfChild (core::Widget *child, bool forceValue); 44 | }; 45 | 46 | } // namespace oof 47 | 48 | } // namespace dw 49 | 50 | #endif // __DW_OOFPOSRELMGR_HH__ 51 | -------------------------------------------------------------------------------- /dpid/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.options 2 | 3 | CFLAGS_EXTRA = -DDPIDRC_SYS='"$(DPIDRC_SYS)"' -DBINNAME='"$(BINNAME)"' 4 | 5 | all: dpid-plus dpidc-plus dpidrc 6 | 7 | dpid-plus: dpi.o dpi_socket_dir.o dpid-plus.o dpid_common.o main.o misc_new.o ../dpip/libDpip.a ../dlib/libDlib.a 8 | $(LINK) dpi.o dpi_socket_dir.o dpid-plus.o dpid_common.o main.o misc_new.o ../dpip/libDpip.a ../dlib/libDlib.a 9 | 10 | dpidc-plus: dpidc-plus.o ../dpip/libDpip.a ../dlib/libDlib.a 11 | $(LINK) dpidc-plus.o ../dpip/libDpip.a ../dlib/libDlib.a 12 | 13 | dpidrc: dpidrc.in 14 | sed -e "s|[@]libdir[@]|$(LIBDIR)|" -e "s|[@]binname[@]|$(BINNAME)|" ./dpidrc.in > dpidrc 15 | 16 | dpi.o: dpi.h dpi.c 17 | $(COMPILE) $(CFLAGS_EXTRA) -c dpi.c 18 | 19 | dpi_socket_dir.o: dpi_socket_dir.h dpi_socket_dir.c 20 | $(COMPILE) $(CFLAGS_EXTRA) -c dpi_socket_dir.c 21 | 22 | dpid-plus.o: dpid-plus.h dpid-plus.c 23 | $(COMPILE) $(CFLAGS_EXTRA) -c dpid-plus.c 24 | 25 | dpid_common.o: dpid_common.h dpid_common.c 26 | $(COMPILE) $(CFLAGS_EXTRA) -c dpid_common.c 27 | 28 | main.o: main.c 29 | $(COMPILE) $(CFLAGS_EXTRA) -c main.c 30 | 31 | misc_new.o: misc_new.h misc_new.c 32 | $(COMPILE) $(CFLAGS_EXTRA) -c misc_new.c 33 | 34 | dpidc-plus.o: dpidc-plus.c 35 | $(COMPILE) $(CFLAGS_EXTRA) -c dpidc-plus.c 36 | 37 | clean: 38 | rm -f *.o dpid-plus dpidc-plus dpidrc 39 | 40 | install: all 41 | $(INSTALL_SH) -c -d "$(DILLO_ETCDIR)" 42 | $(INSTALL) -c -m 644 dpidrc "$(DPIDRC_SYS)" 43 | $(INSTALL_SH) -c -d "$(DILLO_BINDIR)" 44 | $(INSTALL) -c dpid-plus "$(DILLO_BINDIR)" 45 | $(INSTALL) -c dpidc-plus "$(DILLO_BINDIR)" 46 | 47 | uninstall: 48 | rm -f "$(DPIDRC_SYS)" 49 | rm -f "$(DILLO_BINDIR)/dpid-plus" 50 | rm -f "$(DILLO_BINDIR)/dpidc-plus" 51 | -------------------------------------------------------------------------------- /dw/alignedtextblock.hh: -------------------------------------------------------------------------------- 1 | #ifndef __DW_ALIGNEDTEXTBLOCK_HH__ 2 | #define __DW_ALIGNEDTEXTBLOCK_HH__ 3 | 4 | #include "core.hh" 5 | #include "textblock.hh" 6 | 7 | namespace dw { 8 | 9 | /** 10 | * \brief Base widget for all textblocks (sub classes of dw::Textblock), which 11 | * are positioned vertically and aligned horizontally. 12 | */ 13 | class AlignedTextblock: public Textblock 14 | { 15 | private: 16 | class List 17 | { 18 | private: 19 | lout::misc::SimpleVector *textblocks; 20 | lout::misc::SimpleVector *values; 21 | int maxValue, refCount; 22 | 23 | ~List (); 24 | 25 | public: 26 | List (); 27 | inline int add (AlignedTextblock *textblock); 28 | void unref (int pos); 29 | 30 | inline int getMaxValue () { return maxValue; } 31 | inline void setMaxValue (int maxValue) { this->maxValue = maxValue; } 32 | 33 | inline int size () { return textblocks->size (); } 34 | inline AlignedTextblock *getTextblock (int pos) { 35 | return textblocks->get (pos); } 36 | inline int getValue (int pos) {return values->get (pos); } 37 | inline void setValue (int pos, int value) { 38 | return values->set (pos, value); } 39 | }; 40 | 41 | List *list; 42 | int listPos; 43 | 44 | protected: 45 | AlignedTextblock(bool limitTextWidth); 46 | 47 | virtual int getValue () = 0; 48 | virtual void setMaxValue (int maxValue, int value) = 0; 49 | 50 | void setRefTextblock (AlignedTextblock *ref); 51 | void updateValue (); 52 | 53 | public: 54 | static int CLASS_ID; 55 | 56 | ~AlignedTextblock(); 57 | }; 58 | 59 | } // namespace dw 60 | 61 | #endif // __DW_ALIGNEDTEXTBLOCK_HH__ 62 | -------------------------------------------------------------------------------- /dw/tablecell.hh: -------------------------------------------------------------------------------- 1 | #ifndef __DW_TABLECELL_HH__ 2 | #define __DW_TABLECELL_HH__ 3 | 4 | #include "core.hh" 5 | 6 | namespace dw { 7 | 8 | namespace tablecell { 9 | 10 | inline bool usesMaxGeneratorWidth () { return true; } 11 | 12 | bool getAdjustMinWidth (); 13 | bool isBlockLevel (); 14 | 15 | int correctAvailWidthOfChild (core::Widget *widget, core::Widget *child, 16 | int width, bool forceValue); 17 | int correctAvailHeightOfChild (core::Widget *widget, core::Widget *child, 18 | int height, bool forceValue); 19 | 20 | void correctCorrectedRequisitionOfChild (core::Widget *widget, 21 | core::Widget *child, 22 | core::Requisition *requisition, 23 | void (*splitHeightFun) (int, int*, 24 | int*), 25 | bool allowDecreaseWidth, 26 | bool allowDecreaseHeight); 27 | void correctCorrectedExtremesOfChild (core::Widget *widget, core::Widget *child, 28 | core::Extremes *extremes, 29 | bool useAdjustmentWidth); 30 | 31 | int applyPerWidth (core::Widget *widget, int containerWidth, 32 | core::style::Length perWidth); 33 | int applyPerHeight (core::Widget *widget, int containerHeight, 34 | core::style::Length perHeight); 35 | 36 | inline bool adjustExtraSpaceWhenCorrectingRequisitionByOOF () { return false; } 37 | 38 | } // namespace dw 39 | 40 | } // namespace dw 41 | 42 | #endif // __DW_TABLECELL_HH__ 43 | -------------------------------------------------------------------------------- /src/tipwin.hh: -------------------------------------------------------------------------------- 1 | #ifndef __TIPWIN_HH__ 2 | #define __TIPWIN_HH__ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | 9 | /* 10 | * Custom tooltip window 11 | */ 12 | class TipWin : public Fl_Menu_Window { 13 | char tip[256]; 14 | int bgcolor, recent; 15 | void *cur_widget; 16 | public: 17 | TipWin(); 18 | void draw(); 19 | void value(const char *s); 20 | void do_show(void *wid); 21 | void do_hide(); 22 | void recent_tooltip(int val); 23 | 24 | void cancel(void *wid) { 25 | if (wid == cur_widget) { cur_widget = NULL; do_hide(); } 26 | } 27 | }; 28 | 29 | extern TipWin *my_tipwin(void); 30 | 31 | 32 | /* 33 | * A Button sharing a custom tooltip window 34 | */ 35 | class TipWinButton : public Fl_Button { 36 | char *mytooltip; 37 | TipWin *tipwin; 38 | public: 39 | TipWinButton(int x, int y, int w, int h, const char *l = 0); 40 | ~TipWinButton(); 41 | virtual int handle(int e); 42 | 43 | void set_tooltip(const char *s); 44 | }; 45 | 46 | /* 47 | * A button that highlights on mouse over 48 | */ 49 | class CustButton : public TipWinButton { 50 | Fl_Color norm_color, light_color; 51 | public: 52 | CustButton(int x, int y, int w, int h, const char *l=0); 53 | virtual int handle(int e); 54 | void hl_color(Fl_Color col); 55 | }; 56 | 57 | 58 | /* 59 | * An Input with custom tooltip window 60 | */ 61 | class TipWinInput : public Fl_Input { 62 | char *mytooltip; 63 | TipWin *tipwin; 64 | public: 65 | TipWinInput (int x, int y, int w, int h, const char* l=0); 66 | ~TipWinInput(void); 67 | virtual int handle(int e); 68 | 69 | void set_tooltip(const char *s); 70 | }; 71 | 72 | 73 | #endif // __TIPWIN_HH__ 74 | 75 | -------------------------------------------------------------------------------- /dw/events.hh: -------------------------------------------------------------------------------- 1 | #ifndef __DW_EVENTS_HH__ 2 | #define __DW_EVENTS_HH__ 3 | 4 | #ifndef __INCLUDED_FROM_DW_CORE_HH__ 5 | # error Do not include this file directly, use "core.hh" instead. 6 | #endif 7 | 8 | namespace dw { 9 | namespace core { 10 | 11 | /** 12 | * \brief Platform independent representation. 13 | */ 14 | enum ButtonState 15 | { 16 | /* We won't use more than these ones. */ 17 | SHIFT_MASK = 1 << 0, 18 | CONTROL_MASK = 1 << 1, 19 | META_MASK = 1 << 2, 20 | BUTTON1_MASK = 1 << 3, 21 | BUTTON2_MASK = 1 << 4, 22 | BUTTON3_MASK = 1 << 5 23 | }; 24 | 25 | /** 26 | * \brief Base class for all events. 27 | * 28 | * The dw::core::Event hierarchy describes events in a platform independent 29 | * way. 30 | */ 31 | class Event: public lout::object::Object 32 | { 33 | public: 34 | }; 35 | 36 | /** 37 | * \brief Base class for all mouse events. 38 | */ 39 | class MouseEvent: public Event 40 | { 41 | public: 42 | ButtonState state; 43 | }; 44 | 45 | /** 46 | * \brief Base class for all mouse events related to a specific position. 47 | */ 48 | class MousePositionEvent: public MouseEvent 49 | { 50 | public: 51 | int xCanvas, yCanvas, xWidget, yWidget; 52 | }; 53 | 54 | /** 55 | * \brief Represents a button press or release event. 56 | */ 57 | class EventButton: public MousePositionEvent 58 | { 59 | public: 60 | int numPressed; /* 1 for simple click, 2 for double click, etc. */ 61 | int button; 62 | }; 63 | 64 | /** 65 | * \brief Represents a mouse motion event. 66 | */ 67 | class EventMotion: public MousePositionEvent 68 | { 69 | }; 70 | 71 | /** 72 | * \brief Represents a enter or leave notify event. 73 | */ 74 | class EventCrossing: public MouseEvent 75 | { 76 | public: 77 | Widget *lastWidget, *currentWidget; 78 | }; 79 | 80 | } // namespace core 81 | } // namespace dw 82 | 83 | #endif // __DW_EVENTS_HH__ 84 | -------------------------------------------------------------------------------- /src/keys.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Key parser 3 | * 4 | * Copyright (C) 2009 Jorge Arellano Cid 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 | 12 | #ifndef __KEYS_HH__ 13 | #define __KEYS_HH__ 14 | 15 | 16 | typedef enum { 17 | KEYS_INVALID = -1, 18 | KEYS_NOP, /* No operation bound */ 19 | KEYS_OPEN, 20 | KEYS_NEW_WINDOW, 21 | KEYS_NEW_TAB, 22 | KEYS_LEFT_TAB, 23 | KEYS_RIGHT_TAB, 24 | KEYS_CLOSE_TAB, 25 | KEYS_FIRST_TAB, 26 | KEYS_LAST_TAB, 27 | KEYS_FIND, 28 | KEYS_WEBSEARCH, 29 | KEYS_BOOKMARKS, 30 | KEYS_RELOAD, 31 | KEYS_STOP, 32 | KEYS_SAVE, 33 | KEYS_HIDE_PANELS, 34 | KEYS_FILE_MENU, 35 | KEYS_CLOSE_ALL, 36 | KEYS_BACK, 37 | KEYS_FORWARD, 38 | KEYS_GOTO, 39 | KEYS_HOME, 40 | KEYS_VIEW_SOURCE, 41 | KEYS_SCREEN_UP, 42 | KEYS_SCREEN_DOWN, 43 | KEYS_SCREEN_LEFT, 44 | KEYS_SCREEN_RIGHT, 45 | KEYS_LINE_UP, 46 | KEYS_LINE_DOWN, 47 | KEYS_LEFT, 48 | KEYS_RIGHT, 49 | KEYS_TOP, 50 | KEYS_BOTTOM 51 | } KeysCommand_t; 52 | 53 | class Keys { 54 | private: 55 | static int nodeByKeyCmp(const void *node, const void *key); 56 | static void delKeyCmd(int key, int mod); 57 | static KeysCommand_t getCmdCode(const char *symbolName); 58 | static int getKeyCode(char *keyName); 59 | static int getModifier(char *modifierName); 60 | static void parseKey(char *key, char *symbol); 61 | public: 62 | static void init(); 63 | static void free(); 64 | static void parse(FILE *fp); 65 | static KeysCommand_t getKeyCmd(void); 66 | static int getShortcut(KeysCommand_t cmd); 67 | }; 68 | 69 | 70 | #endif /* __KEYS_HH__ */ 71 | -------------------------------------------------------------------------------- /dw/tools.hh: -------------------------------------------------------------------------------- 1 | #ifndef __DW_TOOLS_HH__ 2 | #define __DW_TOOLS_HH__ 3 | 4 | #ifndef __INCLUDED_FROM_DW_CORE_HH__ 5 | # error Do not include this file directly, use "core.hh" instead. 6 | #endif 7 | 8 | #include "core.hh" 9 | #include "../lout/debug.hh" 10 | 11 | namespace dw { 12 | namespace core { 13 | 14 | /** 15 | * \brief Hold arguments passed to dw::core::Widget::sizeRequest and 16 | * dw::core::Widget::getExtremes, as described in \ref dw-size-request-pos. 17 | */ 18 | class SizeParams 19 | { 20 | private: 21 | int numPos; 22 | Widget **references; 23 | int *x, *y; 24 | 25 | void init (); 26 | void cleanup (); 27 | 28 | inline void debugPrint () { 29 | DBG_IF_RTFL { 30 | DBG_OBJ_SET_NUM ("numPos", numPos); 31 | for (int i = 0; i < numPos; i++) { 32 | DBG_OBJ_ARRSET_PTR ("references", i, references[i]); 33 | DBG_OBJ_ARRSET_NUM ("x", i, x[i]); 34 | DBG_OBJ_ARRSET_NUM ("y", i, y[i]); 35 | } 36 | } 37 | } 38 | 39 | public: 40 | SizeParams (); 41 | SizeParams (int numPos, Widget **references, int *x, int *y); 42 | SizeParams (const SizeParams &other); 43 | ~SizeParams (); 44 | 45 | SizeParams &operator=(const SizeParams &other); 46 | 47 | void fill (int numPos, Widget **references, int *x, int *y); 48 | void forChild (Widget *parent, Widget *child, int xRel, int yRel, 49 | SizeParams *childParams); 50 | bool findReference (Widget *reference, int *x, int *y); 51 | 52 | bool isEquivalent (SizeParams *other); 53 | 54 | inline int getNumPos () { return numPos; } 55 | inline Widget **getReferences () { return references; } 56 | inline int *getX () { return x; } 57 | inline int *getY () { return y; } 58 | inline Widget *getReference (int i) { return references[i]; } 59 | inline int getX (int i) { return x[i]; } 60 | inline int getY (int i) { return y[i]; } 61 | }; 62 | 63 | } // namespace core 64 | } // namespace dw 65 | 66 | #endif // __DW_TOOLS_HH__ 67 | -------------------------------------------------------------------------------- /src/chain.h: -------------------------------------------------------------------------------- 1 | #ifndef __CHAIN_H__ 2 | #define __CHAIN_H__ 3 | 4 | /* 5 | * Concomitant control chain (CCC) 6 | * Theory and code by Jorge Arellano Cid 7 | */ 8 | 9 | 10 | /* 11 | * Supported CCC operations 12 | */ 13 | #define OpStart 1 14 | #define OpSend 2 15 | #define OpStop 3 16 | #define OpEnd 4 17 | #define OpAbort 5 18 | 19 | /* 20 | * CCC flags 21 | */ 22 | #define CCC_Stopped (1 << 0) 23 | #define CCC_Ended (1 << 1) 24 | #define CCC_Aborted (1 << 2) 25 | 26 | /* 27 | * Linking direction 28 | */ 29 | #define FWD 1 30 | #define BCK 2 31 | 32 | typedef struct ChainLink ChainLink; 33 | typedef void (*ChainFunction_t)(int Op, int Branch, int Dir, ChainLink *Info, 34 | void *Data1, void *Data2); 35 | 36 | /* This is the main data structure for CCC nodes */ 37 | struct ChainLink { 38 | void *LocalKey; 39 | 40 | int Flags; 41 | 42 | ChainLink *FcbInfo; 43 | ChainFunction_t Fcb; 44 | int FcbBranch; 45 | 46 | ChainLink *BcbInfo; 47 | ChainFunction_t Bcb; 48 | int BcbBranch; 49 | }; 50 | 51 | /* A convenience data structure for passing data chunks between nodes */ 52 | typedef struct { 53 | char *Buf; 54 | int Size; 55 | int Code; 56 | } DataBuf; 57 | 58 | 59 | 60 | /* 61 | * Function prototypes 62 | */ 63 | ChainLink *a_Chain_new(void); 64 | ChainLink *a_Chain_link_new(ChainLink *AInfo, ChainFunction_t AFunc, 65 | int Direction, ChainFunction_t BFunc, 66 | int AtoB_branch, int BtoA_branch); 67 | void a_Chain_unlink(ChainLink *Info, int Direction); 68 | int a_Chain_fcb(int Op, ChainLink *Info, void *Data1, void *Data2); 69 | int a_Chain_bcb(int Op, ChainLink *Info, void *Data1, void *Data2); 70 | int a_Chain_bfcb(int Op, ChainLink *Info, void *Data1, void *Data2); 71 | int a_Chain_check(char *FuncStr, int Op, int Branch, int Dir, 72 | ChainLink *Info); 73 | 74 | DataBuf *a_Chain_dbuf_new(void *buf, int size, int code); 75 | 76 | #endif /* __CHAIN_H__ */ 77 | -------------------------------------------------------------------------------- /style.css.orig.full: -------------------------------------------------------------------------------- 1 | /* source: https://oldforum.puppylinux.com/viewtopic.php?t=70227&sid=1d459a178edf1c0d4f05e04b0d4ec165 */ 2 | 3 | body {background-color: #e0e0a3; font-family: sans-serif; color: black; margin: 5px} 4 | 5 | big {font-size: 1.17em} 6 | 7 | blockquote, dd {margin-left: 40px; margin-right: 40px} 8 | 9 | center {text-align: center} 10 | 11 | dt {font-weight: bolder} 12 | 13 | :link {color: blue; text-decoration: underline; cursor: pointer} 14 | 15 | :visited {color: #800080; text-decoration: underline; cursor: pointer} 16 | 17 | h1, h2, h3, h4, h5, h6, b, strong {font-weight: bolder} 18 | 19 | i, em, cite, address, var {font-style: italic} 20 | 21 | :link img, :visited img {border: 1px solid} 22 | 23 | frameset, ul, ol, dir {margin-left: 40px} 24 | 25 | h1 {font-size: 2em; margin-top: .67em; margin-bottom: 0} 26 | 27 | h2 {font-size: 1.5em; margin-top: .75em; margin-bottom: 0} 28 | 29 | h3 {font-size: 1.17em; margin-top: .83em; margin-bottom: 0} 30 | 31 | h4 {margin-top: 1.12em; margin-bottom: 0} 32 | 33 | h5 {font-size: 0.83em; margin-top: 1.5em; margin-bottom: 0} 34 | 35 | h6 {font-size: 0.75em; margin-top: 1.67em; margin-bottom: 0} 36 | 37 | hr {width: 100%; border: 1px inset} 38 | 39 | li {margin-top: 0.1em} 40 | 41 | pre {white-space: pre} 42 | 43 | ol {list-style-type: decimal} 44 | 45 | ul {list-style-type: disc} 46 | 47 | ul ul {list-style-type: circle} 48 | 49 | ul ul ul {list-style-type: square} 50 | 51 | ul ul ul ul {list-style-type: disc} 52 | 53 | u {text-decoration: underline} 54 | 55 | small, sub, sup {font-size: 0.83em} 56 | 57 | sub {vertical-align: sub} 58 | 59 | sup {vertical-align: super} 60 | 61 | s, strike, del {text-decoration: line-through} 62 | 63 | table {border-style: outset; border-spacing: 1px} 64 | 65 | td, th {border-style: inset; padding: 2px} 66 | 67 | thead, tbody, tfoot {vertical-align: middle} 68 | 69 | th {font-weight: bolder; text-align: center} 70 | 71 | code, tt, pre, samp, kbd {font-family: monospace} 72 | 73 | table, caption {font-size: medium; font-weight: normal} -------------------------------------------------------------------------------- /test/table-h1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
Grundstücksverkehrsgenehmigungszuständigkeit ABC 4 | Sed ut perspiciatis, unde omnis iste natus error sit voluptatem 5 | accusantium doloremque laudantium, totam rem aperiam eaque ipsa, quae 6 | ab illo inventore veritatis et quasi architecto beatae vitae dicta 7 | sunt, explicabo. nemo enim ipsam voluptatem, quia voluptas sit, 8 | aspernatur aut odit aut fugit, sed quia consequuntur magni dolores 9 | eos, qui ratione voluptatem sequi nesciunt, neque porro quisquam est, 10 | qui dolorem ipsum, quia dolor sit, amet, consectetur, adipisci velit, 11 | sed quia non numquam eius modi tempora incidunt, ut labore et dolore 12 | magnam aliquam quaerat voluptatem. ut enim ad minima veniam, quis 13 | nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut 14 | aliquid ex ea commodi consequatur? quis autem vel eum iure 15 | reprehenderit, qui in ea voluptate velit esse, quam nihil molestiae 16 | consequatur, vel illum, qui dolorem eum fugiat, quo voluptas nulla 17 | pariatur? 18 |
19 | 20 | 21 | 22 |
Grund­stücks­ver­kehrs­ge­neh­mi­gungs­zu­stän­dig­keit ABC 23 | Sed ut perspiciatis, unde omnis iste natus error sit voluptatem 24 | accusantium doloremque laudantium, totam rem aperiam eaque ipsa, quae 25 | ab illo inventore veritatis et quasi architecto beatae vitae dicta 26 | sunt, explicabo. nemo enim ipsam voluptatem, quia voluptas sit, 27 | aspernatur aut odit aut fugit, sed quia consequuntur magni dolores 28 | eos, qui ratione voluptatem sequi nesciunt, neque porro quisquam est, 29 | qui dolorem ipsum, quia dolor sit, amet, consectetur, adipisci velit, 30 | sed quia non numquam eius modi tempora incidunt, ut labore et dolore 31 | magnam aliquam quaerat voluptatem. ut enim ad minima veniam, quis 32 | nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut 33 | aliquid ex ea commodi consequatur? quis autem vel eum iure 34 | reprehenderit, qui in ea voluptate velit esse, quam nihil molestiae 35 | consequatur, vel illum, qui dolorem eum fugiat, quo voluptas nulla 36 | pariatur? 37 |
38 | -------------------------------------------------------------------------------- /dw/fltkcomplexbutton.hh: -------------------------------------------------------------------------------- 1 | 2 | // fltkcomplexbutton.hh is derived from FL/Fl_Button.H from FLTK's 1.3 branch 3 | // at http://fltk.org in early 2011. 4 | // FL/Fl_Button.H is Copyright 1998-2010 by Bill Spitzak and others. 5 | 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 . 19 | */ 20 | 21 | #ifndef __FLTK_COMPLEX_BUTTON_HH__ 22 | #define __FLTK_COMPLEX_BUTTON_HH__ 23 | 24 | #include 25 | 26 | namespace dw { 27 | namespace fltk { 28 | namespace ui { 29 | 30 | class ComplexButton : public Fl_Group { 31 | char value_; 32 | char oldval; 33 | uchar down_box_; 34 | 35 | protected: 36 | virtual void draw(); 37 | 38 | public: 39 | virtual int handle(int); 40 | 41 | ComplexButton(int X, int Y, int W, int H, const char *L = 0); 42 | ~ComplexButton(); 43 | 44 | int value(int v); 45 | 46 | /** 47 | Returns the current value of the button (0 or 1). 48 | */ 49 | char value() const {return value_;} 50 | 51 | /** 52 | Returns the current down box type, which is drawn when value() is non-zero. 53 | \retval Fl_Boxtype 54 | */ 55 | Fl_Boxtype down_box() const {return (Fl_Boxtype)down_box_;} 56 | 57 | /** 58 | Sets the down box type. The default value of 0 causes FLTK to figure out 59 | the correct matching down version of box(). 60 | \param[in] b down box type 61 | */ 62 | void down_box(Fl_Boxtype b) {down_box_ = b;} 63 | }; 64 | 65 | } // namespace ui 66 | } // namespace fltk 67 | } // namespace dw 68 | 69 | #endif 70 | 71 | // 72 | // 73 | -------------------------------------------------------------------------------- /test/floats-and-margins.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Floats And Margins 6 | 8 | 9 | 10 |

11 | 12 | Ἐν ἀρχῇ ἦν ὁ Λόγος, καὶ ὁ Λόγος ἦν πρὸς τὸν Θεόν, καὶ Θεὸς ἦν ὁ 13 | Λόγος. Οὗτος ἦν ἐν ἀρχῇ πρὸς τὸν Θεόν. πάντα δι' αὐτοῦ ἐγένετο, 14 | καὶ χωρὶς αὐτοῦ ἐγένετο οὐδὲ ἕν ὃ γέγονεν. ἐν αὐτῷ ζωὴ ἦν, καὶ ἡ 15 | ζωὴ ἦν τὸ φῶς τῶν ἀνθρώπων. καὶ τὸ φῶς ἐν τῇ σκοτίᾳ φαίνει, καὶ 16 | ἡ σκοτία αὐτὸ οὐ κατέλαβεν. 17 |

18 |

19 | 20 | Sed ut perspiciatis, unde omnis iste natus error sit voluptatem 21 | accusantium doloremque laudantium, totam rem aperiam eaque ipsa, 22 | quae ab illo inventore veritatis et quasi architecto beatae 23 | vitae dicta sunt, explicabo. nemo enim ipsam voluptatem, quia 24 | voluptas sit, aspernatur aut odit aut fugit, sed quia 25 | consequuntur magni dolores eos, qui ratione voluptatem sequi 26 | nesciunt, neque porro quisquam est, qui dolorem ipsum, quia 27 | dolor sit, amet, consectetur, adipisci velit, sed quia non 28 | numquam eius modi tempora incidunt, ut labore et dolore magnam 29 | aliquam quaerat voluptatem. ut enim ad minima veniam, quis 30 | nostrum exercitationem ullam corporis suscipit laboriosam, nisi 31 | ut aliquid ex ea commodi consequatur? quis autem vel eum iure 32 | reprehenderit, qui in ea voluptate velit esse, quam nihil 33 | molestiae consequatur, vel illum, qui dolorem eum fugiat, quo 34 | voluptas nulla pariatur? 35 |

36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /dw/oofposabsmgr.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Dillo Widget 3 | * 4 | * Copyright 2014 Sebastian Geerken 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 . 18 | */ 19 | 20 | #include "oofposabsmgr.hh" 21 | 22 | namespace dw { 23 | 24 | namespace oof { 25 | 26 | OOFPosAbsMgr::OOFPosAbsMgr (OOFAwareWidget *container) : 27 | OOFPosAbsLikeMgr (container) 28 | { 29 | DBG_OBJ_CREATE ("dw::oof::OOFPosAbsMgr"); 30 | } 31 | 32 | OOFPosAbsMgr::~OOFPosAbsMgr () 33 | { 34 | DBG_OBJ_DELETE (); 35 | } 36 | 37 | // Comment for all containerBox* implementations: for the toplevel 38 | // widget, assume margin = border = 0 (should perhaps set so when 39 | // widgets are constructed), so that the padding area is actually the 40 | // allocation. 41 | 42 | int OOFPosAbsMgr::containerBoxOffsetX () 43 | { 44 | return container->getParent () ? 45 | container->boxOffsetX () - container->getStyle()->padding.left : 0; 46 | } 47 | 48 | int OOFPosAbsMgr::containerBoxOffsetY () 49 | { 50 | return container->getParent () ? 51 | container->boxOffsetY () - container->getStyle()->padding.top : 0; 52 | } 53 | 54 | int OOFPosAbsMgr::containerBoxRestWidth () 55 | { 56 | return container->getParent () ? 57 | container->boxRestWidth () - container->getStyle()->padding.right : 0; 58 | } 59 | 60 | int OOFPosAbsMgr::containerBoxRestHeight () 61 | { 62 | return container->getParent () ? 63 | container->boxRestHeight () - container->getStyle()->padding.bottom : 0; 64 | } 65 | 66 | } // namespace oof 67 | 68 | } // namespace dw 69 | -------------------------------------------------------------------------------- /src/form.hh: -------------------------------------------------------------------------------- 1 | #ifndef __FORM_HH__ 2 | #define __FORM_HH__ 3 | 4 | #include "url.h" 5 | 6 | /* 7 | * Typedefs 8 | */ 9 | 10 | typedef enum { 11 | DILLO_HTML_METHOD_UNKNOWN, 12 | DILLO_HTML_METHOD_GET, 13 | DILLO_HTML_METHOD_POST 14 | } DilloHtmlMethod; 15 | 16 | typedef enum { 17 | DILLO_HTML_ENC_URLENCODED, 18 | DILLO_HTML_ENC_MULTIPART 19 | } DilloHtmlEnc; 20 | 21 | /* 22 | * Classes 23 | */ 24 | 25 | class DilloHtmlForm; 26 | class DilloHtmlInput; 27 | class DilloHtml; 28 | 29 | /* 30 | * Form API 31 | */ 32 | 33 | DilloHtmlForm *a_Html_form_new(DilloHtml *html, 34 | DilloHtmlMethod method, 35 | const DilloUrl *action, 36 | DilloHtmlEnc enc, 37 | const char *charset, bool enabled); 38 | 39 | void a_Html_form_delete(DilloHtmlForm* form); 40 | void a_Html_input_delete(DilloHtmlInput* input); 41 | void a_Html_form_submit2(void *v_form); 42 | void a_Html_form_reset2(void *v_form); 43 | void a_Html_form_display_hiddens2(void *v_form, bool display); 44 | 45 | 46 | /* 47 | * Form parsing functions 48 | */ 49 | 50 | void Html_tag_open_form(DilloHtml *html, const char *tag, int tagsize); 51 | void Html_tag_close_form(DilloHtml *html); 52 | void Html_tag_open_input(DilloHtml *html, const char *tag, int tagsize); 53 | void Html_tag_open_isindex(DilloHtml *html, const char *tag, int tagsize); 54 | void Html_tag_open_textarea(DilloHtml *html, const char *tag, int tagsize); 55 | void Html_tag_content_textarea(DilloHtml *html, const char *tag, int tagsize); 56 | void Html_tag_close_textarea(DilloHtml *html); 57 | void Html_tag_open_select(DilloHtml *html, const char *tag, int tagsize); 58 | void Html_tag_close_select(DilloHtml *html); 59 | void Html_tag_open_option(DilloHtml *html, const char *tag, int tagsize); 60 | void Html_tag_close_option(DilloHtml *html); 61 | void Html_tag_open_optgroup(DilloHtml *html, const char *tag, int tagsize); 62 | void Html_tag_close_optgroup(DilloHtml *html); 63 | void Html_tag_open_button(DilloHtml *html, const char *tag, int tagsize); 64 | void Html_tag_close_button(DilloHtml *html); 65 | 66 | #endif /* __FORM_HH__ */ 67 | -------------------------------------------------------------------------------- /Makefile.options.OpenBSD: -------------------------------------------------------------------------------- 1 | # == SYSTEM BINARIES == 2 | 3 | AR ?= ar 4 | ARFLAGS ?= cru 5 | RANLIB ?= ranlib 6 | 7 | CC ?= cc 8 | CXX ?= c++ 9 | 10 | INSTALL ?= /usr/bin/install 11 | INSTALL_SH = ../install-sh 12 | 13 | # == COMPILATION FLAGS == 14 | 15 | COMPILE = $(CC) $(INCLUDES) $(CFLAGS) 16 | LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@ 17 | 18 | CFLAGS ?= -g -O2 19 | CFLAGS += -DD_DNS_THREADED -D_REENTRANT -DHAVE_CONFIG -D_THREAD_SAFE -Wall -W -Wno-unused-parameter -Waggregate-return -Wl,--no-as-needed 20 | INCLUDES = -I. -I.. -I/usr/local/include 21 | LDFLAGS = -L/usr/local/lib 22 | 23 | CXXCOMPILE = $(CXX) $(INCLUDES) $(CXXFLAGS) 24 | CXXFLAGS = $(CFLAGS) -fno-rtti -fno-exceptions 25 | 26 | LIBFLTK_CFLAGS = -I/usr/X11R6/include/freetype2 -pipe -I/usr/X11R6/include -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_THREAD_SAFE -D_REENTRANT 27 | LIBFLTK_CXXFLAGS = $(LIBFLTK_CFLAGS) -fvisibility-inlines-hidden 28 | LIBFLTK_LDFLAGS = $(LDFLAGS) -Wl,-rpath,/usr/local/lib -L/usr/X11R6/lib -lfltk -lXcursor -lXfixes -lXext -lXft -lfontconfig -lXinerama -lpthread -lm -lX11 -lXdmcp -lXau 29 | 30 | HTTPS_LDFLAGS = -lcrypto -lssl 31 | 32 | LIBPNG16_CXXFLAGS = -I/usr/local/include/libpng16 33 | 34 | DILLO_LDFLAGS = -ljpeg -L/usr/local/lib -lpng -Wl,-rpath,/usr/local/lib -L/usr/X11R6/lib -lfltk -lXcursor -lXfixes -lXext -lXft -lfontconfig -lXinerama -lpthread -lm -lX11 -lXdmcp -lXau -lz -liconv -lX11 35 | 36 | # == HTTPS CERTS == 37 | 38 | CA_CERTS_FILE ?= /etc/ssl/cert.pem 39 | CA_CERTS_DIR ?= /etc/ssl/ 40 | 41 | # == EXTERNAL TOOLS == 42 | 43 | DOWNLOADER_TOOL = ftp 44 | DOWNLOADER_USER_AGENT_ARG = -U 45 | DOWNLOADER_CONTINUE_ARG = -C 46 | DOWNLOADER_LOAD_COOKIES_ARG = -c 47 | DOWNLOADER_OUTPUT_FILENAME_ARG = -o 48 | 49 | ZIP_USE_7Z = 1 50 | FTP_USE_WGET = 0 51 | 52 | # == INSTALL PATHS == 53 | 54 | BINNAME = dillo-plus 55 | 56 | PREFIX ?= /usr/local 57 | LIBDIR = $(PREFIX)/lib/ 58 | 59 | DILLO_BINDIR = $(PREFIX)/bin/ 60 | DILLO_LIBDIR = $(PREFIX)/lib/$(BINNAME)/ 61 | DILLO_ETCDIR = $(PREFIX)/etc/$(BINNAME)/ 62 | 63 | DPIDRC_SYS = $(DILLO_ETCDIR)/dpidrc 64 | 65 | DOC_PATH = $(PREFIX)/share/doc/$(BINNAME) 66 | MAN_PATH = $(PREFIX)/man/man1 67 | 68 | APP_PATH = $(PREFIX)/share/applications 69 | ICON_PATH = $(PREFIX)/share/icons 70 | 71 | -------------------------------------------------------------------------------- /dw/imgrenderer.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Dillo Widget 3 | * 4 | * Copyright 2013 Sebastian Geerken 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 . 18 | */ 19 | 20 | #include "core.hh" 21 | 22 | namespace dw { 23 | namespace core { 24 | 25 | using namespace lout::container; 26 | using namespace lout::object; 27 | 28 | void ImgRendererDist::setBuffer (core::Imgbuf *buffer, bool resize) 29 | { 30 | for (typed::Iterator > it = 31 | children->iterator (); it.hasNext (); ) { 32 | TypedPointer *tp = it.getNext (); 33 | tp->getTypedValue()->setBuffer (buffer, resize); 34 | } 35 | } 36 | 37 | void ImgRendererDist::drawRow (int row) 38 | { 39 | for (typed::Iterator > it = 40 | children->iterator (); it.hasNext (); ) { 41 | TypedPointer *tp = it.getNext (); 42 | tp->getTypedValue()->drawRow (row); 43 | } 44 | } 45 | 46 | 47 | void ImgRendererDist::finish () 48 | { 49 | for (typed::Iterator > it = 50 | children->iterator (); it.hasNext (); ) { 51 | TypedPointer *tp = it.getNext (); 52 | tp->getTypedValue()->finish (); 53 | } 54 | } 55 | 56 | void ImgRendererDist::fatal () 57 | { 58 | for (typed::Iterator > it = 59 | children->iterator (); it.hasNext (); ) { 60 | TypedPointer *tp = it.getNext (); 61 | tp->getTypedValue()->fatal (); 62 | } 63 | } 64 | 65 | 66 | } // namespace core 67 | } // namespace dw 68 | -------------------------------------------------------------------------------- /Makefile.options: -------------------------------------------------------------------------------- 1 | # == SYSTEM BINARIES == 2 | 3 | AR ?= ar 4 | ARFLAGS ?= cru 5 | RANLIB ?= ranlib 6 | 7 | CC ?= gcc 8 | CXX ?= g++ 9 | 10 | INSTALL ?= /usr/bin/install 11 | INSTALL_SH = ../install-sh 12 | 13 | # == COMPILATION FLAGS == 14 | 15 | COMPILE = $(CC) $(INCLUDES) $(CFLAGS) 16 | LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@ 17 | 18 | CFLAGS ?= -g -O2 19 | CFLAGS += -DD_DNS_THREADED -D_REENTRANT -DHAVE_CONFIG -D_THREAD_SAFE -Wall -W -Wno-unused-parameter -Waggregate-return -Wl,--no-as-needed 20 | INCLUDES ?= -I. -I.. -I/usr/local/include 21 | LDFLAGS ?= -L/usr/local/lib 22 | 23 | CXXCOMPILE = $(CXX) $(INCLUDES) $(CXXFLAGS) 24 | CXXFLAGS = $(CFLAGS) -fno-rtti -fno-exceptions 25 | 26 | LIBFLTK_CFLAGS = -I/usr/X11R6/include/freetype2 -pipe -I/usr/X11R6/include -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_THREAD_SAFE -D_REENTRANT 27 | LIBFLTK_CXXFLAGS = $(LIBFLTK_CFLAGS) -fvisibility-inlines-hidden 28 | LIBFLTK_LDFLAGS = $(LDFLAGS) -Wl,-rpath,/usr/local/lib -L/usr/X11R6/lib -lfltk -lXcursor -lXfixes -lXext -lXft -lfontconfig -lXinerama -lpthread -lm -lX11 -lXdmcp -lXau 29 | 30 | HTTPS_LDFLAGS = -lcrypto -lssl 31 | 32 | LIBPNG16_CXXFLAGS = -I/usr/local/include/libpng16 33 | 34 | DILLO_LDFLAGS = -ljpeg -L/usr/local/lib -lpng -Wl,-rpath,/usr/local/lib -L/usr/X11R6/lib -lfltk -lXcursor -lXfixes -lXext -lXft -lfontconfig -lXinerama -lpthread -lm -lX11 -lXdmcp -lXau -lz -lX11 35 | 36 | # == HTTPS CERTS == 37 | 38 | CA_CERTS_FILE ?= /etc/ssl/cert.pem 39 | CA_CERTS_DIR ?= /etc/ssl/ 40 | 41 | # == EXTERNAL TOOLS == 42 | 43 | DOWNLOADER_TOOL = wget 44 | DOWNLOADER_USER_AGENT_ARG = -U 45 | DOWNLOADER_CONTINUE_ARG = -c 46 | DOWNLOADER_LOAD_COOKIES_ARG = --load_cookies 47 | DOWNLOADER_OUTPUT_FILENAME_ARG = -O 48 | 49 | ZIP_USE_7Z = 0 50 | FTP_USE_WGET = 1 51 | 52 | # == INSTALL PATHS == 53 | 54 | BINNAME = dillo-plus 55 | 56 | PREFIX ?= /usr/local 57 | LIBDIR = $(PREFIX)/lib/ 58 | 59 | DILLO_BINDIR = $(PREFIX)/bin/ 60 | DILLO_LIBDIR = $(PREFIX)/lib/$(BINNAME)/ 61 | DILLO_ETCDIR = $(PREFIX)/etc/$(BINNAME)/ 62 | 63 | DPIDRC_SYS = $(DILLO_ETCDIR)/dpidrc 64 | 65 | DOC_PATH = $(PREFIX)/share/doc/$(BINNAME) 66 | MAN_PATH = $(PREFIX)/share/man/man1 67 | 68 | APP_PATH = $(PREFIX)/share/applications 69 | ICON_PATH = $(PREFIX)/share/icons 70 | 71 | -------------------------------------------------------------------------------- /Makefile.options.Linux: -------------------------------------------------------------------------------- 1 | # == SYSTEM BINARIES == 2 | 3 | AR ?= ar 4 | ARFLAGS ?= cru 5 | RANLIB ?= ranlib 6 | 7 | CC ?= gcc 8 | CXX ?= g++ 9 | 10 | INSTALL ?= /usr/bin/install 11 | INSTALL_SH = ../install-sh 12 | 13 | # == COMPILATION FLAGS == 14 | 15 | COMPILE = $(CC) $(INCLUDES) $(CFLAGS) 16 | LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@ 17 | 18 | CFLAGS ?= -g -O2 19 | CFLAGS += -DD_DNS_THREADED -D_REENTRANT -DHAVE_CONFIG -D_THREAD_SAFE -Wall -W -Wno-unused-parameter -Waggregate-return -Wl,--no-as-needed 20 | INCLUDES ?= -I. -I.. -I/usr/local/include 21 | LDFLAGS ?= -L/usr/local/lib 22 | 23 | CXXCOMPILE = $(CXX) $(INCLUDES) $(CXXFLAGS) 24 | CXXFLAGS = $(CFLAGS) -fno-rtti -fno-exceptions 25 | 26 | LIBFLTK_CFLAGS = -I/usr/X11R6/include/freetype2 -pipe -I/usr/X11R6/include -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_THREAD_SAFE -D_REENTRANT 27 | LIBFLTK_CXXFLAGS = $(LIBFLTK_CFLAGS) -fvisibility-inlines-hidden 28 | LIBFLTK_LDFLAGS = $(LDFLAGS) -Wl,-rpath,/usr/local/lib -L/usr/X11R6/lib -lfltk -lXcursor -lXfixes -lXext -lXft -lfontconfig -lXinerama -lpthread -lm -lX11 -lXdmcp -lXau 29 | 30 | HTTPS_LDFLAGS = -lcrypto -lssl 31 | 32 | LIBPNG16_CXXFLAGS = -I/usr/local/include/libpng16 33 | 34 | DILLO_LDFLAGS = -ljpeg -L/usr/local/lib -lpng -Wl,-rpath,/usr/local/lib -L/usr/X11R6/lib -lfltk -lXcursor -lXfixes -lXext -lXft -lfontconfig -lXinerama -lpthread -lm -lX11 -lXdmcp -lXau -lz -lX11 35 | 36 | # == HTTPS CERTS == 37 | 38 | CA_CERTS_FILE ?= /etc/ssl/cert.pem 39 | CA_CERTS_DIR ?= /etc/ssl/ 40 | 41 | # == EXTERNAL TOOLS == 42 | 43 | DOWNLOADER_TOOL = wget 44 | DOWNLOADER_USER_AGENT_ARG = -U 45 | DOWNLOADER_CONTINUE_ARG = -c 46 | DOWNLOADER_LOAD_COOKIES_ARG = --load_cookies 47 | DOWNLOADER_OUTPUT_FILENAME_ARG = -O 48 | 49 | ZIP_USE_7Z = 0 50 | FTP_USE_WGET = 1 51 | 52 | # == INSTALL PATHS == 53 | 54 | BINNAME = dillo-plus 55 | 56 | PREFIX ?= /usr/local 57 | LIBDIR = $(PREFIX)/lib/ 58 | 59 | DILLO_BINDIR = $(PREFIX)/bin/ 60 | DILLO_LIBDIR = $(PREFIX)/lib/$(BINNAME)/ 61 | DILLO_ETCDIR = $(PREFIX)/etc/$(BINNAME)/ 62 | 63 | DPIDRC_SYS = $(DILLO_ETCDIR)/dpidrc 64 | 65 | DOC_PATH = $(PREFIX)/share/doc/$(BINNAME) 66 | MAN_PATH = $(PREFIX)/share/man/man1 67 | 68 | APP_PATH = $(PREFIX)/share/applications 69 | ICON_PATH = $(PREFIX)/share/icons 70 | 71 | -------------------------------------------------------------------------------- /dw/oofposabslikemgr.hh: -------------------------------------------------------------------------------- 1 | #ifndef __DW_OOFPOSABSLIKEMGR_HH__ 2 | #define __DW_OOFPOSABSLIKEMGR_HH__ 3 | 4 | #include "oofpositionedmgr.hh" 5 | 6 | namespace dw { 7 | 8 | namespace oof { 9 | 10 | class OOFPosAbsLikeMgr: public OOFPositionedMgr 11 | { 12 | protected: 13 | virtual int containerBoxOffsetX () = 0; 14 | virtual int containerBoxOffsetY () = 0; 15 | virtual int containerBoxRestWidth () = 0; 16 | virtual int containerBoxRestHeight () = 0; 17 | 18 | inline int containerBoxDiffWidth () 19 | { return containerBoxOffsetX () + containerBoxRestWidth (); } 20 | inline int containerBoxDiffHeight () 21 | { return containerBoxOffsetY () + containerBoxRestHeight (); } 22 | 23 | bool haveExtremesChanged (); 24 | 25 | void sizeAllocateChildren (); 26 | 27 | bool posXAbsolute (Child *child); 28 | bool posYAbsolute (Child *child); 29 | 30 | void calcPosAndSizeChildOfChild (Child *child, int refWidth, int refHeight, 31 | int *xPtr, int *yPtr, int *widthPtr, 32 | int *ascentPtr, int *descentPtr); 33 | void calcHPosAndSizeChildOfChild (Child *child, int refWidth, 34 | int origChildWidth, int *xPtr, 35 | int *widthPtr); 36 | void calcVPosAndSizeChildOfChild (Child *child, int refHeight, 37 | int origChildAscent, int origChildDescent, 38 | int *yPtr, int *ascentPtr, 39 | int *descentPtr); 40 | 41 | 42 | public: 43 | OOFPosAbsLikeMgr (OOFAwareWidget *container); 44 | ~OOFPosAbsLikeMgr (); 45 | 46 | void calcWidgetRefSize (core::Widget *widget, core::Requisition *size); 47 | 48 | void getSize (core::Requisition *containerReq, int *oofWidth, 49 | int *oofHeight); 50 | void getExtremes (core::Extremes *containerExtr, 51 | int *oofMinWidth, int *oofMaxWidth); 52 | 53 | int getAvailWidthOfChild (core::Widget *child, bool forceValue); 54 | int getAvailHeightOfChild (core::Widget *child, bool forceValue); 55 | }; 56 | 57 | } // namespace oof 58 | 59 | } // namespace dw 60 | 61 | #endif // __DW_OOFPOSABSLIKEMGR_HH__ 62 | -------------------------------------------------------------------------------- /devdoc/README: -------------------------------------------------------------------------------- 1 | README: Last update Jul 2009 2 | 3 | These documents cover dillo's internals. 4 | For user help, see http://dillo-browser.github.io/old/dillo3-help.html 5 | 6 | -------------------------------------------------------------------------- 7 | 8 | These documents need a review. 9 | *.txt were current with Dillo1, but many have since become more or 10 | less out-of-date. 11 | *.doc are doxygen source for the Dillo Widget (dw) component, and 12 | were written for Dillo2. 13 | 14 | They will give you an overview of what's going on, but take them 15 | with a pinch of salt. 16 | 17 | Of course I'd like to have *.txt as doxygen files too! 18 | If somebody wants to make this conversion, please let me know 19 | to assign higher priority to updating these docs. 20 | 21 | -- 22 | Jorge.- 23 | 24 | -------------------------------------------------------------------------- 25 | FILE DESCRIPTION STATE 26 | -------------------------------------------------------------------------- 27 | NC_design.txt Naming&Coding design (Be sure to Current 28 | read it before any other doc) 29 | Dillo.txt General overview of the program Current 30 | IO.txt Extensive introduction Current 31 | Cache.txt Informative description Current 32 | Images.txt Image handling and processing Current 33 | HtmlParser.txt A versatile parser Current 34 | Dw.txt The New Dillo Widget (Overview) Current 35 | Imgbuf.txt Image buffers Pending 36 | Selection.txt Selections, and link activation Current (?) 37 | Cookies.txt Explains how to enable cookies Current 38 | Dpid.txt Dillo plugin daemon Current 39 | -------------------------------------------------------------------------- 40 | 41 | 42 | * BTW, there's a small program (srch) within the src/ dir. It searches 43 | tokens within the whole code (*.[ch]). It has proven very useful. 44 | Ex: ./srch a_Image_write 45 | ./srch todo: 46 | 47 | * Please submit your patches with 'hg diff'. 48 | 49 | 50 | Happy coding! 51 | --Jcid 52 | -------------------------------------------------------------------------------- /Makefile.options.Linux.Wayland: -------------------------------------------------------------------------------- 1 | # Provided by @XDream8 via patch 2 | # Source: https://github.com/crossbowerbt/dillo-plus/issues/15 3 | 4 | # Still not complete, but you can start from this file for a wayland port 5 | 6 | # == SYSTEM BINARIES == 7 | 8 | AR ?= ar 9 | ARFLAGS ?= cru 10 | RANLIB ?= ranlib 11 | 12 | CC ?= gcc 13 | CXX ?= g++ 14 | 15 | INSTALL ?= /usr/bin/install 16 | INSTALL_SH = ../install-sh 17 | 18 | # == COMPILATION FLAGS == 19 | 20 | COMPILE = $(CC) $(INCLUDES) $(CFLAGS) 21 | LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@ 22 | 23 | CFLAGS ?= -g -O2 24 | CFLAGS += -DDISABLE_XEMBED -DD_DNS_THREADED -D_REENTRANT -DHAVE_CONFIG -D_THREAD_SAFE -Wall -W -Wno-unused-parameter -Waggregate-return -Wl,--no-as-needed 25 | INCLUDES ?= -I. -I.. -I/usr/local/include 26 | LDFLAGS ?= -L/usr/lib -L/usr/local/lib 27 | 28 | CXXCOMPILE = $(CXX) $(INCLUDES) $(CXXFLAGS) 29 | CXXFLAGS = $(CFLAGS) -fno-rtti -fno-exceptions 30 | 31 | LIBFLTK_CFLAGS = -pipe -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_THREAD_SAFE -D_REENTRANT 32 | LIBFLTK_CXXFLAGS = $(LIBFLTK_CFLAGS) -fvisibility-inlines-hidden 33 | LIBFLTK_LDFLAGS = $(LDFLAGS) -lfltk -lfontconfig -lpthread -lm 34 | 35 | HTTPS_LDFLAGS = -lcrypto -lssl 36 | 37 | LIBPNG16_CXXFLAGS = -I/usr/include/libpng16 -I/usr/local/include/libpng16 38 | 39 | DILLO_LDFLAGS = -ljpeg -L/usr/lib -L/usr/local/lib -lpng -Wl,-rpath,/usr/lib -Wl,-rpath,/usr/local/lib -lfltk -lfontconfig -lpthread -lm -lz 40 | 41 | # == HTTPS CERTS == 42 | 43 | CA_CERTS_FILE ?= /etc/ssl/cert.pem 44 | CA_CERTS_DIR ?= /etc/ssl/ 45 | 46 | # == EXTERNAL TOOLS == 47 | 48 | DOWNLOADER_TOOL = wget 49 | DOWNLOADER_USER_AGENT_ARG = -U 50 | DOWNLOADER_CONTINUE_ARG = -c 51 | DOWNLOADER_LOAD_COOKIES_ARG = --load_cookies 52 | DOWNLOADER_OUTPUT_FILENAME_ARG = -O 53 | 54 | ZIP_USE_7Z = 0 55 | FTP_USE_WGET = 1 56 | 57 | # == INSTALL PATHS == 58 | 59 | BINNAME = dillo-plus 60 | 61 | PREFIX ?= /usr/local 62 | LIBDIR = $(PREFIX)/lib/ 63 | 64 | DILLO_BINDIR = $(PREFIX)/bin/ 65 | DILLO_LIBDIR = $(PREFIX)/lib/$(BINNAME)/ 66 | DILLO_ETCDIR = $(PREFIX)/etc/$(BINNAME)/ 67 | 68 | DPIDRC_SYS = $(DILLO_ETCDIR)/dpidrc 69 | 70 | DOC_PATH = $(PREFIX)/share/doc/$(BINNAME) 71 | MAN_PATH = $(PREFIX)/share/man/man1 72 | 73 | APP_PATH = $(PREFIX)/share/applications 74 | ICON_PATH = $(PREFIX)/share/icons 75 | 76 | -------------------------------------------------------------------------------- /src/cssparser.hh: -------------------------------------------------------------------------------- 1 | #ifndef __CSSPARSER_HH__ 2 | #define __CSSPARSER_HH__ 3 | 4 | #include "css.hh" 5 | 6 | class DilloHtml; 7 | 8 | class CssParser { 9 | private: 10 | typedef enum { 11 | CSS_TK_DECINT, CSS_TK_FLOAT, CSS_TK_COLOR, CSS_TK_SYMBOL, 12 | CSS_TK_STRING, CSS_TK_CHAR, CSS_TK_END 13 | } CssTokenType; 14 | 15 | static const int maxStrLen = 256; 16 | CssContext *context; 17 | CssOrigin origin; 18 | const DilloUrl *baseUrl; 19 | 20 | const char *buf; 21 | int buflen, bufptr; 22 | 23 | CssTokenType ttype; 24 | char tval[maxStrLen]; 25 | bool withinBlock; 26 | bool spaceSeparated; /* used when parsing CSS selectors */ 27 | 28 | CssParser(CssContext *context, CssOrigin origin, const DilloUrl *baseUrl, 29 | const char *buf, int buflen); 30 | int getChar(); 31 | void ungetChar(); 32 | void nextToken(); 33 | bool skipString(int c, const char *string); 34 | bool tokenMatchesProperty(CssPropertyName prop, CssValueType * type); 35 | bool parseValue(CssPropertyName prop, CssValueType type, 36 | CssPropertyValue * val); 37 | bool parseWeight(); 38 | bool parseRgbColorComponent(int32_t *cc, int *percentage); 39 | bool parseRgbColor(int32_t *c); 40 | void parseDeclaration(CssPropertyList * props, 41 | CssPropertyList * importantProps); 42 | bool parseSimpleSelector(CssSimpleSelector *selector); 43 | char *parseUrl(); 44 | void parseImport(DilloHtml *html); 45 | void parseMedia(); 46 | CssSelector *parseSelector(); 47 | void parseRuleset(); 48 | void ignoreBlock(); 49 | void ignoreStatement(); 50 | 51 | public: 52 | static void parseDeclarationBlock(const DilloUrl *baseUrl, 53 | const char *buf, int buflen, 54 | CssPropertyList *props, 55 | CssPropertyList *propsImortant); 56 | static void parse(DilloHtml *html, const DilloUrl *baseUrl, CssContext *context, 57 | const char *buf, int buflen, CssOrigin origin); 58 | static const char *propertyNameString(CssPropertyName name); 59 | }; 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /test/floats-and-absolute.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Floats And Absolute Positions 6 | 19 | 20 | 21 |

Floats And Absolute Positions

22 |
23 | 24 |

Sed ut perspiciatis, unde omnis iste natus error sit 25 | voluptatem accusantium doloremque laudantium, totam rem 26 | aperiam eaque ipsa, quae ab illo inventore veritatis et quasi 27 | architecto beatae vitae dicta sunt, explicabo. nemo enim ipsam 28 | voluptatem, quia voluptas sit, aspernatur aut odit aut fugit, 29 | sed quia consequuntur magni dolores eos, qui ratione 30 | voluptatem sequi nesciunt, neque porro quisquam est, qui 31 | dolorem ipsum, quia dolor sit, amet, consectetur, adipisci 32 | velit, sed quia non numquam eius modi tempora incidunt, ut 33 | labore et dolore magnam aliquam quaerat voluptatem. ut enim ad 34 | minima veniam, quis nostrum exercitationem ullam corporis 35 | suscipit laboriosam, nisi ut aliquid ex ea commodi 36 | consequatur? quis autem vel eum iure reprehenderit, qui in ea 37 | voluptate velit esse, quam nihil molestiae consequatur, vel 38 | illum, qui dolorem eum fugiat, quo voluptas nulla 39 | pariatur?

40 |

Ἐν ἀρχῇ ἦν ὁ Λόγος, καὶ ὁ Λόγος ἦν πρὸς τὸν Θεόν, καὶ Θεὸς ἦν 41 | ὁ Λόγος. Οὗτος ἦν ἐν ἀρχῇ πρὸς τὸν Θεόν. πάντα δι' αὐτοῦ 42 | ἐγένετο, καὶ χωρὶς αὐτοῦ ἐγένετο οὐδὲ ἕν ὃ γέγονεν. ἐν αὐτῷ 43 | ζωὴ ἦν, καὶ ἡ ζωὴ ἦν τὸ φῶς τῶν ἀνθρώπων. καὶ τὸ φῶς ἐν τῇ 44 | σκοτίᾳ φαίνει, καὶ ἡ σκοτία αὐτὸ οὐ κατέλαβεν.

45 |
46 |
Margin, actually on the left side.
47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /devdoc/dw-fixed-positions.doc: -------------------------------------------------------------------------------- 1 | /** \page dw-fixed-positions Fixed positions 2 | 3 | In some cases, widgets or widget content must be positioned relative 4 | to the viewport. As in the CSS specification, these positions will be 5 | called "fixed positions". This must not be confused with "fixedly 6 | positioned elements" (see \ref dw-out-of-flow), which are a special 7 | case of fixed positions. 8 | 9 | 10 | Applications 11 | ============ 12 | 13 | As defined by CSS 14 | ----------------- 15 | 16 | - "position: fixed"; see \ref dw-out-of-flow. 17 | - "background-attachment: fixed"; see \ref dw-images-and-backgrounds. 18 | 19 | Idea for tables 20 | --------------- 21 | 22 | Often, tables have a header, which contains informations necessary to 23 | interpret the columns in the table body. For this, HTML defines the elements 24 | <thead> and <tbody> 25 | [1]. 26 | 27 | For large tables, the problem occurs that the table header gets out of 28 | the reader's view. In paged media, where a large table covers multiple 29 | pages, this is often solved by *repeating* the table header on each 30 | page occupied by the table. When using a viewport, a table larger than 31 | the vieport could be displayed like this: 32 | 33 | 1. If the top of the table is within the viewport, show the table 34 | header at the usual position. 35 | 2. As soon as top of the table gets above the top border of the 36 | viewport, keep the table header at the viewport top, so that it is 37 | still visible (this means, it moves down, relative to the 38 | *canvas*). This way, the header is still visible, so our objective 39 | is achieved. 40 | 3. When scrolling further down, at some point the table body gets out 41 | of the viewport again, and so should the table header. 42 | 43 | (Some images would be nice.) 44 | 45 | These ideas should be considered when developing a design for fixed 46 | positions. 47 | 48 | 49 | Design sketch 50 | ============== 51 | 52 | [...] 53 | 54 | 55 | ---------------------------------------------------------------------- 56 | 57 | [1] 58 | ... and also <tfoot>, which is not discussed here, for reasons 59 | of simplicity. However, it is obvious that <tfoot> should be 60 | dealt with in an analogue way as <thead>. 61 | 62 | 63 | */ -------------------------------------------------------------------------------- /src/image.hh: -------------------------------------------------------------------------------- 1 | #ifndef __IMAGE_HH__ 2 | #define __IMAGE_HH__ 3 | 4 | // The DilloImage data-structure and methods 5 | 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif /* __cplusplus */ 10 | 11 | 12 | #include "bitvec.h" 13 | #include "url.h" 14 | 15 | /* 16 | * Defines 17 | */ 18 | 19 | /* Arbitrary maximum for image size (to avoid image size-crafting attacks). */ 20 | #define IMAGE_MAX_AREA (6000 * 6000) 21 | 22 | /* 23 | * Types 24 | */ 25 | 26 | typedef struct _DilloImage DilloImage; 27 | 28 | typedef enum { 29 | DILLO_IMG_TYPE_INDEXED, 30 | DILLO_IMG_TYPE_RGB, 31 | DILLO_IMG_TYPE_GRAY, 32 | DILLO_IMG_TYPE_CMYK_INV, 33 | DILLO_IMG_TYPE_NOTSET /* Initial value */ 34 | } DilloImgType; 35 | 36 | /* These will reflect the Image's "state" */ 37 | typedef enum { 38 | IMG_Empty, /* Just created the entry */ 39 | IMG_SetParms, /* Parameters set */ 40 | IMG_SetCmap, /* Color map set */ 41 | IMG_Write, /* Feeding the entry */ 42 | IMG_Close, /* Whole image got! */ 43 | IMG_Abort /* Image transfer aborted */ 44 | } ImageState; 45 | 46 | struct _DilloImage { 47 | void *layout, *img_rndr; 48 | 49 | /* Parameters as told by image data */ 50 | uint_t width; 51 | uint_t height; 52 | 53 | int32_t bg_color; /* Background color */ 54 | bitvec_t *BitVec; /* Bit vector for decoded rows */ 55 | uint_t ScanNumber; /* Current decoding scan */ 56 | ImageState State; /* Processing status */ 57 | 58 | int RefCount; /* Reference counter */ 59 | }; 60 | 61 | 62 | /* 63 | * Function prototypes 64 | */ 65 | DilloImage *a_Image_new(void *layout, void *img_rndr, int32_t bg_color); 66 | DilloImage *a_Image_new_with_dw(void *layout, const char *alt_text, 67 | int32_t bg_color); 68 | void *a_Image_get_dw(DilloImage *Image); 69 | void a_Image_ref(DilloImage *Image); 70 | void a_Image_unref(DilloImage *Image); 71 | 72 | void a_Image_set_parms(DilloImage *Image, void *v_imgbuf, DilloUrl *url, 73 | int version, uint_t width, uint_t height, 74 | DilloImgType type); 75 | void a_Image_write(DilloImage *Image, uint_t y); 76 | void a_Image_close(DilloImage *Image); 77 | void a_Image_abort(DilloImage *Image); 78 | 79 | 80 | #ifdef __cplusplus 81 | } 82 | #endif /* __cplusplus */ 83 | 84 | #endif /* __IMAGE_HH__ */ 85 | 86 | -------------------------------------------------------------------------------- /dw/listitem.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Dillo Widget 3 | * 4 | * Copyright 2005-2007 Sebastian Geerken 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 . 18 | */ 19 | 20 | 21 | 22 | #include "listitem.hh" 23 | #include "../lout/debug.hh" 24 | #include 25 | 26 | namespace dw { 27 | 28 | int ListItem::CLASS_ID = -1; 29 | 30 | ListItem::ListItem (ListItem *ref, bool limitTextWidth): 31 | AlignedTextblock (limitTextWidth) 32 | { 33 | DBG_OBJ_CREATE ("dw::ListItem"); 34 | registerName ("dw::ListItem", &CLASS_ID); 35 | setRefTextblock (ref); 36 | } 37 | 38 | ListItem::~ListItem() 39 | { 40 | DBG_OBJ_DELETE (); 41 | } 42 | 43 | bool ListItem::usesMaxGeneratorWidth () 44 | { 45 | return true; 46 | } 47 | 48 | void ListItem::initWithWidget (core::Widget *widget, 49 | core::style::Style *style) 50 | { 51 | hasListitemValue = true; 52 | addWidget (widget, style); 53 | addSpace (style); 54 | if (style->listStylePosition == core::style::LIST_STYLE_POSITION_OUTSIDE) 55 | updateValue (); 56 | } 57 | 58 | void ListItem::initWithText (const char *text, core::style::Style *style) 59 | { 60 | hasListitemValue = true; 61 | addText (text, style); 62 | addSpace (style); 63 | if (style->listStylePosition == core::style::LIST_STYLE_POSITION_OUTSIDE) 64 | updateValue (); 65 | } 66 | 67 | int ListItem::getValue () 68 | { 69 | if (words->size () == 0) 70 | return 0; 71 | else 72 | return words->getRef(0)->size.width + words->getRef(0)->origSpace; 73 | } 74 | 75 | void ListItem::setMaxValue (int maxValue, int value) 76 | { 77 | leftInnerPadding = maxValue; 78 | line1Offset = - value; 79 | redrawY = 0; 80 | queueResize (0, true); 81 | } 82 | 83 | } // namespace dw 84 | -------------------------------------------------------------------------------- /dw/findtext.hh: -------------------------------------------------------------------------------- 1 | #ifndef __DW_FINDTEXT_STATE_H__ 2 | #define __DW_FINDTEXT_STATE_H__ 3 | 4 | #ifndef __INCLUDED_FROM_DW_CORE_HH__ 5 | # error Do not include this file directly, use "core.hh" instead. 6 | #endif 7 | 8 | #include 9 | 10 | namespace dw { 11 | namespace core { 12 | 13 | class FindtextState 14 | { 15 | public: 16 | typedef enum { 17 | /** \brief The next occurrence of the pattern has been found. */ 18 | SUCCESS, 19 | 20 | /** 21 | * \brief There is no further occurrence of the pattern, instead, the 22 | * first occurrence has been selected. 23 | */ 24 | RESTART, 25 | 26 | /** \brief The patten does not at all occur in the text. */ 27 | NOT_FOUND 28 | } Result; 29 | 30 | private: 31 | /** 32 | * \brief The key used for the last search. 33 | * 34 | * If dw::core::Findtext::search is called with the same key, the search 35 | * is continued, otherwise it is restarted. 36 | */ 37 | char *key; 38 | 39 | /** \brief Whether the last search was case sensitive. */ 40 | bool caseSens; 41 | 42 | /** \brief The table used for KMP search. */ 43 | int *nexttab; 44 | 45 | /** \brief The top of the widget tree, in which the search is done. 46 | * 47 | * From this, the iterator will be constructed. Set by 48 | * dw::core::Findtext::widget 49 | */ 50 | Widget *widget; 51 | 52 | /** \brief The position from where the next search will start. */ 53 | CharIterator *iterator; 54 | 55 | /** 56 | * \brief The position from where the characters are highlighted. 57 | * 58 | * NULL, when no text is highlighted. 59 | */ 60 | CharIterator *hlIterator; 61 | 62 | static const char* rev(const char* _str); /* reverse a C string */ 63 | 64 | static int *createNexttab (const char *needle,bool caseSens,bool backwards); 65 | bool unhighlight (); 66 | bool search0 (bool backwards, bool firstTrial); 67 | 68 | inline static bool charsEqual (char c1, char c2, bool caseSens) 69 | { return caseSens ? c1 == c2 : tolower (c1) == tolower (c2) || 70 | (isspace (c1) && isspace (c2)); } 71 | 72 | public: 73 | FindtextState (); 74 | ~FindtextState (); 75 | 76 | void setWidget (Widget *widget); 77 | Result search (const char *key, bool caseSens, bool backwards); 78 | void resetSearch (); 79 | }; 80 | 81 | } // namespace core 82 | } // namespace dw 83 | 84 | #endif // __DW_FINDTEXT_STATE_H__ 85 | -------------------------------------------------------------------------------- /test/floats4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Floats 4 6 | 33 | 34 | 35 |
Some text in a float.
36 | 37 |

Sed ut perspiciatis, unde omnis iste natus error sit voluptatem 38 | accusantium doloremque laudantium, totam rem aperiam eaque ipsa, 39 | quae ab illo inventore veritatis et quasi architecto beatae 40 | vitae dicta sunt, explicabo. nemo enim ipsam voluptatem, quia 41 | voluptas sit, aspernatur aut odit aut fugit, sed quia 42 | consequuntur magni dolores eos, qui ratione voluptatem sequi 43 | nesciunt, neque porro quisquam est, qui dolorem ipsum, quia 44 | dolor sit, amet, consectetur, adipisci velit, sed quia non 45 | numquam eius modi tempora incidunt, ut labore et dolore magnam 46 | aliquam quaerat voluptatem. ut enim ad minima veniam, quis 47 | nostrum exercitationem ullam corporis suscipit laboriosam, nisi 48 | ut aliquid ex ea commodi consequatur? quis autem vel eum iure 49 | reprehenderit, qui in ea voluptate velit esse, quam nihil 50 | molestiae consequatur, vel illum, qui dolorem eum fugiat, quo 51 | voluptas nulla pariatur?

52 | 53 |
Ἐν ἀρχῇ ἦν ὁ Λόγος, καὶ ὁ Λόγος 54 | ἦν πρὸς τὸν Θεόν, καὶ Θεὸς ἦν ὁ Λόγος. Οὗτος ἦν ἐν ἀρχῇ πρὸς τὸν 55 | Θεόν. πάντα δι' αὐτοῦ ἐγένετο, καὶ χωρὶς αὐτοῦ ἐγένετο οὐδὲ ἕν ὃ 56 | γέγονεν. ἐν αὐτῷ ζωὴ ἦν, καὶ ἡ ζωὴ ἦν τὸ φῶς τῶν ἀνθρώπων. καὶ 57 | τὸ φῶς ἐν τῇ σκοτίᾳ φαίνει, καὶ ἡ σκοτία αὐτὸ οὐ 58 | κατέλαβεν.
59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /devdoc/dw-map.doc: -------------------------------------------------------------------------------- 1 | /** \page dw-map Dillo Widget Documentation Map 2 | 3 | This maps includes special documentations as well as longer comments 4 | in the sources. Arrows denote references between the documents. 5 | 6 | \dot 7 | digraph G { 8 | rankdir=LR; 9 | node [shape=record, fontname=Helvetica, fontsize=8]; 10 | fontname=Helvetica; fontsize=8; 11 | 12 | dw_overview [label="Dillo Widget Overview", URL="\ref dw-overview"]; 13 | dw_usage [label="Dillo Widget Usage", URL="\ref dw-usage"]; 14 | dw_layout_views [label="Layout and Views", URL="\ref dw-layout-views"]; 15 | dw_layout_widgets [label="Layout and Widgets", 16 | URL="\ref dw-layout-widgets"]; 17 | dw_widget_sizes [label="Sizes of Dillo Widgets", 18 | URL="\ref dw-widget-sizes"]; 19 | dw_changes [label="Changes to the GTK+-based Release Version", 20 | URL="\ref dw-changes"]; 21 | dw_images_and_backgrounds [label="Images and Backgrounds in Dw", 22 | URL="\ref dw-images-and-backgrounds"]; 23 | dw_Image [label="dw::Image", URL="\ref dw::Image"]; 24 | dw_core_Imgbuf [label="dw::core::Imgbuf", URL="\ref dw::core::Imgbuf"]; 25 | dw_core_SelectionState [label="dw::core::SelectionState", 26 | URL="\ref dw::core::SelectionState"]; 27 | dw_core_style [label="dw::core::style", URL="\ref dw::core::style"]; 28 | dw_Table [label="dw::Table", URL="\ref dw::Table"]; 29 | dw_Textblock [label="dw::Textblock", URL="\ref dw::Textblock"]; 30 | dw_core_ui [label="dw::core::ui", URL="\ref dw::core::ui"]; 31 | 32 | dw_overview -> dw_changes; 33 | dw_overview -> dw_usage; 34 | dw_overview -> dw_core_style; 35 | dw_overview -> dw_core_ui; 36 | dw_overview -> dw_images_and_backgrounds; 37 | dw_overview -> dw_layout_widgets; 38 | dw_overview -> dw_widget_sizes; 39 | dw_overview -> dw_layout_views; 40 | 41 | dw_usage -> dw_Table; 42 | dw_usage -> dw_Textblock; 43 | dw_usage -> dw_core_style; 44 | dw_usage -> dw_core_ui; 45 | dw_usage -> dw_images_and_backgrounds; 46 | 47 | dw_layout_widgets -> dw_widget_sizes; 48 | dw_layout_widgets -> dw_core_SelectionState; 49 | 50 | dw_widget_sizes -> dw_Table; 51 | dw_widget_sizes -> dw_Textblock; 52 | 53 | dw_images_and_backgrounds -> dw_core_Imgbuf; 54 | dw_images_and_backgrounds -> dw_Image; 55 | 56 | dw_core_style -> dw_Textblock; 57 | } 58 | \enddot 59 | */ -------------------------------------------------------------------------------- /test/hyphens-etc.html: -------------------------------------------------------------------------------- 1 |

Abcde­abcde­abcde­abcde­abcde­abcde­abcde­abcde­abcde­abcde­abcde­abcde­abcde­abcde­abcde­abcde­abcde­abcde­abcde­abcde­abcde­abcde­abcde­abcde­abcde­abcde­abcde­abcde­abcde­abcde­abcde­abcde­abcde­abcde­abcde­abcde­abcde­abcde­abcde­abcde­abcde­abcde­abcde­abcde­abcde­abcde

2 |

Abcde-abcde-abcde-abcde-abcde-abcde-abcde-abcde-abcde-abcde-abcde-abcde-abcde-abcde-abcde-abcde-abcde-abcde-abcde-abcde-abcde-abcde-abcde-abcde-abcde-abcde-abcde-abcde-abcde-abcde-abcde-abcde-abcde-abcde-abcde-abcde-abcde-abcde-abcde-abcde-abcde-abcde-abcde-abcde-abcde-abcde

3 |

Abcde‐abcde‐abcde‐abcde‐abcde‐abcde‐abcde‐abcde‐abcde‐abcde‐abcde‐abcde‐abcde‐abcde‐abcde‐abcde‐abcde‐abcde‐abcde‐abcde‐abcde‐abcde‐abcde‐abcde‐abcde‐abcde‐abcde‐abcde‐abcde‐abcde‐abcde‐abcde‐abcde‐abcde‐abcde‐abcde‐abcde‐abcde‐abcde‐abcde‐abcde‐abcde‐abcde‐abcde‐abcde‐abcde

4 |

Abcde—abcde—abcde—abcde—abcde—abcde—abcde—abcde—abcde—abcde—abcde—abcde—abcde—abcde—abcde—abcde—abcde—abcde—abcde—abcde—abcde—abcde—abcde—abcde—abcde—abcde—abcde—abcde—abcde—abcde—abcde—abcde—abcde—abcde—abcde—abcde—abcde—abcde—abcde—abcde—abcde—abcde—abcde—abcde—abcde—abcde

5 |

Nordrhein-Westfalen—Nordrhein-Westfalen—Nordrhein-Westfalen—Nordrhein-Westfalen—Nordrhein-Westfalen—Nordrhein-Westfalen—Nordrhein-Westfalen—Nordrhein-Westfalen—Nordrhein-Westfalen—Nordrhein-Westfalen—Nordrhein-Westfalen—Nordrhein-Westfalen

6 |

Nord­rheinwestfalen—Nord­rheinwestfalen—Nord­rheinwestfalen—Nord­rheinwestfalen—Nord­rheinwestfalen—Nord­rheinwestfalen—Nord­rheinwestfalen—Nord­rheinwestfalen—Nord­rheinwestfalen—Nord­rheinwestfalen—Nord­rheinwestfalen—Nord­rheinwestfalen

7 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | =================== 2 | Dillo+ web browser 3 | =================== 4 | 5 | Dillo+ is a multi-platform graphical web browser, known for its 6 | speed and small footprint, that is developed with a focus on 7 | personal security and privacy. 8 | 9 | The dillo3 series uses version 1.3.x of the FLTK GUI toolkit 10 | (http://fltk.org). 11 | 12 | The core team currently plans to focus on implementing the CSS 13 | feature of floating elements. This will greatly improve 14 | dillo's web page rendering since many sites have adopted floats 15 | instead of tables. 16 | 17 | The core team welcomes developers willing to join our workforce. 18 | 19 | 20 | NOTE: With FLTK-1.3, when running on X with Xft enabled (the 21 | default), font naming is more restricted than it was with FLTK2 22 | as used by dillo2. If your font_* preferences are no longer 23 | working well, please try the fc-list command as it is shown in 24 | dillorc. 25 | 26 | 27 | Here's a list of some old well-known problems of dillo: 28 | 29 | * no FRAMES rendering 30 | 31 | 32 | -------- 33 | FLTK-1.3 34 | -------- 35 | 36 | If you don't have FLTK-1.3 (try 'fltk-config --version' to check), 37 | you can get it from: 38 | 39 | http://fltk.org/software.php 40 | 41 | and build it like: 42 | 43 | tar zxvf fltk-1.3.3-source.tar.gz [or latest 1.3.x version] 44 | cd fltk-1.3.3 45 | less README.Unix.txt 46 | make 47 | sudo make install 48 | cd .. 49 | 50 | ------ 51 | Dillo3 52 | ------ 53 | 54 | Configure the options in Makefile.options. 55 | Then: 56 | 57 | make 58 | sudo make install 59 | 60 | In order to use the hyphenation feature, pattern files from CTAN need 61 | to be installed. 62 | This can be done with the script dillo-install-hyphenation. 63 | Call it with ISO-639-1 language codes as arguments, or without arguments 64 | to get more help. 65 | 66 | 67 | ------------ 68 | Dpi programs 69 | ------------ 70 | 71 | These are installed by "make install". If you don't have root 72 | access, copy "dillo" and "dpid" to some directory in your path 73 | and install the dpis by running "./install-dpi-local" from the 74 | top directory (they will be installed under ~/.dillo). 75 | 76 | ----------- 77 | Dls scripts 78 | ----------- 79 | 80 | These too are installed by "make install". 81 | You'll probably need python to run some of those. 82 | 83 | ------------ 84 | OS supported 85 | ------------ 86 | 87 | Linux, *BSD, Solaris are all supported, but be sure to personalize 88 | the options in Makefile.options according to your OS. 89 | 90 | -------------------------------------------------------------------------------- /test/KHM1.html: -------------------------------------------------------------------------------- 1 |
2 |

In den alten Zeiten, wo das Wünschen noch geholfen hat, lebte ein 3 | König, dessen Töchter waren alle schön, aber die jüngste war so schön, 4 | daß die Sonne selber, die doch so vieles gesehen hat, sich verwunderte 5 | so oft sie ihr ins Gesicht schien. Nahe bei dem Schlosse des Königs 6 | lag ein großer dunkler Wald, und in dem Walde unter einer alten Linde 7 | war ein Brunnen: wenn nun der Tag recht heiß war, so ging das 8 | Königskind hinaus in den Wald und setzte sich an den Rand des kühlen 9 | Brunnens: und wenn sie Langeweile hatte, so nahm sie eine goldene 10 | Kugel, warf sie in die Höhe und fieng sie wieder; und das war ihr 11 | liebstes Spielwerk.

12 |

Nun trug es sich einmal zu, daß die goldene Kugel der Königstochter 13 | nicht in ihr Händchen fiel, das sie in die Höhe gehalten hatte, 14 | sondern vorbei auf die Erde schlug und geradezu ins Wasser hinein 15 | rollte. Die Königstochter folgte ihr mit den Augen nach, aber die 16 | Kugel verschwand, und der Brunnen war tief, so tief daß man keinen 17 | Grund sah. Da fieng sie an zu weinen und weinte immer lauter und 18 | konnte sich gar nicht trösten. Und wie sie so klagte, rief ihr jemand 19 | zu „was hast du vor, Königstochter, du schreist ja daß sich ein Stein 20 | erbarmen möchte.“ Sie sah sich um, woher die Stimme käme, da erblickte 21 | sie einen Frosch, der seinen dicken häßlichen Kopf aus dem Wasser 22 | streckte. „Ach, du bists, alter Wasserpatscher,“ sagte sie, „ich weine 23 | über meine goldene Kugel, die mir in den Brunnen hinab gefallen ist.“ 24 | „Sei still und weine nicht,“ antwortete der Frosch, „ich kann wohl 25 | Rath schaffen, aber was gibst du mir, wenn ich dein Spielwerk wieder 26 | heraufhole?“ „Was du haben willst, lieber Frosch,“ sagte sie, „meine 27 | Kleider, meine Perlen und Edelsteine, auch noch die goldene Krone, die 28 | ich trage.“ Der Frosch antwortete „deine Kleider, deine Perlen und 29 | Edelsteine, und deine goldene Krone, die mag ich nicht: aber wenn du 30 | mich lieb haben willst, und ich soll dein Geselle und Spielkamerad 31 | sein, an deinem Tischlein neben dir sitzen, von deinem goldenen 32 | Tellerlein essen, aus deinem Becherlein trinken, in deinem Bettlein 33 | schlafen: wenn du mir das versprichst, so will ich hinunter steigen 34 | und dir die goldene Kugel wieder herauf holen.“ „Ach ja,“ sagte sie, 35 | „ich verspreche dir alles, was du willst, wenn du mir nur die Kugel 36 | wieder bringst.“ Sie dachte aber „was der einfältige Frosch schwätzt, 37 | der sitzt im Wasser bei seines Gleichen und quackt, und kann keines 38 | Menschen Geselle sein.“

39 |
40 | -------------------------------------------------------------------------------- /dw/imgrenderer.hh: -------------------------------------------------------------------------------- 1 | #ifndef __DW_IMGRENDERER_HH__ 2 | #define __DW_IMGRENDERER_HH__ 3 | 4 | #ifndef __INCLUDED_FROM_DW_CORE_HH__ 5 | # error Do not include this file directly, use "core.hh" instead. 6 | #endif 7 | 8 | namespace dw { 9 | namespace core { 10 | 11 | /** 12 | * \brief ... 13 | * 14 | * \sa \ref dw-images-and-backgrounds 15 | */ 16 | class ImgRenderer 17 | { 18 | public: 19 | virtual ~ImgRenderer () { } 20 | 21 | /** 22 | * \brief Called, when an image buffer is attached. 23 | * 24 | * This is typically the case when all meta data (size, depth) has been read. 25 | */ 26 | virtual void setBuffer (core::Imgbuf *buffer, bool resize = false) = 0; 27 | 28 | /** 29 | * \brief Called, when data from a row is available and has been copied into 30 | * the image buffer. 31 | * 32 | * The implementation will typically queue the respective area for drawing. 33 | */ 34 | virtual void drawRow (int row) = 0; 35 | 36 | /** 37 | * \brief Called, when all image data has been retrieved. 38 | * 39 | * The implementation may use this instead of "drawRow" for drawing, to 40 | * limit the number of draws. 41 | */ 42 | virtual void finish () = 0; 43 | 44 | /** 45 | * \brief Called, when there are problems with the retrieval of image data. 46 | * 47 | * The implementation may use this to indicate an error. 48 | */ 49 | virtual void fatal () = 0; 50 | }; 51 | 52 | /** 53 | * \brief Implementation of ImgRenderer, which distributes all calls 54 | * to a set of other implementations of ImgRenderer. 55 | * 56 | * The order of the call children is not defined, especially not 57 | * identical to the order in which they have been added. 58 | */ 59 | class ImgRendererDist: public ImgRenderer 60 | { 61 | lout::container::typed::HashSet > 62 | *children; 63 | 64 | public: 65 | inline ImgRendererDist () 66 | { children = new lout::container::typed::HashSet 67 | > (true); } 68 | ~ImgRendererDist () { delete children; } 69 | 70 | void setBuffer (core::Imgbuf *buffer, bool resize); 71 | void drawRow (int row); 72 | void finish (); 73 | void fatal (); 74 | 75 | void put (ImgRenderer *child) 76 | { children->put (new lout::object::TypedPointer (child)); } 77 | void remove (ImgRenderer *child) 78 | { lout::object::TypedPointer tp (child); 79 | children->remove (&tp); } 80 | }; 81 | 82 | } // namespace core 83 | } // namespace dw 84 | 85 | #endif // __DW_IMGRENDERER_HH__ 86 | 87 | 88 | -------------------------------------------------------------------------------- /src/dpiapi.c: -------------------------------------------------------------------------------- 1 | /* 2 | * File: dpiapi.c 3 | * 4 | * Copyright (C) 2004-2007 Jorge Arellano Cid 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 | 12 | /* Support for dpi/dpip from Dillo's side */ 13 | 14 | #include "msg.h" 15 | #include "bw.h" 16 | #include "capi.h" 17 | #include "dpiapi.h" /* for prototypes */ 18 | #include "dialog.hh" 19 | #include "../dpip/dpip.h" 20 | 21 | 22 | //---------------------------------------------------------------------------- 23 | // Dialog interface 24 | // 25 | 26 | /* This variable can be eliminated as a parameter with a cleaner API. */ 27 | static char *dialog_server = NULL; 28 | 29 | 30 | /* 31 | * Generic callback function for dpip dialogs. 32 | */ 33 | static void Dpiapi_dialog_answer_cb(BrowserWindow *bw, int answer) 34 | { 35 | char *cmd, numstr[16]; 36 | 37 | /* make dpip tag with the answer */ 38 | snprintf(numstr, 16, "%d", answer); 39 | cmd = a_Dpip_build_cmd("cmd=%s to_cmd=%s msg=%s", 40 | "answer", "dialog", numstr); 41 | 42 | /* Send answer */ 43 | a_Capi_dpi_send_cmd(NULL, bw, cmd, dialog_server, 0); 44 | dFree(cmd); 45 | } 46 | 47 | /* 48 | * Process a dpip "dialog" command from any dpi. 49 | */ 50 | void a_Dpiapi_dialog(BrowserWindow *bw, char *server, char *dpip_tag) 51 | { 52 | char *title, *msg, *alt1, *alt2, *alt3, *alt4, *alt5; 53 | size_t dpip_tag_len; 54 | int ret; 55 | 56 | _MSG("a_Dpiapi_dialog:\n"); 57 | _MSG(" dpip_tag: %s\n", dpip_tag); 58 | 59 | /* set the module scoped variable */ 60 | dialog_server = server; 61 | 62 | /* other options can be parsed the same way */ 63 | dpip_tag_len = strlen(dpip_tag); 64 | title = a_Dpip_get_attr_l(dpip_tag, dpip_tag_len, "title"); 65 | msg = a_Dpip_get_attr_l(dpip_tag, dpip_tag_len, "msg"); 66 | alt1 = a_Dpip_get_attr_l(dpip_tag, dpip_tag_len, "alt1"); 67 | alt2 = a_Dpip_get_attr_l(dpip_tag, dpip_tag_len, "alt2"); 68 | alt3 = a_Dpip_get_attr_l(dpip_tag, dpip_tag_len, "alt3"); 69 | alt4 = a_Dpip_get_attr_l(dpip_tag, dpip_tag_len, "alt4"); 70 | alt5 = a_Dpip_get_attr_l(dpip_tag, dpip_tag_len, "alt5"); 71 | 72 | ret = a_Dialog_choice(title, msg, alt1, alt2, alt3, alt4, alt5, NULL); 73 | /* As choice is modal, call the callback function directly. */ 74 | Dpiapi_dialog_answer_cb(bw, ret); 75 | 76 | dFree(alt1); dFree(alt2); dFree(alt3); dFree(alt4); dFree(alt5); 77 | dFree(title); dFree(msg); 78 | } 79 | 80 | -------------------------------------------------------------------------------- /src/bookmark.c: -------------------------------------------------------------------------------- 1 | /* 2 | * File: bookmark.c 3 | * 4 | * Copyright 2002-2007 Jorge Arellano Cid 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 | 12 | #include 13 | 14 | #include "msg.h" 15 | #include "history.h" 16 | #include "capi.h" 17 | #include "bookmark.h" /* for prototypes */ 18 | #include "../dpip/dpip.h" 19 | 20 | 21 | 22 | /* 23 | * Have a short chat with the bookmarks server, 24 | * and finally ask it to add a new bookmark. 25 | * (this is an example of dpi chat) 26 | */ 27 | void a_Bookmarks_chat_add(BrowserWindow *Bw, char *Cmd, char *answer) 28 | { 29 | static char *cmd1 = NULL, *cmd2 = NULL, *cmd3 = NULL, *cmd4 = NULL; 30 | static BrowserWindow *bw = NULL; 31 | 32 | if (!cmd1) { 33 | cmd1 = a_Dpip_build_cmd("cmd=%s msg=%s", "chat", "Hi server"); 34 | cmd2 = a_Dpip_build_cmd("cmd=%s msg=%s", "chat", 35 | "I want to set a bookmark"); 36 | cmd3 = a_Dpip_build_cmd("cmd=%s msg=%s", "chat", "Sure it is!"); 37 | } 38 | 39 | _MSG("a_Bookmarks_chat_add\n answer=%s\n", answer ? answer : "(null)"); 40 | 41 | if (Bw) 42 | bw = Bw; 43 | if (!cmd4 && Cmd) 44 | cmd4 = dStrdup(Cmd); 45 | 46 | if (!answer) { 47 | a_Capi_dpi_send_cmd(NULL, bw, cmd1, "bookmarks", 1); 48 | 49 | } else { 50 | /* we have an answer */ 51 | if (answer) { 52 | if (*answer == 'H') { 53 | /* "Hi browser" */ 54 | a_Capi_dpi_send_cmd(NULL, bw, cmd2, "bookmarks", 0); 55 | } else if (*answer == 'I') { 56 | /* "Is it worth?" */ 57 | a_Capi_dpi_send_cmd(NULL, bw, cmd3, "bookmarks", 0); 58 | } else if (*answer == 'O') { 59 | /* "OK, send it!" */ 60 | a_Capi_dpi_send_cmd(NULL, bw, cmd4, "bookmarks", 0); 61 | dFree(cmd4); 62 | cmd4 = NULL; 63 | } 64 | } 65 | } 66 | } 67 | 68 | /* 69 | * Add the new bookmark through the bookmarks server 70 | */ 71 | void a_Bookmarks_add(BrowserWindow *bw, const DilloUrl *url) 72 | { 73 | const char *title; 74 | char *cmd; 75 | 76 | dReturn_if_fail(url != NULL); 77 | 78 | /* if the page has no title, we'll use the url string */ 79 | title = a_History_get_title_by_url(url, 1); 80 | 81 | cmd = a_Dpip_build_cmd("cmd=%s url=%s title=%s", 82 | "add_bookmark", URL_STR(url), title); 83 | a_Bookmarks_chat_add(bw, cmd, NULL); 84 | dFree(cmd); 85 | } 86 | 87 | -------------------------------------------------------------------------------- /Makefile.options.MacOS: -------------------------------------------------------------------------------- 1 | # Provided by Timur Ismagilov (@bouncepaw) 2 | # Tested for MacBook Air M1 2020 running Big Sur 3 | 4 | # Original code: 5 | # https://gist.github.com/bouncepaw/0c3744497d1764abf30f6a515498ddb7 6 | 7 | # == SYSTEM BINARIES == 8 | 9 | AR ?= ar 10 | ARFLAGS ?= cru 11 | RANLIB ?= ranlib 12 | 13 | CC ?= gcc 14 | CXX ?= g++ 15 | 16 | INSTALL ?= /usr/bin/install 17 | INSTALL_SH = ../install-sh 18 | 19 | # == COMPILATION FLAGS == 20 | 21 | COMPILE = $(CC) $(INCLUDES) $(CFLAGS) 22 | LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@ 23 | 24 | CFLAGS ?= -g -O2 25 | CFLAGS += -DD_DNS_THREADED -D_REENTRANT -DHAVE_CONFIG -D_THREAD_SAFE -Wall -W -Wno-unused-parameter -Waggregate-return 26 | INCLUDES ?= -I. -I.. -I/usr/local/include -I/opt/homebrew/Cellar/fltk/1.3.8_1/include -I/opt/homebrew/include/ 27 | LDFLAGS ?= -L/opt/homebrew/opt/libiconv/lib -L/opt/homebrew/opt/openssl@3.1/lib -L/opt/homebrew/opt/jpeg/lib -L/usr/local/lib -L/opt/homebrew/Cellar/fltk/1.3.8_1/lib -lfltk -lpthread -framework Cocoa -v 28 | 29 | CXXCOMPILE = $(CXX) $(INCLUDES) $(CXXFLAGS) 30 | CXXFLAGS = $(CFLAGS) -fno-rtti -fno-exceptions 31 | 32 | LIBFLTK_CFLAGS = -I/usr/X11R6/include/freetype2 -pipe -I/usr/X11R6/include -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_THREAD_SAFE -D_REENTRANT 33 | LIBFLTK_CXXFLAGS = $(LIBFLTK_CFLAGS) -fvisibility-inlines-hidden 34 | LIBFLTK_LDFLAGS = $(LDFLAGS) -Wl,-rpath,/usr/local/lib -L/usr/X11R6/lib -lfltk -lXcursor -lXfixes -lXext -lXft -lfontconfig -lXinerama -lpthread -lm -lX11 -lXdmcp -lXau 35 | 36 | HTTPS_LDFLAGS = -L/opt/homebrew/opt/openssl@3.1/lib -lcrypto -lssl 37 | 38 | LIBPNG16_CXXFLAGS = -I/usr/local/include/libpng16 39 | 40 | DILLO_LDFLAGS = -ljpeg -L/usr/local/lib -lpng -Wl,-rpath,/usr/local/lib -L/usr/X11R6/lib -lfltk -lXcursor -lXfixes -lXext -lXft -lfontconfig -lXinerama -lpthread -lm -lX11 -lXdmcp -lXau -lz -liconv -lX11 41 | 42 | # == HTTPS CERTS == 43 | 44 | CA_CERTS_FILE ?= /etc/ssl/cert.pem 45 | CA_CERTS_DIR ?= /etc/ssl/ 46 | 47 | # == EXTERNAL TOOLS == 48 | 49 | DOWNLOADER_TOOL = wget 50 | DOWNLOADER_USER_AGENT_ARG = -U 51 | DOWNLOADER_CONTINUE_ARG = -c 52 | DOWNLOADER_LOAD_COOKIES_ARG = --load_cookies 53 | DOWNLOADER_OUTPUT_FILENAME_ARG = -O 54 | 55 | ZIP_USE_7Z = 0 56 | FTP_USE_WGET = 1 57 | 58 | # == INSTALL PATHS == 59 | 60 | BINNAME = dillo-plus 61 | 62 | PREFIX ?= /usr/local 63 | LIBDIR = $(PREFIX)/lib/ 64 | 65 | DILLO_BINDIR = $(PREFIX)/bin/ 66 | DILLO_LIBDIR = $(PREFIX)/lib/$(BINNAME)/ 67 | DILLO_ETCDIR = $(PREFIX)/etc/$(BINNAME)/ 68 | 69 | DPIDRC_SYS = $(DILLO_ETCDIR)/dpidrc 70 | 71 | DOC_PATH = $(PREFIX)/share/doc/$(BINNAME) 72 | MAN_PATH = $(PREFIX)/share/man/man1 73 | 74 | APP_PATH = $(PREFIX)/share/applications 75 | ICON_PATH = $(PREFIX)/share/icons 76 | 77 | -------------------------------------------------------------------------------- /dw/fltkviewport.hh: -------------------------------------------------------------------------------- 1 | #ifndef __DW_FLTKVIEWPORT_HH__ 2 | #define __DW_FLTKVIEWPORT_HH__ 3 | 4 | #include 5 | #include 6 | 7 | #include "core.hh" 8 | #include "fltkcore.hh" 9 | #include "fltkviewbase.hh" 10 | 11 | namespace dw { 12 | namespace fltk { 13 | 14 | class FltkViewport: public FltkWidgetView 15 | { 16 | public: 17 | enum GadgetOrientation { GADGET_VERTICAL, GADGET_HORIZONTAL }; 18 | 19 | private: 20 | enum { SCROLLBAR_THICKNESS = 15 }; 21 | 22 | int scrollX, scrollY; 23 | int scrollDX, scrollDY; 24 | int hasDragScroll, dragScrolling, dragX, dragY; 25 | int horScrolling, verScrolling; 26 | 27 | Fl_Scrollbar *vscrollbar, *hscrollbar; 28 | 29 | GadgetOrientation gadgetOrientation[4]; 30 | lout::container::typed::List > 31 | *gadgets; 32 | 33 | void adjustScrollbarsAndGadgetsAllocation (); 34 | void adjustScrollbarValues (); 35 | void hscrollbarChanged (); 36 | void vscrollbarChanged (); 37 | void positionChanged (); 38 | 39 | static void hscrollbarCallback (Fl_Widget *hscrollbar, void *viewportPtr); 40 | static void vscrollbarCallback (Fl_Widget *vscrollbar, void *viewportPtr); 41 | 42 | void selectionScroll(); 43 | static void selectionScroll(void *vport); 44 | 45 | void updateCanvasWidgets (int oldScrollX, int oldScrollY); 46 | static void draw_area (void *data, int x, int y, int w, int h); 47 | 48 | protected: 49 | int translateViewXToCanvasX (int x); 50 | int translateViewYToCanvasY (int y); 51 | int translateCanvasXToViewX (int x); 52 | int translateCanvasYToViewY (int y); 53 | 54 | public: 55 | FltkViewport (int x, int y, int w, int h, const char *label = 0); 56 | ~FltkViewport (); 57 | 58 | void resize(int x, int y, int w, int h); 59 | void draw (); 60 | int handle (int event); 61 | 62 | void setCanvasSize (int width, int ascent, int descent); 63 | 64 | bool usesViewport (); 65 | int getHScrollbarThickness (); 66 | int getVScrollbarThickness (); 67 | void scroll(int dx, int dy); 68 | void scroll(dw::core::ScrollCommand cmd); 69 | void scrollTo (int x, int y); 70 | void setViewportSize (int width, int height, 71 | int hScrollbarThickness, int vScrollbarThickness); 72 | void setScrollStep(int step); 73 | 74 | void setGadgetOrientation (bool hscrollbarVisible, bool vscrollbarVisible, 75 | GadgetOrientation gadgetOrientation); 76 | void setDragScroll (bool enable) { hasDragScroll = enable ? 1 : 0; } 77 | void addGadget (Fl_Widget *gadget); 78 | }; 79 | 80 | } // namespace fltk 81 | } // namespace dw 82 | 83 | #endif // __DW_FLTKVIEWPORT_HH__ 84 | 85 | -------------------------------------------------------------------------------- /src/doctree.hh: -------------------------------------------------------------------------------- 1 | #ifndef __DOCTREE_HH__ 2 | #define __DOCTREE_HH__ 3 | 4 | #include "lout/misc.hh" 5 | 6 | class DoctreeNode { 7 | public: 8 | DoctreeNode *parent; 9 | DoctreeNode *sibling; 10 | DoctreeNode *lastChild; 11 | int num; // unique ascending id 12 | int element; 13 | lout::misc::SimpleVector *klass; 14 | const char *pseudo; 15 | const char *id; 16 | 17 | DoctreeNode () { 18 | parent = NULL; 19 | sibling = NULL; 20 | lastChild = NULL; 21 | klass = NULL; 22 | pseudo = NULL; 23 | id = NULL; 24 | element = 0; 25 | }; 26 | 27 | ~DoctreeNode () { 28 | dFree ((void*) id); 29 | while (lastChild) { 30 | DoctreeNode *n = lastChild; 31 | lastChild = lastChild->sibling; 32 | delete n; 33 | } 34 | if (klass) { 35 | for (int i = 0; i < klass->size (); i++) 36 | dFree (klass->get(i)); 37 | delete klass; 38 | } 39 | } 40 | }; 41 | 42 | /** 43 | * \brief HTML document tree interface. 44 | * 45 | * The Doctree class defines the interface to the parsed HTML document tree 46 | * as it is used for CSS selector matching. 47 | */ 48 | class Doctree { 49 | private: 50 | DoctreeNode *topNode; 51 | DoctreeNode *rootNode; 52 | int num; 53 | 54 | public: 55 | Doctree () { 56 | rootNode = new DoctreeNode; 57 | topNode = rootNode; 58 | num = 0; 59 | }; 60 | 61 | ~Doctree () { 62 | delete rootNode; 63 | }; 64 | 65 | DoctreeNode *push () { 66 | DoctreeNode *dn = new DoctreeNode (); 67 | dn->parent = topNode; 68 | dn->sibling = dn->parent->lastChild; 69 | dn->parent->lastChild = dn; 70 | dn->num = num++; 71 | topNode = dn; 72 | return dn; 73 | }; 74 | 75 | void pop () { 76 | assert (topNode != rootNode); // never pop the root node 77 | topNode = topNode->parent; 78 | }; 79 | 80 | inline DoctreeNode *top () { 81 | if (topNode != rootNode) 82 | return topNode; 83 | else 84 | return NULL; 85 | }; 86 | 87 | inline DoctreeNode *parent (const DoctreeNode *node) { 88 | if (node->parent != rootNode) 89 | return node->parent; 90 | else 91 | return NULL; 92 | }; 93 | 94 | inline DoctreeNode *sibling (const DoctreeNode *node) { 95 | return node->sibling; 96 | }; 97 | }; 98 | 99 | #endif 100 | -------------------------------------------------------------------------------- /dw/stackingcontextmgr.hh: -------------------------------------------------------------------------------- 1 | #ifndef __DW_STACKINGCONTEXTMGR_HH__ 2 | #define __DW_STACKINGCONTEXTMGR_HH__ 3 | 4 | #ifndef __INCLUDED_FROM_DW_CORE_HH__ 5 | # error Do not include this file directly, use "core.hh" instead. 6 | #endif 7 | 8 | #include "../lout/container.hh" 9 | 10 | #include 11 | 12 | namespace dw { 13 | 14 | namespace core { 15 | 16 | /** 17 | * \brief See \ref dw-stacking-context. 18 | */ 19 | class StackingContextMgr 20 | { 21 | private: 22 | Widget *widget; 23 | lout::container::typed::Vector *childSCWidgets; 24 | int *zIndices, numZIndices; 25 | 26 | int findZIndex (int zIndex, bool mustExist); 27 | void draw (View *view, Rectangle *area, int startZIndex, int endZIndex, 28 | DrawingContext *context); 29 | Widget *getWidgetAtPoint (int x, int y, 30 | core::GettingWidgetAtPointContext *context, 31 | int startZIndex, int endZIndex); 32 | 33 | public: 34 | StackingContextMgr (Widget *widget); 35 | ~StackingContextMgr (); 36 | 37 | inline static bool isEstablishingStackingContext (Widget *widget) { 38 | return IMPL_POS && 39 | widget->getStyle()->position != style::POSITION_STATIC && 40 | widget->getStyle()->zIndex != style::Z_INDEX_AUTO; 41 | } 42 | 43 | inline static bool handledByStackingContextMgr (Widget *widget) { 44 | // Each widget establishing a stacking context is child of another 45 | // stacking context, so drawn by StackingContextMgr::drawTop or 46 | // StackingContextMgr::drawBottom etc. 47 | return widget->getParent () != NULL 48 | && isEstablishingStackingContext (widget); 49 | } 50 | 51 | void addChildSCWidget (Widget *widget); 52 | 53 | inline int getNumZIndices () { return numZIndices; } 54 | inline int getNumChildSCWidgets () { return childSCWidgets->size (); } 55 | 56 | inline void drawBottom (View *view, Rectangle *area, DrawingContext *context) 57 | { draw (view, area, INT_MIN, -1, context); } 58 | void drawTop (View *view, Rectangle *area, DrawingContext *context) 59 | { draw (view, area, 0, INT_MAX, context); } 60 | 61 | inline Widget *getTopWidgetAtPoint (int x, int y, 62 | core::GettingWidgetAtPointContext 63 | *context) 64 | { return getWidgetAtPoint (x, y, context, 0, INT_MAX); } 65 | 66 | inline Widget *getBottomWidgetAtPoint (int x, int y, 67 | core::GettingWidgetAtPointContext 68 | *context) 69 | { return getWidgetAtPoint (x, y, context, INT_MIN, -1); } 70 | }; 71 | 72 | } // namespace core 73 | 74 | } // namespace dw 75 | 76 | #endif // __DW_STACKINGCONTEXTMGR_HH__ 77 | -------------------------------------------------------------------------------- /dw/fltkflatview.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Dillo Widget 3 | * 4 | * Copyright 2005-2007 Sebastian Geerken 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 . 18 | */ 19 | 20 | 21 | 22 | #include "fltkflatview.hh" 23 | #include "../lout/debug.hh" 24 | 25 | #include 26 | 27 | using namespace lout::container::typed; 28 | 29 | namespace dw { 30 | namespace fltk { 31 | 32 | FltkFlatView::FltkFlatView (int x, int y, int w, int h, const char *label): 33 | FltkWidgetView (x, y, w, h, label) 34 | { 35 | DBG_OBJ_CREATE ("dw::fltk::FltkFlatView"); 36 | } 37 | 38 | FltkFlatView::~FltkFlatView () 39 | { 40 | } 41 | 42 | void FltkFlatView::setCanvasSize (int width, int ascent, int descent) 43 | { 44 | /** 45 | * \bug It has to be clarified, who is responsible for setting the 46 | * FLTK widget size. In the only used context (complex buttons), 47 | * it is done elsewhere. 48 | */ 49 | 50 | #if 0 51 | FltkWidgetView::setCanvasSize (width, ascent, descent); 52 | 53 | w (width); 54 | h (ascent + descent); 55 | #endif 56 | } 57 | 58 | bool FltkFlatView::usesViewport () 59 | { 60 | return false; 61 | } 62 | 63 | int FltkFlatView::getHScrollbarThickness () 64 | { 65 | return 0; 66 | } 67 | 68 | int FltkFlatView::getVScrollbarThickness () 69 | { 70 | return 0; 71 | } 72 | 73 | void FltkFlatView::scrollTo (int x, int y) 74 | { 75 | } 76 | 77 | void FltkFlatView::setViewportSize (int width, int height, 78 | int hScrollbarThickness, 79 | int vScrollbarThickness) 80 | { 81 | } 82 | 83 | int FltkFlatView::translateViewXToCanvasX (int X) 84 | { 85 | return X - x (); 86 | } 87 | 88 | int FltkFlatView::translateViewYToCanvasY (int Y) 89 | { 90 | return Y - y (); 91 | } 92 | 93 | int FltkFlatView::translateCanvasXToViewX (int X) 94 | { 95 | return X + x (); 96 | } 97 | 98 | int FltkFlatView::translateCanvasYToViewY (int Y) 99 | { 100 | return Y + y (); 101 | } 102 | 103 | 104 | } // namespace fltk 105 | } // namespace dw 106 | -------------------------------------------------------------------------------- /dw/fltkpreview.hh: -------------------------------------------------------------------------------- 1 | #ifndef __FlTKPREVIEW_HH__ 2 | #define __FlTKPREVIEW_HH__ 3 | 4 | #include 5 | #include 6 | #include "fltkviewbase.hh" 7 | 8 | namespace dw { 9 | namespace fltk { 10 | 11 | class FltkPreview: public FltkViewBase 12 | { 13 | friend class FltkPreviewWindow; 14 | 15 | private: 16 | int scrollX, scrollY, scrollWidth, scrollHeight; 17 | 18 | protected: 19 | int translateViewXToCanvasX (int x); 20 | int translateViewYToCanvasY (int y); 21 | int translateCanvasXToViewX (int x); 22 | int translateCanvasYToViewY (int y); 23 | 24 | public: 25 | FltkPreview (int x, int y, int w, int h, dw::core::Layout *layout, 26 | const char *label = 0); 27 | ~FltkPreview (); 28 | 29 | int handle (int event); 30 | 31 | void setCanvasSize (int width, int ascent, int descent); 32 | 33 | bool usesViewport (); 34 | int getHScrollbarThickness (); 35 | int getVScrollbarThickness (); 36 | void scrollTo (int x, int y); 37 | void scroll (dw::core::ScrollCommand cmd); 38 | void setViewportSize (int width, int height, 39 | int hScrollbarThickness, int vScrollbarThickness); 40 | 41 | void drawText (core::style::Font *font, 42 | core::style::Color *color, 43 | core::style::Color::Shading shading, 44 | int x, int y, const char *text, int len); 45 | void drawSimpleWrappedText (core::style::Font *font, 46 | core::style::Color *color, 47 | core::style::Color::Shading shading, 48 | int x, int y, int w, int h, 49 | const char *text); 50 | void drawImage (core::Imgbuf *imgbuf, int xRoot, int yRoot, 51 | int x, int y, int width, int height); 52 | 53 | bool usesFltkWidgets (); 54 | void drawFltkWidget (Fl_Widget *widget, core::Rectangle *area); 55 | }; 56 | 57 | 58 | class FltkPreviewWindow: public Fl_Menu_Window 59 | { 60 | private: 61 | enum { BORDER_WIDTH = 2 }; 62 | 63 | FltkPreview *preview; 64 | int posX, posY; 65 | 66 | public: 67 | FltkPreviewWindow (dw::core::Layout *layout); 68 | ~FltkPreviewWindow (); 69 | 70 | void reallocate (); 71 | 72 | void showWindow (); 73 | void hideWindow (); 74 | 75 | void scrollTo (int mouseX, int mouseY); 76 | }; 77 | 78 | 79 | class FltkPreviewButton: public Fl_Button 80 | { 81 | private: 82 | FltkPreviewWindow *window; 83 | 84 | public: 85 | FltkPreviewButton (int x, int y, int w, int h, 86 | dw::core::Layout *layout, const char *label = 0); 87 | ~FltkPreviewButton (); 88 | 89 | int handle (int event); 90 | }; 91 | 92 | } // namespace fltk 93 | } // namespace dw 94 | 95 | #endif // __FlTKPREVIEW_HH__ 96 | -------------------------------------------------------------------------------- /lout/debug.hh: -------------------------------------------------------------------------------- 1 | #ifndef __LOUT_DEBUG_H__ 2 | #define __LOUT_DEBUG_H__ 3 | 4 | /* 5 | * Simple debug messages. Add: 6 | * 7 | * #define DEBUG_LEVEL 8 | * #include "debug.h" 9 | * 10 | * to the file you are working on, or let DEBUG_LEVEL undefined to 11 | * disable all messages. A higher level denotes a greater importance 12 | * of the message. 13 | */ 14 | 15 | #include 16 | 17 | #define D_STMT_START do 18 | #define D_STMT_END while (0) 19 | 20 | #define D_STMT_NOP D_STMT_START { } D_STMT_END 21 | 22 | # ifdef DEBUG_LEVEL 23 | # define DEBUG_MSG(level, ...) \ 24 | D_STMT_START { \ 25 | if (DEBUG_LEVEL && (level) >= DEBUG_LEVEL) \ 26 | printf(__VA_ARGS__); \ 27 | } D_STMT_END 28 | # else 29 | # define DEBUG_MSG(level, ...) 30 | # endif /* DEBUG_LEVEL */ 31 | 32 | #include "debug_rtfl.hh" 33 | 34 | /* Some extensions for RTFL dealing with static stuff. */ 35 | 36 | #ifdef DBG_RTFL 37 | 38 | #define DBG_OBJ_MSG_S(aspect, prio, msg) \ 39 | RTFL_OBJ_PRINT ("msg", "s:s:d:s", "", aspect, prio, msg) 40 | 41 | #define DBG_OBJ_MSGF_S(aspect, prio, fmt, ...) \ 42 | STMT_START { \ 43 | char msg[256]; \ 44 | snprintf (msg, sizeof (msg), fmt, __VA_ARGS__); \ 45 | RTFL_OBJ_PRINT ("msg", "s:s:d:s", "", aspect, prio, msg) \ 46 | } STMT_END 47 | 48 | #define DBG_OBJ_ENTER0_S(aspect, prio, funname) \ 49 | RTFL_OBJ_PRINT ("enter", "s:s:d:s:", "", aspect, prio, funname); 50 | 51 | #define DBG_OBJ_ENTER_S(aspect, prio, funname, fmt, ...) \ 52 | STMT_START { \ 53 | char args[256]; \ 54 | snprintf (args, sizeof (args), fmt, __VA_ARGS__); \ 55 | RTFL_OBJ_PRINT ("enter", "s:s:d:s:s", "", aspect, prio, funname, \ 56 | args); \ 57 | } STMT_END 58 | 59 | #define DBG_OBJ_LEAVE_S() \ 60 | RTFL_OBJ_PRINT ("leave", "s", ""); 61 | 62 | #define DBG_OBJ_LEAVE_VAL_S(fmt, ...) \ 63 | STMT_START { \ 64 | char vals[256]; \ 65 | snprintf (vals, sizeof (vals), fmt, __VA_ARGS__); \ 66 | RTFL_OBJ_PRINT ("leave", "s:s", "", vals); \ 67 | } STMT_END 68 | 69 | #else /* DBG_RTFL */ 70 | 71 | #define STMT_NOP do { } while (0) 72 | 73 | #define DBG_IF_RTFL if(0) 74 | 75 | #define DBG_OBJ_MSG_S(aspect, prio, msg) STMT_NOP 76 | #define DBG_OBJ_MSGF_S(aspect, prio, fmt, ...) STMT_NOP 77 | #define DBG_OBJ_ENTER0_S(aspect, prio, funname) STMT_NOP 78 | #define DBG_OBJ_ENTER_S(aspect, prio, funname, fmt, ...) STMT_NOP 79 | #define DBG_OBJ_LEAVE_S() STMT_NOP 80 | #define DBG_OBJ_LEAVE_VAL_S(fmt, ...) STMT_NOP 81 | 82 | #endif /* DBG_RTFL */ 83 | 84 | #endif /* __LOUT_DEBUG_H__ */ 85 | 86 | 87 | -------------------------------------------------------------------------------- /dw/table_iterator.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Dillo Widget 3 | * 4 | * Copyright 2005-2007, 2014 Sebastian Geerken 5 | * 6 | * (This file was originally part of textblock.cc.) 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | 23 | #include "table.hh" 24 | 25 | using namespace lout; 26 | 27 | namespace dw { 28 | 29 | Table::TableIterator::TableIterator (Table *table, 30 | core::Content::Type mask, bool atEnd): 31 | OOFAwareWidgetIterator (table, mask, atEnd, table->children->size ()) 32 | { 33 | } 34 | 35 | object::Object *Table::TableIterator::clone() 36 | { 37 | TableIterator *tIt = 38 | new TableIterator ((Table*)getWidget(), getMask(), false); 39 | cloneValues (tIt); 40 | return tIt; 41 | } 42 | 43 | 44 | void Table::TableIterator::highlight (int start, int end, 45 | core::HighlightLayer layer) 46 | { 47 | if (inFlow ()) { 48 | /** todo Needs this an implementation? */ 49 | } else 50 | highlightOOF (start, end, layer); 51 | } 52 | 53 | void Table::TableIterator::unhighlight (int direction, 54 | core::HighlightLayer layer) 55 | { 56 | if (inFlow ()) { 57 | // ??? 58 | } else 59 | unhighlightOOF (direction, layer); 60 | } 61 | 62 | void Table::TableIterator::getAllocation (int start, int end, 63 | core::Allocation *allocation) 64 | { 65 | if (inFlow ()) { 66 | /** \bug Not implemented. */ 67 | } else 68 | getAllocationOOF (start, end, allocation); 69 | } 70 | 71 | int Table::TableIterator::numContentsInFlow () 72 | { 73 | return ((Table*)getWidget())->children->size (); 74 | } 75 | 76 | void Table::TableIterator::getContentInFlow (int index, 77 | core::Content *content) 78 | { 79 | Table *table = (Table*)getWidget(); 80 | 81 | if (table->children->get(index) != NULL && 82 | table->children->get(index)->type == Child::CELL) { 83 | content->type = core::Content::WIDGET_IN_FLOW; 84 | content->widget = table->children->get(index)->cell.widget; 85 | } else 86 | content->type = core::Content::INVALID; 87 | } 88 | 89 | } // namespace dw 90 | --------------------------------------------------------------------------------