.
-EOF
- exit $?
- ;;
- -v | --v*)
- echo "depcomp $scriptversion"
- exit $?
- ;;
-esac
-
-if test -z "$depmode" || test -z "$source" || test -z "$object"; then
- echo "depcomp: Variables source, object and depmode must be set" 1>&2
- exit 1
-fi
-
-# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
-depfile=${depfile-`echo "$object" |
- sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
-tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
-
-rm -f "$tmpdepfile"
-
-# Some modes work just like other modes, but use different flags. We
-# parameterize here, but still list the modes in the big case below,
-# to make depend.m4 easier to write. Note that we *cannot* use a case
-# here, because this file can only contain one case statement.
-if test "$depmode" = hp; then
- # HP compiler uses -M and no extra arg.
- gccflag=-M
- depmode=gcc
-fi
-
-if test "$depmode" = dashXmstdout; then
- # This is just like dashmstdout with a different argument.
- dashmflag=-xM
- depmode=dashmstdout
-fi
-
-case "$depmode" in
-gcc3)
-## gcc 3 implements dependency tracking that does exactly what
-## we want. Yay! Note: for some reason libtool 1.4 doesn't like
-## it if -MD -MP comes after the -MF stuff. Hmm.
- "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
- stat=$?
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile"
- exit $stat
- fi
- mv "$tmpdepfile" "$depfile"
- ;;
-
-gcc)
-## There are various ways to get dependency output from gcc. Here's
-## why we pick this rather obscure method:
-## - Don't want to use -MD because we'd like the dependencies to end
-## up in a subdir. Having to rename by hand is ugly.
-## (We might end up doing this anyway to support other compilers.)
-## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
-## -MM, not -M (despite what the docs say).
-## - Using -M directly means running the compiler twice (even worse
-## than renaming).
- if test -z "$gccflag"; then
- gccflag=-MD,
- fi
- "$@" -Wp,"$gccflag$tmpdepfile"
- stat=$?
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile"
- exit $stat
- fi
- rm -f "$depfile"
- echo "$object : \\" > "$depfile"
- alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
-## The second -e expression handles DOS-style file names with drive letters.
- sed -e 's/^[^:]*: / /' \
- -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
-## This next piece of magic avoids the `deleted header file' problem.
-## The problem is that when a header file which appears in a .P file
-## is deleted, the dependency causes make to die (because there is
-## typically no way to rebuild the header). We avoid this by adding
-## dummy dependencies for each header file. Too bad gcc doesn't do
-## this for us directly.
- tr ' ' '
-' < "$tmpdepfile" |
-## Some versions of gcc put a space before the `:'. On the theory
-## that the space means something, we add a space to the output as
-## well.
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly. Breaking it into two sed invocations is a workaround.
- sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-hp)
- # This case exists only to let depend.m4 do its work. It works by
- # looking at the text of this script. This case will never be run,
- # since it is checked for above.
- exit 1
- ;;
-
-sgi)
- if test "$libtool" = yes; then
- "$@" "-Wp,-MDupdate,$tmpdepfile"
- else
- "$@" -MDupdate "$tmpdepfile"
- fi
- stat=$?
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile"
- exit $stat
- fi
- rm -f "$depfile"
-
- if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
- echo "$object : \\" > "$depfile"
-
- # Clip off the initial element (the dependent). Don't try to be
- # clever and replace this with sed code, as IRIX sed won't handle
- # lines with more than a fixed number of characters (4096 in
- # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
- # the IRIX cc adds comments like `#:fec' to the end of the
- # dependency line.
- tr ' ' '
-' < "$tmpdepfile" \
- | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
- tr '
-' ' ' >> $depfile
- echo >> $depfile
-
- # The second pass generates a dummy entry for each header file.
- tr ' ' '
-' < "$tmpdepfile" \
- | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
- >> $depfile
- else
- # The sourcefile does not contain any dependencies, so just
- # store a dummy comment line, to avoid errors with the Makefile
- # "include basename.Plo" scheme.
- echo "#dummy" > "$depfile"
- fi
- rm -f "$tmpdepfile"
- ;;
-
-aix)
- # The C for AIX Compiler uses -M and outputs the dependencies
- # in a .u file. In older versions, this file always lives in the
- # current directory. Also, the AIX compiler puts `$object:' at the
- # start of each line; $object doesn't have directory information.
- # Version 6 uses the directory in both cases.
- stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
- tmpdepfile="$stripped.u"
- if test "$libtool" = yes; then
- "$@" -Wc,-M
- else
- "$@" -M
- fi
- stat=$?
-
- if test -f "$tmpdepfile"; then :
- else
- stripped=`echo "$stripped" | sed 's,^.*/,,'`
- tmpdepfile="$stripped.u"
- fi
-
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile"
- exit $stat
- fi
-
- if test -f "$tmpdepfile"; then
- outname="$stripped.o"
- # Each line is of the form `foo.o: dependent.h'.
- # Do two passes, one to just change these to
- # `$object: dependent.h' and one to simply `dependent.h:'.
- sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
- sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
- else
- # The sourcefile does not contain any dependencies, so just
- # store a dummy comment line, to avoid errors with the Makefile
- # "include basename.Plo" scheme.
- echo "#dummy" > "$depfile"
- fi
- rm -f "$tmpdepfile"
- ;;
-
-icc)
- # Intel's C compiler understands `-MD -MF file'. However on
- # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
- # ICC 7.0 will fill foo.d with something like
- # foo.o: sub/foo.c
- # foo.o: sub/foo.h
- # which is wrong. We want:
- # sub/foo.o: sub/foo.c
- # sub/foo.o: sub/foo.h
- # sub/foo.c:
- # sub/foo.h:
- # ICC 7.1 will output
- # foo.o: sub/foo.c sub/foo.h
- # and will wrap long lines using \ :
- # foo.o: sub/foo.c ... \
- # sub/foo.h ... \
- # ...
-
- "$@" -MD -MF "$tmpdepfile"
- stat=$?
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile"
- exit $stat
- fi
- rm -f "$depfile"
- # Each line is of the form `foo.o: dependent.h',
- # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
- # Do two passes, one to just change these to
- # `$object: dependent.h' and one to simply `dependent.h:'.
- sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
- # Some versions of the HPUX 10.20 sed can't process this invocation
- # correctly. Breaking it into two sed invocations is a workaround.
- sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
- sed -e 's/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-tru64)
- # The Tru64 compiler uses -MD to generate dependencies as a side
- # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
- # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
- # dependencies in `foo.d' instead, so we check for that too.
- # Subdirectories are respected.
- dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
- test "x$dir" = "x$object" && dir=
- base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
-
- if test "$libtool" = yes; then
- # With Tru64 cc, shared objects can also be used to make a
- # static library. This mecanism is used in libtool 1.4 series to
- # handle both shared and static libraries in a single compilation.
- # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
- #
- # With libtool 1.5 this exception was removed, and libtool now
- # generates 2 separate objects for the 2 libraries. These two
- # compilations output dependencies in in $dir.libs/$base.o.d and
- # in $dir$base.o.d. We have to check for both files, because
- # one of the two compilations can be disabled. We should prefer
- # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
- # automatically cleaned when .libs/ is deleted, while ignoring
- # the former would cause a distcleancheck panic.
- tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
- tmpdepfile2=$dir$base.o.d # libtool 1.5
- tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
- tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
- "$@" -Wc,-MD
- else
- tmpdepfile1=$dir$base.o.d
- tmpdepfile2=$dir$base.d
- tmpdepfile3=$dir$base.d
- tmpdepfile4=$dir$base.d
- "$@" -MD
- fi
-
- stat=$?
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
- exit $stat
- fi
-
- for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
- do
- test -f "$tmpdepfile" && break
- done
- if test -f "$tmpdepfile"; then
- sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
- # That's a tab and a space in the [].
- sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
- else
- echo "#dummy" > "$depfile"
- fi
- rm -f "$tmpdepfile"
- ;;
-
-#nosideeffect)
- # This comment above is used by automake to tell side-effect
- # dependency tracking mechanisms from slower ones.
-
-dashmstdout)
- # Important note: in order to support this mode, a compiler *must*
- # always write the preprocessed file to stdout, regardless of -o.
- "$@" || exit $?
-
- # Remove the call to Libtool.
- if test "$libtool" = yes; then
- while test $1 != '--mode=compile'; do
- shift
- done
- shift
- fi
-
- # Remove `-o $object'.
- IFS=" "
- for arg
- do
- case $arg in
- -o)
- shift
- ;;
- $object)
- shift
- ;;
- *)
- set fnord "$@" "$arg"
- shift # fnord
- shift # $arg
- ;;
- esac
- done
-
- test -z "$dashmflag" && dashmflag=-M
- # Require at least two characters before searching for `:'
- # in the target name. This is to cope with DOS-style filenames:
- # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
- "$@" $dashmflag |
- sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
- rm -f "$depfile"
- cat < "$tmpdepfile" > "$depfile"
- tr ' ' '
-' < "$tmpdepfile" | \
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly. Breaking it into two sed invocations is a workaround.
- sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-dashXmstdout)
- # This case only exists to satisfy depend.m4. It is never actually
- # run, as this mode is specially recognized in the preamble.
- exit 1
- ;;
-
-makedepend)
- "$@" || exit $?
- # Remove any Libtool call
- if test "$libtool" = yes; then
- while test $1 != '--mode=compile'; do
- shift
- done
- shift
- fi
- # X makedepend
- shift
- cleared=no
- for arg in "$@"; do
- case $cleared in
- no)
- set ""; shift
- cleared=yes ;;
- esac
- case "$arg" in
- -D*|-I*)
- set fnord "$@" "$arg"; shift ;;
- # Strip any option that makedepend may not understand. Remove
- # the object too, otherwise makedepend will parse it as a source file.
- -*|$object)
- ;;
- *)
- set fnord "$@" "$arg"; shift ;;
- esac
- done
- obj_suffix="`echo $object | sed 's/^.*\././'`"
- touch "$tmpdepfile"
- ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
- rm -f "$depfile"
- cat < "$tmpdepfile" > "$depfile"
- sed '1,2d' "$tmpdepfile" | tr ' ' '
-' | \
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly. Breaking it into two sed invocations is a workaround.
- sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile" "$tmpdepfile".bak
- ;;
-
-cpp)
- # Important note: in order to support this mode, a compiler *must*
- # always write the preprocessed file to stdout.
- "$@" || exit $?
-
- # Remove the call to Libtool.
- if test "$libtool" = yes; then
- while test $1 != '--mode=compile'; do
- shift
- done
- shift
- fi
-
- # Remove `-o $object'.
- IFS=" "
- for arg
- do
- case $arg in
- -o)
- shift
- ;;
- $object)
- shift
- ;;
- *)
- set fnord "$@" "$arg"
- shift # fnord
- shift # $arg
- ;;
- esac
- done
-
- "$@" -E |
- sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
- sed '$ s: \\$::' > "$tmpdepfile"
- rm -f "$depfile"
- echo "$object : \\" > "$depfile"
- cat < "$tmpdepfile" >> "$depfile"
- sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-msvisualcpp)
- # Important note: in order to support this mode, a compiler *must*
- # always write the preprocessed file to stdout, regardless of -o,
- # because we must use -o when running libtool.
- "$@" || exit $?
- IFS=" "
- for arg
- do
- case "$arg" in
- "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
- set fnord "$@"
- shift
- shift
- ;;
- *)
- set fnord "$@" "$arg"
- shift
- shift
- ;;
- esac
- done
- "$@" -E |
- sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
- rm -f "$depfile"
- echo "$object : \\" > "$depfile"
- . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
- echo " " >> "$depfile"
- . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-none)
- exec "$@"
- ;;
-
-*)
- echo "Unknown depmode $depmode" 1>&2
- exit 1
- ;;
-esac
-
-exit 0
-
-# Local Variables:
-# mode: shell-script
-# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
-# End:
diff --git a/dillorc b/dillorc
index 343c1f6..b990ea5 100644
--- a/dillorc
+++ b/dillorc
@@ -1,58 +1,98 @@
# dillorc
# Sample dillo initialization file.
-# Copy this file to ~/.dillo/dillorc and edit to your taste.
+#
# Lines that start with a '#' are comments.
-
+# "#option=..." shows the built-in default.
+# "# option=..." is an additional example.
+# "option=..." overrides the built-in value.
#-------------------------------------------------------------------------
# FIRST SECTION :)
#-------------------------------------------------------------------------
# Set the desired initial browser size
-geometry=640x550
-
-# Dicache is where the Decompressed Images are cached (not the original ones).
-# If you have a lot of memory and a slow CPU, use YES, otherwise use NO
-use_dicache=NO
-
+# geometry=650x545+0+20
+#geometry=780x580
+
+# Change this if you want to have text-only browsing from the start.
+# (While browsing, this can be changed from the tools/settings menu.)
+#load_images=YES
+
+# Change this if you want to disable loading of CSS stylesheets initially.
+# (While browsing, this can be changed from the tools/settings menu.)
+#load_stylesheets=YES
+
+# Change this if you want to disable parsing of embedded CSS initially.
+# (While browsing, this can be changed from the tools/settings menu.)
+#parse_embedded_css=YES
+
+# How should Dillo restrict automatic requests (e.g., redirections,
+# pages containing images or stylesheets)?
+# allow_all
+# same_domain : Permit www.example.org to load an image from img.example.org,
+# but not from the unrelated ad.doubleclick.net.
+#filter_auto_requests=same_domain
+
+# Change the buffering scheme for drawing
+# 0 no double buffering - useful for debugging
+# 1 light buffering using a single back buffer for all windows
+# 2 full fltk-based double buffering for all windows
+#buffered_drawing=1
+
+# Set your default directory for download/save operations
+#save_dir=/tmp
#-------------------------------------------------------------------------
# RENDERING SECTION
#-------------------------------------------------------------------------
-# Fontname for variable width rendering (most of the text).
-# - some fonts may slow down rendering, some others not!
-# - try to tune a fontname/font_factor combination.
-# Ex. {helvetica, lucida, times, "new century schoolbook", utopia, ...}
-vw_fontname=helvetica
-
-# Fontname for fixed width rendering (mainly quoted text)
-fw_fontname=courier
-
-# All fontsizes are scaled by this value (default is 1.0)
-#font_factor=1.2
-
-# If you prefer oblique over italic fonts, uncoment next line
-#use_oblique=YES
-
-# Show tooltip popup for images?
-# Note: We use the "title" attribute and not "alt".
-# More info at: http://bugzilla.mozilla.org/show_bug.cgi?id=25537
-show_tooltip=YES
-
-# Set this to YES, if you want to limit the word wrap width to the vieport
+# Default fonts:
+#
+# If FLTK has been configured with Xft enabled (the default), you can use
+# scalable fonts such as DejaVu or Liberation (try running
+# "fc-list : family | cut -d ',' -f 2 | sort").
+#font_serif="DejaVu Serif"
+#font_sans_serif="DejaVu Sans"
+#font_cursive="URW Chancery L"
+#font_fantasy="DejaVu Sans"
+#font_monospace="DejaVu Sans Mono"
+#
+# Otherwise, use bitmapped fonts like the following (for a list, try running
+# "xlsfonts -fn *-iso10646-1 | grep -v -e -0-0 | cut -d - -f 3 | sort | uniq").
+# font_serif="times"
+# font_sans_serif="helvetica"
+# font_cursive="helvetica"
+# font_fantasy="helvetica"
+# font_monospace="courier"
+
+# All font sizes are scaled by this value
+# font_factor=1.5
+#font_factor=1.0
+
+# Maximum font size in pixels
+#font_max_size=100
+
+# Minimum font size in pixels
+#font_min_size=6
+
+# Show tooltip popups for UI and for HTML title attributes
+#show_tooltip=YES
+
+# Set this to YES if you want to limit the word wrap width to the viewport
# width (may be useful for iPAQ)
-limit_text_width=NO
+# *** NOT HOOKED UP YET ***
+#
+#limit_text_width=NO
#-------------------------------------------------------------------------
# PARSING SECTION
#-------------------------------------------------------------------------
-# If you prefer more accurate HTML bug diagnose, over better rendering
+# If you prefer more accurate HTML bug diagnosis over better rendering
# (page authors and webmasters) set the following to "NO".
#
-w3c_plus_heuristics=YES
+#w3c_plus_heuristics=YES
#-------------------------------------------------------------------------
@@ -60,59 +100,89 @@
#-------------------------------------------------------------------------
# Set the start page.
-# Uncomment if you want to override the default start page.
-#start_page="file:/home/user/custom.html"
+# start_page="about:blank"
+# start_page="http://www.dillo.org"
+# start_page="file:/home/jcid/custom_page.html"
+#start_page="about:splash"
# Set the home location
-home="http://www.dillo.org/"
-
-# Set search url to use with the search dialog.
-# %s is replaced with urlencoded keywords, and %% by '%'.
-search_url="http://www.google.com/search?q=%s"
-#search_url="http://search.lycos.com/default.asp?query=%s"
-#search_url="http://www.alltheweb.com/search?cat=web&query=%s"
-
-# Set the proxy information for http
-#http_proxy=http://localhost:8080/
-
-# if you need to provide a user/password pair for the proxy,
+# home="file:/home/jcid/HomePage/Home.html"
+#home="http://www.dillo.org/"
+
+# Set the URL used by the web search dialog.
+# "%s" is replaced with the search keywords separated by '+'.
+# search_url="http://www.wikipedia.org/wiki/Special:Search?search=%s"
+# search_url="http://search.lycos.com/?query=%s"
+# search_url="http://duckduckgo.com/html?q=%s"
+#search_url="http://www.google.com/search?ie=UTF-8&oe=UTF-8&q=%s"
+
+# If set, dillo will ask web servers to send pages in this language.
+# This setting does NOT change dillo's user interface.
+# Format explained: www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4
+# Language-REGION values: www.iana.org/assignments/language-subtag-registry
+# (by default, no Accept-Language header is sent)
+# http_language="de"
+# http_language="pt-BR"
+# http_language="vi,de-CH,de;q=0.5,th;q=0.3"
+
+# Maximum number of simultaneous TCP connections to a single server or proxy.
+# http_max_conns=6
+
+# Set the proxy information for http.
+# Note that the http_proxy environment variable overrides this setting.
+# WARNING: FTP and downloads plugins use wget. To use a proxy with them,
+# you will need to configure wget accordingly. See
+# http://www.gnu.org/software/wget/manual/html_node/Proxies.html
+# http_proxy="http://localhost:8080/"
+#(by default, no proxy is used)
+
+# If you need to provide a user/password pair for the proxy,
# set the proxy user name here and Dillo will ask for the password later.
-#http_proxyuser="joe"
-
-# When using a proxy, this sets the domains to access without proxy.
-# (separated with a single space -- see examples below)
-#no_proxy = ".mynet.com"
-#no_proxy = ".mynet.com .other.net .foo.bar.org"
-
+# http_proxyuser="joe"
+#(by default, no proxy is used)
+
+# Set the domains to access without proxy
+# no_proxy = ".hola.com .mynet.cl .hi.de"
+#no_proxy="localhost 127.0.0.1"
+
+# Set the HTTP Referer (sic) header.
+# Note that there is no option to reveal the page that you came from because it
+# would endanger your privacy. 'host' and 'path' allow you to pretend that the
+# link you followed was on the same site that you're going to.
+# none : Don't send any Referer header at all.
+# host : Send the requested URI's hostname.
+# path : Send the requested URI's host and path.
+#http_referer=host
+
+# Set the HTTP User-Agent header.
+# This can be useful for privacy and for working around servers who think
+# Dillo is less capable than it really is. However, if you pretend to use a
+# different browser, servers may send you pages that work with the features
+# and bugs of that other browser -- or even disallow access in cases like
+# wget or googlebot. Remember this before submitting bug reports.
+#
+# See http://zytrax.com/tech/web/browser_ids.htm for a compilation of strings.
+#
+# http_user_agent="Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6"
+# http_user_agent="Wget/1.11.4"
+#The default is Dillo/(current version number)
#-------------------------------------------------------------------------
# COLORS SECTION
#-------------------------------------------------------------------------
-
-# Here we can use the HTML (standard and extended) or C syntax.
# Set the background color
# bg_color=gray
# bg_color=0xd6d6c0
-bg_color=0xdcd1ba
-
-# Set the text color
-text_color=black
-
-# Set the link color
-link_color=blue
-
-# If your eyes suffer with white backgrounds, or you have headaches after
-# lengthy computer sessions, and you don't need high contrast to see sharply,
-# uncomment next line (it'll use 'bg_color' instead). -- It works!
-#allow_white_bg=NO
-
-# Use the same colors with all documents?
-force_my_colors=NO
-
-# When set to YES, visited links will always have a contrasting color,
-# independent of the page author's setting.
-contrast_visited_color=YES
+#bg_color=0xdcd1ba
+
+# If your eyes suffer with white backgrounds, change this.
+#allow_white_bg=YES
+
+# When set to YES, the page author's visited link color may be overridden
+# to allow better contrast with text/links/background
+#contrast_visited_color=YES
+
#-------------------------------------------------------------------------
# USER INTERFACE SECTION
@@ -123,58 +193,74 @@
# small : very nice! (it's "medium" without icon titles)
# medium : nice!
# large : Traditional
-panel_size=medium
-small_icons=NO
+# panel_size=tiny
+# panel_size=small
+#panel_size=medium
+# panel_size=large
+
+#small_icons=NO
# Here you can choose to hide some widgets of the dillo panel...
-#show_back=NO
-#show_forw=NO
-#show_home=NO
-#show_reload=NO
-#show_save=NO
-#show_stop=NO
-#show_bookmarks=NO
-#show_menubar=NO
-#show_clear_url=NO
-#show_url=NO
-#show_search=NO
-#show_progress_box=NO
-
-# Start dillo windows with a hidden panel?
-fullwindow_start=NO
-
-# Enabling this will restrain OpenUrl and FindText, but may be required
-# for the ION window manager.
-transient_dialogs=NO
-
-# When filling forms, our default behaviour is to submit on enterpress,
+#show_back=YES
+#show_forw=YES
+#show_home=YES
+#show_reload=YES
+#show_save=YES
+#show_stop=YES
+#show_bookmarks=YES
+#show_tools=YES
+#show_filemenu=YES
+#show_clear_url=YES
+#show_url=YES
+#show_search=YES
+#show_help=YES
+#show_progress_box=YES
+
+# Start dillo with the panels hidden?
+#fullwindow_start=NO
+
+# When filling out forms, our default behaviour is to submit on enterpress,
# but only when there's a single text entry (to avoid incomplete submits).
-# OTOH, if you have to fill the same form lots of times, you may find
+# OTOH, if you have to fill out the same form repeatedly, you may find it
# useful to keep away from the mouse by forcing enter to submit.
-enterpress_forces_submit=NO
-
-# Some forms lack a submit button, and dillo can generate a custom one
-# internally. Unfortunately there's no guarantee for it to work. :(
-# (my experience is that forms that lack a submit rely on Javascript)
-generate_submit=NO
+#enterpress_forces_submit=NO
+
+# A mouse's middle click over a link opens a new Tab.
+# If you prefer to open a new Window instead, set it to NO.
+#middle_click_opens_new_tab=YES
+
+# A mouse's middle click over a tab closes the Tab.
+# With mousewheel mouses, right click feels way better (set to YES).
+#right_click_closes_tab=NO
+
+# Mouse middle click by default drives drag-scrolling.
+# To paste an URL into the window instead of scrolling, set it to NO.
+# Note: You could always paste the URL onto the URL box clear button.
+#middle_click_drags_page=YES
+
+# Focus follows new Tabs.
+# You can hold SHIFT to temporarily revert this behaviour.
+#focus_new_tab=YES
+
#-------------------------------------------------------------------------
# DEBUG MESSAGES SECTION
#-------------------------------------------------------------------------
-# Generic messsages (mainly for debugging specific parts)
-# Uncomment the following line to disable them.
-#show_msg=NO
-
-# Soon we'll add the "show_debug_messages=NO" option...
+# Soon we should add the "show_debug_messages=NO" option...
+
+# Generic messages (mainly for debugging specific parts)
+# Change this to disable them.
+#show_msg=YES
+
#-------------------------------------------------------------------------
# HTML BUG MESSAGES SECTION
#-------------------------------------------------------------------------
# Accepted by the W3C validator but "strongly discouraged" by the SPEC.
-# (As "TAB character inside ").
-#show_extra_warnings=YES
+# (Such as "TAB character inside ").
+#show_extra_warnings=NO
# -----------------------------------------------------------------------
diff --git a/dlib/Makefile.am b/dlib/Makefile.am
new file mode 100644
index 0000000..0d44c13
--- /dev/null
+++ b/dlib/Makefile.am
@@ -0,0 +1,8 @@
+AM_CPPFLAGS = \
+ -I$(top_srcdir)
+
+noinst_LIBRARIES = libDlib.a
+
+libDlib_a_SOURCES = \
+ dlib.h \
+ dlib.c
diff --git a/dlib/dlib.c b/dlib/dlib.c
new file mode 100644
index 0000000..b87d0ce
--- /dev/null
+++ b/dlib/dlib.c
@@ -0,0 +1,894 @@
+/*
+ * File: dlib.c
+ *
+ * Copyright (C) 2006-2007 Jorge Arellano Cid
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ */
+
+/* Memory allocation, Simple dynamic strings, Lists (simple and sorted),
+ * and a few utility functions
+ */
+
+/*
+ * TODO: vsnprintf() is in C99, maybe a simple replacement if necessary.
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include "dlib.h"
+
+static bool_t dLib_show_msg = TRUE;
+
+/* dlib msgs go to stderr to avoid problems with filter dpis */
+#define DLIB_MSG(...) \
+ D_STMT_START { \
+ if (dLib_show_msg) \
+ fprintf(stderr, __VA_ARGS__); \
+ } D_STMT_END
+
+/*
+ *- Memory --------------------------------------------------------------------
+ */
+
+void *dMalloc (size_t size)
+{
+ void *value = malloc (size);
+ if (value == 0)
+ exit(1);
+ return value;
+}
+
+void *dRealloc (void *mem, size_t size)
+{
+ void *value = realloc (mem, size);
+ if (value == 0)
+ exit(1);
+ return value;
+}
+
+void *dMalloc0 (size_t size)
+{
+ void *value = dMalloc (size);
+ memset (value, 0, size);
+ return value;
+}
+
+void dFree (void *mem)
+{
+ if (mem)
+ free(mem);
+}
+
+/*
+ *- strings (char *) ----------------------------------------------------------
+ */
+
+char *dStrdup(const char *s)
+{
+ if (s) {
+ int len = strlen(s)+1;
+ char *ns = dNew(char, len);
+ memcpy(ns, s, len);
+ return ns;
+ }
+ return NULL;
+}
+
+char *dStrndup(const char *s, size_t sz)
+{
+ if (s) {
+ char *ns = dNew(char, sz+1);
+ memcpy(ns, s, sz);
+ ns[sz] = 0;
+ return ns;
+ }
+ return NULL;
+}
+
+/*
+ * Concatenate a NULL-terminated list of strings
+ */
+char *dStrconcat(const char *s1, ...)
+{
+ va_list args;
+ char *s, *ns = NULL;
+
+ if (s1) {
+ Dstr *dstr = dStr_sized_new(64);
+ va_start(args, s1);
+ for (s = (char*)s1; s; s = va_arg(args, char*))
+ dStr_append(dstr, s);
+ va_end(args);
+ ns = dstr->str;
+ dStr_free(dstr, 0);
+ }
+ return ns;
+}
+
+/*
+ * Remove leading and trailing whitespace
+ */
+char *dStrstrip(char *s)
+{
+ char *p;
+ int len;
+
+ if (s && *s) {
+ for (p = s; dIsspace(*p); ++p);
+ for (len = strlen(p); len && dIsspace(p[len-1]); --len);
+ if (p > s)
+ memmove(s, p, len);
+ s[len] = 0;
+ }
+ return s;
+}
+
+/*
+ * Return a new string of length 'len' filled with 'c' characters
+ */
+char *dStrnfill(size_t len, char c)
+{
+ char *ret = dNew(char, len+1);
+ for (ret[len] = 0; len > 0; ret[--len] = c);
+ return ret;
+}
+
+/*
+ * strsep() implementation
+ */
+char *dStrsep(char **orig, const char *delim)
+{
+ char *str, *p;
+
+ if (!(str = *orig))
+ return NULL;
+
+ p = strpbrk(str, delim);
+ if (p) {
+ *p++ = 0;
+ *orig = p;
+ } else {
+ *orig = NULL;
+ }
+ return str;
+}
+
+/*
+ * Case insensitive strstr
+ */
+char *dStristr(const char *haystack, const char *needle)
+{
+ int i, j;
+ char *ret = NULL;
+
+ if (haystack && needle) {
+ for (i = 0, j = 0; haystack[i] && needle[j]; ++i)
+ if (tolower(haystack[i]) == tolower(needle[j])) {
+ ++j;
+ } else if (j) {
+ i -= j;
+ j = 0;
+ }
+ if (!needle[j]) /* Got all */
+ ret = (char *)(haystack + i - j);
+ }
+ return ret;
+}
+
+
+/*
+ *- dStr ----------------------------------------------------------------------
+ */
+
+/*
+ * Private allocator
+ */
+static void dStr_resize(Dstr *ds, int n_sz, int keep)
+{
+ if (n_sz >= 0) {
+ if (keep && n_sz > ds->len) {
+ ds->str = (Dstr_char_t*) dRealloc (ds->str, n_sz*sizeof(Dstr_char_t));
+ ds->sz = n_sz;
+ } else {
+ dFree(ds->str);
+ ds->str = dNew(Dstr_char_t, n_sz);
+ ds->sz = n_sz;
+ ds->len = 0;
+ ds->str[0] = 0;
+ }
+ }
+}
+
+/*
+ * Create a new string with a given size.
+ * Initialized to ""
+ */
+Dstr *dStr_sized_new (int sz)
+{
+ Dstr *ds;
+ if (sz < 2)
+ sz = 2;
+
+ ds = dNew(Dstr, 1);
+ ds->str = NULL;
+ dStr_resize(ds, sz + 1, 0); /* (sz + 1) for the extra '\0' */
+ return ds;
+}
+
+/*
+ * Return memory if there's too much allocated
+ */
+void dStr_fit (Dstr *ds)
+{
+ dStr_resize(ds, ds->len + 1, 1);
+}
+
+/*
+ * Insert a C string, at a given position, into a Dstr (providing length).
+ * Note: It also works with embedded nil characters.
+ */
+void dStr_insert_l (Dstr *ds, int pos_0, const char *s, int l)
+{
+ int n_sz;
+
+ if (ds && s && l && pos_0 >= 0 && pos_0 <= ds->len) {
+ for (n_sz = ds->sz; ds->len + l >= n_sz; n_sz *= 2);
+ if (n_sz > ds->sz) {
+ dStr_resize(ds, n_sz, (ds->len > 0) ? 1 : 0);
+ }
+ if (pos_0 < ds->len)
+ memmove(ds->str+pos_0+l, ds->str+pos_0, ds->len-pos_0);
+ memcpy(ds->str+pos_0, s, l);
+ ds->len += l;
+ ds->str[ds->len] = 0;
+ }
+}
+
+/*
+ * Insert a C string, at a given position, into a Dstr
+ */
+void dStr_insert (Dstr *ds, int pos_0, const char *s)
+{
+ if (s)
+ dStr_insert_l(ds, pos_0, s, strlen(s));
+}
+
+/*
+ * Append a C string to a Dstr (providing length).
+ * Note: It also works with embedded nil characters.
+ */
+void dStr_append_l (Dstr *ds, const char *s, int l)
+{
+ dStr_insert_l(ds, ds->len, s, l);
+}
+
+/*
+ * Append a C string to a Dstr.
+ */
+void dStr_append (Dstr *ds, const char *s)
+{
+ dStr_append_l(ds, s, strlen(s));
+}
+
+/*
+ * Create a new string.
+ * Initialized to 's' or empty if 's == NULL'
+ */
+Dstr *dStr_new (const char *s)
+{
+ Dstr *ds = dStr_sized_new(0);
+ if (s && *s)
+ dStr_append(ds, s);
+ return ds;
+}
+
+/*
+ * Free a dillo string.
+ * if 'all' free everything, else free the structure only.
+ */
+void dStr_free (Dstr *ds, int all)
+{
+ if (ds) {
+ if (all)
+ dFree(ds->str);
+ dFree(ds);
+ }
+}
+
+/*
+ * Append one character.
+ */
+void dStr_append_c (Dstr *ds, int c)
+{
+ char cs[2];
+
+ if (ds) {
+ if (ds->sz > ds->len + 1) {
+ ds->str[ds->len++] = (Dstr_char_t)c;
+ ds->str[ds->len] = 0;
+ } else {
+ cs[0] = (Dstr_char_t)c;
+ cs[1] = 0;
+ dStr_append_l (ds, cs, 1);
+ }
+ }
+}
+
+/*
+ * Truncate a Dstr to be 'len' bytes long.
+ */
+void dStr_truncate (Dstr *ds, int len)
+{
+ if (ds && len < ds->len) {
+ ds->str[len] = 0;
+ ds->len = len;
+ }
+}
+
+/*
+ * Erase a substring.
+ */
+void dStr_erase (Dstr *ds, int pos_0, int len)
+{
+ if (ds && pos_0 >= 0 && len > 0 && pos_0 + len <= ds->len) {
+ memmove(ds->str + pos_0, ds->str + pos_0 + len, ds->len - pos_0 - len);
+ ds->len -= len;
+ ds->str[ds->len] = 0;
+ }
+}
+
+/*
+ * vsprintf-like function that appends.
+ * Used by: dStr_vsprintf(), dStr_sprintf() and dStr_sprintfa().
+ */
+void dStr_vsprintfa (Dstr *ds, const char *format, va_list argp)
+{
+ int n, n_sz;
+
+ if (ds && format) {
+ va_list argp2; /* Needed in case of looping on non-32bit arch */
+ while (1) {
+ va_copy(argp2, argp);
+ n = vsnprintf(ds->str + ds->len, ds->sz - ds->len, format, argp2);
+ va_end(argp2);
+ if (n > -1 && n < ds->sz - ds->len) {
+ ds->len += n; /* Success! */
+ break;
+ } else if (n > -1) { /* glibc >= 2.1 */
+ n_sz = ds->len + n + 1;
+ } else { /* old glibc */
+ n_sz = ds->sz * 2;
+ }
+ dStr_resize(ds, n_sz, (ds->len > 0) ? 1 : 0);
+ }
+ }
+}
+
+/*
+ * vsprintf-like function.
+ */
+void dStr_vsprintf (Dstr *ds, const char *format, va_list argp)
+{
+ if (ds) {
+ dStr_truncate(ds, 0);
+ dStr_vsprintfa(ds, format, argp);
+ }
+}
+
+/*
+ * Printf-like function
+ */
+void dStr_sprintf (Dstr *ds, const char *format, ...)
+{
+ va_list argp;
+
+ if (ds && format) {
+ va_start(argp, format);
+ dStr_vsprintf(ds, format, argp);
+ va_end(argp);
+ }
+}
+
+/*
+ * Printf-like function that appends.
+ */
+void dStr_sprintfa (Dstr *ds, const char *format, ...)
+{
+ va_list argp;
+
+ if (ds && format) {
+ va_start(argp, format);
+ dStr_vsprintfa(ds, format, argp);
+ va_end(argp);
+ }
+}
+
+/*
+ * Compare two dStrs.
+ */
+int dStr_cmp(Dstr *ds1, Dstr *ds2)
+{
+ int ret = 0;
+
+ if (ds1 && ds2)
+ ret = memcmp(ds1->str, ds2->str, MIN(ds1->len+1, ds2->len+1));
+ return ret;
+}
+
+/*
+ * Return a pointer to the first occurrence of needle in haystack.
+ */
+char *dStr_memmem(Dstr *haystack, Dstr *needle)
+{
+ int i;
+
+ if (needle && haystack) {
+ if (needle->len == 0)
+ return haystack->str;
+
+ for (i = 0; i <= (haystack->len - needle->len); i++) {
+ if (haystack->str[i] == needle->str[0] &&
+ !memcmp(haystack->str + i, needle->str, needle->len))
+ return haystack->str + i;
+ }
+ }
+ return NULL;
+}
+
+/*
+ * Return a printable representation of the provided Dstr, limited to a length
+ * of roughly maxlen.
+ *
+ * This is NOT threadsafe.
+ */
+const char *dStr_printable(Dstr *in, int maxlen)
+{
+ int i;
+ static const char *const HEX = "0123456789ABCDEF";
+ static Dstr *out = NULL;
+
+ if (in == NULL)
+ return NULL;
+
+ if (out)
+ dStr_truncate(out, 0);
+ else
+ out = dStr_sized_new(in->len);
+
+ for (i = 0; (i < in->len) && (out->len < maxlen); ++i) {
+ if (isprint(in->str[i]) || (in->str[i] == '\n')) {
+ dStr_append_c(out, in->str[i]);
+ } else {
+ dStr_append_l(out, "\\x", 2);
+ dStr_append_c(out, HEX[(in->str[i] >> 4) & 15]);
+ dStr_append_c(out, HEX[in->str[i] & 15]);
+ }
+ }
+ if (out->len >= maxlen)
+ dStr_append(out, "...");
+ return out->str;
+}
+
+/*
+ *- dList ---------------------------------------------------------------------
+ */
+
+/*
+ * Create a new empty list
+ */
+Dlist *dList_new(int size)
+{
+ Dlist *l;
+ if (size <= 0)
+ return NULL;
+
+ l = dNew(Dlist, 1);
+ l->len = 0;
+ l->sz = size;
+ l->list = dNew(void*, l->sz);
+ return l;
+}
+
+/*
+ * Free a list (not its elements)
+ */
+void dList_free (Dlist *lp)
+{
+ if (!lp)
+ return;
+
+ dFree(lp->list);
+ dFree(lp);
+}
+
+/*
+ * Insert an element at a given position [0 based]
+ */
+void dList_insert_pos (Dlist *lp, void *data, int pos0)
+{
+ int i;
+
+ if (!lp || pos0 < 0 || pos0 > lp->len)
+ return;
+
+ if (lp->sz == lp->len) {
+ lp->sz *= 2;
+ lp->list = (void**) dRealloc (lp->list, lp->sz*sizeof(void*));
+ }
+ ++lp->len;
+
+ for (i = lp->len - 1; i > pos0; --i)
+ lp->list[i] = lp->list[i - 1];
+ lp->list[pos0] = data;
+}
+
+/*
+ * Append a data item to the list
+ */
+void dList_append (Dlist *lp, void *data)
+{
+ dList_insert_pos(lp, data, lp->len);
+}
+
+/*
+ * Prepend a data item to the list
+ */
+void dList_prepend (Dlist *lp, void *data)
+{
+ dList_insert_pos(lp, data, 0);
+}
+
+/*
+ * For completing the ADT.
+ */
+int dList_length (Dlist *lp)
+{
+ if (!lp)
+ return 0;
+ return lp->len;
+}
+
+/*
+ * Remove a data item without preserving order.
+ */
+void dList_remove_fast (Dlist *lp, const void *data)
+{
+ int i;
+
+ if (!lp)
+ return;
+
+ for (i = 0; i < lp->len; ++i) {
+ if (lp->list[i] == data) {
+ lp->list[i] = lp->list[--lp->len];
+ break;
+ }
+ }
+}
+
+/*
+ * Remove a data item preserving order.
+ */
+void dList_remove (Dlist *lp, const void *data)
+{
+ int i, j;
+
+ if (!lp)
+ return;
+
+ for (i = 0; i < lp->len; ++i) {
+ if (lp->list[i] == data) {
+ --lp->len;
+ for (j = i; j < lp->len; ++j)
+ lp->list[j] = lp->list[j + 1];
+ break;
+ }
+ }
+}
+
+/*
+ * Return the nth data item,
+ * NULL when not found or 'n0' is out of range
+ */
+void *dList_nth_data (Dlist *lp, int n0)
+{
+ if (!lp || n0 < 0 || n0 >= lp->len)
+ return NULL;
+ return lp->list[n0];
+}
+
+/*
+ * Return the found data item, or NULL if not present.
+ */
+void *dList_find (Dlist *lp, const void *data)
+{
+ int i = dList_find_idx(lp, data);
+ return (i >= 0) ? lp->list[i] : NULL;
+}
+
+/*
+ * Search a data item.
+ * Return value: its index if found, -1 if not present.
+ * (this is useful for a list of integers, for finding number zero).
+ */
+int dList_find_idx (Dlist *lp, const void *data)
+{
+ int i, ret = -1;
+
+ if (!lp)
+ return ret;
+
+ for (i = 0; i < lp->len; ++i) {
+ if (lp->list[i] == data) {
+ ret = i;
+ break;
+ }
+ }
+ return ret;
+}
+
+/*
+ * Search a data item using a custom function.
+ * func() is given the list item and the user data as parameters.
+ * Return: data item when found, NULL otherwise.
+ */
+void *dList_find_custom (Dlist *lp, const void *data, dCompareFunc func)
+{
+ int i;
+ void *ret = NULL;
+
+ if (!lp)
+ return ret;
+
+ for (i = 0; i < lp->len; ++i) {
+ if (func(lp->list[i], data) == 0) {
+ ret = lp->list[i];
+ break;
+ }
+ }
+ return ret;
+}
+
+/*
+ * QuickSort implementation.
+ * This allows for a simple compare function for all the ADT.
+ */
+static void QuickSort(void **left, void **right, dCompareFunc compare)
+{
+ void **p = left, **q = right, **t = left;
+
+ while (1) {
+ while (p != t && compare(*p, *t) < 0)
+ ++p;
+ while (q != t && compare(*q, *t) > 0)
+ --q;
+ if (p > q)
+ break;
+ if (p < q) {
+ void *tmp = *p;
+ *p = *q;
+ *q = tmp;
+ if (t == p)
+ t = q;
+ else if (t == q)
+ t = p;
+ }
+ if (++p > --q)
+ break;
+ }
+
+ if (left < q)
+ QuickSort(left, q, compare);
+ if (p < right)
+ QuickSort(p, right, compare);
+}
+
+/*
+ * Sort the list using a custom function
+ */
+void dList_sort (Dlist *lp, dCompareFunc func)
+{
+ if (lp && lp->len > 1) {
+ QuickSort(lp->list, lp->list + lp->len - 1, func);
+ }
+}
+
+/*
+ * Insert an element into a sorted list.
+ * The comparison function receives two list elements.
+ */
+void dList_insert_sorted (Dlist *lp, void *data, dCompareFunc func)
+{
+ int i, st, min, max;
+
+ if (lp) {
+ min = st = i = 0;
+ max = lp->len - 1;
+ while (min <= max) {
+ i = (min + max) / 2;
+ st = func(lp->list[i], data);
+ if (st < 0) {
+ min = i + 1;
+ } else if (st > 0) {
+ max = i - 1;
+ } else {
+ break;
+ }
+ }
+ dList_insert_pos(lp, data, (st >= 0) ? i : i+1);
+ }
+}
+
+/*
+ * Search a sorted list.
+ * Return the found data item, or NULL if not present.
+ * func() is given the list item and the user data as parameters.
+ */
+void *dList_find_sorted (Dlist *lp, const void *data, dCompareFunc func)
+{
+ int i, st, min, max;
+ void *ret = NULL;
+
+ if (lp && lp->len) {
+ min = 0;
+ max = lp->len - 1;
+ while (min <= max) {
+ i = (min + max) / 2;
+ st = func(lp->list[i], data);
+ if (st < 0) {
+ min = i + 1;
+ } else if (st > 0) {
+ max = i - 1;
+ } else {
+ ret = lp->list[i];
+ break;
+ }
+ }
+ }
+
+ return ret;
+}
+
+/*
+ *- Parse function ------------------------------------------------------------
+ */
+
+/*
+ * Take a dillo rc line and return 'name' and 'value' pointers to it.
+ * Notes:
+ * - line is modified!
+ * - it skips blank lines and lines starting with '#'
+ *
+ * Return value: 1 on blank line or comment, 0 on successful value/pair,
+ * -1 otherwise.
+ */
+int dParser_parse_rc_line(char **line, char **name, char **value)
+{
+ char *eq, *p;
+ int len, ret = -1;
+
+ dReturn_val_if_fail(*line, ret);
+
+ *name = NULL;
+ *value = NULL;
+ dStrstrip(*line);
+ if (!*line[0] || *line[0] == '#') {
+ /* blank line or comment */
+ ret = 1;
+ } else if ((eq = strchr(*line, '='))) {
+ /* get name */
+ for (p = *line; *p && *p != '=' && !dIsspace(*p); ++p);
+ *p = 0;
+ *name = *line;
+
+ /* skip whitespace */
+ if (p < eq)
+ for (++p; dIsspace(*p); ++p);
+
+ /* get value */
+ if (p == eq) {
+ for (++p; dIsspace(*p); ++p);
+ len = strlen(p);
+ if (len >= 2 && *p == '"' && p[len-1] == '"') {
+ p[len-1] = 0;
+ ++p;
+ }
+ *value = p;
+ ret = 0;
+ }
+ }
+
+ return ret;
+}
+
+/*
+ *- Dlib messages -------------------------------------------------------------
+ */
+void dLib_show_messages(bool_t show)
+{
+ dLib_show_msg = show;
+}
+
+/*
+ *- Misc utility functions ----------------------------------------------------
+ */
+
+/*
+ * Return the current working directory in a new string
+ */
+char *dGetcwd ()
+{
+ size_t size = 128;
+
+ while (1) {
+ char *buffer = dNew(char, size);
+ if (getcwd (buffer, size) == buffer)
+ return buffer;
+ dFree (buffer);
+ if (errno != ERANGE)
+ return 0;
+ size *= 2;
+ }
+}
+
+/*
+ * Return the home directory in a static string (don't free)
+ */
+char *dGethomedir ()
+{
+ static char *homedir = NULL;
+
+ if (!homedir) {
+ if (getenv("HOME")) {
+ homedir = dStrdup(getenv("HOME"));
+
+ } else if (getenv("HOMEDRIVE") && getenv("HOMEPATH")) {
+ homedir = dStrconcat(getenv("HOMEDRIVE"), getenv("HOMEPATH"), NULL);
+ } else {
+ DLIB_MSG("dGethomedir: $HOME not set, using '/'.\n");
+ homedir = dStrdup("/");
+ }
+ }
+ return homedir;
+}
+
+/*
+ * Get a line from a FILE stream.
+ * It handles backslash as line-continues character.
+ * Return value: read line on success, NULL on EOF.
+ */
+char *dGetline (FILE *stream)
+{
+ int ch;
+ Dstr *dstr;
+ char *line;
+
+ dReturn_val_if_fail (stream, 0);
+
+ dstr = dStr_sized_new(64);
+ while ((ch = fgetc(stream)) != EOF) {
+ if (ch == '\\') {
+ /* continue with the next line */
+ while ((ch = fgetc(stream)) != EOF && ch != '\n') ;
+ continue;
+ }
+ dStr_append_c(dstr, ch);
+ if (ch == '\n')
+ break;
+ }
+
+ line = (dstr->len) ? dstr->str : NULL;
+ dStr_free(dstr, (line) ? 0 : 1);
+ return line;
+}
+
diff --git a/dlib/dlib.h b/dlib/dlib.h
new file mode 100644
index 0000000..ae9c728
--- /dev/null
+++ b/dlib/dlib.h
@@ -0,0 +1,186 @@
+#ifndef __DLIB_H__
+#define __DLIB_H__
+
+#include /* for FILE* */
+#include /* for size_t */
+#include /* for va_list */
+#include /* for strerror */
+#include /* for strcasecmp, strncasecmp (POSIX 2001) */
+
+#include "d_size.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/*
+ *-- Common macros -----------------------------------------------------------
+ */
+#ifndef FALSE
+#define FALSE (0)
+#endif
+
+#ifndef TRUE
+#define TRUE (!FALSE)
+#endif
+
+#undef MAX
+#define MAX(a, b) (((a) > (b)) ? (a) : (b))
+
+#undef MIN
+#define MIN(a, b) (((a) < (b)) ? (a) : (b))
+
+/* Handle signed char */
+#define dIsspace(c) isspace((uchar_t)(c))
+#define dIsalnum(c) isalnum((uchar_t)(c))
+
+/*
+ *-- Casts -------------------------------------------------------------------
+ */
+/* TODO: include a void* size test in configure.in */
+/* (long) works for both 32bit and 64bit */
+#define VOIDP2INT(p) ((long)(p))
+#define INT2VOIDP(i) ((void*)((long)(i)))
+
+/*
+ *-- Memory -------------------------------------------------------------------
+ */
+#define dNew(type, count) \
+ ((type *) dMalloc ((unsigned) sizeof (type) * (count)))
+#define dNew0(type, count) \
+ ((type *) dMalloc0 ((unsigned) sizeof (type) * (count)))
+
+void *dMalloc (size_t size);
+void *dRealloc (void *mem, size_t size);
+void *dMalloc0 (size_t size);
+void dFree (void *mem);
+
+/*
+ *- Debug macros --------------------------------------------------------------
+ */
+#define D_STMT_START do
+#define D_STMT_END while (0)
+#define dReturn_if(expr) \
+ D_STMT_START{ \
+ if (expr) { return; }; \
+ }D_STMT_END
+#define dReturn_val_if(expr,val) \
+ D_STMT_START{ \
+ if (expr) { return val; }; \
+ }D_STMT_END
+#define dReturn_if_fail(expr) \
+ D_STMT_START{ \
+ if (!(expr)) { return; }; \
+ }D_STMT_END
+#define dReturn_val_if_fail(expr,val) \
+ D_STMT_START{ \
+ if (!(expr)) { return val; }; \
+ }D_STMT_END
+
+/*
+ *- C strings -----------------------------------------------------------------
+ */
+char *dStrdup(const char *s);
+char *dStrndup(const char *s, size_t sz);
+char *dStrconcat(const char *s1, ...);
+char *dStrstrip(char *s);
+char *dStrnfill(size_t len, char c);
+char *dStrsep(char **orig, const char *delim);
+char *dStristr(const char *haystack, const char *needle);
+
+/* these are in POSIX 2001. Could be implemented if a port requires it */
+#define dStrcasecmp strcasecmp
+#define dStrncasecmp strncasecmp
+#define dStrerror strerror
+
+/*
+ *-- dStr ---------------------------------------------------------------------
+ */
+#define Dstr_char_t char
+
+typedef struct _dstr {
+ int sz; /* allocated size (private) */
+ int len;
+ Dstr_char_t *str;
+} Dstr;
+
+Dstr *dStr_new (const char *s);
+Dstr *dStr_sized_new (int sz);
+void dStr_fit (Dstr *ds);
+void dStr_free (Dstr *ds, int all);
+void dStr_append_c (Dstr *ds, int c);
+void dStr_append (Dstr *ds, const char *s);
+void dStr_append_l (Dstr *ds, const char *s, int l);
+void dStr_insert (Dstr *ds, int pos_0, const char *s);
+void dStr_insert_l (Dstr *ds, int pos_0, const char *s, int l);
+void dStr_truncate (Dstr *ds, int len);
+void dStr_erase (Dstr *ds, int pos_0, int len);
+void dStr_vsprintfa (Dstr *ds, const char *format, va_list argp);
+void dStr_vsprintf (Dstr *ds, const char *format, va_list argp);
+void dStr_sprintf (Dstr *ds, const char *format, ...);
+void dStr_sprintfa (Dstr *ds, const char *format, ...);
+int dStr_cmp(Dstr *ds1, Dstr *ds2);
+char *dStr_memmem(Dstr *haystack, Dstr *needle);
+const char *dStr_printable(Dstr *in, int maxlen);
+
+/*
+ *-- dList --------------------------------------------------------------------
+ */
+struct Dlist_ {
+ int sz; /* allocated size (private) */
+ int len;
+ void **list;
+};
+
+typedef struct Dlist_ Dlist;
+
+/* dCompareFunc:
+ * Return: 0 if parameters are equal (for dList_find_custom).
+ * Return: 0 if equal, < 0 if (a < b), > 0 if (b < a) --for insert sorted.
+ *
+ * For finding a data node with an external key, the comparison function
+ * parameters are: first the data node, and then the key.
+ */
+typedef int (*dCompareFunc) (const void *a, const void *b);
+
+
+Dlist *dList_new(int size);
+void dList_free (Dlist *lp);
+void dList_append (Dlist *lp, void *data);
+void dList_prepend (Dlist *lp, void *data);
+void dList_insert_pos (Dlist *lp, void *data, int pos0);
+int dList_length (Dlist *lp);
+void dList_remove (Dlist *lp, const void *data);
+void dList_remove_fast (Dlist *lp, const void *data);
+void *dList_nth_data (Dlist *lp, int n0);
+void *dList_find (Dlist *lp, const void *data);
+int dList_find_idx (Dlist *lp, const void *data);
+void *dList_find_custom (Dlist *lp, const void *data, dCompareFunc func);
+void dList_sort (Dlist *lp, dCompareFunc func);
+void dList_insert_sorted (Dlist *lp, void *data, dCompareFunc func);
+void *dList_find_sorted (Dlist *lp, const void *data, dCompareFunc func);
+
+/*
+ *- Parse function ------------------------------------------------------------
+ */
+int dParser_parse_rc_line(char **line, char **name, char **value);
+
+/*
+ *- Dlib messages -------------------------------------------------------------
+ */
+void dLib_show_messages(bool_t show);
+
+/*
+ *- Misc utility functions ----------------------------------------------------
+ */
+char *dGetcwd ();
+char *dGethomedir ();
+char *dGetline (FILE *stream);
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __DLIB_H__ */
+
diff --git a/doc/CCCwork.txt b/doc/CCCwork.txt
new file mode 100644
index 0000000..1ea5d20
--- /dev/null
+++ b/doc/CCCwork.txt
@@ -0,0 +1,153 @@
+Last review: August 04, 2009 --jcid
+
+
+----------------------------
+Internal working for the CCC
+----------------------------
+
+
+HTTP protocol
+-------------
+
+
+ Query: |
+ .
+ 1B --> 1B 1B --> 1B --> | -------------.
+ .----. .----. .----. . |
+I |Capi| |http| | IO | | |
+ '----' '----' '----' . |
+ 1F <-- 1F 1F <-- 1F | V
+ .
+ | [Server]
+ Answer: .
+
+ 2B --> 2B 2B --> 2B | |
+ .----. .----. .----. . |
+II |Capi| |Dpi | | IO | | |
+ '----' '----' '----' . |
+ 2F <-- 2F 2F <-- 2F <-- | <------------'
+ .
+ |
+
+* a_Capi_open_url() builds both the Answer and Query chains at
+once (Answer first then Query), to ensure a uniform structure
+that avoids complexity (e.g. race conditions).
+
+* Http_get() sets a callback for the DNS hostname resolve.
+Normally it comes later, but may also by issued immediately if
+the hostname is cached.
+
+* The socket FD is passed by means of OpSend by the http module
+once the remote IP is known and the socket is connected.
+
+
+
+Function calls for HTTP CCC
+---------------------------
+
+ a_Capi_open_url
+ if (reload)
+ Capi OpStart 2B (answer) [Capi] --> [dpi] --> [IO]
+ Capi OpStart 1B (query) [Capi] --> [http] --> [IO]
+ Http_get
+ a_Cache_open_url
+ if URL_E2EReload -> prepare reload
+ if cached
+ client enqueue
+ delayed process queue
+ else
+ Cache_entry_add
+ client enqueue
+
+ -//->
+ a_Http_dns_cb
+ Http_connect_socket
+ OpSend FD, BCK
+ OpSend FD, FWD
+ Http_send_query
+ a_Http_make_query_str
+ OpSend, BCK
+ IO_submit
+ a_IOwatch_add_fd (DIO_WRITE, ...)
+
+
+ Note about 'web' structures. They're created using a_Web_new().
+The web.c module keeps a list of valid webs, so anytime you're
+unsure of a weak reference to 'web', it can be checked with
+a_Web_valid(web).
+
+
+
+------------
+Dpi protocol
+------------
+
+
+ Query: |
+ .
+ 1B --> 1B 1B --> 1B --> | -------------.
+ .----. .----. .----. . |
+I |Capi| |Dpi | | IO | | |
+ '----' '----' '----' . |
+ 1F <-- 1F 1F <-- 1F | V
+ .
+ | [Server]
+ .
+ Answer (same as HTTP): | |
+ . |
+ 2B --> 2B 2B --> 2B | |
+ .----. .----. .----. . |
+II |Capi| |Dpi | | IO | | |
+ '----' '----' '----' . |
+ 2F <-- 2F 2F <-- 2F <-- | <------------'
+ .
+ |
+
+
+CCC Construction:
+
+ a_Capi_open_url() calls a_Capi_dpi_send_cmd() when the URL
+belongs to a dpi and it is not cached.
+
+ a_Capi_dpi_send_cmd() builds both the Answer and Query chains
+at once (Answer first then Query), in the same way as HTTP does.
+Note that the answer chain is the same for both, and the query
+chain only differs in the module in the middle ([http] or [dpi]).
+
+
+Function calls for DPI CCC
+--------------------------
+
+ a_Capi_open_url
+ a_Capi_dpi_send_cmd
+ Capi OpStart 2B (answer) [Capi] --> [dpi] --> [IO]
+ Capi OpStart 1B (query) [Capi] --> [http] --> [IO]
+ a_Cache_open_url
+ [...]
+
+
+Normal termination:
+
+ When the dpi server is done, it closes the FD, and OpEnd flows
+from IO to Capi (answer branch). When in Capi, capi propagates
+OpEnd to the query branch.
+
+Abnormal termination:
+
+ The transfer may be aborted by a_Capi_conn_abort_by_url(). The
+OpAbort is not yet standardized and has an ad-hoc implementation.
+One idea is to have OpAbort always propagate BCK and then FWD and
+to jump into the other chain when it gets to [Capi].
+
+
+Debugging CCC
+-------------
+
+ A simple way to "look" inside it, is to "#define VERBOSE 1" in
+chain.c, and then to follow its work with a printed copy of the
+diagrams in this document.
+
+ Each new data request generates a CCC, so if you want to debug,
+it's good to refine the testcase to the minimum possible number
+of connections.
+
diff --git a/doc/Cache.txt b/doc/Cache.txt
index ac1ecf8..4e885df 100644
--- a/doc/Cache.txt
+++ b/doc/Cache.txt
@@ -1,5 +1,5 @@
June 2000, --Jcid
- Last update: Oct 2004
+ Last update: Jul 09
-------
CACHE
@@ -12,28 +12,21 @@
calls the cache or the dpi routines depending on the type of
request.
- Every URL must be requested using a_Capi_open_url, no matter
-if it is a http, file, dpi or whatever type of request. The capi
-asks the dpi module for dpi URLs and the Cache for everything
-else.
+ Every URL must be requested using a_Capi_open_url, which
+sends the request to the cache if the data is cached, to dillo's
+http module for http: URLs, and through dillo's DPI system for
+other URLs.
Here we'll document non dpi requests.
-
- The cache, at its turn, sends the requested-data from memory
-(if cached), or opens a new network connection (if not cached).
-
- This means that no mattering whether the answer comes from
-memory or the net, the client requests it through the capi
-wrapper, in a single uniform way.
----------------
CACHE PHILOSOPHY
----------------
- Dillo's cache is very simple, every single resource that's
-retrieved (URL) is kept in memory. NOTHING is saved. This is
-mainly for three reasons:
+ Dillo's cache is very simple; every single resource that's
+retrieved (URL) is kept in memory. NOTHING is saved to disk.
+This is mainly for three reasons:
- Dillo encourages personal privacy and it assures there'll be
no recorded tracks of the sites you visited.
@@ -42,7 +35,7 @@
serve as caches.
- If you still want to have cached stuff, you can install an
-external cache server (as WWWOFFLE), and benefit from it.
+external cache server (such as WWWOFFLE), and benefit from it.
---------------
@@ -51,15 +44,14 @@
Currently, dillo's cache code is spread in different sources:
mainly in cache.[ch], dicache.[ch] and it uses some other
-functions from mime.c, Url.c and web.c.
+functions from mime.c and web.cc.
- Cache.c is the principal source, and it also is the main
+ Cache.c is the principal source, and it also is the one
responsible for processing cache-clients (held in a queue).
-Dicache.c is the "decompressed image cache" and it holds the
-original data and its corresponding decompressed RGB
-representation (more on this subject in Images.txt).
+Dicache.c is the interface to the decompressed RGB representations
+of currently-displayed images held in DW's imgbuf.
- Url.c, mime.c and web.c are used for secondary tasks; as
+ mime.c and web.cc are used for secondary tasks such as
assigning the right "viewer" or "decoder" for a given URL.
@@ -67,7 +59,7 @@
A bit of history
----------------
- Some time ago, the cache functions, URL retrieving and
+ Some time ago, the cache functions, URL retrieval and
external protocols were a whole mess of mixed code, and it was
getting REALLY hard to fix, improve or extend the functionality.
The main idea of this "layering" is to make code-portions as
@@ -76,32 +68,34 @@
An interesting part of the process is that, as resources are
retrieved, the client (dillo in this case) doesn't know the
-Content-Type of the resource at request-time. It only gets known
-when the resource header is retrieved (think of http), and it
-happens when the cache has the control so, the cache sets the
-proper viewer for it! (unless the Callback function is specified
-with the URL request).
+Content-Type of the resource at request-time. It only becomes known
+when the resource header is retrieved (think of http). This
+happens when the cache has control, so the cache sets the
+proper viewer for it (unless the Callback function was already
+specified with the URL request).
You'll find a good example in http.c.
- Note: Files don't have a header, but the file handler inside
-dillo tries to determine the Content-Type and sends it back in
-HTTP form!
+ Note: All resources received by the cache have HTTP-style headers.
+ The file/data/ftp DPIs generate these headers when sending their
+ non-HTTP resources. Most importantly, a Content-Type header is
+ generated based on file extension or file contents.
-------------
Cache clients
-------------
- Cache clients MUST use a_Cache_open_url to request an URL. The
+ Cache clients MUST use a_Capi_open_url to request an URL. The
client structure and the callback-function prototype are defined,
in cache.h, as follows:
struct _CacheClient {
- gint Key; /* Primary Key for this client */
- const char *Url; /* Pointer to a cache entry Url */
- guchar *Buf; /* Pointer to cache-data */
- guint BufSize; /* Valid size of cache-data */
+ int Key; /* Primary Key for this client */
+ const DilloUrl *Url; /* Pointer to a cache entry Url */
+ int Version; /* Dicache version of this Url (0 if not used) */
+ void *Buf; /* Pointer to cache-data */
+ uint_t BufSize; /* Valid size of cache-data */
CA_Callback_t Callback; /* Client function */
void *CbData; /* Client function data */
void *Web; /* Pointer to the Web structure of our client */
@@ -124,26 +118,13 @@
--------------------------
································································
-int a_Cache_open_url(const char *Url, CA_Callback_t Call, void *CbData)
+int a_Cache_open_url(void *Web, CA_Callback_t Call, void *CbData)
- if Url is not cached
+ if Web->url is not cached
Create a cache-entry for that URL
Send client to cache queue
- Initiate a new connection
else
Feed our client with cached data
-
-································································
-ChainFunction_t a_Url_get_ccc_funct(const char *Url)
-
- Scan the Url handlers for a handler that matches
- If found
- Return the CCC function for it
- else
- Return NULL
-
- * Ex: If Url is an http request, a_Http_ccc is the matching
-handler.
································································
@@ -177,9 +158,9 @@
to document it in more detail later (source is commented).
Currently I have a drawing to understand it; hope the ASCII
translation serves the same as the original.
- If you're planning to understand the cache process troughly,
-write me a note, just to assign a higher priority on further
-improving of this doc.
+ If you're planning to understand the cache process thoroughly,
+write me a note and I will assign higher priority to further
+improvement of this doc.
Hope this helps!
diff --git a/doc/Cookies.txt b/doc/Cookies.txt
index 4aa65f8..49e743b 100644
--- a/doc/Cookies.txt
+++ b/doc/Cookies.txt
@@ -1,58 +1,52 @@
Jan 2002, Jörgen Viksell - jorgen.viksell@telia.com,
Jorge Arellano Cid --
-Last update: April 2005, DarkSpirit
+Last update: March 2010
==================
Cookies in Dillo
==================
- The cookie support in Dillo aims to support cookies of the old
-original Netscape style, as well as the kind specified in RFC 2109.
+The current specification for cookies is RFC 6265
+( http://tools.ietf.org/html/rfc6265 ).
- Cookies are managed outside of dillo by the cookies.dpi. It uses
-a cookies file in netscape format so it can be used with other
-programs like for example wget.
+Cookies are handled by a dpi (plugin) which shares them between your
+instances of Dillo.
- Between sessions cookies are saved to ~/.dillo/cookies.txt, the
-old ~/.dillo/cookies is read too but not updated. At the moment
-the only enforcements on the amount of cookies to save to disk is
-max 20 per domain.
+Current cookie limits are: 20 per domain, and 1200 in total.
- There's also a file for controlling cookies: ~/.dillo/cookiesrc.
-Dillo initially sets it to ignore (reject) all cookies, so if you
-want to use cookies, change it to meet your needs.
-
- If you don't want cookies at all, you have two options:
-
-1.- Delete ~/.dillo/cookiesrc (or leave it just as dillo creates it).
-2. Configure Dillo with ./configure --disable-cookies. Then all the
- cookie stuff will be skipped at compilation.
-
-Note: "--disable-cookies" absolutely eliminates cookie support,
-no matter what "cookiesrc" says.
-
+When the dpi exits, cookies that you have ACCEPTed are saved to
+~/.dillo/cookies.txt, and ACCEPT_SESSION cookies are forgotten.
+The dpi normally exits after a period of inactivity, but you can force it to
+exit with the command "dpidc stop".
=====================
Controlling cookies
=====================
- There is a small and simple way to restrict urls from setting cookies
-in Dillo. In the file ~/.dillo/cookiesrc You may specify rules
-for different domains. The syntax looks something like this:
+Out of the box, dillo rejects all cookies.
+
+If you want to accept certain cookies, you can specify rules for different
+domains in the file ~/.dillo/cookiesrc. The syntax looks like:
+
+#host action
DEFAULT DENY
-slashdot.org ACCEPT
+fltk.org ACCEPT
.host.com ACCEPT_SESSION
- The first line says that we should deny all cookies from all domains
-by default.
- The second one tells Dillo to save all cookies from slashdot.org
-across sessions, until it expires.
- And finally, the third says that all subdomains of host.com should be
-allowed to set cookies. But these cookies will only be saved in
-memory until you exit.
+Line 0: Comment line begins with '#'.
+Line 1: Deny all cookies from all domains not otherwise specified.
+Line 2: Accept all cookies from fltk.org, and save them to
+ ~/.dillo/cookies.txt when the cookies dpi exits.
+Line 3: Accept all cookies from all subdomains of host.com, but
+ do not save them when the dpi exits.
+
+
+If you are positive that you will never want any cookies, you can
+configure/compile Dillo without cookie support. The option is:
+./configure --disable-cookies
===================
@@ -71,57 +65,10 @@
with more information than you have about yourself.
Some people may tell you this is "paranoid". But please, take my words
-as those of someone that has written a web browser, a cookies implementation,
-and that has deep understanding of HTTP (RFC-2068) and cookies (RFC-2965).
-
- Non technical persons may like to read:
- http://www.junkbusters.com/cookies.html
- http://www.newsfactor.com/perl/story/16455.html (about user-spying)
+as those of someone who has written a web browser, a cookies implementation,
+and who has deep understanding of HTTP and cookies.
The dillo project is especially concerned about privacy and security
issues. Our advice is to avoid cookies whenever possible and at most set
ACCEPT_SESSION to specific, trusted sites. -- You have been warned.
-
-=========================
- DPI-Dillo comunications
-=========================
-
- The cookies.dpi has the state of the cookies and is the only one
-that reads and writes to the cookies.txt file. The different
-running dillos must ask and send cookies to it.
-
- To minimize communications between the dpi and dillo clients,
-every different instance of dillo reads 'cookiesrc' and only ask
-and send cookies for allowed sites.
-
- The cookies.dpi also needs to read 'cookiesrc'. If a site is
-changed to deny cookies in 'cookiesrc', the cookies dpi can
-delete the cookies for that site from the 'cookies.txt' file the
-next time it loads and writes that file.
-
- All the work is implemented adding only three new dpi commands,
-two really, and a new send bloking dpi command function.
-
- When dillo wants the cookies for a certain site, it sends the
-'get_cookie' dpi command to the cookies.dpi, and the dpi sends
-the answer inside a 'get_cookies_answer' dpi command.
-
- If an allowed site sends a cookie, dillo uses the 'set_cookies'
-dpi command to let the cookies dpi store it.
-
-
-==============
- Restrictions
-==============
-
- Use "dpidc stop" before making changes to cookies.txt or any
-cookie files or you can lose your changes when the running dpi
-rewrites them. After the cookies dpi reloads the file all dillos
-will use the new one.
-
- If you change the 'cookiesrc' (previously calling "dpidc stop")
-only newly opened dillos will use the changes.
-
-
-Thats all folks!
diff --git a/doc/Dillo.txt b/doc/Dillo.txt
index 31f8ffb..a63c958 100644
--- a/doc/Dillo.txt
+++ b/doc/Dillo.txt
@@ -23,31 +23,31 @@
Dillo can be viewed as the sum of five main parts:
- 1.- Dillo Widget: A custom widget, gtk+ based, that holds the
-neccesary data structures and mechanisms for graphical rendering.
+ 1.- Dillo Widget: A custom widget, FLTK-based, that holds the
+necessary data structures and mechanisms for graphical rendering.
(Described in Dw*.txt, dw*.c files among the sources.)
2.- Dillo Cache: Integrated with a signal driven Input/Output
engine that handles file descriptor activity, the cache acts as
the main abstraction layer between rendering and networking.
Every URL, whether cached or not, must be retrieved using
-a_Cache_open_url (Described briefly in Cache.txt, source
-contained in cache.c).
- IO is described in IO.txt (recommended), source in IO/.
+a_Capi_open_url (Described briefly in Cache.txt, source
+contained in capi.c).
+ IO is described in IO.txt (recommended), source in src/IO/.
3.- The HTML parser: A streamed parser that joins the Dillo
Widget and the Cache functionality to make browsing possible
-(Described in HtmlParser.txt, source mainly inside html.c).
+(Described in HtmlParser.txt, source mainly inside html.cc).
4.- Image processing code: The part that handles image
-retrieving, decoding, caching and displaying. (Described in
-Images.txt. Sources: image.c, dw_image.c, dicache.c, gif.c,
+retrieval, decoding, caching and displaying. (Described in
+Images.txt. Sources: image.c, dw/image.cc, dicache.c, gif.c,
jpeg.c and png.c)
5.- The dpi framework: a gateway to interface the browser with
external programs (Example: the bookmarks server plugin).
Dpi spec: http://www.dillo.org/dpi1.html
-
+
-------------------------
HOW IS THE PAGE RENDERED?
@@ -55,34 +55,27 @@
(A short description of the internal function calling process)
- When the user requests a new URL, a_Interface_entry_open_url
+ When the user requests a new URL, a_UIcmd_open_url
is queried to do the job; it calls a_Nav_push (The highest level
URL dispatcher); a_Nav_push updates current browsing history and
calls Nav_open_url. Nav_open_url closes all open connections by
-calling a_Interface_stop and a_Interface_stop, and then calls
-a_Capi_open_url wich calls a_Cache_open_url (or the dpi module if
+calling a_Bw_stop_clients, and then calls
+a_Capi_open_url which calls a_Cache_open_url (or the dpi module if
this gateway is used).
- If Cache_search hits (due to a cached url :), the client is
+ If Cache_entry_search hits (due to a cached url :), the client is
fed with cached data, but if the URL isn't cached yet, a new CCC
-(Concomitant Control Chain) is created and commited to fetch the
-URL. Note that a_Cache_open_url will return the requested URL,
-whether cached or not.
+(Concomitant Control Chain) is created and committed to fetch the
+URL.
The next CCC link is dynamically assigned by examining the
-URL's protocol. It can be:
+URL's protocol. It can be a_Http_ccc or a_Dpi_ccc.
- a_Http_ccc
- a_File_ccc
- a_About_ccc
- a_Plugin_ccc (not implemented yet)
-
-
- If we have a HTTP URL, a_Http_ccc will succeed, and the http
+ If we have an HTTP URL, a_Http_ccc will succeed, and the http
module will be linked; it will create the proper HTTP query and
link the IO module to submit and deliver the answer.
- Note that as the Content-type of the URL is not always known
+ Note that as the Content-Type of the URL is not always known
in advance, the answering branch decides where to dispatch it to
upon HTTP header arrival.
@@ -94,7 +87,7 @@
and the whole page is contructed in a streamed way.
Somewhere in the middle of it, resize and repaint functions
are activated and idle functions draw to screen what has been
-processed.
+processed.
(The process for images is described in Images.txt)
diff --git a/doc/Dpid.txt b/doc/Dpid.txt
index 8f69843..bf9e822 100644
--- a/doc/Dpid.txt
+++ b/doc/Dpid.txt
@@ -1,6 +1,6 @@
Aug 2003, Jorge Arellano Cid,
Ferdi Franceschini --
-Last update: Dec 2004
+Last update: Nov 2009
------
@@ -14,7 +14,7 @@
dpi:
generic term referring to dillo's plugin system (version1).
- dpi1:
+ dpi1:
specific term for dillo's plugin spec version 1.
at: http://www.dillo.org/dpi1.html
@@ -39,27 +39,24 @@
never run more than one instance of a server plugin at a time.
filter plugin:
- Any program/script that can read or write to stdio. If you can write a
- shell script you can write one of these (see examples at the end).
+ A dpi program that reads from stdin and writes to stdout, and that
+ exits after its task is done (they don't remain as server plugins).
Warning, dpid will run multiple instances of filter plugins if requested.
- This is safe if the plugin only writes to stdout which is what the filter
- type dpis do at the moment.
-----------
About dpid:
-----------
* dpid is a program which manages dpi connections.
- * dpid is a daemon that serves dillo using unix domain
- sockets (UDS).
+ * dpid is a daemon that serves dillo using IDS sockets.
* dpid launches dpi programs and arranges socket communication
between the dpi program and dillo.
The concept and motivation is similar to that of inetd. The
-plugin manager (dpid) listens for a service request on a Unix
-domain socket and returns the socket name of a plugin that
-handles the service. It also watches sockets of inactive plugins
-and starts them when a connection is requested.
+plugin manager (dpid) listens for a service request on a socket
+and returns the socket/port pair of a plugin that handles the
+service. It also watches sockets of inactive plugins and starts
+them when a connection is requested.
-----------------------------------------------------------
@@ -72,9 +69,9 @@
* When having two or more running instances of Dillo, one
should prevail, and take control of dpi managing (but all
dillos carry the managing code).
- * If the managing dillo exits, it must pass control to another
+ * If the managing-dillo exits, it must pass control to another
instance, or leave it void if there's no other dillo running!
- * The need to synchronise all the running instances of
+ * The need to synchronize all the running instances of
dillo arises.
* If the controlling instance finishes and quits, all the
dpi-program PIDs are lost.
@@ -83,7 +80,7 @@
* Forks can be expensive (Dillo had to fork its dpis).
* When a managing dillo exits, the new one is no longer the
parent of the forked dpis.
- * If the Unix domain sockets for the dpis were to be named
+ * If Unix domain sockets for the dpis were to be named
randomly, it gets very hard to recover their names if the
controlling instance of dillo exits and another must "take
over" the managing.
@@ -109,12 +106,12 @@
* Different implementations of the same service
dpi programs ("dpis") are just an implementation of a
- service. There's no problem in having more than one for the
- same service.
+ service. There's no problem in implementing a different one
+ for the same service (e.g. downloads).
* Upgrading a service:
to a new version or implementation without requiring
- bringing down the dpid or patching dillo's core.
+ patching dillo's core or even bringing down the dpid.
And finally, being aware that this design can support the
@@ -124,8 +121,8 @@
------------------------------------------------------------
* "one demand/one response" man, preferences, ...
* "resident while working" downloads, mp3, ...
- * "resident until TERM signal" bookmarks, ...
-
+ * "resident until exit request" bookmarks, ...
+
* "one client only" cd burner, ...
* "one client per instance" man, ...
* "multiple clients/one instance" downloads, cookies ...
@@ -136,12 +133,12 @@
--------
* Dpi programs go in: "EPREFIX/dillo/dpi" or "~/.dillo/dpi". The binaries
are named .dpi as "bookmarks.dpi" and .filter.dpi as in
- "hello.filter.dpi". The ".filter" plugins simply read and write to stdio
- and can be implemented with a shell script easily.
+ "hello.filter.dpi". The ".filter" plugins simply read from stdin
+ and write to stdout.
* Register/update/remove dpis from list of available dpis when a
- is received.
- * dpid terminates when it receives a command.
- * dpis can be terminated with a command.
+ 'register_all' command is received.
+ * dpid terminates when it receives a 'DpiBye' command.
+ * dpis can be terminated with a 'DpiBye' command.
* dpidc control program for dpid, currently allows register and stop.
@@ -151,36 +148,7 @@
These features are already designed, waiting for implementation:
- * How to register/update/remove/ individual dpis?
- * How to kill dpis? (signals)
-
- How:
-
- A useful and flexible way is to have a "control program" for
-dpid (it avoids having to find its PID among others).
-
- Let's say:
-
- dpidc [register | upgrade | stop | ...]
-
- It can talk to a dpid UDS that serves for that (the same that
-dillo would use). That way we may also have a dpidc dpi! :-)
-
- Seriously, what I like from this approach is that it is very
-flexible and can be implemented incrementally ("dpidc register"
-is enough to start).
-
- It also avoids the burden of having to periodically check the
-dpis directory structure for changes).
-
- It also lets shell scripts an easy way to do the "dirty" work
-of installing dpis; as is required with distros' package
-systems.
-
-
- How do we tell a crashed dpi? That's the question.
- We're thinking about using the "lease" concept (as in JINI).
-
+ * dpidc remove // May be not necessary after all...
-----------------
@@ -193,14 +161,11 @@
o both directories are scanned for the list of available plugins.
~/.dillo/dpi overrides system-wide dpis.
-o ~/.dillo/dpi_socket_dir is then checked for the name of the dpi socket
- directory, if dpi_socket_dir does not exist it will be created.
-
-o next it creates Unix domain sockets for the available plugins and
- then listens for service requests on its own socket (dpid.srs)
+o next it creates internet domain sockets for the available plugins and
+ then listens for service requests on its own socket,
and for connections to the sockets of inactive plugins.
-o dpid returns the name of a plugin's socket when a client (dillo)
+o dpid returns the port of a plugin's socket when a client (dillo)
requests a service.
o if the requested plugin is a 'server' then
@@ -210,7 +175,7 @@
o if the requested plugin is a 'filter' then
1) dpid accepts the connection
- 2) duplicates the connection on stdio
+ 2) maps the socket fd to stdin/stdout (with dup2)
3) forks and starts the plugin
4) continues to watch the socket for new connections
@@ -226,7 +191,7 @@
(I)
.--- s1 s2 s3 ... sn
- |
+ |
[dpid] [dillo]
|
'--- srs
@@ -236,7 +201,7 @@
(II)
.--- s1 s2 s3 ... sn
- |
+ |
[dpid] [dillo]
| |
'--- srs ------------------'
@@ -262,7 +227,7 @@
.[dpid] | [dillo]
. | | |
. '--- srs '---------------'
- .
+ .
.............[dpi program]
when s3 has activity (incoming data), dpid forks the dpi
@@ -271,7 +236,7 @@
(V)
.--- s1 s2 (s3) ... sn
- |
+ |
[dpid] [dillo]
| |
'--- srs .---------------'
@@ -285,170 +250,80 @@
the dpi program exits, dpid resumes listening on the socket (s3).
------------------------------------------------
-How are the unix-domain-sockets for dpis named?
------------------------------------------------
-
- Let's say we have two users, "fred" and "joe".
-
- When Fred's dillo starts its dpid, the dpid creates the
-following directory (rwx------):
-
- /tmp/fred-XXXXXX
-
- using mkdtemp().
-
- and saves that filename within "~/.dillo/dpi_socket_dir".
-
- That way, another dillo instance of user Fred can easily find
-the running dpid's service request socket at:
-
- /tmp/fred-XXXXXX/dpid.srs
-
- (because it is saved in "~/.dillo/dpi_socket_dir").
-
- Now, we have a dpi directory per user, and its permissions are
-locked so only the user has access, thus the following directory
-tree structure should pose no problems:
-
- /tmp/fred-XXXXXX/bookmarks
- /downloads
- /cookies
- /ftp
- ...
- dpid.srs
-
- If user Joe starts his dillo, the same happens for him:
-
- /tmp/joe-XXXXXX/bookmarks
- /downloads
- /cookies
- /ftp
- ...
- dpid.srs
-
-
- What should dpid do at start time:
-
- Check if both, ~/.dillo/dpi_socket_dir and its directory, exist
- (it can also check the ownership and permissions).
-
- If (both exist)
- use them!
- else
- delete ~/.dillo/dpi_socket_dir
- create another /tmp/-XXXXXX directory
- save the new directory name into ~/.dillo/dpi_socket_dir
- (we could also add some paranoid level checks)
-
- To some degree, this scheme solves the tmpnam issue, different
-users of dillo at the same time, multiple dillo instances,
-polluting /tmp (cosmetic), and reasonably accounts for an
-eventual dillo or dpid crash.
-
- It has worked very well so far!
-
-
--------------------------------
So, how do I make my own plugin?
--------------------------------
- First, at least, read the "Developing a dillo plugin" section
-of dpi1 spec! :-)
-
- Note that the dpi1 spec may not be absolutely accurate, but the
-main ideas remain.
-
- Once you've got the concepts, contrast them with the drawings
-in this document. Once it all makes sense, start playing with
-hello.dpi, you can run it by starting dillo with
- dillo dpi:/hello/
-or entering
- dpi:/hello/
-as the url. Then try to understand how it works (use the drawings)
-and finally look at its code.
-
- Really, the order is not that important, what really matters is
-to do it all.
-
- Start modifying hello.dpi, and then some more. When you feel
-like trying new things, review the code of the other plugins for
-ideas.
-
- The hardest part is to try to modify the dpi framework code
+ Maybe the simplest way to get started is to understand a few
+concepts and then to use the hands-on method by using/modifying
+the hello dpi. It's designed as an example to get developers
+started.
+
+ ---------
+ Concepts:
+ ---------
+
+ * Dillo plugins work by communicating two processes: dillo
+ and the dpi.
+ * The underlying protocol (DPIP) has a uniform API which is
+ powerful enough for both blocking and nonblocking IO, and
+ filter or server dpis.
+ * The simplest example is one-request one-answer (for example
+ dillo asks for a URL and the dpi sends it). You'll find
+ this and more complex examples in hello.c
+
+ First, you should get familiar with the hello dpi as a user:
+
+ $dillo dpi:/hello/
+
+ Once you've played enough with it, start reading the well
+commented code in hello.c and start making changes!
+
+
+ ---------------
+ Debugging a dpi
+ ---------------
+
+ The simplest way is to add printf() feedback using the MSG*
+macros. You can start the dpid by hand on a terminal to force
+messages to go there.
+
+ Sometimes more complex dpis need more than MSG*. In this case
+you can use gdb like this.
+
+ 1.- Add an sleep(20) statement just after the dpi starts.
+ 2.- Start dillo and issue a request for your dpi. This will
+ get your dpi started.
+ 3.- Standing in the dpi source directory:
+ ps aux|grep dpi
+ 4.- Take note of the dpi's PID and start gdb, then:
+ (gdb) attach
+ 5.- Continue from there...
+
+
+ ------------
+ Final Notes:
+ ------------
+
+ 1.- If you already understand the hello dpi and want to try
+something more advanced:
+
+ * bookmarks.c is a good example of a blocking server
+ * file.c is an advanced example of a server handling multiple
+ non-blocking connections with select().
+
+ 2.- Multiple instances of a filter plugin may be run
+concurrently, this could be a problem if your plugin records data
+in a file, however it is safe if you simply write to stdout.
+Alternatively you could write a 'server' plugin instead as they
+are guaranteed not to run concurrently.
+
+ 3.- The hardest part is to try to modify the dpi framework code
inside dillo; you have been warned! It already supports a lot of
functionality, but if you need to do some very custom stuff, try
-extending the "chat" command.
-
-
----------------------------------
-Examples: Simple 'filter' plugins
----------------------------------
-
- For a quick and dirty introduction to dpis try the following shell scripts.
-
- #!/bin/sh
-
- read -d'>' dpip_tag # Read dillo's request
-
- # Don't forget the empty line after the Content-type
- cat <
- Content-type: text
-
- EOF
-
- echo Hi
-
- Of course you should use html in a real application (perl makes this easy).
-
- A more useful example uses the "si" system info viewer:
-
- #!/bin/sh
- # si - System Information Viewer
-
- read -d'>' dpip_tag
-
- # We don't need to send the Content-type because "si --html" does this
- # for us.
- cat <
- EOF
-
- si --html
-
- just make sure that you have si installed or you wont get far.
-
-To try out the examples create two directories for the scripts under your home directory as follows:
- mkdir -p ~/.dillo/dpi/hi
- mkdir -p ~/.dillo/dpi/si
-
-then create the scripts and put them in the dpi service directories so that you end up with
- ~/.dillo/dpi/hi/hi.filter.dpi
- ~/.dillo/dpi/si/si.filter.dpi
-
-Don't forget to make them executable.
-
-If dpid is already running register the new plugins with
- dpidc register
-
-You can now test them by entering
- dpi:/hi/
-or
- dpi:/si/
-as the url. Or simply passing the url to dillo on startup
-
- dillo dpi:/si/
-
-
- You can edit the files in place while dpid is running and reload them in
-dillo to see the result, however if you change the file name or add a new
-script you must run 'dpidc register'.
-
-WARNING
-Multiple instances of a filter plugin may be run concurrently, this could be a
-problem if your plugin records data in a file, however it is safe if you simply
-write to stdout. Alternatively you could write a 'server' plugin instead as
-they are guaranteed not to run concurrently.
- >>>>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<<<
-
+extending the "chat" command, or asking in dillo-dev.
+
+
+
+ >>>>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<<<
+
diff --git a/doc/Dw.txt b/doc/Dw.txt
index 7884ace..f690938 100644
--- a/doc/Dw.txt
+++ b/doc/Dw.txt
@@ -1,379 +1,11 @@
-Jan 2001, S.Geerken@ping.de
-Last update: Dec 2004
+Last update: Oct 2008
================
Dw: Dillo Widget
================
-Dw is mainly the module for rendering HTML. It provides a framework
-for widgets, based on the Gtk+ object framework, and is very similar
-to Gtk+, so that experiences in using and extending Gtk+ help very
-much in understanding Dw. There is some documentation at www.gtk.org
-(and probably on your local harddisk, somewhere in /usr/doc/*gtk*),
-you should especially have read the chapter "Writing Your Own
-Widgets" in the tutorial.
+Dw is the internal widget library for rendering HTML. It has excellent
+documentation.
+ Just run "doxygen" and browse the html/ directory!
-Why Not Gtk+?
-=============
-
-There are two reasons for designing a new model instead of simply
-using Gtk+ objects:
-
- 1. Most important, Gtk+ widgets are limited in size, because X
- windows are so.
- 2. There are a few extensions which are due to the different needs
- for HTML rendering compared to GUI's. (Of course, this could
- have been solved by defining a new object derived from
- GtkWidget.)
-
-
-Notes On Naming
-===============
-
-According to the naming standards, functions beginning with "a_Dw_"
-may be used outside of Dw, while, as an extention, functions used
-within Dw (e.g. p_Dw_widget_queue_resize) are prefixed with "p_Dw_".
-[todo: This could be included in NC_design.txt.]
-
-Non-static functions beginning with "Dw_" are only used between
-GtkDwViewport and DwWidget (e.g. Dw_gtk_viewport_remove_dw), they
-belong to the core of Dw. And, of course, functions only used within a
-sub-module (e.g. a specific widget) start with "Dw_" and are static
-(e.g. Dw_page_find_line_index).
-
-Dw widgets and some other structures have the prefix "Dw", while Gtk+
-widgets in Dw have the prefix "GtkDw", but functions of them begin
-with "Dw_gtk_" or "a_Dw_gtk", respectively.
-
-
-Basic Overview
-==============
-
-Dw widgets are objects derived from DwWidget, which itself derives
-from GtkObject. DwWidget is quite similar to GtkWidget, the main
-difference is that Dw widgets are always windowless and that they are
-presented in a viewport, so there is no need to limit the size. Much
-of the functionality normally provided by the X server is simulated
-by Dw.
-
-The interface between Gtk+ and Dw is the Gtk+ widget GtkDwViewport,
-which contains (at most) one top-level Dw widget.
-
-A Few Definitions:
-
- - world coordinates: coordinates relative to the upper left corner
- of the whole scrolled area ("the world")
- - viewport coordinates: coordinates relative to the upper left
- corner of the visible area
- - widget coordinates: coordinates relative to the upper left corner
- of the widget
-
-Dw widgets draw into the viewport window, and must adhere to
-*viewport coordinates*: the "world" is only an abstract term, there
-is no window for it. When GtkDwViewport processes expose events, they
-are automatically delivered to the Dw widgets. Redrawing requests due
-to scrolling of the viewport is done by the base object GtkLayout,
-you will not find any code for this in Dw.
-
-Mouse events also contain viewport coordinates. Dw will try to find
-the right Dw widget to deliver the event to.
-
-Resizing the GtkDwViewport will not resize the top-level Dw widget,
-but the latter will get some hints, so that, e.g., the page widget
-rewraps the lines at the appropriate width.
-
-See DwWidget.txt for more details.
-
-
-Embedding Gtk+ Widgets In Dw
-----------------------------
-Dw Widgets may embed Gtk+ widgets, this is done by the Dw widget
-DwEmbedGtk. For Gtk+, these embedded Gtk+ widgets are themselves
-children of the GtkDwViewport, since Gtk+ does not care about Dw.
-
-Of course, embedded Gtk+ widgets are again limited in size, but but
-in position: GtkDwViewport is derived from GtkLayout which is exactly
-designed for positioning widgets in an infinite scrolled area.
-
-
-How To Get The Top-Level Dw Widget From A BrowserWindow
--------------------------------------------------------
-The member "docwin" of BrowserWindow points on a GtkDwScrolledWindow,
-which contains a GtkDwScrolledFrame, which contains a GtkDwViewport.
-The member "child" of the latter points on the top-level Dw widget,
-or may be NULL. The top-level Dw is (currently) a DwPage (HTML and
-plain text documents) or a DwImage (images).
-
-There is a function a_Dw_gtk_scrolled_window_get_dw for this.
-
-
-Sizes
------
-A feature adapted from the old Dw are baselines. As well DwAllocation
-as DwRequisition do not have a height member, but instead ascent and
-descent, both positive or zero. (Originally I removed this, but there
-will be a few widgets in future depending on this, e.g., math
-formulas.)
-
-Unlike in Gtk, sizes of zero are allowed. The upper limit for the
-size of a widget is 2^31 (this will be enough to show the contents of
-a small library in a web page).
-
-
-Resizing
-========
-
-From outside: When writing a new widget, you should implement the
-signal "size_request". When the widget changes its size, it should
-call p_Dw_widget_queue_resize, as in a_Dw_image_size. See "Incremental
-Resizing" below for a way to increase the speed.
-
-Even if the implementation of "size_request" gets quite expensive,
-you do not have to check whether the size has changed, this is done
-by a_Dw_widget_size_request.
-
-Inside: q_Dw_widget_queue_resize will set the DW_NEEDS_RESIZE flag, a
-further call of a_Dw_widget_size_request will only then emit the
-"size_request" signal. Furthermore, mark_size_change and
-mark_extremes_change are called (see below). After that, the resizing
-is done in an idle loop, this prevents too many size requests. The
-algorithm is quite simple: any widget with a child which needs
-resizing, needs resizing, thus all parents up to top-level widget are
-marked.
-
-Incremental Resizing
----------------------
-A widget may calculate its size based on size calculations already
-done before. In this case, a widget must exactly know the reasons, why
-a call of size_request is necessary. To make use of this, a widget
-must implement the following:
-
- 1. There is a member in DwWidget, called parent_ref, which is
- totally under control of the parent widget (and so sometimes not
- used at all). It is necessary to define how parent_ref is used
- by a specific parent widget, and it has to be set to the correct
- value whenever necessary.
-
- 2. The widget must implement mark_size_change and
- mark_extremes_change, these methods are called in two cases:
-
- a) directly after q_Dw_widget_queue_resize, with the argument
- ref was passed to q_Dw_widget_queue_resize, and
- b) if a child widget has called q_Dw_widget_queue_resize,
- with the value of the parent_ref member of this child.
-
-This way, a widget can exactly keep track on size changes, and so
-implement resizing in a faster way. A good example on how to use this
-is the DwPage widget, see DwPage.txt for details.
-
-
-Anchors and Scrolling
-=====================
-
-Anchors
--------
-todo: This section is out of sync with the actual code.
-
-To set the anchor a page is viewed at, you can use one of the
-following functions:
-
- - void a_Dw_gtk_viewport_set_anchor (GtkDwViewport *viewport,
- gchar *anchor)
-
- Scroll directly to an anchor. The anchor does not need to exist
- already, see below.
-
- - void a_Dw_gtk_viewport_queue_anchor (GtkDwViewport *viewport,
- gchar *anchor)
-
- Set the anchor for the next top-level DwWidget (the next call
- of a_Dw_gtk_viewport_add_dw).
-
-There are wrappers, a_Dw_gtk_scrolled_window_queue_anchor and
-a_Dw_gtk_scrolled_window_set_anchor.
-
-After a_Dw_gtk_viewport_set_anchor has been called (indirectly by
-Nav_open_url, or by a_Dw_gtk_viewport_add_dw), changes of anchor
-positions (e.g., if widgets change there size or the anchor was not
-known before) will correct the viewport adjustment (in function
-p_Dw_gtk_viewport_update_anchor), but only as long as the user did not
-change it directly. Look at Dw_gtk_scrolled_window_init for details
-about the latter.
-
-Use p_Dw_widget_set_anchor to add anchors to a widget, see
-DwWidget.txt.
-
-Scrolling
----------
-Here is an overview on more functions for scrolling:
-
- - To scroll to a given position, there are two possibilities:
- a_Dw_gtk_viewport_set_scrolling_position simply scrolls to this
- position, while Dw_gtk_viewport_scroll_to has more facilities:
- you specify a rectangle you want to see, and the way how it is
- seen (at the border, centered, or just scroll as much as
- necessary, that it is seen). If you have a widget, you can also
- use Dw_widget_scroll_to. There is also a wrapper for
- GtkDwScrolledWindow,
- a_Dw_gtk_scrolled_window_set_scrolling_position, and two
- functions for getting the position,
- a_Dw_gtk_scrolled_window_get_scrolling_position_x, and
- a_Dw_gtk_scrolled_window_get_scrolling_position_y.
-
- - If you have a region, and want to display it, use
- a_Dw_iterator_scroll_to. For example, the findtext module makes
- use of it. There are equivalents for DwExtIterator and
- DwWordIterator. See comments on and in the function for more
- informations.
-
- - If you just want to determine where some content is allocated,
- represented by an iterator, you can use
- a_Dw_iterator_get_allocation. There are equivalents for
- DwExtIterator and DwWordIterator.
-
-
-The Objects
-===========
-
-This is the hierarchy of all objects of Dw:
-
- (GtkObject)
- +-DwWidget
- | +----DwBullet
- | +----DwContainer
- | | `----DwPage
- | +----DwEmbedGtk
- | +----DwHruler
- | `----DwImage
- `----(GtkWidget)
- `----(GtkContainer)
- +----(GtkBin)
- | +----(GtkScrolledWindow)
- | | `----GtkDwScrolledWindow
- | `----GtkDwScrolledFrame
- `----(GtkLayout)
- `----GtkDwViewport
-
-Objects in parentheses are part of Gtk+, not of Dw.
-
-
-DwBullet
---------
-Simple widget used for unnumbered list ().
-
-
-DwContainer
------------
-The base object for Dw widgets which contain other Dw widgets. As in
-Gtk+, containers are responsible for storing the children, there is
-no common data structure. There are a few signals:
-
- - void add (DwContainer *container,
- DwWidget *child);
-
- Currently not used, but may be in future.
-
- - void remove (DwContainer *container,
- DwWidget *widget);
-
- *Recognize* that a widget is destroyed, i.e., an implementation
- should remove *the pointer* from the list or so, but not
- destroy the child widget. It is called by Dw_widget_shutdown.
-
- - void forall (DwContainer *container,
- DwCallback callback,
- gpointer callback_data);
-
- Process callback for all children, in the form
- (*callback)(child, callback_data).
-
- The include_internals of the Gtk+ equivalent was not adapted,
- since it is used for more sophisticated purposes not needed in
- Dw.
-
-
-DwEmbedGtk
-----------
-This Dw widget is used to embed Gtk+ widgets into Dw container
-widgets. The Gtk+ widget is set by a_Dw_embed_gtk_add_gtk, and can
-simply be removed by destroying it.
-
-If the DwEmbedGtk contains no Gtk+ widget, it always returns 0x0x0 as
-size, so, for speed reasons, first add the Gtk+ widget into the
-DwEmbedGtk, and then the DwEmbedGtk into the other Dw widget, as at
-the end of Html_tag_open_input.
-
-
-DwHruler
---------
-Simple widget used for the
tag.
-
-
-DwImage
--------
-Widget for displaying image. See DwImage.txt for details.
-
-
-DwPage
-------
-A widget for displaying texts. See DwPage.txt for details.
-
-
-DwTable
--------
-A container widget for rendering tables. See DwTable.txt for details.
-
-
-DwWidget
---------
-The base object for all Dw widgets. See DwWidget.txt for details.
-
-
-GtkDwScrolledWindow
--------------------
-Adds a few functionalities to GtkScrolledWindow: it creates the
-GtkDwScrolledFrame and the GtkDwViewport, connects some signals, and
-provides some wrappers for using the GtkDwViewport.
-
-
-GtkDwScrolledFrame
-------------------
-General purpose scrolled widget containing another scrolled widget,
-adding a border and a focus frame. Furthermore, it processes key
-presses and mouse drags (button 2, as in Gimp) to move the viewport.
-
-There are two signals (except "set_scroll_adjustments"),
-"user_hchanged" and "user_vchanged", which are emitted when the user
-changed the viewport adjustments horizontally/vertically by using the
-keys or button 2 dragging.
-
-
-GtkDwViewport
--------------
-The interface between Gtk+ and Dw. It is responsible for displaying
-Dw Widgets and processing their events. It is derived from GtkLayout,
-to make embedding Gtk+ widgets into Dw widgets simpler, see the
-documentation of GtkLayout in the Gtk+ tutorial for details.
-
-GtkDwViewport contains at most one top-level Dw Widget, if it exists.
-The Gtk+ methods of GtkDwViewport are more or less mapped on the
-methods of the DwWidget. In detail:
-
- - Dw_gtk_viewport_size_allocate will call a_Dw_widget_set_width,
- a_Dw_widget_set_ascent (with allocation->height) and
- a_Dw_widget_set_descent (with zero as argument), and then allocate
- the Dw widget at the size returned by a_Dw_widget_size_request.
-
- - Dw_gtk_viewport_draw and Dw_gtk_viewport_expose will call
- a_Dw_widget_draw, which will emit the "draw" signal.
-
- - Handling of mouse events is mostly done in Dw_widget_mouse_event,
- see DwWidget.txt for details. Note that the functions return
- FALSE, if the event was not processed, so that they are delivered
- to the parent widget(s) of the GtkDwViewport, this scheme e.g.
- prevents dragging of the viewport (done by GtkScrolledFrame) when
- pressing mouse button 2 on a link.
-
-You may call gtk_container_set_border_width for a border around the
-scrolled area.
diff --git a/doc/DwImage.txt b/doc/DwImage.txt
deleted file mode 100644
index e995c98..0000000
--- a/doc/DwImage.txt
+++ /dev/null
@@ -1,198 +0,0 @@
-Jan 2001, S.Geerken@ping.de
-Last update: Dec 2004
-
-=======
-DwImage
-=======
-
-A widget for displaying images and handling image maps.
-
-
-Image Maps
-==========
-
-Client Side Image Maps
-----------------------
-You must first create a list of image maps: Allocate a DwImageMapList,
-and initialize it by calling a_Dw_image_map_list_init. Adding a map is
-done by a_Dw_image_map_list_add_map. a_Dw_image_map_list_add_shape
-adds a shape to the last map. For the meaning of the link argument,
-see Section "Signals".
-
-Image maps are referred by a URL (not only by a name). But currently,
-the image map list is stored in DilloHtmlLB and there is no
-possibility to parse documents without rendering, so images can only
-use maps defined in the same document.
-
-To use a map in an image, call a_Dw_image_set_usemap with the image,
-the map list, and the URL of the map. Passing the whole list makes it
-possible to use maps parsed after the image is created.
-
-
-Server Side Image Maps
-----------------------
-To use images for server side image maps, you must call
-a_Dw_image_set_ismap and the style must contain a valid link
-element. See section "Signals" for more details.
-
-
-Signals
-=======
-
-There are five signals, which can be connected to process actions with
-links. All have at least three arguments:
-
- - link is the link element of the DwStyle (server side image maps)
- or DwImageMapShape (client side image maps). The value is an
- integer, which is currently only used for hypertext links. But
- generally, it depends on the signal callback how this value is
- used.
-
- - x and y are, when server side image maps are used, the relative
- coordinates of the mouse pointer, otherwise always -1.
-
-Note that, unlike by DwPage before, no cursors are set. Instead, the
-signal callback function has to do this.
-
-The signals:
-
- - void link_entered (DwImage *image,
- gint link, gint x, gint y)
-
- Emitted when the link the mouse pointer is over has
- changed. "Changed" includes link, x and y, so this signal is also
- emitted each time the pointer is moved within a server side image
- map. If the pointer is outside of a link, all arguments have the
- value -1.
-
-
- - void link_pressed (DwImage *image,
- gint link, gint x, gint y,
- GdkEventButton *event)
-
- Emitted when the user presses a mouse button _inside_ a link,
- this signal is never emitted with link = -1. You can use the
- event to get information about the button, shift keys, etc.
-
-
- - void link_released (DwImage *image,
- gint link, gint x, gint y,
- GdkEventButton *event)
-
- - void link_clicked (DwImage *image,
- gint link, gint x, gint y,
- GdkEventButton *event)
-
- Analogue to link_pressed.
-
- - void void (*image_pressed) (DwImage *page,
- GdkEventButton *event)
-
- Emitted when the user presses the mouse button on an image which
- has no related map. In some cases, it may be neccessary to
- suppress event processing by a_Dw_widget_set_button_sensitive().
-
-
-Future Extentions
-=================
-
-These are some ideas for a different design, which will solve several
-problems (image transparency, memory usage when implementing a global
-size factor):
-
-1. Instead of a guchar array, a new data type, DilloImageBuffer,
- should be used (DICacheEntry::ImageBuffer and DwImage::buffer). Any
- access is done by function calls. Copying the lines (in
- a_Image_write) is done by a_Image_buffer_copy_line, etc. The call to
- Image_line becomes obsolete, since DilloImageBuffer will deal with
- different types: indexed, RGB, gray, RGBA, gray-alpha(?). This may
- be useful for a more efficient implementation of DilloImageBuffer.
-
-2. The modules Png, Jpeg, Gif, Image and DICache deal with the
- original image size (read by the decoders), while DwImage gets the
- "viewed" size (original size, multiplied by the global image
- scaling factor) from DilloImageBuffer.
-
-3. For DwImage, there are further methods which replace the current
- direct access. Note to worth:
-
- - Scaled buffers are shared, reference counters are used. Copying
- rows will automatically also affect the related scaled buffers.
-
- - There are two methods for drawing, one called after expose events
- (Dw_image_draw) and another called by a_Dw_image_draw_row. The
- exact rules, how the buffer is scaled (this can, e.g., differ by a
- pixel or so), is hidden by DilloImageBuffer.
-
- - As noted above, all DwImage code is based on the viewed size.
-
-4. The global image scaling factor is used in two places. The HTML
- parser must apply it on the WIDTH and HEIGHT attributes of the
- tag and DilloImageBuffer must use it to scale the inherent
- size of an image. There are two modes, which the user can switch
- by a dillorc option:
-
- (i) The original image data is preserved, and an additional scaled
- buffer is created:
-
- +-------+ +------------------+ additional
- | Image | -- copy --> | DilloImageBuffer | --> scaled
- +-------+ rows | (original size) | buffers
- +------------------+
- | ^
- | |
- scale requests
- each row for scaled
- | buffers
- | |
- v |
- +------------------+
- | DilloImageBuffer |
- | (viewed size) |
- +------------------+
- ^
- |
- +---------+
- | DwImage |
- +---------+
-
- (ii) The original data gets lost just after scaling:
-
- +-------+ +------------------+
- | Image | -- copy --> | DilloImageBuffer | --> scaled
- +-------+ rows | (viewed size) | buffers
- +------------------+
- ^
- |
- +---------+
- | DwImage |
- +---------+
-
- (ii) uses generally less memory, while in some cases leads to a
- lower rendering quality, as in this example:
-
- "foo.png" has a size of 100x100 pixels, the image scaling factor is
- 50%, and the following HTML sniplet is rendered:
-
-
-
-
- The first image is displayed at a size of 50x50, the second at
- 100x100. (i) will, for the second, use the original buffer, but
- (ii) will enlarge the buffer, which was scaled down before, so
- resulting in a "pixelized" image.
-
-5. Any implementation of DilloImageBuffer will handle transparency
- independent of the background, i.e., the background colour will not
- be used anymore. The first implementation may be based on GdkRGB
- and (when needed) dithered clipping bitmaps. Better implementations
- may then be developed in the future.
-
-6. Background images: The modules Image and DICache do no longer
- access the DwImage directly, all calls are replaced by an
- Interface, which is then implemented by DwImage and an appropriate
- structure for background images (part of DwStyle). The interface is
- in C realized by a struct of function pointers, and a generic
- pointer on DwImage, etc.
-
-7. If someone really needs it, animated GIF's may be considered.
diff --git a/doc/DwPage.txt b/doc/DwPage.txt
deleted file mode 100644
index 71e6af8..0000000
--- a/doc/DwPage.txt
+++ /dev/null
@@ -1,152 +0,0 @@
-Nov 2001, S.Geerken@ping.de
-Last update: Dec 2004
-
-======
-DwPage
-======
-
-A widget for displaying texts. It is (currently) the main widget for
-rendering HTML documents.
-
-
-Signals
-=======
-
-DwPage defines the same signals as DwImage, except "image_pressed",
-with the exception that the coordinates are always -1. See
-DwImage.txt for more details.
-
-
-Collapsing Spaces
-=================
-
-The idea behind this is that every text box has a specific vertical
-space around and that they are combined to one space, according to
-rules stated below. A rule is either a paragraph within a DwPage
-widget, or a DwPage within a DwPage widget, in a single line; the
-latter is used for indented boxes and list items.
-
-The rules:
-
- 1. If a box is following another, the space between them is the
- maximum of both box spaces:
-
- +---------+
- |/////////|
- |/////////| +---------+
- +---------+ |/////////|
- | A | |/////////|
- +---------+ +---------+
- |/////////| | A |
- |/////////| +---------+
- +---------+ are combined like this: |/////////|
- |XXXXXXXXX|
- +---------+ +---------+
- |\\\\\\\\\| | B |
- +---------+ +---------+
- | B | |\\\\\\\\\|
- +---------+ +---------+
- |\\\\\\\\\|
- +---------+
-
- 2. a) If one box is the first box within another, the upper space
- of these boxes collapse. b) The analogue is the case for the
- last box:
-
- +---------+ If B and C are put into A,
- |/////////| the result is:
- |/////////|
- +---------+ +---------+ +---------+
- | A | <--+-- |\\\\\\\\\| |/////////|
- +---------+ ¦ +---------+ |XXXXXXXXX|
- |/////////| | | B | +---------+
- |/////////| | +---------+ | B |
- +---------+ | |\\\\\\\\\| +---------+
- | +---------+ |\\\\\\\\\|
- | |\\\\\\\\\|
- | +---------+ |\\\\\\\\\|
- `-- |\\\\\\\\\| +---------+
- |\\\\\\\\\| | C |
- |\\\\\\\\\| +---------+
- +---------+ |\\\\\\\\\|
- | C | |XXXXXXXXX|
- +---------+ |XXXXXXXXX|
- |\\\\\\\\\| +---------+
- |\\\\\\\\\|
- |\\\\\\\\\|
- +---------+
-
-For achieving this, there are some features of DwPage:
-
- - Consequent breaks are automatically combined, according to
- rule 1. See the code of a_Dw_page_add_break for details.
-
- - If a break is added as the first word of the DwPage within
- another DwPage, collapsing according to rule 2a is done
- automatically. See the code of a_Dw_page_add_break.
-
- - To collapse spaces according to rule 2b,
- a_Dw_page_hand_over_break must be called for the *inner*
- widget. The HTML parser does this in Html_eventually_pop_dw.
-
-
-Collapsing Margins
-==================
-
-Collapsing margins, as defined in the CSS2 specification, are,
-supported in addition to collapsing spaces. Also, spaces and margins
-collapse themselves. I.e., the space between two paragraphs is the
-maximum of the space calculated as described in "Collapsing Spaces"
-and the space calculated according to the rules for collapsing margins.
-
-(This is an intermediate hybrid state, collapsing spaces are used in
-the current version of dillo, while I implemented collapsing margins
-for CSS and integrated it already into the main trunk. For a pure
-CSS-based dillo, collapsing spaces will not be needed anymore, and may
-be removed for simplicity.)
-
-
-Some Internals
-==============
-
-There are two lists, words and lines. The word list is quite static;
-only new words may be added. A word is either text, a widget, a break
-or an anchor. Anchors are stored in the text, because it may be
-necessary to correct the scroller positions at rewrapping.
-
-Lines refer to the word list (first and last), they are completely
-redundant, i.e., they can be rebuilt from the words. Lines can be
-rewrapped either completely or partially (see "Incremental Resizing"
-below). For the latter purpose, several values are accumulated in the
-lines. See the file "dw_page.h" for details.
-
-
-Incremental Resizing
---------------------
-DwPage makes use of incremental resizing as described in Dw.txt,
-section "Resizing". The parent_ref is, for children of a DwPage,
-simply the number of the line.
-
-Generally, there are three cases which may change the size of the
-widget:
-
- 1. The available size of the widget has changed, e.g., because the
- user has changed the size of the browser window. In this case,
- it is necessary to rewrap all the lines.
-
- 2. A child widget has changed its size. In this case, only a rewrap
- down from the line where this widget is located is necessary.
-
- (This case is very important for tables. Tables are quite at the
- bottom, so that a partial rewrap is relevant. Otherwise, tables
- change their size quite often, so that this is necessary for a
- fast, non-blocking rendering)
-
- 3. A word (or widget, break etc.) is added to the page. This makes
- it possible to reuse the old size by simply adjusting the
- current width and height, so no rewrapping is necessary.
-
-The state of the size calculation is stored in wrap_ref within DwPage,
-which has the value -1 if no rewrapping of lines necessary, or
-otherwise the line from which a rewrap is necessary.
-
diff --git a/doc/DwStyle.txt b/doc/DwStyle.txt
deleted file mode 100644
index 9a1ec4e..0000000
--- a/doc/DwStyle.txt
+++ /dev/null
@@ -1,310 +0,0 @@
-Apr 2001, S.Geerken@ping.de
-Last update: Dec 2004
-
-=======
-DwStyle
-=======
-
-Styles of Dillo Widgets
-
-
-Note
-====
-
-DwStyle has derived from DwPageAttr, and its current structure is very
-similar to it. In the future, there will be some changes and extensions.
-Namely:
-
- - image maps will be handled differently (done),
- - margins, borders, paddings (done),
- - background colors/images, and
- - cursors and tooltips will perhaps move into DwStyle.
-
-Furthermore, widgets will probably refer to different styles for
-different states.
-
-
-Overview
-========
-
-DwStyle provides some resources and attributes for drawing widgets, as
-well as for parts of a widget (e.g., DwPage uses DwStyle's for its
-words). Creating a style is done by filling a DwStyle with the
-attributes (except the ref_count), and calling Dw_style_new:
-
- DwStyle style_attrs, *style;
-
- style_attrs.foo = bar;
- // etc.
- style = a_Dw_style_new (&style_attrs, random_window);
- // do something with style
-
-After this, the attributes of style should not be changed anymore,
-since styles are often shared between different widgets etc. (see
-below). Most times, you simply copy the attributes of another style
-and modify them:
-
- style_attrs = *another_style;
- style_attrs.foo = bar;
- style = a_Dw_style_new (&style_attrs, random_window);
-
-The font structure can be created by Dw_style_font_new, in a similar
-way (the GdkFont in font_attrs will be ignored), and colors by
-Dw_style_color_new, passing 0xrrggbb as an argument. Note that fonts
-and colors are only intended to be used in conjunction with DwStyle.
-
-
-Lengths and Percentages
-=======================
-
-DwStyleLength is a simple data type for lengths and percentages:
-
- - A length refers to an absolute measurement. It is used to
- represent the HTML type %Pixels; and the CSS type .
-
- For CSS lenghts, there are two units: (i) pixels and absolute
- units, which have to be converted to pixels (a pixel is, unlike
- in the CSS specification, treated as absolute unit), and (ii) the
- relative units "em" and "ex" (see below).
-
- - A percentage refers to a value relative to another value. It is
- used for the HTML type %Length; (except %Pixels;), and the CSS
- type .
-
- - A relative length can be used in lists of HTML MultiLengths.
-
-Since many values in CSS may be either lengths or percentages, a
-single type is very useful.
-
-Useful macros and functions
----------------------------
-Macros for creating lengths:
-
- DW_STYLE_CREATE_LENGTH (n) Returns a length of n pixels.
-
- DW_STYLE_CREATE_EX_LENGTH (n) Returns a length of n times the
- 'x-height'
-
- DW_STYLE_CREATE_EM_LENGTH (n) Returns a length of n times the
- 'font-size'
-
- DW_STYLE_CREATE_PERCENTAGE (n) Returns a percentage, n is relative
- to 1, not to 100.
-
- DW_STYLE_CREATE_RELATIVE (n) Returns a relative length.
-
- DW_STYLE_UNDEF_LENGTH Used to indicate unspecified sizes,
- errors, and the end of a list of
- lengths.
-
-Furthermore, there are some functions in html.c:
-
- DwStyleLength Html_parse_length (gchar *attr);
-
- Returns a length or a percentage, or DW_STYLE_UNDEF_LENGTH in
- case of an error.
-
- DwStyleLength* Html_parse_multi_length (gchar *attr);
-
- Returns a vector of lengths/percentages. The caller has to free
- the result when it is not longer used.
-
-Macros for examining lengths:
-
- DW_STYLE_IS_LENGTH (l) Returns TRUE if l is a length.
-
- DW_STYLE_IS_PERCENTAGE (l) Returns TRUE if l is a percentage.
-
- DW_STYLE_IS_RELATIVE (l) Returns TRUE if l is a relative
- length.
-
- DW_STYLE_GET_LENGTH (l, f) Returns the value of a length in
- pixels, as an integer. f is the
- font, this is used if l is based on
- font sizes.
-
- DW_STYLE_GET_PERCENTAGE (l) Returns the value of a percentage,
- relative to 1, as a float.
-
- DW_STYLE_GET_RELATIVE (l) Returns the value of a relative
- length, as a float.
-
-
-Representation
---------------
-Notes:
-
- 1. This is not part of the interface and may change! Use the
- macros described above.
- 2. Negative numbers may not work yet.
-
-DwStyleLength is represented by an integer (n is the number of bits of
-an integer):
-
- - Undefined lengths are represented by 0.
-
- - Lenghts in pixel:
-
- +---+ - - - +---+---+---+---+
- | int value | 0 | 1 |
- +---+ - - - +---+---+---+---+
- n-1 3 2 1 0
-
- - Lengths in in x-height:
-
- +---+ - - - +---+---+---+---+
- | real value | 0 | 1 | 1 |
- +---+ - - - +---+---+---+---+
- n-1 3 2 1 0
-
- - Lengths in in font-size:
-
- +---+ - - - +---+---+---+---+
- | real value | 1 | 1 | 1 |
- +---+ - - - +---+---+---+---+
- n-1 3 2 1 0
-
- - Percentages:
-
- +---+ - - - +---+---+---+---+
- | real value | 0 | 1 | 0 |
- +---+ - - - +---+---+---+---+
- n-1 3 2 1 0
-
- - Relative lengths:
-
- +---+ - - - +---+---+---+---+
- | real value | 1 | 1 | 0 |
- +---+ - - - +---+---+---+---+
- n-1 3 2 1 0
-
-A "real value" is a fixed point number consisting of (m is the number
-of bits of the value, not the whole integer):
-
- +---+ - - - +---+---+ - - - +---+
- | integer part | rest |
- +---+ - - - +---+---+ - - - +---+
- m 16 15 0
-
-For *internal* use, there are two converting macros,
-DW_STYLE_REAL_TO_FLOAT and DW_STYLE_FLOAT_TO_REAL.
-
-
-DwStyle Boxes
-=============
-
-The CSS Box Model
------------------
-For borders, margins etc., DwStyle uses the box model defined by
-CSS2. DwStyle contains some members defining these attributes. A
-widget must use these values for any calculation of sizes. There are
-some helper functions (see dw_style.h). A DwStyle box looks quite
-similar to a CSS box:
-
-
- ,-- margin.left
- | ,-- border.left
- | | ,-- padding.left
- |---+---+---|
- +---------------------------------------+ ---
- | | | margin.top
- | +-------------------------------+ | -+-
- | | Border | | | border.top
- | | +-----------------------+ | | -+-
- | | | Padding | | | | padding.top
- new widget | | | +---------------+ | | | ---
- allocation -->| | | | | | | |
- | | | | Content | | | |
- former widget ------------>| | | | |
- allocation | | | +---------------+ | | | ---
- | | | | | | | margin.bottom
- | | +-----------------------+ | | -+-
- | | | | | border.bottom
- | +-------------------------------+ | -+-
- | | | padding.bottom
- +---------------------------------------+ ---
- |---+---+---|
- padding.right --' | |
- border.right --' |
- margin.right --'
-
-Background colors
------------------
-The background color is stored in style->background_color, which be
-NULL (the background color of the parent widget is shining through).
-
-For toplevel widgets, this color is set as the background color of the
-viewport, for other widgets, a filled rectangle is drawn, covering the
-content and padding. (This is compliant with CSS2, the background
-color of the toplevel element covers the whole canvas.)
-
-Drawing
--------
-There is a new function Dw_widget_draw_widget_box, which should be
-called at the beginning of Dw_foo_draw. For parts referring to styles
-(e.g., words in a page), Dw_widget_draw_box should be used.
-
-
-Notes on Memory Management
-==========================
-
-Memory management is done by reference counting, a_Dw_style_new
-returns a pointer to DwStyle with an increased reference counter, so
-you should care about calling Dw_style_unref if it is not used
-anymore. You do *not* need to care about the reference counters of
-fonts and styles.
-
-In detail:
-
- - a_Dw_style_ref is called in
-
- * a_Dw_widget_set_style, to assign a style to a widget,
-
- * a_Dw_page_add_text, a_Dw_page_add_widget,
- a_Dw_page_add_anchor, to assign a style to a word,
-
- * and Html_push_tag (often the reference counter is again
- decreased shortly after this).
-
- - a_Dw_unref_style is called in:
-
- * Dw_page_destroy, Dw_widget_destroy, Html_cleanup_tag,
- Html_pop_tag, Html_close,
-
- * a_Dw_widget_set_style, Html_set_top_font (and several
- Html_tag_open_... functions), these functions overwrite an
- existing style.
-
-
-HTML Stack
-==========
-
-(This is not DwStyle specific, but may be useful if you are working on
-the HTML parser.)
-
-The topmost element of the HTML stack contains a (reference to a)
-style which will be used to add the text to the current page. If you
-use a style only for a short while (see Html_tag_open_frame for an
-example), you may use it this way:
-
- style_attrs = *html->stack[html->stack_top].style;
- style_attrs.foo = bar;
- style = a_Dw_style_new (&style_attrs, random_window);
-
-Do not forget to unref it afterwards. A good choice for random_window
-is html->bw->main_window->window.
-
-In many cases, you want to set the style for the content of an element
-(e.g., ). Then you must store it in the stack:
-
- DwStyle style_attrs, *old_style;
-
- old_style = html->stack[html->stack_top].style;
- style_attrs = *old_style;
- style_attrs.foo = bar;
- html->stack[html->stack_top].style =
- a_Dw_style_new (&style_attrs, random_window);
- a_Dw_style_unref (old_style);
-
-The macro HTML_SET_TOP_ATTR can be used for single attributes, for
-changing more attributes, this code should be copied for efficiency.
diff --git a/doc/DwTable.txt b/doc/DwTable.txt
deleted file mode 100644
index 07c0618..0000000
--- a/doc/DwTable.txt
+++ /dev/null
@@ -1,205 +0,0 @@
-May 2001, S.Geerken@ping.de
-Last update: Dec 2004
-
-=======
-DwTable
-=======
-
-A container widget for rendering tables.
-
-
-The DwTable Widget
-==================
-
-DwTable is a container widget for rendering tables. It aligns other
-DwWidgets (normally DwPage), according to the following rules:
-
- 1. All columns have have the same width W, except:
-
- - W is less than the minimal column width, or
- - W is greater than the maximal column width.
-
- Furthermore, W is
-
- - less than all minimal widths of columns not having W as
- width, and
- - greater than all maximal widths of columns not having W as
- width.
-
- 2. The table tries to use exactly the whole available width, except
- if it is not possible, because the it is less/greater than the
- minimal/maximal table width.
-
-This is simple to implement for columns with COLSPAN == 1, using
-a_Dw_get_extremes for getting the minimal and maximal widths. For
-arbitrary COLSPAN values, an approach described in "Subtables" is
-used to get optimal results (as described above) in most cases, while
-the rendering remains fast.
-
-
-Subtables
-=========
-
-A table is divided into subtables, which do not (in most cases) share
-spanning cells, until single columns are left. Cells spanning the
-whole width are removed before dividing further. Example:
-
- +---+-------+---+
- | A | B | C |
- +---+-------+---+
- | D | E |
- +---+-------+---+
- | F | G | H |
- +---+-------+---+
- ' ' ` `
- ' ' ` `
- +---+-------+ +---+
- | A | B | | C |
- +---+-------+ +---+
- removed --> | D | | E |
- +---+-------+ +---+
- | F | G | | H |
- +---+-------+ +---+
- ' ' ` ` final
- ' ' ` `
- +---+ +-------+
- | A | | B | <-.
- +---+ +-------+ >- removed
- | F | | G | <-'
- +---+ +-------+
- final ' ' ` `
- ' ' ` `
- [empty] [empty]
- final final
-
-There is a structure, DwTableSub, for holding all the information. It
-is rebuilt when new cells are added. Do not confuse this with nested
-tables, these are represented by the Dw widget hierarchy.
-
-If table cells overlap horizontally, they are (virtually) divided. The
-minimal and maximal widths are apportioned to the other columns
-(resulting in a non optimal layout):
-
- +-------+---+---+
- | A | B | C |
- +---+---+---+---+
- | D | E |
- +---+-----------+
- ' ' ` `
- ' ' ` `
- +-------+ +---+---+
- | A | | B | C |
- +---+---+ +---+---+
- | D |1/3| | 2/3 E |
- | | E | | |
- +---+---+ +-------+
-
-Example for a non-optimal case
-------------------------------
-The HTML document fragment
-
-
-
- Text
- | LongText
- |
- Text
- | LongText
- |
-
-will result in:
-
- | 0 | 1 | 2 |
-
- +------------+----------+
- | Text | LongText |
- +------+-----+----------+
- | Text | LongText |
- +------+----------------+
-
-The width of column 1 is determined by the half of the minimal width
-of the LongText. An optimal rendering would be something like:
-
- ,- 1
- | 0 || 2 |
-
- +-------+----------+
- | Text | LongText |
- +------++----------+
- | Text | LongText |
- +------+-----------+
-
-
-Algorithms
-==========
-
-Calculating extremes
---------------------
-The extremes of all subtables are calculated by
-Dw_table_sub_get_extremes and stored in DwTableSub:
-
- minimal/maximal width (sub table) =
- - for single column: maximum of all minimal/maximal widths
- - otherwise: maximum of
- 1. all minimal/maximal widths of cells spanning
- the whole width, and
- 2. the sum of the minimal/maximal widths of the
- sub-subtables
-
- In step 1, the width argument is used to adjust the maximum
- and minimum width of the whole subtable and mark it as fixed.
-
-todo: describe percentages.
-
-Calculating column widths
--------------------------
-The calculation is based on a fixed width, which is, at the top, the
-width set by a_Dw_widget_set_width. This is corrected by the minimal and
-maximal width of the whole table, and, if given, the width attribute
-of the table. At each level, the available width is always between the
-minimal and the maximal width of the subtable.
-
-For single columns, the width is the passed fixed width. Otherwise:
-
- 1. Calculate relative widths, they effect the minimal and maximal
- widths. (Temporally, not permanently!)
-
- 2. The sum of these corrected minima may be greater as the fixed
- width of the subtable. In this case, decrease them again to
- match exactly the fixed width, then use them as sub-subtable
- fixed widths and finish. Otherwise, continue:
-
- 3. If the extremes of the spanning widths of the subtable are
- greater than the sum of sub-subtables extremes, adjust the
- extremes of sub-subtables which are not fixed, i.e., where no
- width argument (either percentage or fixed) freezes the width.
-
- 4. Use an iteration on the subtables, to determine the column
- widths, see Dw_table_sub_calc_col_widths for details.
-
- 5. After this, apply this recursively on all subtables and pass the
- subtable width as fixed width.
-
-
-Borders, Paddings, Spacing
-==========================
-
-Currently, DwTable supports only the separated borders model (see CSS
-specification). Borders, paddings, spacing is done by creating DwStyle
-structures with values equivalent to following CSS:
-
- TABLE {
- border: outset ;
- border-collapse: separate;
- border-spacing:
- background-color:
- }
-
- TD TH {
- border: inset ;
- padding:
- background-color:
- }
-
-Here, refers to the attribute bar of the tag foo. See
-Html_open_table and Html_open_table_cell for more details.
diff --git a/doc/DwWidget.txt b/doc/DwWidget.txt
deleted file mode 100644
index fed0a3b..0000000
--- a/doc/DwWidget.txt
+++ /dev/null
@@ -1,339 +0,0 @@
-Jan 2001, S.Geerken@ping.de
-Last update: Dec 2004
-
-========
-DwWidget
-========
-
-The base object for all Dw widgets.
-
-
-Structures
-==========
-
-DwRectangle
------------
-A replacement for GdkRectangle, the only difference is the use of 32
-instead of 16 bit integers.
-
-
-DwAllocation, DwRequisition
----------------------------
-Similar to GtkAllocation and GtkRequisition. Instead of a height, you
-have two members, ascent and descent.
-
-
-DwExtremes
-----------
-A structure containing the minimal and maximal width of a widget. See
-get_extremes below for details.
-
-
-DwWidget
---------
-Some members you may use:
-
- parent The parent widget. NULL for toplevel widgets.
-
- flags See below.
-
- style The style attached to the widget, this must
- always be defined, but is not created
- automatically. Instead, this has to be done
- immediately after creating the widget
- (e.g., in a_Web_dispatch_by_type). This style
- contains attributes and resources for general
- drawing. See DwStyle.txt for details.
-
-These members should only be used within the "core" (GtkDw*, DwWidget
-and DwEmbedGtk):
-
- viewport The viewport containing the widget. Defined
- for all widgets.
-
- allocation,
- requisition,
- extremes,
- user_requisition These are used to optimize several wrappers,
- see below.
-
- anchors_table See notes on achors.
-
-Flags
------
-Flags can be set and unset with DW_WIDGET_SET_FLAGS and
-DW_WIDGET_UNSET_FLAGS. For reading flags use the macros DW_WIDGET_...
-
- DW_NEEDS_RESIZE
- DW_EXTREMES_CHANGED Denotes that the widget must be resized. Used
- only internally. See Dw.txt and the source
- for more details.
-
- DW_NEEDS_ALLOCATE Set to overide the optimation in
- a_Dw_widget_size_allocate. Used only
- internally.
-
- DW_REALIZED Set when the widget is realized. Should be
- used to prevent crashes in certain
- situations.
-
-Following flags describe characteristics of widgets and are typically
-set in the init function:
-
- DW_USES_HINTS A widget with this flag set has a complex way
- to deal with sizes, and should
-
- - implement the functions set_width,
- set_ascent, set_descent, and
- get_extremes, and
- - deal completely with width and height
- in widget->style.
-
- Examples are DwPage and DwTable. Other
- widgets, like DwImage and DwHRuler, are much
- simpler and don't have to set this flag. For
- these widgets, much of the size calculation
- is done by the parent widget.
-
- This flag is unset by default.
-
- DW_HAS_CONTENT If this flag is set, more space is reserved
- for the widget in some circumstances. E.g.,
- if an image has a width of 100%, it makes
- sense to use more space within a table cell,
- as compared to a horizontal ruler, which does
- not "have a content".
-
- This flag is set by default.
-
-
-Signal Prototypes
-=================
-
- - void size_request (DwWidget *widget,
- DwRequisition *requisition);
-
- Similar to Gtk.
-
- void get_extremes (DwWidget *widget,
- DwExtremes *extremes);
-
- Return the maximal and minimal width of the widget, equivalent
- to the requisition width after calling set_width with zero and
- infinitive, respectively. This is important for fast table
- rendering. Simple widgets do not have to implement this; the
- default is the requisition width for both values.
-
- - void size_allocate (DwWidget *widget,
- DwAllocation *allocation);
-
- Similar in Gtk. Note: allocation has world coordinates.
-
- - void set_width (DwWidget *widget,
- guint32 width);
-
- - void set_height (DwWidget *widget,
- guint32 height);
-
- These are hints by the caller, which *may* influence the size
- returned by size_request. The implementation should call
- Dw_widget_queue_resize if necessary. In most cases, these
- signals do not have to be implemented. Currently, only the
- DwPage widget uses this to determine the width for rewrapping
- text (note that the resulting width returned by
- Dw_page_size_request may be _bigger_) and relative sizes of the
- children.
-
- - void draw (DwWidget *widget,
- DwRectangle *area,
- GdkEventExpose *event);
-
- Draw the widget's content in the specified area. It may either
- be caused by an expose event, or by an internal drawing request
- (e.g., followed by resizing of widgets). In the first case, you
- get the *original* expose event as third argument. In the
- latter, event is NULL. The area argument has widget
- coordinates. A DwContainer is responsible for drawing its
- children.
-
- (Since DwWidget's are always windowless, there was no need for
- two signals, "draw" and "expose_event".)
-
- - void realize (DwWidget *widget);
-
- Create all necessary X resources. Called when either the
- viewport (top-level widgets) or, respectively, the parent Dw
- widget is realized, or an widget is added to an already
- realized Dw widget/viewport.
-
- - void unrealize (DwWidget *widget);
-
- Remove created X resources.
-
- - gint button_press_event (DwWidget *widget,
- guint32 x,
- guint32 y,
- GdkEventButton *event);
-
- This signal is emitted when the user presses a mouse button in
- a DwWidget. x and y are the coordinates relative to the origin
- of the widget, event is the *original* event, which may, e.g.,
- be used to determine the number of the pressed button, the state
- of the shift keys, etc. The implementation of this signal
- should return TRUE, if the event has been processed, otherwise
- FALSE.
-
- A DwContainer is *not* responsible for delivering button press
- events to its children. Instead, Dw first emits the
- button_press_event signal for the most inner widgets and
- continues this for the parents, until TRUE is returned.
-
- - gint button_release_event (DwWidget *widget,
- guint32 x,
- guint32 y,
- GdkEventButton *event);
-
- Compare button_press_event.
-
- - gint motion_notify_event (DwWidget *widget,
- guint32 x,
- guint32 y,
- GdkEventMotion *event);
-
- Compare button_press_event. event may be NULL when the call was
- caused by something different than a "real" motion notify event.
- E.g., either when widgets are moved (not yet implemented), or the
- viewport.
-
- - gint enter_notify_event (DwWidget *widget,
- DwWidget *last_widget,
- GdkEventMotion *event);
-
- These "events" are simulated based on motion nofify events.
- event is the *original* event (may also be NULL in some cases).
- last_widget is the widget in which the pointer was in before.
-
- - gint leave_notify_event (DwWidget *widget,
- DwWidget *next_widget,
- GdkEventMotion *event);
-
- Compare enter_notify_event. next_widget is the widget the
- pointer is now in.
-
-
-Useful Internal Functions and Macros
-====================================
-
- - gint Dw_widget_intersect (DwWidget *widget,
- DwRectangle *area,
- DwRectangle *intersection);
-
- Calculates the intersection of widget->allocation and area,
- returned in intersection (in widget coordinates!). Typically
- used by containers when drawing their children. Returns whether
- intersection is not empty.
-
- - gint32 Dw_widget_x_viewport_to_world (DwWidget *widget,
- gint16 viewport_x);
-
- - gint32 Dw_widget_y_viewport_to_world (DwWidget *widget,
- gint16 viewport_y);
-
- - gint16 Dw_widget_x_world_to_viewport (DwWidget *widget,
- gint32 world_x);
-
- - gint16 Dw_widget_y_world_to_viewport (DwWidget *widget,
- gint32 world_y);
-
- These functions convert between world and viewport coordinates.
-
- - void Dw_widget_queue_draw (DwWidget *widget);
-
- - void Dw_widget_queue_draw_area (DwWidget *widget,
- gint32 x,
- gint32 y,
- guint32 width,
- guint32 height);
-
- - void Dw_widget_queue_clear (DwWidget *widget);
-
- - void Dw_widget_queue_clear_area (DwWidget *widget,
- gint32 x,
- gint32 y,
- guint32 width,
- guint32 height);
-
- Equivalents to the Gtk+ functions. They (currently) result in a
- call of gtk_widget_xxx_area with the viewport as first
- argument. x and y are widget coordinates.
-
- - void Dw_widget_queue_resize (DwWidget *widget,
- gint ref,
- gboolean extremes_changed);
-
- Similar to gtk_widget_queue_resize. Call this function when the
- widget has changed its size. The next call to
- Dw_xxx_size_request should then return the new size.
-
- See Dw.txt for explanation on how to use the ref argument,
- extremes_changed specifies whether the extremes have changed
- (the latter is often not the case for an implementations of
- set_{width|ascent|descent}).
-
- - void Dw_widget_set_anchor (DwWidget *widget,
- gchar *name,
- int pos);
-
- Add an anchor to a widget. The name will not be copied, it has
- to be stored elsewhere (DwPage e.g. stores it in the DwPageWord
- structure).
-
- - void a_Dw_widget_set_cursor (DwWidget *widget,
- GdkCursor *cursor)
-
- Set the cursor for a DwWidget. cursor has to be stored
- elsewhere, it is not copied (and not destroyed). If cursor is
- NULL, the cursor of the parent widget is used.
-
- (This will probably be changed in the future and replaced by a
- common style mechanism.)
-
- - DW_WIDGET_WINDOW (widget)
-
- Returns the window a widget should draw into.
-
-
-External Functions
-==================
-
- - void a_Dw_widget_set_usize (DwWidget *widget,
- guint32 width,
- guint32 ascent,
- guint32 descent);
-
- Override the "desired" size of a widget. Further calls of
- a_Dw_widget_request_size will return these values, except those
- specified as -1. A possible use shows Html_add_widget in
- html.c.
-
- (This will probably be removed. Instead DwStyle should be used.)
-
-
- - void a_Dw_widget_set_bg_color (DwWidget *widget,
- gint32 color);
-
- Set the background color of a widget. This works currently only
- for the top-level widget. In this case, the background color of
- the GtkDwViewport is changed. In future, background colors for
- all widgets will be needed, e.g., for table cells (will be
- DwPage's), this will (probably) be based on filled rectangles.
-
- - void a_Dw_widget_scroll_to (DwWidget *widget,
- int pos)
-
- Scroll viewport to pos (vertical widget coordinate).
-
-There are furthermore wrappers for the signals, in some cases they
-are optimized and/or provide further functionality. In (almost) no
-case should you emit the signals directly. See dw_widget.c for more
-details.
diff --git a/doc/HtmlParser.txt b/doc/HtmlParser.txt
index ec64164..2eb8be6 100644
--- a/doc/HtmlParser.txt
+++ b/doc/HtmlParser.txt
@@ -1,5 +1,5 @@
October 2001, --Jcid
- Last update: Dec 2004
+ Last update: Jul 2009
---------------
THE HTML PARSER
@@ -11,7 +11,7 @@
behaviour while working:
typedef enum {
- DILLO_HTML_PARSE_MODE_INIT,
+ DILLO_HTML_PARSE_MODE_INIT = 0,
DILLO_HTML_PARSE_MODE_STASH,
DILLO_HTML_PARSE_MODE_STASH_AND_BODY,
DILLO_HTML_PARSE_MODE_BODY,
@@ -22,12 +22,12 @@
The parser works upon a token-grained basis, i.e., the data
stream is parsed into tokens and the parser is fed with them. The
-process is simple: whenever the cache has new data, it gets
+process is simple: whenever the cache has new data, it is
passed to Html_write, which groups data into tokens and calls the
-appropriate functions for the token type (TAG, SPACE or WORD).
+appropriate functions for the token type (tag, space, or word).
Note: when in DILLO_HTML_PARSE_MODE_VERBATIM, the parser
-doesn't try to split the data stream into tokens anymore, it
+doesn't try to split the data stream into tokens anymore; it
simply collects until the closing tag.
------
@@ -65,44 +65,52 @@
As it's a common mistake for human authors to mistype or
forget one of the quote marks of an attribute value; the
parser solves the problem with a look-ahead technique
- (otherwise the parser could skip significative amounts of
- well written HTML).
+ (otherwise the parser could skip significant amounts of
+ properly-written HTML).
* WORD --> Html_process_word
- A word is anything that doesn't start with SPACE, and that's
+ A word is anything that doesn't start with SPACE, that's
outside of a tag, up to the first SPACE or tag start.
SPACE = ' ' | \n | \r | \t | \f | \v
-----------------
-THE PARSING STACK
+THE PARSING STACK
-----------------
The parsing state of the document is kept in a stack:
- struct _DilloHtml {
+ class DilloHtml {
[...]
- DilloHtmlState *stack;
- gint stack_top; /* Index to the top of the stack [0 based] */
- gint stack_max;
+ lout::misc::SimpleVector *stack;
[...]
};
struct _DilloHtmlState {
- char *tag;
- DwStyle *style, *table_cell_style;
- DilloHtmlParseMode parse_mode;
- DilloHtmlTableMode table_mode;
- gint list_level;
- gint list_number;
- DwWidget *page, *table;
- gint32 current_bg_color;
+ CssPropertyList *table_cell_props;
+ DilloHtmlParseMode parse_mode;
+ DilloHtmlTableMode table_mode;
+ bool cell_text_align_set;
+ DilloHtmlListMode list_type;
+ int list_number;
+
+ /* TagInfo index for the tag that's being processed */
+ int tag_idx;
+
+ dw::core::Widget *textblock, *table;
+
+ /* This is used to align list items (especially in enumerated lists) */
+ dw::core::Widget *ref_list_item;
+
+ /* This is used for list items etc; if it is set to TRUE, breaks
+ have to be "handed over" (see Html_add_indented and
+ Html_eventually_pop_dw). */
+ bool hand_over_break;
};
-
Basically, when a TAG is processed, a new state is pushed into
the 'stack' and its 'style' is set to reflect the desired
diff --git a/doc/IO.txt b/doc/IO.txt
index fb69122..cd62a4f 100644
--- a/doc/IO.txt
+++ b/doc/IO.txt
@@ -73,7 +73,7 @@
Closing the TCP connection:
The four packet-sending closing sequence of the TCP protocol.
-
+
In a WAN context, every single item of this list has an
associated delay that is non deterministic and often measured in
seconds. If we add several connections per browsed page (each one
@@ -96,7 +96,7 @@
packets that belong to other connections may be arriving,
and have to wait for service.
- Web browsers handle many small transactions,
+ Web browsers handle many small transactions,
if waiting times are not overlapped
the latency perceived by the user can be very annoying.
@@ -219,7 +219,7 @@
what it was doing at DNS-request time. The interesting thing is
that the call-back happens in the main thread, while the child
thread simply exits when done. This is implemented through a
-server-channel design.
+server-channel design.
The server channel
@@ -252,7 +252,7 @@
and set to non-blocking I/O. When the DNS server has resolved the
name, the socket connection process begins by calling connect(2);
{We use the Unix convention of identifying the manual section
- where the concept is described, in this case
+ where the concept is described, in this case
section 2 (system calls).}
which returns immediately with an EINPROGRESS error.
@@ -311,7 +311,7 @@
----------------------
Closing the connection
----------------------
-
+
Closing a TCP connection requires four data segments, not an
impressive amount but twice the round trip time, which can be
substantial. When data retrieval finishes, socket closing is
@@ -370,7 +370,7 @@
'ExtData' MAY be provided.
'Status', 'FD' and 'GioCh' are set by I/O engine internal
-routines.
+routines.
When there is new data in the file descriptor, 'IO_callback'
gets called (by glib). Only after the I/O engine finishes
@@ -383,7 +383,7 @@
The 'Buf' and 'BufSize' fields of the request structure
provide the transfer buffer for each operation. This buffer must
be set by the client (to increase performance by avoiding copying
-data).
+data).
On reads, the client specifies the amount and where to place
the retrieved data; on writes, it specifies the amount and source
diff --git a/doc/Images.txt b/doc/Images.txt
index aaf4f63..6a36e6f 100644
--- a/doc/Images.txt
+++ b/doc/Images.txt
@@ -1,4 +1,4 @@
- February 2001, --Jcid
+ January 2009, --Jcid
------
IMAGES
@@ -23,21 +23,28 @@
one has the whole data already decoded.
* Regardless of the RGB-data feeding method, the decoded data is
-passed to the widget (DwImage) and drawn by GdkRGB in a streamed
-way.
- Note that INDEXED images are also decoded into RGB format
-before sending them to GdkRGB.
+passed to the widget (DwImage) and drawn in a streamed way.
+ Note that INDEXED images are also decoded into RGB format.
+
+ Html_tag_open_img // IMG element processing
+ Html_add_new_image // Read attributes, create image, add to HTML page
+ a_Image_new // Create a 'DilloImage' data structure, to coordinate
+ // decoded image-data transfer to an 'Imgbuf'.
+ Html_add_widget // Adds the dw::Image to the page
+ Html_load_image // Tells cache to retrieve image
---------------------
Fetching from the net
---------------------
-* a_Cache_open_url initiates the resource request, and when
+* a_Capi_open_url initiates the resource request, and when
finally the answer arrives, the HTTP header is examined for MIME
type and either the GIF or PNG or JPEG decoder is set to handle
the incoming data stream.
- Decoding functions: a_Gif_image, a_Jpeg_image and a_Png_image.
+
+ Decoding functions:
+ a_Gif_callback, a_Jpeg_callback and a_Png_callback.
* The decoding function calls the following dicache methods as
the data is processed (listed in order):
@@ -45,7 +52,9 @@
a_Dicache_set_parms
a_Dicache_set_cmap (only for indexed-GIF images)
a_Dicache_write
+ a_Dicache_new_scan (MAY be called here or after set_cmap)
a_Dicache_close
+
* The dicache methods call the necessary functions to connect
with the widget code. This is done by calling image.c functions:
@@ -53,63 +62,65 @@
a_Image_set_parms
a_Image_set_cmap
a_Image_write
+ a_Image_new_scan
a_Image_close
-
-* The functions in image.c make the required a_Dw_image_...
-calls.
+
+* The functions in image.c make the required Dw calls.
-------------------------
Fetching from the dicache
-------------------------
-* a_Cache_open_url tests the dicache for the image, and directly
-enqueues a cache client for it, without asking the network for
-the data. When the client queue is processed (a bit later), the
-decoder is selected based on the cache entry type.
+* a_Capi_open_url() tests the cache for the image, and the cache,
+via a_Cache_open_url(), enqueues a client for it, without asking
+the network for the data. When the client queue is processed (a
+bit later), Dicache_image() is set as the callback.
-* When the decoder is called, it tests the dicache for the image;
-if the image is found, then it sets a_Dicache_callback as the
-handling function and gets out of the way (no image decoding is
-needed).
+* When Dicache_image() is called, it sets the proper image data
+decoder (RGB) and its data structure based on the entry's Type.
+Then it substitutes itself with a_Dicache_callback() as the
+handling function, and gets out of the way.
-* Later on, the DwImage buffer is set to reference the
-dicache-entry's buffer and the rest of the functions calls is
-driven by a_Dicache_callback.
+* Thenceforth the rest of the functions calls is driven by
+a_Dicache_callback().
-----------
Misc. notes
-----------
-* Repeated images generate new cache clients, but only one of
-them (the first) is handled with a_Dicache_* functions, the rest
-is done with a_Dicache_callback..
+* Repeated images generate new cache clients, but they may share
+the imgbuf.
+ Note: Currently there's no proper support for transparent
+images (i.e. decode to RGBA), but most of the time they render
+the background color OK. This is: when first loaded, repeated
+images share a background color, but when cached they render
+correctly ;-). There's no point in trying to fix this because the
+correct solution is to decode to RGBA and let the toolkit (FLTK)
+handle the transparency.
-* The cache-client callback is set when the Content-type of the
-image is got. It can be: a_Png_image, a_Gif_image or a_Jpeg_image
-Those are called 'decoders' because their main function is to
-translate the original data into RGB format.
+* The first cache-client callback (Dicache_image()) is set when
+the Content-type of the image is got.
-* Later on, the decoder can substitute itself, if it finds the
-image has been already decoded, with a_Dicache_callback function.
-This avoids decoding it twice.
+* Later on, when there's a shared imgbuf, the dicache's logic
+avoids decoding it multiple times and reuses what's already done.
* The dicache-entry and the Image structure hold bit arrays that
-represent which rows had been decoded.
+represent which rows have been decoded.
* The image processing can be found in the following sources:
- - image.[ch]
+ - image.{cc,hh}
- dicache.[ch]
- gif.[ch], png.[ch], jpeg.[ch]
- - dw_image.[ch]
+ - dw/image.{cc,hh}
-* Bear in mind that there are three data structures for image
+* Bear in mind that there are four data structures for image
code:
- - DilloImage (image.h)
- - DwImage (dw_image.h)
+ - DilloImage (image.hh)
- DICacheEntry (dicache.h)
+ - dw::Image (class Image in dw/image.hh)
+ - core::Imgbuf (imgbuf.hh)
-
diff --git a/doc/Imgbuf.txt b/doc/Imgbuf.txt
new file mode 100644
index 0000000..f4a5666
--- /dev/null
+++ b/doc/Imgbuf.txt
@@ -0,0 +1,177 @@
+Aug 2004, S.Geerken@ping.de
+
+=============
+Image Buffers
+=============
+
+General
+=======
+
+Image buffers depend on the platform (see DwRender.txt), but have a
+general, platform independant interface, which is described in this
+section. The next section describes the Gdk version of Imgbuf.
+
+The structure ImgBuf will become part of the image processing, between
+image data decoding and the widget DwImage. Its purposes are
+
+ 1. storing the image data,
+ 2. handling scaled versions of this buffer, and
+ 3. drawing.
+
+The latter must be done independently from the window.
+
+Storing Image Data
+------------------
+Imgbuf supports five image types, which are listed in the table
+below. The representation defines, how the colors are stored within
+the data, which is passed to a_Imgbuf_copy_row().
+
+ | bytes per |
+ type | pixel | representation
+ ---------------+-----------+-------------------------
+ RGB | 3 | red, green, blue
+ RGBA | 4 | red, green, blue, alpha
+ gray | 1 | gray value
+ indexed | 1 | index to colormap
+ indexed alpha | 1 | index to colormap
+
+The last two types need a colormap, which is set by
+a_Imgbuf_set_cmap(), which must be called before
+a_Imgbuf_copy_row(). This function expects the colors as 32 bit
+unsigned integers, which have the format 0xrrbbgg (for indexed
+images), or 0xaarrggbb (for indexed alpha), respectively.
+
+Scaling
+-------
+The buffer with the original size, which was created by
+a_Imgbuf_new(), is called root buffer. Imgbuf provides the ability to
+scale buffers. Generally, both root buffers, as well as scaled
+buffers, may be shared, memory management is done by reference
+counters.
+
+Via a_Imgbuf_get_scaled_buf(), you can retrieve a scaled buffer. The
+way, how this function works in detail, is described in the code, but
+generally, something like this works always, in an efficient way:
+
+ old_buf = cur_buf;
+ cur_buf = a_Imgbuf_get_scaled_buf(old_buf, with, height);
+ a_Imgbuf_unref (old_buf);
+
+Old_buf may both be a root buffer, or a scaled buffer.
+
+(As an exception, there should always be a reference on the root
+buffer, since scaled buffers cannot exist without the root buffer, but
+on the other side, do not hold references on it. So, if in the example
+above, old_buf would be a root buffer, and there would, at the
+beginning, only be one reference on it, new_buf would also be
+destroyed, along with old_buf. Therefore, an external reference must
+be added to the root buffer, which is in dillo done within the dicache
+module.)
+
+The root buffer keeps a list of all children, and all operations
+operating on the image data (a_Imgbuf_copy_row() and
+a_Imgbuf_set_cmap()) are delegated to the scaled buffers, when
+processed, and inherited, when a new scaled buffer is created. This
+means, that they must only be performed for the root buffer.
+
+Drawing
+-------
+There are two situations, when drawing is necessary:
+
+ 1. To react on expose events, the function a_Imgbuf_draw() can be
+ used. Notice that the exact signature of this function is
+ platform dependant.
+
+ 2. When a row has been copied, it has to be drawn. To determine the
+ area, which has to be drawn, the function
+ a_Imgbuf_get_row_area() should be used. In dillo, the dicache
+ module will first call a_Img_copy_row(), and then call
+ a_Dw_image_draw_row() for the images connected to this image
+ buffer. a_Dw_image_draw_row() will then call
+ p_Dw_widget_queue_draw(), with an area determined by
+ a_Imgbuf_get_row_area().
+
+
+The Gdk Implementation
+======================
+
+The Gdk implementation is used by the Gtk+ platform. [... todo]
+
+
+Global Scalers
+==============
+
+In some cases, there is a context, where images have to be scaled
+often, by a relatively constant factor. For example, the preview
+window (GtkDwPreview) draws images via the Imgbuf draw functions, but
+uses scaled buffers. Scaling such a buffer each time it is needed,
+causes huge performance losses. On the other hand, if the preview
+window would keep these scaled buffers (e.g. by lazy mapping of the
+original buffer to the scaled buffer), the scaled buffers get never
+freed, since the view is not told about, when the original buffer is
+not needed anymore. (n.b., that currently, the scaled buffers are
+destroyed, when the original buffer is destroyed, but this may change,
+and even this would leave "zombies" in this mapping structure, where
+the values refer to dead pointers).
+
+It is sufficient, that references on the scaled buffers are referred
+somehow, so that they do not get destroyed between different
+usages. The caller (in this case the preview) simply requests a scaled
+buffer, but the Imgbuf returns this from the list of already scaled
+buffers.
+
+These references are hold by special structures, which are called
+"scalers". There are two types of scalers, local scalers, which are
+bound to image buffers, and global scalers, which refer to multiple
+scalers.
+
+What happens in different situations:
+
+ - The caller (e.g. the preview) requests a scaled buffer. For this,
+ it uses a special method, which also passes the global image
+ scaler, which was created before (for the preview, there is a 1-1
+ association). The Imgbuf uses this global image scaler, to
+ identify the caller, and keeps a list of them. If this global
+ scaler is not yet in the list, it is added, and a local scaler is
+ created.
+
+
+
+ -
+
+There are three images in the page, i1a, i1b, and i2. I1a and i1b
+refer to the same image recource, represented by the root image buffer
+iba, which original size is 200 x 200. I1a is displayed in original
+size, while i1b is displayed at 100 x 100. I2 refers to an other
+recource, ibb, which has the size 300 x 300. I2 is shown in original
+size.
+
+
+ :DwRenderLayout ------------------- :DwPage ----------.
+ / \ |
+ ,----' `----. ,------ i1a:DwImage --+
+ / \ | |
+ view1:GtkDwViewport view2:GtkDwPreview | ,---- i1b:DwImage --|
+ | | | |
+ ,------------------------------' | | ,-- i2: DwImage --'
+ | | | |
+ | ,-------------------------------------' | |
+ | | ,--------------------------------' |
+ | | | ,----'
+ | | | |
+ | V | V
+ | iba:Imgbuf | ibb:Imgbuf -- 30x30
+ | | | V | ^
+ | | +- 100x100 ,- 20x20 ,- 10x10 | |
+ | | | | ^ | ^ | |
+ | | `----------+----|---' | `--. ,--'
+ | | ,--------------' | | |
+ | | | ,------------------' | |
+ | | | | | |
+ | lca:ImgbufLSc lcb:ImgbufLSc
+ | (factor 1/10) (factor 1/10)
+ | \ /
+ | `-----------. ,-------------------'
+ | \ /
+ `------------------> scl:ImgbufGSc
+ (factor 1/10)
diff --git a/doc/Makefile.am b/doc/Makefile.am
index d7f1ce1..d644393 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -1,17 +1,41 @@
+dist_doc_DATA = user_help.html
+man_MANS = dillo.1
EXTRA_DIST = \
- Cache.txt \
- Cookies.txt \
- Dillo.txt \
- Dw.txt \
- DwImage.txt \
- DwPage.txt \
- DwStyle.txt \
- DwTable.txt \
- DwWidget.txt \
- HtmlParser.txt \
- IO.txt \
- Images.txt \
- NC_design.txt \
- Selection.txt \
- Dpid.txt \
- README
+ $(man_MANS) \
+ index.doc \
+ lout.doc \
+ dw-map.doc \
+ dw-overview.doc \
+ dw-usage.doc \
+ dw-layout-views.doc \
+ dw-layout-widgets.doc \
+ dw-widget-sizes.doc \
+ dw-changes.doc \
+ dw-images-and-backgrounds.doc \
+ fltk-problems.doc \
+ rounding-errors.doc \
+ uml-legend.doc \
+ dw-example-screenshot.png \
+ dw-viewport-without-scrollbar.png \
+ dw-viewport-with-scrollbar.png \
+ dw-size-of-widget.png \
+ dw-style-box-model.png \
+ dw-style-length-absolute.png \
+ dw-style-length-percentage.png \
+ dw-style-length-relative.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 \
+ Cache.txt \
+ Cookies.txt \
+ Dillo.txt \
+ Dw.txt \
+ HtmlParser.txt \
+ IO.txt \
+ Images.txt \
+ Imgbuf.txt \
+ NC_design.txt \
+ Selection.txt \
+ Dpid.txt \
+ README
diff --git a/doc/Makefile.in b/doc/Makefile.in
deleted file mode 100644
index 556b7ed..0000000
--- a/doc/Makefile.in
+++ /dev/null
@@ -1,331 +0,0 @@
-# Makefile.in generated by automake 1.9.5 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005 Free Software Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ..
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-target_triplet = @target@
-subdir = doc
-DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/configure.in
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-SOURCES =
-DIST_SOURCES =
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
-AMTAR = @AMTAR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLGUI_FALSE = @DLGUI_FALSE@
-DLGUI_TRUE = @DLGUI_TRUE@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-GLIB_CFLAGS = @GLIB_CFLAGS@
-GLIB_CONFIG = @GLIB_CONFIG@
-GLIB_LIBS = @GLIB_LIBS@
-GTK_CFLAGS = @GTK_CFLAGS@
-GTK_CONFIG = @GTK_CONFIG@
-GTK_LIBS = @GTK_LIBS@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LDFLAGS = @LDFLAGS@
-LIBFLTK_CXXFLAGS = @LIBFLTK_CXXFLAGS@
-LIBFLTK_LIBS = @LIBFLTK_LIBS@
-LIBJPEG_CPPFLAGS = @LIBJPEG_CPPFLAGS@
-LIBJPEG_LDFLAGS = @LIBJPEG_LDFLAGS@
-LIBJPEG_LIBS = @LIBJPEG_LIBS@
-LIBOBJS = @LIBOBJS@
-LIBPNG_CFLAGS = @LIBPNG_CFLAGS@
-LIBPNG_LIBS = @LIBPNG_LIBS@
-LIBPTHREAD_LDFLAGS = @LIBPTHREAD_LDFLAGS@
-LIBPTHREAD_LIBS = @LIBPTHREAD_LIBS@
-LIBS = @LIBS@
-LIBSSL_LIBS = @LIBSSL_LIBS@
-LIBZ_LIBS = @LIBZ_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-OBJEXT = @OBJEXT@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-RANLIB = @RANLIB@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-datadir = @datadir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
-EXTRA_DIST = \
- Cache.txt \
- Cookies.txt \
- Dillo.txt \
- Dw.txt \
- DwImage.txt \
- DwPage.txt \
- DwStyle.txt \
- DwTable.txt \
- DwWidget.txt \
- HtmlParser.txt \
- IO.txt \
- Images.txt \
- NC_design.txt \
- Selection.txt \
- Dpid.txt \
- README
-
-all: all-am
-
-.SUFFIXES:
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
- && exit 0; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \
- cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu doc/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-uninstall-info-am:
-tags: TAGS
-TAGS:
-
-ctags: CTAGS
-CTAGS:
-
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
- list='$(DISTFILES)'; for file in $$list; do \
- case $$file in \
- $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
- $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
- esac; \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test "$$dir" != "$$file" && test "$$dir" != "."; then \
- dir="/$$dir"; \
- $(mkdir_p) "$(distdir)$$dir"; \
- else \
- dir=''; \
- fi; \
- if test -d $$d/$$file; then \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
- fi; \
- cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
- else \
- test -f $(distdir)/$$file \
- || cp -p $$d/$$file $(distdir)/$$file \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-all-am: Makefile
-installdirs:
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic mostlyclean-am
-
-distclean: distclean-am
- -rm -f Makefile
-distclean-am: clean-am distclean-generic
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-exec-am:
-
-install-info: install-info-am
-
-install-man:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-generic
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-info-am
-
-.PHONY: all all-am check check-am clean clean-generic distclean \
- distclean-generic distdir dvi dvi-am html html-am info info-am \
- install install-am install-data install-data-am install-exec \
- install-exec-am install-info install-info-am install-man \
- install-strip installcheck installcheck-am installdirs \
- maintainer-clean maintainer-clean-generic mostlyclean \
- mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am \
- uninstall-info-am
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/doc/NC_design.txt b/doc/NC_design.txt
index 6932b9c..380787f 100644
--- a/doc/NC_design.txt
+++ b/doc/NC_design.txt
@@ -1,13 +1,13 @@
_________________________________________________________________
-
+
Naming&Coding design
_________________________________________________________________
-
+
Dillo's code is divided into modules. For instance: bookmark, cache,
dicache, gif.
-
- Lets think of a module named "menu", then:
+
+ Let's think of a module named "menu", then:
* Every internal routine of the module, should start with "Menu_"
prefix.
* "Menu_" prefixed functions are not meant to be called from outside
@@ -15,66 +15,113 @@
* If the function is to be exported to other modules (i.e. it will
be called from the outside), it should be wrapped with an "a_"
prefix.
-
+
For instance: if the function name is "Menu_create", then it's an
internal function, but if we need to call it from the outside, then it
should be renamed to "a_Menu_create".
-
+
Why the "a_" prefix?
Because of historical reasons.
- And it reads better "a_Menu_create" than "d_Menu_create" cause the
+ And "a_Menu_create" reads better than "d_Menu_create" because the
first one suggests "a Menu create" function!
-
+
Another way of understanding this is thinking of "a_" prefixed
functions as Dillo's internal library, and the rest ("Menu_" prefixed
in our example) as a private module-library.
-
- Indentation: Source code must be indented with 3 blank spaces, no Tabs.
+
+ Indentation:
+
+ Source code must be indented with 3 blank spaces, no Tabs.
Why?
Because different editors expand or treat tabs in several ways; 8
spaces being the most common, but that makes code really wide and
we'll try to keep it within the 80 columns bounds (printer friendly).
-
+
+ You can use: indent -kr -sc -i3 -bad -nbbo -nut -l79 myfile.c
+
Function commenting:
-
+
Every single function of the module should start with a short comment
- that explains it's purpose; three lines must be enough, but if you
+ that explains its purpose; three lines must be enough, but if you
think it requires more, enlarge it.
-/*
- * Try finding the url in the cache. If it hits, send the contents
- * to the caller. If it misses, set up a new connection.
- */
-int a_Cache_open_url(const char *url, void *Data)
-{
- ...
- ...
- ...
-}
+ /*
+ * Try finding the url in the cache. If it hits, send the contents
+ * to the caller. If it misses, set up a new connection.
+ */
+ int a_Cache_open_url(const char *url, void *Data)
+ {
+ ...
+ ...
+ ...
+ }
- We also have the BUG: and todo: tags.
+ We also have the BUG:, TODO:, and WORKAROUND: tags.
Use them within source code comments to spot hidden issues. For
instance:
-/* BUG: this counter is not accurate */
-++i;
+ /* BUG: this counter is not accurate */
+ ++i;
-/* todo: get color from the right place */
-a = color;
+ /* TODO: get color from the right place */
+ a = color;
+
+ /* WORKAROUND: the canonical way of doing it doesn't work yet. */
+ ++a; ++a; ++a;
+
+ Function length:
+
+ Let's try to keep functions within the 45 lines boundary. This eases
+ code reading, following, understanding and maintenance.
+
+ Functions with a single exit:
+
+ It's much easier to follow and maintain functions with a single exit
+ point at the bottom (instead of multiple returns). The exception to
+ the rule are calls like dReturn_if_fail() at its head.
+
+ dlib functions:
+
+ * Dillo uses dlib extensively in its C sources. Before starting
+ to code something new, a good starting point is to check what
+ this library has to offer (check dlib/dlib.h).
+ * Memory management must be done using dNew, dNew0, dMalloc, dFree
+ and their relatives.
+ * For debugging purposes and error catching (not for normal flow):
+ dReturn_if_fail, dReturn_val_if_fail etc. are encouraged.
+ * The MSG macro is extensively used to output additional information
+ to the calling terminal.
+
_________________________________________________________________
-
+
+ C++
+
+ Source code in C++ should follow the same rules with these exceptions:
+
+ * Class method names are camel-cased and start with lowercase
+ e.g. appendInputMultipart
+ * Classes and types start uppercased
+ e.g. class DilloHtmlReceiver
+ * Class methods don't need to prefix its module name
+ e.g. links->get()
+
+ We also try to keep the C++ relatively simple. Dillo does use
+ inheritance and templates, but that's about all.
+
+ _________________________________________________________________
+
What do we get with this?
-
+
* A clear module API for Dillo; every function prefixed "a_" is to
be used outside the module.
- * A way for identifying where the function came from (the
+ * A way to identify where the function came from (the
capitalized word is the module name).
- * An inner ADT (Abstract data type) for the module. That can be
+ * An inner ADT (Abstract data type) for the module that can be
isolated, tested and replaced independently.
* A two stage instance for bug-fixing. You can change the exported
function algorithms while someone else fixes the internal
module-ADT!
* A coding standard ;)
_________________________________________________________________
-
+
Naming&Coding design by Jorge Arellano Cid
diff --git a/doc/README b/doc/README
index eb290e7..8af9a87 100644
--- a/doc/README
+++ b/doc/README
@@ -1,6 +1,25 @@
+README: Last update Jul 2009
- OK, here we are:
+These documents cover dillo's internals.
+For user help, see http://www.dillo.org/dillo2-help.html
+--------------------------------------------------------------------------
+
+These documents need a review.
+*.txt were current with Dillo1, but many have since become more or
+ less out-of-date.
+*.doc are doxygen source for the Dillo Widget (dw) component, and
+ were written for Dillo2.
+
+They will give you an overview of what's going on, but take them
+with a pinch of salt.
+
+ Of course I'd like to have *.txt as doxygen files too!
+If somebody wants to make this conversion, please let me know
+to assign higher priority to updating these docs.
+
+--
+Jorge.-
--------------------------------------------------------------------------
FILE DESCRIPTION STATE
@@ -13,26 +32,20 @@
Images.txt Image handling and processing Current
HtmlParser.txt A versatile parser Current
Dw.txt The New Dillo Widget (Overview) Current
- DwWidget.txt The base object of Dw Current
- DwImage.txt Dillo Widget image handling Incomplete
- DwPage.txt Dillo Widget page (shortly) Incomplete
- DwStyle.txt Styles of Dillo Widgets Pending
- DwTable.txt Tables in dillo Current
+ Imgbuf.txt Image buffers Pending
Selection.txt Selections, and link activation Current (?)
Cookies.txt Explains how to enable cookies Current
Dpid.txt Dillo plugin daemon Current
--------------------------------------------------------------------------
- [This documents cover dillo's internal working. They're NOT a user manual]
- --------------------------------------------------------------------------
- * Ah!, there's a small program (srch) within the src/ dir. It searches
+ * BTW, there's a small program (srch) within the src/ dir. It searches
tokens within the whole code (*.[ch]). It has proven very useful.
Ex: ./srch a_Image_write
./srch todo:
- * Please submit your patches with 'diff -pru'.
+ * Please submit your patches with 'hg diff'.
- Happy coding!
+ Happy coding!
--Jcid
diff --git a/doc/Selection.txt b/doc/Selection.txt
index 08fe0ab..7904bd9 100644
--- a/doc/Selection.txt
+++ b/doc/Selection.txt
@@ -26,7 +26,7 @@
transferred to extended iterators (DwExtIterator), see below for more
details. All event handling functions have the same signature, the
arguments in detail are:
-
+
- DwIterator *it the iterator pointing on the item under
the mouse pointer,
- gint char_pos the exact (character) position within
diff --git a/doc/dillo.1 b/doc/dillo.1
new file mode 100644
index 0000000..2342d76
--- /dev/null
+++ b/doc/dillo.1
@@ -0,0 +1,101 @@
+.TH dillo 1 "August 5, 2010" "version 2.2" "USER COMMANDS"
+.SH NAME
+dillo \- web browser
+.SH SYNOPSIS
+.B dillo
+.RI [ OPTION ]...
+.RB [ \-\- ]
+.RI [ URL | FILE ]...
+.SH DESCRIPTION
+.PP
+Dillo is a lightweight graphical web browser that aims to be secure.
+It handles HTTP internally, and FILE, FTP, and
+DATA URIs are handled through a plugin system (dpi). In addition,
+.I INSECURE
+HTTPS support can be enabled. Both FTP and Dillo's download manager use the
+.BR wget (1)
+downloader.
+.PP
+Dillo displays HTML, text, PNG, JPEG, and GIF files.
+It handles cookies, basic authentication, proxying, and some CSS.
+.PP
+Framesets are displayed as links to frames, and there is currently
+no support for javascript or video.
+.SH OPTIONS
+.TP
+\fB\-f\fR, \fB\-\-fullwindow\fR
+Start in full window mode: hide address bar, navigation buttons, menu, and
+status bar.
+.TP
+\fB\-g\fR, \fB\-\-geometry \fIGEO\fR
+Set initial window position where \fIGEO\fR is
+\fIW\fBx\fIH\fR[{\fB+\-\fR}\fIX\fR{\fB+\-\fR}\fIY\fR].
+.TP
+\fB\-h\fR, \fB\-\-help\fR
+Display this help text and exit.
+.TP
+\fB\-l\fR, \fB\-\-local\fR
+Don't load images for these URL(s).
+.TP
+\fB\-v\fR, \fB\-\-version\fR
+Display version info and exit.
+.TP
+\fB\-x\fR, \fB\-\-xid \fIXID\fR
+Open first Dillo window in an existing window whose window ID is \fIXID\fR.
+.SH EXIT STATUS
+.TP
+.B 0
+No error.
+.TP
+.B 1
+Internal error.
+.TP
+.B 2
+Error in command line arguments.
+.SH ENVIRONMENT
+.TP
+.BR "HOME " "(or " "HOMEDRIVE " "and " "HOMEPATH " "on Cygwin)"
+User's home directory.
+.TP
+.B http_proxy
+URL of proxy to send HTTP traffic through.
+.SH FILES
+.TP
+.I dpid
+Dillo plugin daemon
+.TP
+.I dpidc
+Control program for dpid.
+.TP
+.I ~/.dillo/bm.txt
+User bookmarks
+.TP
+.I ~/.dillo/certs/
+Saved certificates for HTTPS.
+.TP
+.I ~/.dillo/cookies.txt
+Stored cookies
+.TP
+.I ~/.dillo/cookiesrc
+Cookie settings
+.TP
+.I ~/.dillo/dillorc
+Configuration file.
+.TP
+.I ~/.dillo/dpid_comm_keys
+Keys used in dpi daemon communication.
+.TP
+.I ~/.dillo/dpidrc
+Contains name of directory containing dpis, and associates
+dpi files with protocols.
+.TP
+.I ~/.dillo/keysrc
+Keybindings.
+.TP
+.I ~/.dillo/style.css
+User style sheet
+.SH SEE ALSO
+.BR wget (1)
+.PP
+Dillo website:
+.B http://www.dillo.org
diff --git a/doc/dw-changes.doc b/doc/dw-changes.doc
new file mode 100644
index 0000000..7050df9
--- /dev/null
+++ b/doc/dw-changes.doc
@@ -0,0 +1,105 @@
+/** \page dw-changes Changes to the GTK+-based Release Version
+
+Changes in Dw
+
+Related to the FLTK port, there have been many changes, this is a
+(hopefully complete) list:
+
+
+- Rendering abstraction, read \ref dw-overview and \ref dw-layout-views
+ for details. Some important changes:
+
+
+ - The underlying platform (e.g. the UI toolkit) is fully abstract,
+ there are several platform independent structures replacing
+ GTK+ structures, e.g. dw::core::Event.
+
+
- The central class managing the widget tree is not anymore
+ GtkDwViewport, but dw::core::Layout.
+
+
- Drawing is done via dw::core::View, a pointer is passed to
+ dw::core::Widget::draw.
+
+
- The distinction between viewport coordinates and canvas
+ coordinates (formerly world coordinates) has been mostly
+ removed. (Only for views, it sometimes plays a role, see
+ \ref dw-layout-views).
+
+
+ - Cursors have been moved to dw::core::style, see
+ dw::core::style::Style::cursor. dw::core::Widget::setCursor is now
+ protected (and so only called by widget implementations).
+
+
- World coordinates are now called canvas coordinates.
+
+
- There is now a distinction between dw::core::style::StyleAttrs and
+ dw::core::style::Style.
+
+
- There is no base class for container widgets anymore. The former
+ DwContainer::for_all has been removed, instead this functionality
+ is now done via iterators (dw::core::Widget::iterator,
+ dw::core::Iterator).
+
+
- DwPage is now called dw::Textblock, and DwAlignedPage
+ dw::AlignedTextblock.
+
+
- dw::Textblock, all sub classes of it, and dw::Table do not read
+ "limit_text_width" from the preferences, but get it as an argument.
+ (May change again.)
+
+
- dw::Table has been rewritten.
+
+
- Instead of border_spacing in the old DwStyle, there are two attributes,
+ dw::core::style::Style::hBorderSpacing and
+ dw::core::style::Style::vBorderSpacing, since CSS allowes to specify
+ two values. Without CSS, both attributes should have the same value.
+
+
- Images are handled differently, see \ref dw-images-and-backgrounds.
+
+
- Embedded UI widgets (formerly GtkWidget's) are handled differently,
+ see dw::core::ui.
+
+
- DwButton has been removed, instead, embedded UI widgets are used. See
+ dw::core::ui and dw::core::ui::ComplexButtonResource.
+
+
+Dw is now written C++, the transition should be obvious. All "Dw"
+prefixes have been removed, instead, namespaces are used now:
+
+
+- dw::core contains the core,
+
- dw::core::style styles,
+
- dw::core::ui embedded UI resources,
+
- dw::fltk classes related to FLTK, and
+
- ::dw the widgets.
+
+
+Documentation
+
+The old documentation has been moved to:
+
+
+Old | New
+ |
---|
Dw.txt
+ | general part | \ref dw-overview, \ref dw-usage,
+ \ref dw-layout-widgets,
+ \ref dw-widget-sizes
+ | remarks on specific widgets | respective source files: dw::Bullet,
+ dw::core::ui::Embed
+ | DwImage.txt
+ | signals | dw::core::Layout::LinkReceiver
+ | rest | dw::Image,
+ \ref dw-images-and-backgrounds
+ | Imgbuf.txt | dw::core::Imgbuf,
+ \ref dw-images-and-backgrounds
+ | DwPage.txt | dw::Textblock
+ | DwRender.txt | \ref dw-overview, \ref dw-layout-views,
+ dw::core::ui
+ | DwStyle.txt | dw::core::style
+ | DwTable.txt | dw::Table
+ | DwWidget.txt | dw::core::Widget, \ref dw-layout-widgets,
+ \ref dw-widget-sizes
+ | Selection.txt | dw::core::SelectionState
+ |
+
+*/
diff --git a/doc/dw-example-screenshot.png b/doc/dw-example-screenshot.png
new file mode 100644
index 0000000..a4d3790
Binary files /dev/null and b/doc/dw-example-screenshot.png differ
diff --git a/doc/dw-images-and-backgrounds.doc b/doc/dw-images-and-backgrounds.doc
new file mode 100644
index 0000000..bb55aca
--- /dev/null
+++ b/doc/dw-images-and-backgrounds.doc
@@ -0,0 +1,146 @@
+/** \page dw-images-and-backgrounds Images and Backgrounds in Dw
+
+General
+
+Representation of the image data is delegated to dw::core::Imgbuf, see
+there for details. Drawing is delegated to dw::core::View
+(dw::core::View::drawImgbuf).
+
+Since dw::core::Imgbuf provides memory management based on reference
+counting, there may be an 1-to-n relation from image renderers (image
+widgets or backgrounds, see below) and dw::core::Imgbuf. Since
+dw::core::Imgbuf does not know about renderers, but just provides
+rendering functionality, the caller must (typically after calling
+dw::core::Imgbuf::copyRow) notify all renderers connected to the
+buffer.
+
+
+Images
+
+This is the simplest renderer, displaying an image. For each row to be
+drawn,
+
+
+- first dw::core::Imgbuf::copyRow, and then
+
- for each dw::Image, dw::Image::drawRow must be called, with the same
+ argument (no scaling is necessary).
+
+
+dw::Image automatically scales the dw::core::Imgbuf, the root buffer
+should be passed to dw::Image::setBuffer.
+
+\see dw::Image for more details.
+
+Future Extensions
+
+(This is not implemented yet.) Rendering itself (image widgets and
+background) will be abstracted, by a new interface
+dw::core::ImageRenderer. In the current code for image decoding, this
+interface will replace references to dw::Image, which implements
+dw::core::ImageRenderer, in most cases.
+
+Backgrounds
+
+(This is based on future extensions described above.) Since background
+are style resources, they are associated with
+dw::core::style::Style. For backgrounds, another level is needed,
+because of the 1-to-n relation from dw::core::style::Style to
+dw::core::Widget:
+
+\dot
+digraph G {
+ node [shape=record, fontname=Helvetica, fontsize=10];
+ edge [arrowhead="open", arrowtail="none", labelfontname=Helvetica,
+ labelfontsize=10, color="#404040", labelfontcolor="#000080"];
+ fontname=Helvetica; fontsize=10;
+
+ "background renderer (as a part of style)" -> "image buffer" [headlabel="*",
+ taillabel="1"];
+ "widget (or a part of it)" -> "background renderer (as a part of style)"
+ [headlabel="*", taillabel="1"];
+}
+\enddot
+
+Unlike dw::Image, dw::core::style::BgRenderer is not associated with a
+certain rectangle on the canvas. Instead, widgets, or parts of widgets
+take this role. This is generally represented by an implementation of
+the interface dw::core::style::BgAllocation, which is implemented by
+dw::core::Widget, but also by all parts of widget implementation,
+which may have an own background image.
+
+The following diagram gives a total overview:
+
+\dot
+digraph G {
+ node [shape=record, fontname=Helvetica, fontsize=10];
+ edge [arrowhead="open", arrowtail="none", labelfontname=Helvetica,
+ labelfontsize=10, color="#404040", labelfontcolor="#000080"];
+ fontname=Helvetica; fontsize=10;
+
+ "DICache Entry";
+
+ subgraph cluster_dw_images {
+ style="dashed"; color="#000080"; fontname=Helvetica; fontsize=10;
+ label="Dw Images";
+
+ ImageRenderer [URL="\ref dw::core::ImageRenderer", color="#ff8080"];
+ Imgbuf [URL="\ref dw::core::Imgbuf", color="#ff8080"];
+ }
+
+ subgraph cluster_widgets {
+ style="dashed"; color="#000080"; fontname=Helvetica; fontsize=10;
+ label="Widgets";
+
+ Widget [URL="\ref dw::core::Widget", color="#a0a0a0"];
+ Textblock [URL="\ref dw::Textblock"];
+ "Textblock::Word" [URL="\ref dw::Textblock::Word"];
+ Table [URL="\ref dw::Table"];
+ "Table::Row" [URL="\ref dw::Table::Row"];
+ Image [URL="\ref dw::Image"];
+ }
+
+ subgraph cluster_style {
+ style="dashed"; color="#000080"; fontname=Helvetica; fontsize=10;
+ label="dw::core::style";
+
+ Style [URL="\ref dw::core::style::Style"];
+ BgRenderer [URL="\ref dw::core::style::BgRenderer"];
+ BgAllocation [URL="\ref dw::core::style::BgAllocation", color="#ff8080"];
+ }
+
+ "DICache Entry" -> ImageRenderer [headlabel="*", taillabel="1"];
+ "DICache Entry" -> Imgbuf [headlabel="1", taillabel="1"];
+
+ BgRenderer -> Imgbuf [headlabel="1", taillabel="*"];
+ BgRenderer -> BgAllocation [headlabel="*", taillabel="1"];
+ ImageRenderer -> BgRenderer [arrowhead="none", arrowtail="empty",
+ style="dashed"];
+ ImageRenderer -> Image [arrowhead="none", arrowtail="empty",
+ style="dashed"];
+
+ Style -> BgRenderer [headlabel="0..1", taillabel="1"];
+
+ Widget -> Textblock [arrowhead="none", arrowtail="empty"];
+ Textblock -> "Textblock::Word" [headlabel="*", taillabel="1"];
+ Widget -> Table [arrowhead="none", arrowtail="empty"];
+ Table -> "Table::Row" [headlabel="*", taillabel="1"];
+ Widget -> Image [arrowhead="none", arrowtail="empty"];
+
+ BgAllocation -> Widget [arrowhead="none", arrowtail="empty",
+ style="dashed"];
+ BgAllocation -> "Textblock::Word" [arrowhead="none", arrowtail="empty",
+ style="dashed"];
+ BgAllocation -> "Table::Row" [arrowhead="none", arrowtail="empty",
+ style="dashed"];
+}
+\enddot
+
+[\ref uml-legend "legend"]
+
+
+Integration into dillo
+
+\todo Add some references.
+
+
+*/
diff --git a/doc/dw-layout-views.doc b/doc/dw-layout-views.doc
new file mode 100644
index 0000000..d111848
--- /dev/null
+++ b/doc/dw-layout-views.doc
@@ -0,0 +1,256 @@
+/** \page dw-layout-views Layout and Views
+
+Rendering of Dw is done in a way resembling the model-view pattern, at
+least formally. Actually, the counterpart of the model, the layout
+(dw::core::Layout), does a bit more than a typical model, namely the
+layouting (delegated to the widget tree, see \ref dw-layout-widgets),
+and the view does a bit less than a typical view, i.e. only the actual
+drawing.
+
+Additionally, there is a structure representing common properties of
+the platform. A platform is typically related to the underlying UI
+toolkit, but other uses may be thought of.
+
+This design helps to archieve two important goals:
+
+
+- Abstraction of the actual drawing, by different implementations
+ of dw::core::View.
+
+
- It makes portability simple.
+
+
+
+Viewports
+
+Although the design implies that the usage of viewports should be
+fully transparent to the layout module, this cannot be fully achieved,
+for the following reasons:
+
+
+- Some features, which are used on the level of dw::core::Widget,
+ e.g. anchors, refer to scrolling positions.
+
+
- Size hints (see \ref dw-layout-widgets) depend on the viewport
+ sizes, e.g. when the user changes the window size, and so also
+ the size of a viewport, the text within should be rewrapped.
+
+
+Therefore, dw::core::Layout keeps track of the viewport size, the
+viewport position, and even the thickness of the scrollbars, they are
+relevant, see below for more details.
+If a viewport is not used, however, the size is not defined.
+
+Whether a given dw::core::View implementation is a viewport or not, is
+defined by the return value of dw::core::View::usesViewport. If this
+method returns false, the following methods need not to be implemented
+at all:
+
+
+- dw::core::View::getHScrollbarThickness,
+
- dw::core::View::getVScrollbarThickness,
+
- dw::core::View::scrollTo, and
+
- dw::core::View::setViewportSize.
+
+
+Scrolling Positions
+
+The scrolling position is the canvas position at the upper left corner
+of the viewport. Views using viewports must
+
+
+- change this value on request (dw::core::View::scrollTo), and
+
- tell other changes to the layout, e.g. caused by user events
+ (dw::core::Layout::scrollPosChanged).
+
+
+Applications of scrolling positions (anchors, test search etc.) are
+handled by the layout, in a way fully transparent to the view.
+
+Scrollbars
+
+A feature of the viewport size model are scrollbars. There may be a
+vertical scrollbar and a horizontal scrollbar, displaying the
+relationship between canvas and viewport height or width,
+respectively. If they are not needed, they are hidden, to save screen
+space.
+
+Since scrollbars decrease the usable space of a view, dw::core::Layout
+must know how much space they take. The view returns, via
+dw::core::View::getHScrollbarThickness and
+dw::core::View::getVScrollbarThickness, how thick they will be, when
+visible.
+
+Viewport sizes, which denote the size of the viewport widgets, include
+scrollbar thicknesses. When referring to the viewport \em excluding
+the scrollbars space, we will call it "usable viewport size", this is
+the area, which is used to display the canvas.
+
+Drawing
+
+A view must implement several drawing methods, which work on the whole
+canvas. If it is necessary to convert them (e.g. into
+dw::fltk::FltkViewport), this is done in a way fully transparent to
+dw::core::Widget and dw::core::Layout, instead, this is done by the
+view implementation.
+
+There exist following situations:
+
+
+- A view gets an expose event: It will delegate this to the
+ layout (dw::core::Layout::draw), which will then pass it to the
+ widgets (dw::core::Widget::draw), with the view as a parameter.
+ Eventually, the widgets will call drawing methods of the view.
+
+
- A widget requests a redraw: In this case, the widget will
+ delegate this to the layout (dw::core::Layout::queueDraw), which
+ delegates it to the view (dw::core::View::queueDraw).
+ Typically, the view will queue these requests for efficiency.
+
+
- A widget requests a resize: This case is described below, in short,
+ dw::core::View::queueDrawTotal is called for the view.
+
+
+If the draw method of a widget is implemented in a way that it may
+draw outside of the widget's allocation, it should draw into a
+clipping view. A clipping view is a view related to the actual
+view, which guarantees that the parts drawn outside are discarded. At
+the end, the clipping view is merged into the actual view. Sample
+code:
+
+\code
+void Foo::draw (dw::core::View *view, dw::core::Rectangle *area)
+{
+ // 1. Create a clipping view.
+ dw::core::View clipView =
+ view->getClippingView (allocation.x, allocation.y,
+ allocation.width, getHeight ());
+
+ // 2. Draw into clip_view
+ clipView->doSomeDrawing (...);
+
+ // 3. Draw the children, they receive the clipping view as argument.
+ dw::core::Rectangle *childArea
+ for () {
+ if (child->intersects (area, &childArea))
+ child->draw (clipView, childArea);
+ }
+
+ // 4. Merge
+ view->mergeClippingView (clipView);
+}
+\endcode
+
+A drawing process is always embedded into calls of
+dw::core::View::startDrawing and dw::core::View::finishDrawing. An
+implementation of this may e.g. use backing pixmaps, to prevent
+flickering.
+
+
+Sizes
+
+In the simplest case, the view does not have any influence on
+the canvas size, so it is told about changes of the
+canvas size by a call to dw::core::View::setCanvasSize. This happens
+in the following situations:
+
+
+- dw::core::Layout::addWidget,
+
- dw::core::Layout::removeWidget (called by dw::core::Widget::~Widget),
+ and
+
- dw::core::Layout::queueResize (called by
+ dw::core::Widget::queueResize, when a widget itself requests a size
+ change).
+
+
+Viewports
+
+There are two cases where the viewport size changes:
+
+
+- As an reaction on a user event, e.g. when the user changes the
+ window size. In this case, the view delegates this
+ change to the layout, by calling
+ dw::core::Layout::viewportSizeChanged.
+
+
- The viewport size may also depend on the visibility of UI
+ widgets, which depend on the world size, e.g scrollbars,
+ generally called "viewport markers". This is described in a separate
+ section.
+
+
+After the creation of the layout, the viewport size is undefined. When
+a view is attached to a layout, and this view can already specify
+its viewport size, it may call
+dw::core::Layout::viewportSizeChanged within the implementation of
+dw::core::Layout::setLayout. If not, it may do this as soon as the
+viewport size is known.
+
+Generally, the scrollbars have to be considered. If e.g. an HTML page
+is rather small, it looks like this:
+
+\image html dw-viewport-without-scrollbar.png
+
+If some more data is retrieved, so that the height exceeds the
+viewport size, the text has to be rewrapped, since the available width
+gets smaller, due to the vertical scrollbar:
+
+\image html dw-viewport-with-scrollbar.png
+
+Notice the different line breaks.
+
+This means circular dependencies between these different sizes:
+
+
+- Whether the scrollbars are visible or not, determines the
+ usable space of the viewport.
+
+
- From the usable space of the viewport, the size hints for the
+ toplevel are calculated.
+
+
- The size hints for the toplevel widgets may have an effect on its
+ size, which is actually the canvas size.
+
+
- The canvas size determines the visibility of the scrollbarss.
+
+
+To make an implementation simpler, we simplify the model:
+
+
+- For the calls to dw::core::Widget::setAscent and
+ dw::core::Widget::setDescent, we will always exclude the
+ horizontal scrollbar thickness (i.e. assume the horizontal
+ scrollbar is used, although the visibility is determined correctly).
+
+
- For the calls to dw::core::Widget::setWidth, we will calculate
+ the usable viewport width, but with the general assumption, that
+ the widget generally gets higher.
+
+
+This results in the following rules:
+
+
+- Send always (when it changes) dw::core::Layout::viewportHeight
+ minus the maximal value of dw::core::View::getHScrollbarThickness as
+ argument to dw::core::Widget::setAscent, and 0 as argument to
+ dw::core::Widget::setDescent.
+
+
- There is a flag, dw::core::Layout::canvasHeightGreater, which is set
+ to false in the following cases:
+
+
+ - dw::core::Layout::addWidget,
+
- dw::core::Layout::removeWidget (called by dw::core::Widget::~Widget),
+ and
+
- dw::core::Layout::viewportSizeChanged.
+
+
+ Whenever the canvas size is calculated (dw::core::Layout::resizeIdle),
+ and dw::core::Layout::canvasHeightGreater is false, a test is made,
+ whether the widget has in the meantime grown that high, that the second
+ argument should be set to true (i.e. the vertical scrollbar gets visible).
+ As soon as and dw::core::Layout::canvasHeightGreater is true, no such test
+ is done anymore.
+
+
+*/
diff --git a/doc/dw-layout-widgets.doc b/doc/dw-layout-widgets.doc
new file mode 100644
index 0000000..e021556
--- /dev/null
+++ b/doc/dw-layout-widgets.doc
@@ -0,0 +1,267 @@
+/** \page dw-layout-widgets Layout and Widgets
+
+Both, the layouting and the drawing is delegated to a tree of
+widgets. A widget represents a given part of the document, e.g. a text
+block, a table, or an image. Widgets may be nested, so layouting and
+drawing may be delegated by one widget to its child widgets.
+
+Where to define the borders of a widget, whether to combine different
+widgets to one, or to split one widget into multiple ones, should be
+considered based on different concerns:
+
+
+- First, there are some restrictions of Dw:
+
+
+ - The allocation (this is the space a widget allocates at
+ a time) of a dillo widget is always rectangular, and
+
- the allocation of a child widget must be a within the allocation
+ of the parent widget.
+
+
+ - Since some widgets are already rather complex, an important goal
+ is to keep the implementation of the widget simple.
+
+
- Furthermore, the granularity should not be too fine, because of the
+ overhead each single widget adds.
+
+
+For CSS, there will be a document tree on top of Dw, this will be
+flexible enough when mapping the document structure on the widget
+structure, so you should not have the document structure in mind.
+
+Sizes
+
+\ref dw-widget-sizes
+
+
+Styles
+
+Each widget is assigned a style, see dw::core::style for more
+informations.
+
+
+Iterators
+
+Widgets must implement dw::core::Widget::iterator. There are several
+common iterators:
+
+
+- dw::core::EmptyIterator, and
+
- dw::core::TextIterator.
+
+
+Both hide the constructor, use the \em create method.
+
+These simple iterators only iterate through one widget, it does not
+have to iterate recursively through child widgets. Instead, the type
+dw::core::Content::WIDGET is returned, and the next call of
+dw::core::Iterator::next will return the piece of contents \em after
+(not within) this child widget.
+
+This makes implementation much simpler, for recursive iteration, there
+is dw::core::DeepIterator.
+
+
+Anchors and Scrolling
+
+\todo This section is not implemented yet, after the implementation,
+ the documentation should be reviewed.
+
+Here is a description, what is to be done for a widget
+implementation. How to jump to anchors, set scrolling positions
+etc. is described in \ref dw-usage.
+
+Anchors
+
+Anchors are position markers, which are identified by a name, which is
+unique in the widget tree. The widget must care about anchors in three
+different situations:
+
+
+- Adding an anchor is inititiated by a specific widget method, e.g.
+ dw::Textblock::addAnchor. Here, dw::core::Widget::addAnchor must be
+ called,
+
+
- Whenever the position of an anchor is changed,
+ dw::core::Widget::changeAnchor is called (typically, this is done
+ in the implementation of dw::core::Widget::sizeAllocateImpl).
+
+
- When a widget is destroyed, the anchor must be removed, by calling
+ dw::core::Widget::removeAnchor.
+
+
+All these methods are delegated to dw::core::Layout, which manages
+anchors centrally. If the anchor in question has been set to jump to,
+the viewport position is automatically adjusted, see \ref
+dw-usage.
+
+
+Drawing
+
+In two cases, a widget has to be drawn:
+
+
+- as a reaction on an expose event,
+
- if the widget content has changed and it needs to be redrawn.
+
+
+In both cases, drawing is done by the implementation of
+dw::core::Widget::draw, which draws into the view.
+
+
+Each view provides some primitive methods for drawing, most should be
+obvious. Note that the views do not know anything about dillo
+widgets, and so coordinates have to be passed as canvas coordinates.
+
+A widget may only draw in its own allocation. If this cannot be
+achieved, a clipping view can be used, this is described in
+\ref dw-layout-views. Generally, drawing should then look like:
+
+\code
+void Foo::draw (dw::core::View *view, dw::core::Rectangle *area)
+{
+ // 1. Create a clipping view.
+ dw::core::View clipView =
+ view->getClippingView (allocation.x, allocation.y,
+ allocation.width, getHeight ());
+
+ // 2. Draw into clip_view
+ clipView->doSomeDrawing (...);
+
+ // 3. Draw the children, they receive the clipping view as argument.
+ dw::core::Rectangle *childArea
+ for () {
+ if (child->intersects (area, &childArea))
+ child->draw (clipView, childArea);
+ }
+
+ // 4. Merge
+ view->mergeClippingView (clipView);
+}
+\endcode
+
+Clipping views are expensive, so they should be avoided when possible.
+
+The second argument to dw::core::Widget::draw is the region, which has
+to be drawn. This may (but needs not) be used for optimization.
+
+If a widget contains child widgets, it must explicitly draw these
+children (see also code example above). For this, there is the useful
+method dw::core::Widget::intersects, which returns, which area of the
+child must be drawn.
+
+Explicit Redrawing
+
+If a widget changes its contents, so that it must be redrawn, it must
+call dw::core::Widget::queueDrawArea or
+dw::core::Widget::queueDraw. The first variant expects a region within
+the widget, the second will cause the whole widget to be redrawn. This
+will cause an asynchronous call of dw::core::Widget::draw.
+
+If only the size changes, a call to dw::core::Widget::queueResize is
+sufficient, this will also queue a complete redraw (see \ref
+dw-widget-sizes.)
+
+
+Mouse Events
+
+A widget may process mouse events. The view (\ref dw-layout-views)
+passes mouse events to the layout, which then passes them to the
+widgets. There are two kinds of mouse events:
+
+
+- events returning bool, and
+
- events returning nothing (void).
+
+
+The first group consists of:
+
+
+- dw::core::Widget::buttonPressImpl,
+
- dw::core::Widget::buttonReleaseImpl, and
+
- dw::core::Widget::motionNotifyImpl.
+
+
+For these events, a widget returns a boolean value, which denotes,
+whether the widget has processed this event (true) or not (false). In
+the latter case, the event is delegated according to the following
+rules:
+
+
+- First, this event is passed to the bottom-most widget, in which
+ allocation the mouse position is in.
+
- If the widget does not process this event (returning false), it is
+ passed to the parent, and so on.
+
- The final result (whether \em any widget has processed this event) is
+ returned to the view.
+
+
+The view may return this to the UI toolkit, which then interprets this
+in a similar way (whether the viewport, a UI widget, has processed
+this event).
+
+These events return nothing:
+
+
+- dw::core::Widget::enterNotifyImpl and
+
- dw::core::Widget::leaveNotifyImpl.
+
+
+since they are bound to a widget.
+
+When processing mouse events, the layout always deals with two
+widgets: the widget, the mouse pointer was in, when the previous mouse
+event was processed, (below called the "old widget") and the widget,
+in which the mouse pointer is now ("new widget").
+
+The following paths are calculated:
+
+
+- the path from the old widget to the nearest common ancestor of the old
+ and the new widget, and
+
- the path from this ancestor to the new widget.
+
+
+For the widgets along these paths, dw::core::Widget::enterNotifyImpl
+and dw::core::Widget::leaveNotifyImpl are called.
+
+Signals
+
+If a caller outside of the widget is interested in these events, he
+can connect a dw::core::Layout::LinkReceiver. For those events with a
+boolean return value, the results of the signal emission is regarded,
+i.e. the delegation of an event to the parent of the widget can be
+stopped by a signal receiver returning true, even if the widget method
+returns false.
+
+First, the widget method is called, then (in any case) the signal is
+emitted.
+
+Selection
+
+If your widget has selectable contents, it should delegate the events
+to dw::core::SelectionState (dw::core::Layout::selectionState).
+
+
+Miscellaneous
+
+Cursors
+
+Each widget has a cursor, which is set by
+dw::core::Widget::setCursor. If a cursor is assigned to a part of a
+widget, this widget must process mouse events, and call
+dw::core::Widget::setCursor explicitly.
+
+(This will change, cursors should become part of
+dw::core::style::Style.)
+
+Background
+
+Backgrounds are part of styles
+(dw::core::style::Style::backgroundColor). If a widget assigns
+background colors to parts of a widget (as dw::Table does for rows),
+it must call dw::core::Widget::setBgColor for the children inside this
+part.
+
+*/
diff --git a/doc/dw-map.doc b/doc/dw-map.doc
new file mode 100644
index 0000000..aebeb7d
--- /dev/null
+++ b/doc/dw-map.doc
@@ -0,0 +1,59 @@
+/** \page dw-map Dillo Widget Documentation Map
+
+This maps includes special documentations as well as longer comments
+in the sources. Arrows denote references between the documents.
+
+\dot
+digraph G {
+ rankdir=LR;
+ node [shape=record, fontname=Helvetica, fontsize=8];
+ fontname=Helvetica; fontsize=8;
+
+ dw_overview [label="Dillo Widget Overview", URL="\ref dw-overview"];
+ dw_usage [label="Dillo Widget Usage", URL="\ref dw-usage"];
+ dw_layout_views [label="Layout and Views", URL="\ref dw-layout-views"];
+ dw_layout_widgets [label="Layout and Widgets",
+ URL="\ref dw-layout-widgets"];
+ dw_widget_sizes [label="Sizes of Dillo Widgets",
+ URL="\ref dw-widget-sizes"];
+ dw_changes [label="Changes to the GTK+-based Release Version",
+ URL="\ref dw-changes"];
+ dw_images_and_backgrounds [label="Images and Backgrounds in Dw",
+ URL="\ref dw-images-and-backgrounds"];
+ dw_Image [label="dw::Image", URL="\ref dw::Image"];
+ dw_core_Imgbuf [label="dw::core::Imgbuf", URL="\ref dw::core::Imgbuf"];
+ dw_core_SelectionState [label="dw::core::SelectionState",
+ URL="\ref dw::core::SelectionState"];
+ dw_core_style [label="dw::core::style", URL="\ref dw::core::style"];
+ dw_Table [label="dw::Table", URL="\ref dw::Table"];
+ dw_Textblock [label="dw::Textblock", URL="\ref dw::Textblock"];
+ dw_core_ui [label="dw::core::ui", URL="\ref dw::core::ui"];
+
+ dw_overview -> dw_changes;
+ dw_overview -> dw_usage;
+ dw_overview -> dw_core_style;
+ dw_overview -> dw_core_ui;
+ dw_overview -> dw_images_and_backgrounds;
+ dw_overview -> dw_layout_widgets;
+ dw_overview -> dw_widget_sizes;
+ dw_overview -> dw_layout_views;
+
+ dw_usage -> dw_Table;
+ dw_usage -> dw_Textblock;
+ dw_usage -> dw_core_style;
+ dw_usage -> dw_core_ui;
+ dw_usage -> dw_images_and_backgrounds;
+
+ dw_layout_widgets -> dw_widget_sizes;
+ dw_layout_widgets -> dw_core_SelectionState;
+
+ dw_widget_sizes -> dw_Table;
+ dw_widget_sizes -> dw_Textblock;
+
+ dw_images_and_backgrounds -> dw_core_Imgbuf;
+ dw_images_and_backgrounds -> dw_Image;
+
+ dw_core_style -> dw_Textblock;
+}
+\enddot
+*/
\ No newline at end of file
diff --git a/doc/dw-overview.doc b/doc/dw-overview.doc
new file mode 100644
index 0000000..8c74063
--- /dev/null
+++ b/doc/dw-overview.doc
@@ -0,0 +1,157 @@
+/** \page dw-overview Dillo Widget Overview
+
+Note: If you are already familiar with the Gtk+-based version of Dw,
+read \ref dw-changes.
+
+
+The module Dw (Dillo Widget) is responsible for the low-level rendering of
+all resources, e.g. images, plain text, and HTML pages (this is the
+most complex type). Dw is \em not responsible for parsing HTML, or
+decoding image data. Furthermore, the document tree, which is planned
+for CSS, is neither a part of Dw, instead, it is a new module on top
+of Dw.
+
+The rendering, as done by Dw, is split into two phases:
+
+
+- the \em layouting, this means calculating the exact positions of
+ words, lines, etc. (in pixel position), and
+
- the \em drawing, i.e. making the result of the layouting visible
+ on the screen.
+
+
+The result of the layouting allocates an area, which is called
+\em canvas.
+
+Structure
+
+The whole Dw module can be split into the following parts:
+
+\dot
+digraph G {
+ node [shape=record, fontname=Helvetica, fontsize=10];
+ edge [arrowhead="open", fontname=Helvetica, fontsize=10,
+ labelfontname=Helvetica, labelfontsize=10,
+ color="#404040", labelfontcolor="#000080"];
+
+ subgraph cluster_core {
+ style="dashed"; color="#000080"; fontname=Helvetica; fontsize=10;
+ label="Platform independent core";
+
+ Layout [URL="\ref dw::core::Layout"];
+ Platform [URL="\ref dw::core::Platform", color="#ff8080"];
+ View [URL="\ref dw::core::View", color="#ff8080"];
+ Widget [URL="\ref dw::core::Widget", color="#a0a0a0"];
+ }
+
+ subgraph cluster_fltk {
+ style="dashed"; color="#000080"; fontname=Helvetica; fontsize=10;
+ label="FLTK specific part (as an\nexample for the platform specific\n\
+implementations)";
+
+ subgraph cluster_fltkcore {
+ style="dashed"; color="#000080"; fontname=Helvetica; fontsize=10;
+ label="FLTK core";
+
+ FltkPlatform [URL="\ref dw::fltk::FltkPlatform"];
+ FltkView [URL="\ref dw::fltk::FltkView", color="#ff8080"];
+ }
+
+ FltkViewport [URL="\ref dw::fltk::FltkViewport"];
+ FltkPreview [URL="\ref dw::fltk::FltkPreview"];
+ }
+
+ subgraph cluster_widgets {
+ style="dashed"; color="#000080"; fontname=Helvetica; fontsize=10;
+ label="Platform independent widgets";
+
+ Textblock [URL="\ref dw::Textblock"];
+ AlignedTextblock [URL="\ref dw::AlignedTextblock", color="#a0a0a0"];
+ Table [URL="\ref dw::Table"];
+ Image [URL="\ref dw::Image"];
+ etc1 [label="..."];
+ etc2 [label="..."];
+ }
+
+ Layout -> Platform [headlabel="1", taillabel="1"];
+ Layout -> View [headlabel="*", taillabel="1"];
+
+ Layout -> Widget [headlabel="1", taillabel="1", label="topLevel"];
+ Widget -> Widget [headlabel="*", taillabel="1", label="children"];
+
+ Widget -> Textblock [arrowhead="none", arrowtail="empty"];
+ Widget -> Table [arrowhead="none", arrowtail="empty"];
+ Widget -> Image [arrowhead="none", arrowtail="empty"];
+ Widget -> etc1 [arrowhead="none", arrowtail="empty"];
+ Textblock -> AlignedTextblock [arrowhead="none", arrowtail="empty"];
+ AlignedTextblock -> etc2 [arrowhead="none", arrowtail="empty"];
+
+ Platform -> FltkPlatform [arrowhead="none", arrowtail="empty",
+ style="dashed"];
+ FltkPlatform -> FltkView [headlabel="*", taillabel="1"];
+
+ View -> FltkView [arrowhead="none", arrowtail="empty"];
+ FltkView -> FltkViewport [arrowhead="none", arrowtail="empty",
+ style="dashed"];
+ FltkView -> FltkPreview [arrowhead="none", arrowtail="empty",
+ style="dashed"];
+}
+\enddot
+
+[\ref uml-legend "legend"]
+
+\em Platform means in most cases the underlying UI toolkit
+(e.g. FLTK). A layout is bound to a specific platform, but multiple
+platforms may be handled in one program.
+
+A short overview:
+
+
+- dw::core::Layout is the central class, it manages the widgets and the
+ view, and provides delegation methods for the platform.
+
+
- The layouting is done by a tree of widgets (details are described in
+ \ref dw-layout-widgets), also the drawing, which is finally delegated
+ to the view.
+
+
- The view (implementation of dw::core::View) provides primitive methods
+ for drawing, but also have an influence on
+ the canvas size (via size hints). See \ref dw-layout-views for details.
+
+
- Some platform dependencies are handled by implementations
+ of dw::core::Platform.
+
+
+
+Header Files
+
+The structures mentioned above can be found in the following header
+files:
+
+
+- Anything from the Dw core in core.hh. Do not include the single files.
+
+
- The single widgets can be found in the respective header files, e.g.
+ image.hh for dw::Image.
+
+
- The core of the FLTK implementation is defined in fltkcore.hh. This
+ includes dw::fltk::FltkPlatform, dw::fltk::FltkView, but not the concrete
+ view implementations.
+
+
- The views can be found in single header files, e.g fltkviewport.hh for
+ dw::fltk::FltkViewport.
+
+
+
+Further Documentations
+
+A complete map can be found at \ref dw-map.
+
+
+- For learning, how to use Dw, read \ref dw-usage and related documents,
+ dw::core::style, dw::core::ui and \ref dw-images-and-backgrounds.
+
- Advanced topics are described in \ref dw-layout-widgets,
+ \ref dw-widget-sizes and \ref dw-layout-views.
+
+
+*/
diff --git a/doc/dw-size-of-widget.png b/doc/dw-size-of-widget.png
new file mode 100644
index 0000000..eda93ee
Binary files /dev/null and b/doc/dw-size-of-widget.png differ
diff --git a/doc/dw-style-box-model.png b/doc/dw-style-box-model.png
new file mode 100644
index 0000000..aa65ecb
Binary files /dev/null and b/doc/dw-style-box-model.png differ
diff --git a/doc/dw-style-length-absolute.png b/doc/dw-style-length-absolute.png
new file mode 100644
index 0000000..6b4d838
Binary files /dev/null and b/doc/dw-style-length-absolute.png differ
diff --git a/doc/dw-style-length-percentage.png b/doc/dw-style-length-percentage.png
new file mode 100644
index 0000000..15b3695
Binary files /dev/null and b/doc/dw-style-length-percentage.png differ
diff --git a/doc/dw-style-length-relative.png b/doc/dw-style-length-relative.png
new file mode 100644
index 0000000..d54d99b
Binary files /dev/null and b/doc/dw-style-length-relative.png differ
diff --git a/doc/dw-textblock-collapsing-spaces-1-1.png b/doc/dw-textblock-collapsing-spaces-1-1.png
new file mode 100644
index 0000000..d528dfb
Binary files /dev/null and b/doc/dw-textblock-collapsing-spaces-1-1.png differ
diff --git a/doc/dw-textblock-collapsing-spaces-1-2.png b/doc/dw-textblock-collapsing-spaces-1-2.png
new file mode 100644
index 0000000..483e79d
Binary files /dev/null and b/doc/dw-textblock-collapsing-spaces-1-2.png differ
diff --git a/doc/dw-textblock-collapsing-spaces-2-1.png b/doc/dw-textblock-collapsing-spaces-2-1.png
new file mode 100644
index 0000000..0a03ea8
Binary files /dev/null and b/doc/dw-textblock-collapsing-spaces-2-1.png differ
diff --git a/doc/dw-textblock-collapsing-spaces-2-2.png b/doc/dw-textblock-collapsing-spaces-2-2.png
new file mode 100644
index 0000000..b89c625
Binary files /dev/null and b/doc/dw-textblock-collapsing-spaces-2-2.png differ
diff --git a/doc/dw-usage.doc b/doc/dw-usage.doc
new file mode 100644
index 0000000..a23920b
--- /dev/null
+++ b/doc/dw-usage.doc
@@ -0,0 +1,375 @@
+/** \page dw-usage Dillo Widget Usage
+
+This document describes the usage of Dw, without going too much into
+detail.
+
+
+Getting Started
+
+In this section, a small runnable example is described, based on the
+FLTK implementation.
+
+As described in \ref dw-overview, the following objects are needed:
+
+
+- dw::core::Layout,
+
- an implementation of dw::core::Platform (we will use
+ dw::fltk::FltkPlatform),
+
- at least one implementation of dw::core::View (dw::fltk::FltkViewport),
+ and
+
- some widgets (for this example, only a simple dw::Textblock).
+
+
+First of all, the necessary \#include's:
+
+\code
+#include
+#include
+
+#include "dw/core.hh"
+#include "dw/fltkcore.hh"
+#include "dw/fltkviewport.hh"
+#include "dw/textblock.hh"
+\endcode
+
+Everything is put into one function:
+
+\code
+int main(int argc, char **argv)
+{
+\endcode
+
+As the first object, the platform is instantiated:
+
+\code
+ dw::fltk::FltkPlatform *platform = new dw::fltk::FltkPlatform ();
+\endcode
+
+Then, the layout is created, with the platform attached:
+
+\code
+ dw::core::Layout *layout = new dw::core::Layout (platform);
+\endcode
+
+For the view, we first need a FLTK window:
+
+\code
+ Fl_Window *window = new Fl_Window(200, 300, "Dw Example");
+ window->begin();
+\endcode
+
+After this, we can create a viewport, and attach it to the layout:
+
+\code
+ dw::fltk::FltkViewport *viewport =
+ new dw::fltk::FltkViewport (0, 0, 200, 300);
+ layout->attachView (viewport);
+\endcode
+
+Each widget needs a style (dw::core::style::Style, see dw::core::style),
+so we construct it here. For this, we need to fill a
+dw::core::style::StyleAttrs structure with values, and call
+dw::core::style::Style::create (latter is done further below):
+
+\code
+ dw::core::style::StyleAttrs styleAttrs;
+ styleAttrs.initValues ();
+ styleAttrs.margin.setVal (5);
+\endcode
+
+dw::core::style::StyleAttrs::initValues sets several default
+values. The last line sets a margin of 5 pixels. Next, we need a
+font. Fonts are created in a similar way, first, the attributes are
+defined:
+
+\code
+ dw::core::style::FontAttrs fontAttrs;
+ fontAttrs.name = "Bitstream Charter";
+ fontAttrs.size = 14;
+ fontAttrs.weight = 400;
+ fontAttrs.style = dw::core::style::FONT_STYLE_NORMAL;
+ fontAttrs.letterSpacing = 0;
+ fontAttrs.fontVariant = dw::core::style::FONT_VARIANT_NORMAL;
+\endcode
+
+Now, the font can be created:
+
+\code
+ styleAttrs.font = dw::core::style::Font::create (layout, &fontAttrs);
+\endcode
+
+As the last attributes, the background and forground colors are
+defined, here dw::core::style::Color::createSimple must be called:
+
+\code
+ styleAttrs.color =
+ dw::core::style::Color::create (layout, 0x000000);
+ styleAttrs.backgroundColor =
+ dw::core::style::Color::create (layout, 0xffffff);
+\endcode
+
+Finally, the style for the widget is created:
+
+\code
+ dw::core::style::Style *widgetStyle =
+ dw::core::style::Style::create (layout, &styleAttrs);
+\endcode
+
+Now, we create a widget, assign a style to it, and set it as the
+toplevel widget of the layout:
+
+\code
+ dw::Textblock *textblock = new dw::Textblock (false);
+ textblock->setStyle (widgetStyle);
+ layout->setWidget (textblock);
+\endcode
+
+The style is not needed anymore (a reference is added in
+dw::core::Widget::setStyle), so it should be unreferred:
+
+\code
+ widgetStyle->unref();
+\endcode
+
+Now, some text should be added to the textblock. For this, we first
+need another style. \em styleAttrs can still be used for this. We set
+the margin to 0, and the background color to "transparent":
+
+\code
+ styleAttrs.margin.setVal (0);
+ styleAttrs.backgroundColor = NULL;
+
+ dw::core::style::Style *wordStyle =
+ dw::core::style::Style::create (layout, &styleAttrs);
+\endcode
+
+This loop adds some paragraphs:
+
+\code
+ for(int i = 1; i <= 10; i++) {
+ char buf[4];
+ sprintf(buf, "%d.", i);
+
+ char *words[] = { "This", "is", "the", buf, "paragraph.",
+ "Here", "comes", "some", "more", "text",
+ "to", "demonstrate", "word", "wrapping.",
+ NULL };
+
+ for(int j = 0; words[j]; j++) {
+ textblock->addText(strdup(words[j]), wordStyle);
+\endcode
+
+Notice the \em strdup, dw::Textblock::addText will feel responsible
+for the string, and free the text at the end. (This has been done to
+avoid some overhead in the HTML parser.)
+
+The rest is simple, it also includes spaces (which also have styles):
+
+\code
+ textblock->addSpace(wordStyle);
+ }
+\endcode
+
+Finally, a paragraph break is added, which is 10 pixels high:
+
+\code
+ textblock->addParbreak(10, wordStyle);
+ }
+\endcode
+
+Again, this style should be unreferred:
+
+\code
+ wordStyle->unref();
+\endcode
+
+After adding text, this method should always be called (for faster
+adding large text blocks):
+
+\code
+ textblock->flush ();
+\endcode
+
+Some FLTK stuff to finally show the window:
+
+\code
+ window->resizable(viewport);
+ window->show();
+ int errorCode = Fl::run();
+\endcode
+
+For cleaning up, it is sufficient to destroy the layout:
+
+\code
+ delete layout;
+\endcode
+
+And the rest
+
+\code
+ return errorCode;
+}
+\endcode
+
+If you compile and start the program, you should see the following:
+
+\image html dw-example-screenshot.png
+
+Try to scroll, or to resize the window, you will see, that everything
+is done automatically.
+
+Of course, creating new widgets, adding text to widgets etc. can also
+be done while the program is running, i.e. after fltk::run has been
+called, within timeouts, idles, I/O functions etc. Notice that Dw is
+not thread safe, so that everything should be done within one thread.
+
+With the exception, that you have to call dw::Textblock::flush,
+everything gets immediately visible, within reasonable times; Dw has
+been optimized for frequent updates.
+
+
+List of all Widgets
+
+These widgets are used within dillo:
+
+
+- dw::core::ui::Embed
+
- dw::AlignedTextblock
+
- dw::Bullet
+
- dw::Ruler
+
- dw::Image
+
- dw::ListItem
+
- dw::Table
+
- dw::TableCell
+
- dw::Textblock
+
+
+If you want to create a new widget, refer to \ref dw-layout-widgets.
+
+
+List of Views
+
+There are three dw::core::View implementations for FLTK:
+
+
+- dw::fltk::FltkViewport implements a viewport, which is used in the
+ example above.
+
+
- dw::fltk::FltkPreview implements a preview window, together with
+ dw::fltk::FltkPreviewButton, it is possible to have a scaled down
+ overview of the whole canvas.
+
+
- dw::fltk::FltkFlatView is a "flat" view, i.e. it does not support
+ scrolling. It is used for HTML buttons, see
+ dw::fltk::ui::FltkComplexButtonResource and especially
+ dw::fltk::ui::FltkComplexButtonResource::createNewWidget for details.
+
+
+More informations about views in general can be found in \ref
+dw-layout-views.
+
+
+Iterators
+
+For examining generally the contents of widgets, there are iterators
+(dw::core::Iterator), created by the method
+dw::core::Widget::iterator (see there for more details).
+
+These simple iterators only iterate through one widget, and return
+child widgets as dw::core::Content::WIDGET. The next call of
+dw::core::Iterator::next will return the piece of contents \em after
+(not within) this child widget.
+
+If you want to iterate through the whole widget trees, there are two
+possibilities:
+
+
+- Use a recursive function. Of course, with this approach, you are
+ limited by the program flow.
+
+
- Maintain a stack of iterators, so you can freely pass this stack
+ around. This is already implemented, as dw::core::DeepIterator.
+
+
+As an example, dw::core::SelectionState represents the selected region
+as two instances of dw::core::DeepIterator.
+
+
+Finding Text
+
+See dw::core::Layout::findtextState and dw::core::FindtextState
+(details in the latter). There are delegation methods:
+
+
+- dw::core::Layout::search and
+
- dw::core::Layout::resetSearch.
+
+
+
+Anchors and Scrolling
+
+In some cases, it is necessary to scroll to a given position, or to
+an anchor, programmatically.
+
+Anchors
+
+Anchors are defined by widgets, e.g. dw::Textblock defines them, when
+dw::Textblock::addAnchor is called. To jump to a specific anchor
+within the current widget tree, use dw::core::Layout::setAnchor.
+
+This can be done immediately after assignig a toplevel widget, even
+when the anchor has not yet been defined. The layout will remember the
+anchor, and jump to the respective position, as soon as possible. Even
+if the anchor position changes (e.g., when an anchor is moved
+downwards, since some space is needed for an image in the text above),
+the position is corrected.
+
+As soon as the user scrolls the viewport, this correction is not done
+anymore. If in dillo, the user request a page with an anchor, which is
+quite at the bottom of the page, he may be get interested in the text
+at the beginning of the page, and so scrolling down. If then, after
+the anchor has been read and added to the dw::Textblock, this anchor
+would be jumped at, the user would become confused.
+
+The anchor is dismissed, too, when the toplevel widget is removed
+again.
+
+\todo Currently, anchors only define vertical positions.
+
+Scrolling
+
+To scroll to a given position, use the method
+dw::core::Layout::scrollTo. It expects several parameters:
+
+
+- a horizontal adjustment parameter, defined by dw::core::HPosition,
+
- a vertical adjustment parameter, defined by dw::core::VPosition, and
+
- a rectangle (\em x, \em y, \em width and \em heigh) of the region
+ to be adjusted.
+
+
+If you just want to move the canvas coordinate (\em x, \em y) into the
+upper left corner of the viewport, you can call:
+
+\code
+dw::core::Layout *layout;
+// ...
+layout->scrollTo(dw::core::HPOS_LEFT, dw::core::VPOS_TOP, 0, 0, 0, 0);
+\endcode
+
+By using dw::core::HPOS_NO_CHANGE or dw::core::VPOS_NO_CHANGE, you can
+change only one dimension. dw::core::HPOS_INTO_VIEW and
+dw::core::VPOS_INTO_VIEW will cause the viewport to move as much as
+necessary, that the region is visible in the viewport (this is
+e.g. used for finding text).
+
+
+Further Documentations
+
+
+- dw::core::style
+
- dw::core::ui
+
- \ref dw-images-and-backgrounds
+
+
+*/
diff --git a/doc/dw-viewport-with-scrollbar.png b/doc/dw-viewport-with-scrollbar.png
new file mode 100644
index 0000000..7ac62de
Binary files /dev/null and b/doc/dw-viewport-with-scrollbar.png differ
diff --git a/doc/dw-viewport-without-scrollbar.png b/doc/dw-viewport-without-scrollbar.png
new file mode 100644
index 0000000..8aa20fe
Binary files /dev/null and b/doc/dw-viewport-without-scrollbar.png differ
diff --git a/doc/dw-widget-sizes.doc b/doc/dw-widget-sizes.doc
new file mode 100644
index 0000000..419a4a7
--- /dev/null
+++ b/doc/dw-widget-sizes.doc
@@ -0,0 +1,186 @@
+/** \page dw-widget-sizes Sizes of Dillo Widgets
+
+Allocation
+
+Each widget has an \em allocation at a given time, this includes
+
+
+- the position (\em x, \em y) relative to the upper left corner of the
+ canvas, and
+
- the size (\em width, \em ascent, \em descent).
+
+
+The \em canvas is the whole area available for the widgets, in most
+cases, only a part is seen in a viewport. The allocation of the toplevel widget is exactly the allocation of the canvas, i.e.
+
+
+- the position of the toplevel widget is always (0, 0), and
+
- the canvas size is defined by the size of the toplevel widget.
+
+
+The size of a widget is not simply defined by the width and the
+height, instead, widgets may have a base line, and so are vertically
+divided into an ascender (which height is called \em ascent), and a
+descender (which height is called \em descent). The total height is so
+the sum of \em ascent and \em descent.
+
+Sizes of zero are allowed. The upper limit for the size of a widget is
+defined by the limits of the C++ type \em int.
+
+\image html dw-size-of-widget.png Allocation of a Widget
+
+In the example in the image, the widget has the following allocation:
+
+
+- \em x = 50
+
- \em y = 50
+
- \em width = 150
+
- \em ascent = 150
+
- \em descent = 100
+
+
+The current allocation of a widget is hold in
+dw::core::Widget::allocation. It can be set from outside by
+calling dw::core::Widget::sizeAllocate. This is a concrete method,
+which will call dw::core::Widget::sizeAllocateImpl (see code of
+dw::core::Widget::sizeAllocate for details).
+
+For trivial widgets (like dw::Bullet),
+dw::core::Widget::sizeAllocateImpl does not need to be
+implemented. For more complex widgets, the implementation should call
+dw::core::Widget::sizeAllocate (not
+dw::core::Widget::sizeAllocateImpl) on all child widgets, with
+appropriate child allocations. dw::core::Widget::allocation should not
+be changed here, this is already done in
+dw::core::Widget::sizeAllocate.
+
+Requisitions
+
+A widget may prefer a given size for the allocation. This size, the
+\em requisition, should be returned by the method
+dw::core::Widget::sizeRequestImpl. In the simplest case, this is
+independent of the context, e.g. for an
+image. dw::Image::sizeRequestImpl returns the following size:
+
+
+- If no buffer has yet been assigned (see dw::Image for more details),
+ the size necessary for the alternative text is returned. If no
+ alternative text has been set, zero is returned.
+
+
- If a buffer has been assigned (by dw::Image::setBuffer), the root
+ size is returned (i.e. the original size of the image to display).
+
+
+This is a bit simplified, dw::Image::sizeRequestImpl should also deal
+with margins, borders and paddings, see dw::core::style.
+
+From the outside, dw::Image::sizeRequest should be called, which does
+a bit of optimization. Notice that in dw::Image::sizeRequestImpl, no
+optimization like lazy evaluation is necessary, this is already done
+in dw::Image::sizeRequest.
+
+A widget, which has children, will likely call dw::Image::sizeRequest
+on its children, to calculate the total requisition.
+
+The caller (this is either the dw::core::Layout, or the parent
+widget), may, but also may not consider the requisition. Instead, a
+widget must deal with any allocation. (For example, dw::Image scales
+the image buffer when allocated at another size.)
+
+Size Hints
+
+Some widgets do not have an inherent size, but depend on the context,
+e.g. the viewport size. These widgets should adhere to size hints,
+i.e. implement the methods dw::core::Widget::setWidth,
+dw::core::Widget::setAscent and dw::core::Widget::setDescent. The values
+passed to the callees are
+
+
+- the viewport size (ascent is the heigt here, while descent is 0) for
+ the toplevel widget, and
+
- determined by the parent for its child widgets.
+
+
+Generally, the values should define the available space for the
+widget.
+
+A widget, which depends on size hints, should call
+dw::core::Widget::queueResize, when apropriate.
+
+\todo There should be a definition of "available space".
+
+Width Extremes
+
+dw::Table uses width extremes for fast calculation of column
+widths. The structure dw::core::Extremes represents the minimal and
+maximal width of a widget, as defined by:
+
+
+- the minimal width is the smallest width, at which a widget can still
+ display contents, and
+
- the maximal width is the largest width, above which increasing the width
+ does not make any sense.
+
+
+Especially the latter is vaguely defined, here are some examples:
+
+
+- For those widgets, which do not depend on size hints, the minimal and
+ the maximal width is the inherent width (the one returned by
+ dw::core::Widget::sizeRequest).
+
+
- For a textblock, the minimal width is the width of the widest
+ (unbreakable) word, the maximal width is the width of the total
+ paragraph (stretching a paragraph further would only waste space).
+ Actually, the implementation of dw::Textblock::getExtremesImpl is
+ a bit more complex.
+
+
- dw::Table is an example, where the width extremes are calculated
+ from the width extremes of the children.
+
+
+Handling width extremes is similar to handling requisitions, a widget
+must implement dw::core::Widget::getExtremesImpl, but a caller will
+use dw::core::Widget::getExtremes.
+
+
+Resizing
+
+When the widget changes its size (requisition), it should call
+dw::core::Widget::queueResize. The next call of
+dw::core::Widget::sizeRequestImpl should then return the new
+size. See dw::Image::setBuffer as an example.
+
+Interna are described in the code of dw::core::Widget::queueResize.
+
+Incremental Resizing
+
+A widget may calculate its size based on size calculations already
+done before. In this case, a widget must exactly know the reasons, why
+a call of dw::core::Widget::sizeRequestImpl is necessary. To make use
+of this, a widget must implement the following:
+
+
+- There is a member dw::core::Widget::parentRef, which is
+ totally under control of the parent widget (and so sometimes not
+ used at all). It is necessary to define how parentRef is used
+ by a specific parent widget, and it has to be set to the correct
+ value whenever necessary.
+
+
- The widget must implement dw::core::Widget::markSizeChange and
+ dw::core::Widget::markExtremesChange, these methods are called in
+ two cases:
+
+
+ - directly after dw::core::Widget::queueResize, with the argument
+ ref was passed to dw::core::Widget::queueResize, and
+
- if a child widget has called dw::core::Widget::queueResize,
+ with the value of the parent_ref member of this child.
+
+
+
+This way, a widget can exactly keep track on size changes, and so
+implement resizing in a faster way. A good example on how to use this
+is dw::Textblock.
+
+*/
diff --git a/doc/fltk-problems.doc b/doc/fltk-problems.doc
new file mode 100644
index 0000000..df4f1f1
--- /dev/null
+++ b/doc/fltk-problems.doc
@@ -0,0 +1,180 @@
+/** \page fltk-problems Problems with FLTK
+
+dw::fltk::FltkViewport
+
+Current problems:
+
+
+- How should dw::fltk::FltkViewport::cancelQueueDraw be implemented?
+
+
- If the value of a scrollbar is changed by the program, not the user,
+ the callback seems not to be called. Can this be assured?
+
+
- The same for dw::fltk::FltkViewport::layout?
+
+
- Also, the problems with the widgets seems to work. Also sure?
+
+
- When drawing, clipping of 32 bit values is not working properly.
+
+
- The item group within a selection widget (menu) should not be selectable.
+
+
+
+dw::fltk::FltkPlatform
+
+
+- There is the problem, that fltk::font always returns a font, the
+ required one, or a replacements. The latter is not wanted in all
+ cases, e.g. when several fonts are tested. Perhaps, this could be
+ solved by searching in the font list. [This was true of fltk2.
+ What is the state of font handling now with fltk-1.3?]
+
+
- Distinction between italics and oblique would be nice
+ (dw::fltk::FltkFont::FltkFont).
+
+
+
+dw::fltk::ui::FltkCheckButtonResource
+
+Groups of Fl_Radio_Button must be added to one Fl_Group, which is
+not possible in this context. There are two alternatives:
+
+
+- there is a more flexible way to group radio buttons, or
+
- radio buttons are not grouped, instead, grouping (especially
+ unchecking other buttons) is done by the application.
+
+
+(This is mostly solved.)
+
+dw::fltk::FltkImgbuf
+
+Alpha transparency should be best abstracted by FLTK itself. If not,
+perhaps different implementations for different window systems could
+be used. Then, it is for X necessary to use GCs with clipping masks.
+
+
+dw::fltk::ui::ComplexButton
+
+Unfortunately, FLTK does not provide a button with Fl_Group as parent, so
+that children may be added to the button. dw::fltk::ui::ComplexButton does
+exactly this, and is, in an ugly way, a modified copy of the FLTK
+button.
+
+It would be nice, if this is merged with the standard FLTK
+button. Furthermore, setting the type is strange.
+
+If the files do not compile, it may be useful to create a new one from
+the FLTK source:
+
+
+- Copy Fl_Button.H from FLTK to dw/fltkcomplexbutton.hh and
+ src/Button.cxx to dw/fltkcomplexbutton.cc.
+
+
- In both files, rename "Button" to "ComplexButton". Automatic replacing
+ should work.
+
+
- Apply the changes below.
+
+
+The following changes should be applied manually.
+
+Changes in fltkcomplexbutton.hh
+
+First of all, the \#define's for avoiding multiple includes:
+
+\code
+-#ifndef fltk_ComplexButton_h // fltk_Button_h formerly
+-#define fltk_ComplexButton_h
++#ifndef __FLTK_COMPLEX_BUTTON_HH__
++#define __FLTK_COMPLEX_BUTTON_HH__
+\endcode
+
+at the beginning and
+
+\code
+-#endif
++#endif // __FLTK_COMPLEX_BUTTON_HH__
+\endcode
+
+at the end. Then, the namespace is changed:
+
+\code
+-namespace fltk {
++namespace dw {
++namespace fltk {
++namespace ui {
+\endcode
+
+at the beginning and
+
+\code
+-}
++} // namespace ui
++} // namespace fltk
++} // namespace dw
+\endcode
+
+at the end. Most important, the base class is changed:
+
+\code
+-#include "FL/Fl_Widget.H"
++#include
+\endcode
+
+and
+
+\code
+-class FL_API ComplexButton : public Fl_Widget {
++class ComplexButton: public Fl_Group
++{
+\endcode
+
+Finally, for dw::fltk::ui::ComplexButton::default_style, there is a
+namespace conflict:
+
+\code
+- static NamedStyle* default_style;
++ static ::fltk::NamedStyle* default_style;
+\endcode
+
+Changes in fltkcomplexbutton.cc
+
+First, \#include's:
+
+\code
+
+ #include
+-#include // formerly
+ #include
+ #include
++
++#include "fltkcomplexbutton.hh"
+\endcode
+
+Second, namespaces:
+
+\code
++using namespace dw::fltk::ui;
+\endcode
+
+Since the base class is now Fl_Group, the constructor must be changed:
+
+\code
+-ComplexButton::ComplexButton(int x,int y,int w,int h, const char *l) : Fl_Widget(x,y,w,h,l) {
++ComplexButton::ComplexButton(int x,int y,int w,int h, const char *l) :
++ Fl_Group(x,y,w,h,l)
++{
+\endcode
+
+Finally, the button must draw its children (end of
+dw::fltk::ui::ComplexButton::draw()):
+
+\code
++
++ for (int i = children () - 1; i >= 0; i--)
++ draw_child (*child (i));
+ }
+\endcode
+
+*/
diff --git a/doc/index.doc b/doc/index.doc
new file mode 100644
index 0000000..9892f17
--- /dev/null
+++ b/doc/index.doc
@@ -0,0 +1,48 @@
+/** \mainpage
+
+Overview
+
+This is a list of documents to start with:
+
+
+- \ref lout
+
- \ref dw-overview (map at \ref dw-map)
+
+
+Currently, a document \ref fltk-problems is maintained, ideally, it
+will be removed soon.
+
+Historical
+
+Replacements for GTK+ and GLib
+
+There are several classes etc., which are used for tasks formerly (in the GTK+
+version of dillo) achieved by GtkObject (in 1.2.x, this is part of Gtk+) and
+GLib. For an overview on all this, take a look at \ref lout.
+
+GtkObject is replaced by the following:
+
+
+- object::Object is a common base class for many classes used dillo. In
+ the namespace ::object, there are also some more common classes and
+ interfaces.
+
+
- A sub class of object::Object is identity::IdentifiableObject, which
+ allows to determine the class at run-time (equivalent to GTK_CHECK_CAST
+ in GtkObject).
+
+
- For signals, there is the namespace ::signal.
+
+
+Hash tables, linked lists etc. can be found in the ::container namespace,
+several useful macros from GLib have been implemented as inline functions
+in the ::misc namespace.
+
+As an alternative to the macros defined in list.h, there is also a template
+class, misc::SimpleVector, which does the same.
+
+Changes in Dw
+
+If you have been familiar with Dw before, take a look at \ref dw-changes.
+
+*/
diff --git a/doc/lout.doc b/doc/lout.doc
new file mode 100644
index 0000000..0d5be67
--- /dev/null
+++ b/doc/lout.doc
@@ -0,0 +1,94 @@
+/** \page lout Lots of Useful Tools
+
+In the "lout" directory, there are some common base functionality for
+C++. Most is described as doxygen comments, this text gives an
+overview.
+
+Common Base Class
+
+Many classes are derived from object::Object, which defines some
+general methods. See there for more information.
+
+For the case, that you need primitive C++ types, there are some
+wrappers:
+
+
+C++ Type | Wrapper Class
+ |
---|
void* | object::Pointer
+ | specific pointer | object::TypedPointer (template class)
+ | int | object::Integer
+ | const char* | object::ConstString
+ | char* | object::String
+ |
+
+
+Containers
+
+In the namespace ::container, several container classes are defined,
+which all deal with instances of object::Object.
+
+Untyped Containers
+
+In container::untyped, there are the following containers:
+
+
+- container::untyped::Vector, a dynamically increases array,
+
- container::untyped::List, a linked list,
+
- container::untyped::HashTable, a hash table, and
+
- container::untyped::Stack, a stack.
+
+
+All provide specific methods, but since they have a common base class,
+container::untyped::Collection, they all provide iterators, by the
+method container::untyped::Collection::iterator.
+
+Typed Containers
+
+container::typed provides wrappers for the container classes defined
+in container::untyped, which are more type safe, by using C++
+templates.
+
+
+Signals
+
+For how to connect objects at run-time (to reduce dependencies), take a
+look at the ::signal namespace.
+
+There is also a base class signal::ObservedObject, which implements
+signals for deletion.
+
+
+Debugging
+
+In debug.hh, there are some some useful macros for debugging messages,
+see the file for mor informations.
+
+
+Identifying Classes at Runtime
+
+If the class of an object must be identified at runtime,
+identity::IdentifiableObject should be used as the base class, see
+there for more details.
+
+
+Miscellaneous
+
+The ::misc namespace provides several miscellaneous stuff:
+
+
+- In some contexts, it is necessary to compare objects
+ (less/greater), for this, also misc::Comparable must be
+ implemented. For example., container::untyped::Vector::sort and
+ container::typed::Vector::sort cast the elements to
+ misc::Comparable. This can be mixed with object::Object.
+
- misc::SimpleVector, a simple, template based vector class (not
+ depending on object::Object),
+
- misc::StringBuffer, class for fast concatenation of a large number
+ of strings,
+
- misc::BitSet implements a bitset.
+
- useful (template) functions (misc::min, misc::max), and
+
- some functions useful for runtime checks (misc::assert,
+ misc::assertNotReached).
+
+
+*/
diff --git a/doc/rounding-errors.doc b/doc/rounding-errors.doc
new file mode 100644
index 0000000..433d6ed
--- /dev/null
+++ b/doc/rounding-errors.doc
@@ -0,0 +1,24 @@
+/** \page rounding-errors How to Avoid Rounding Errors
+
+(Probably, this is a standard algorithm, so if someone knows the name,
+drop me a note.)
+
+If something like
+
+\f[y_i = {x_i a \over b}\f]
+
+is to be calculated, and all numbers are integers, a naive
+implementation would result in something, for which
+
+\f[\sum y_i \ne {(\sum x_i) a \over b}\f]
+
+because of rounding errors, due to the integer division. This can be
+avoided by transforming the formula into
+
+\f[y_i = {(\sum_{j=0}^{j=i} x_j) a \over b} - \sum_{j=0}^{j=i} y_j\f]
+
+Of corse, when all \f$y_i\f$ are calculated in a sequence,
+\f$\sum_{j=0}^{j=i} x_j\f$ and \f$\sum_{j=0}^{j=i} y_j\f$ can be
+accumulated in the same loop.
+
+*/
\ No newline at end of file
diff --git a/doc/uml-legend.doc b/doc/uml-legend.doc
new file mode 100644
index 0000000..90294ef
--- /dev/null
+++ b/doc/uml-legend.doc
@@ -0,0 +1,192 @@
+/** \page uml-legend UML Legend
+
+This page describes the notation for several diagrams used in the
+documentation, which is a slight variation of UML.
+
+
+Classes
+
+Classes are represented by boxes, containing there names:
+
+\dot
+digraph G {
+ node [shape=record, fontname=Helvetica, fontsize=10];
+ fontname=Helvetica; fontsize=8;
+ "Concrete Class";
+ "Abstract Class" [color="#a0a0a0"];
+ Interface [color="#ff8080"];
+}
+\enddot
+
+(In most cases, the attributes and operations are left away, for
+better readibility. Just click on it, to get to the detailed
+description.)
+
+Of course, in C++, there are no interfaces, but here, we call a class,
+which has only virtual abstract methods, and so does not provide any
+functionality, an interface.
+
+Templates get a yellow background color:
+
+\dot
+digraph G {
+ node [shape=record, fontname=Helvetica, fontsize=10,
+ fillcolor="#ffffc0", style="filled"];
+ fontname=Helvetica; fontsize=8;
+ "Concrete Class Template";
+ "Abstract Class Template" [color="#a0a0a0"];
+ "Interface Template" [color="#ff8080"];
+}
+\enddot
+
+
+Objects
+
+In some cases, an examle for a concrete constellation of objects is
+shown. An object is represented by a box containing a name and the
+class, separated by a colon.
+
+\dot
+digraph G {
+ node [shape=record, fontname=Helvetica, fontsize=10];
+ edge [arrowhead="open", labelfontname=Helvetica, labelfontsize=10,
+ color="#404040", labelfontcolor="#000080"];
+ fontname=Helvetica; fontsize=10;
+
+ "x: A" -> "y1: B";
+ "x: A" -> "y2: B";
+}
+\enddot
+
+The names (\em x, \em y, and \em z) are only meant within the context
+of the diagram, there needs not to be a relation to the actual names
+in the program. They should be unique within the diagram.
+
+Classes and objects may be mixed in one diagram.
+
+
+Associations
+
+\dot
+digraph G {
+ node [shape=record, fontname=Helvetica, fontsize=10];
+ edge [arrowhead="open", labelfontname=Helvetica, labelfontsize=10,
+ color="#404040", labelfontcolor="#000080",
+ fontname=Helvetica, fontsize=10, fontcolor="#000080"];
+ fontname=Helvetica; fontsize=10;
+ A -> B [headlabel="*", taillabel="1", label="x"];
+}
+\enddot
+
+In this example, one instance of A refers to an arbitrary number of B
+instances (denoted by the "*"), and each instance of B is referred by
+exactly one ("1") A. The label \em x is the name of the association,
+in most cases the name of the field, e.g. A::x.
+
+Possible other values for the \em multiplicity:
+
+
+- a concrete number, in most cases "1",
+
- a range, e.g. "0..1",
+
- "*", denoting an arbitrary number.
+
+
+
+Implementations and Inheritance
+
+\dot
+digraph G {
+ node [shape=record, fontname=Helvetica, fontsize=10];
+ edge [arrowhead="none", arrowtail="empty", labelfontname=Helvetica,
+ labelfontsize=10, color="#404040", labelfontcolor="#000080"];
+ fontname=Helvetica; fontsize=10;
+ A[color="#ff8080"];
+ B[color="#ff8080"];
+ C;
+ D;
+ A -> B;
+ A -> C [style="dashed"];
+ C -> D;
+}
+\enddot
+
+In this example,
+
+
+- the interface B extends the interface A,
+
- the class C implements the interface A, and
+
- the class D extends the class C.
+
+
+
+Template Instantiations
+
+Template instantiations are shown as own classes/interfaces, the
+instantiation by the template is shown by a yellow dashed arrow:
+
+\dot
+digraph G {
+ node [shape=record, fontname=Helvetica, fontsize=10];
+ edge [arrowhead="none", arrowtail="empty", labelfontname=Helvetica,
+ labelfontsize=10, color="#404040", labelfontcolor="#000080"];
+ fontname=Helvetica; fontsize=10;
+
+ A[color="#ff8080"];
+ B[color="#ff8080"];
+ C[color="#ff8080", fillcolor="#ffffc0", style="filled"];
+ C_A[color="#ff8080", label="C \"];
+ C_B[color="#ff8080", label="C \"];
+ D;
+
+ C -> C_A [arrowhead="open", arrowtail="none", style="dashed",
+ color="#808000"];
+ C -> C_B [arrowhead="open", arrowtail="none", style="dashed",
+ color="#808000"];
+ A -> C_A;
+ B -> C_B;
+ C_A -> D [style="dashed"];
+}
+\enddot
+
+In this example, the interface template C uses the template argument
+as super interface.
+
+
+Packages
+
+Packages are presented by dashed rectangles:
+
+\dot
+digraph G {
+ node [shape=record, fontname=Helvetica, fontsize=10];
+ edge [arrowhead="none", arrowtail="empty", labelfontname=Helvetica,
+ labelfontsize=10, color="#404040", labelfontcolor="#000080"];
+ fontname=Helvetica; fontsize=10;
+
+ subgraph cluster_1 {
+ style="dashed"; color="#000080"; fontname=Helvetica; fontsize=10;
+ label="package 1";
+
+ A;
+ B [color="#a0a0a0"];
+ }
+
+ subgraph cluster_2 {
+ style="dashed"; color="#000080"; fontname=Helvetica; fontsize=10;
+ label="package 2";
+
+ C;
+ D [color="#a0a0a0"];
+ E
+ }
+
+ A -> C;
+ B -> D;
+ D -> E;
+ E -> A [arrowhead="open", arrowtail="none"];
+}
+\enddot
+
+Packages may be nested.
+
+*/
\ No newline at end of file
diff --git a/doc/user_help.html b/doc/user_help.html
new file mode 100644
index 0000000..ec1c73e
--- /dev/null
+++ b/doc/user_help.html
@@ -0,0 +1,327 @@
+
+
+
+
+
+ Dillo Web Browser ::
+
+ Help for New Users
+
+
+
+
+
+
+
+
+
+
+
+ Basics:
+ |
+
+
+
+ - You can tell a link from plain content by the hand-shaped cursor.
+
+
- Besides browsing the web, Dillo also has basic file browsing
+ capabilities included. So, entering
file: in your
+ Dillo URL window will give you the contents of your current
+ working directory, and file:~ entered in the
+ same place will point your Dillo browser right to your home
+ directory...
+
+ - Dillo, at this stage of development, is not ready
+ to render pages that use frames.
+ Nevertheless, it comes with a tiny handler (lynx/w3m-like) that will
+ let you choose which frame to visit, one by one.
+
+
- Dillo has context
+ sensitive menus using the right mouse button
+ (available on pages, links, images, forms, the Back
+ and Forward buttons, and the bug meter).
+
+
- Some of the functions in Dillo are handled by independent
+ processes. For instance, downloads come through
+ wget.
+ If Dillo exits, the downloads continue (more details
+ below).
+
+
+
+ |
+
+
+
+
+ Usage:
+ |
+
+
+
+ - You can scroll around your Dillo main window using
+ CTRL+{PgUp|PgDwn|Home|End} or using the mouse middle button
+ or mouse wheel. If nothing happens when keys are pressed, try
+ focusing your Dillo main
+ window first by clicking it (not on any link!:)).
+
+
- You can use the space key as PgDn, and {'b' | 'B'} as PgUp.
+
+ - Similarly, you can use "," and "." as shortcuts for
+ forward and backward buttons (mnemonic: those
+ keys are usually labeled "<" and ">").
+
+
- Configuration: If you want to change Dillo's
+ appearance or behaviour, look at the options in your
+ dillorc
+ file (if you don't have a copy in your ~/.dillo/ directory, get it
+ here).
+
+
- Clicking the "Reload" button always requests an end-to-end reload
+ of the page currently viewed, but it will *not* reload embedded
+ images during this process.
+
+
- Dialogs can be closed with the ESC key
+ (ESC also hides the findbar and control panels).
+
+ - If you want to try a different control panel, right-click over the
+ tools button and select one that suits your needs, then make
+ it the default in your
dillorc file.
+
+ - The whole window area can be used to display the page (ESC key).
+
+
+ |
+
+
+
+
+ Downloads:
+ |
+
+
+
+ Downloads are made using
+
+ wget
+ with a FLTK-based GUI wrapper, through
+ the Dillo plugin (dpi) framework.
+ If you close the browser window, downloads will continue.
+
+ |
+
+
+
+
+ Find text:
+ |
+
+
+
+ This one is very useful;
+ it can be found in the right-mouse-button menu
+ Find text is tuned for speed so don't hesitate to use it even for minimal
+ searches.
+
+ Semantics:
+
+ - You can search for substrings, words and sentences.
+ - To find a substring or word, just enter its text.
+ - To find a left-aligned substring, prepend it with a space.
+ - To find a right-aligned substring, append a space to it.
+ - To find full words only, prepend and append spaces to them.
+ - To find a sentence, enter the words and remember that
+ the above rules apply for every word in it.
+
+
+ Dillo will scroll the page and highlight found text!
+
+ Default shortcut: [CTRL]+"F".
+
+ |
+
+
+
+
+ Copy&Paste:
+ |
+
+
+
+ Just hold down the left mouse button and move to select the
+ area to copy. To paste, go to the target application and
+ press the middle mouse button.
+
+ If you want to select more than one screen, hold the mouse button
+ down and scroll with PgUp, PgDn or the arrow keys.
+
+ If you want to paste an URL into Dillo, do it on the "clear-URL"
+ button (the "X" next to the location bar).
+
+ Note: If it doesn't work, please try again. There's a bug lurking there.
+ |
+
+
+
+
+ Navigation history:
+ |
+
+
+
+ Currently, navigation history supports the navigation-stack model; just
+ right-click on the Back or Forward buttons and they will pop up!
+ Remember:
+
+ - These history menus are relative to the current page.
+ - They show the page-title but the status bar shows the URL.
+ - Left-click jumps to the selected item.
+ - Middle-click opens the item in a new browser tab/window.
+
+ |
+
+
+
+
+ Cookies:
+ |
+
+
+
+ Due to privacy concerns, cookies are disabled by default.
+ That is, if you just compile and use dillo, it will reject
+ every single cookie sent to it!
+
+ If you want to enable cookies in dillo, please read
+ Cookies.txt. It's very easy --
+ just a matter of setting up a cookiesrc file).
+ |
+
+
+
+
+ Tabs:
+ |
+
+
+
+ Dillo has tabbed browsing. Just middle click to open a link or submit a
+ form in a new tab. It will be automatically focused. If you want to
+ customize this behaviour, adjust these dillorc options:
+
+ middle_click_opens_new_tab
+ focus_new_tab
+
+ Press SHIFT to temporarily reverse the focusing behaviour.
+
+ You can close
+ a tab with middle-click on its label (the default),
+ or with right-click by setting this dillorc option:
+
+ |
+
+
+
+
+ Images-off mode:
+ |
+
+
+ You can browse without images now:
+
+ - There is an option in the Tools menu to disable automatic image loading.
+ An image's alt text (or
[IMG] placeholder) will appear in the
+ page.
+ - If you want to load an individual image, left click on its text.
+
- You can set "no images" as the default mode in dillorc.
+
+ |
+
+
+
+
+ Bookmarks:
+ |
+
+
+
+ Bookmarks are handled by the Dillo plugin
+ (dpi) framework.
+ This should be transparent to the end user. Please note that:
+
+ - It is a good idea to keep a backup of your
+
~/.dillo/bm.txt
+ - The server will stay alive after closing dillo.
+
- You can stop the server by sending it a KILL signal. Dillo
+ will automatically restart it when it is needed.
+
- If you don't have root access, install dpid and
+ the dpis
+ inside your
~/.dillo/ directory as explained
+ in the README file.
+
+ |
+
+
+
+
+ Bug Meter:
+ |
+
+
+ Dillo's Bug
+ meter shows the
+ number of detected bugs inside the
+ page. The bugs are caught at parsing time, so the
+ error messages also show the line where they occur and provide a
+ hint of what was expected instead!
+
+ The primary purpose of the bug meter is to
+ help webmasters and page
+ authors to polish the contents of their sites with a view to making
+ them standards-compliant.
+
+ The Bug meter is located at the lower right corner of
+ Dillo. Left-click to see the messages, right-click for a menu.
+ |
+
+
+
+
+ Keyboard shortcuts:
+ |
+
+
+Shortcut | Mnemonic | Function
+ |
---|
Ctrl-L | Location | enter a new URL
+ | Ctrl-F | Find | find text
+ | Ctrl-S | Search | search the web
+ | Ctrl-R | Reload | reload current page
+ | Ctrl-N | New | New browser window
+ | Ctrl-T | Tab | New tab
+ | Ctrl-W | Window | quit tab/window
+ | Ctrl-O | Open | Open file
+ | Ctrl-B | Bookmarks | view bookmarks
+ | Ctrl-Q | Quit | Quit dillo
+ | Back or "," | < | previous page
+ | Shift-Back or "." | > | next page
+ | Alt-F | File | file menu
+ | Ctrl-TabKey | TabKey | Next tab
+ | Shift-TabKey | TabKey | Previous tab
+ | Esc | escape | close dialog,
+ close findbar,
+ Hide/show control panels
+ |
+
+You can change the bindings using a
+~/.dillo/keysrc
+file.
+ |
+
+
+
+
+
+
diff --git a/dpi/Makefile.am b/dpi/Makefile.am
index b9ea098..ade1485 100644
--- a/dpi/Makefile.am
+++ b/dpi/Makefile.am
@@ -1,11 +1,12 @@
-AM_CFLAGS = @GLIB_CFLAGS@
-AM_CXXFLAGS = @GLIB_CFLAGS@
+AM_CPPFLAGS = \
+ -I$(top_srcdir)
bookmarksdir = $(libdir)/dillo/dpi/bookmarks
downloadsdir = $(libdir)/dillo/dpi/downloads
ftpdir = $(libdir)/dillo/dpi/ftp
httpsdir = $(libdir)/dillo/dpi/https
hellodir = $(libdir)/dillo/dpi/hello
+vsourcedir = $(libdir)/dillo/dpi/vsource
filedir = $(libdir)/dillo/dpi/file
cookiesdir = $(libdir)/dillo/dpi/cookies
datauridir = $(libdir)/dillo/dpi/datauri
@@ -14,34 +15,47 @@
ftp_PROGRAMS = ftp.filter.dpi
https_PROGRAMS = https.filter.dpi
hello_PROGRAMS = hello.filter.dpi
+vsource_PROGRAMS = vsource.filter.dpi
file_PROGRAMS = file.dpi
cookies_PROGRAMS = cookies.dpi
datauri_PROGRAMS = datauri.filter.dpi
-bookmarks_dpi_LDADD = @GLIB_LIBS@ ../dpip/libDpip.a
-if DLGUI
-downloads_dpi_LDADD = @GLIB_LIBS@ @LIBFLTK_LIBS@ ../dpip/libDpip.a
-else
-downloads_dpi_LDADD = @GLIB_LIBS@ ../dpip/libDpip.a
-endif
-ftp_filter_dpi_LDADD = @GLIB_LIBS@ ../dpip/libDpip.a
-https_filter_dpi_LDADD = @GLIB_LIBS@ @LIBSSL_LIBS@ ../dpip/libDpip.a
-hello_filter_dpi_LDADD = @GLIB_LIBS@ ../dpip/libDpip.a
-file_dpi_LDADD = @GLIB_LIBS@ @LIBPTHREAD_LIBS@ ../dpip/libDpip.a
-cookies_dpi_LDADD = @GLIB_LIBS@ ../dpip/libDpip.a
-datauri_filter_dpi_LDADD = @GLIB_LIBS@ ../dpip/libDpip.a
+bookmarks_dpi_LDADD = \
+ $(top_builddir)/dpip/libDpip.a \
+ $(top_builddir)/dlib/libDlib.a
+downloads_dpi_LDADD = @LIBFLTK_LIBS@ \
+ $(top_builddir)/dpip/libDpip.a \
+ $(top_builddir)/dlib/libDlib.a
+ftp_filter_dpi_LDADD = \
+ $(top_builddir)/dpip/libDpip.a \
+ $(top_builddir)/dlib/libDlib.a
+https_filter_dpi_LDADD = @LIBSSL_LIBS@ \
+ $(top_builddir)/dpip/libDpip.a \
+ $(top_builddir)/dlib/libDlib.a
+hello_filter_dpi_LDADD = \
+ $(top_builddir)/dpip/libDpip.a \
+ $(top_builddir)/dlib/libDlib.a
+vsource_filter_dpi_LDADD = \
+ $(top_builddir)/dpip/libDpip.a \
+ $(top_builddir)/dlib/libDlib.a
+file_dpi_LDADD = \
+ $(top_builddir)/dpip/libDpip.a \
+ $(top_builddir)/dlib/libDlib.a
+cookies_dpi_LDADD = \
+ $(top_builddir)/dpip/libDpip.a \
+ $(top_builddir)/dlib/libDlib.a
+datauri_filter_dpi_LDADD = \
+ $(top_builddir)/dpip/libDpip.a \
+ $(top_builddir)/dlib/libDlib.a
-file_dpi_LDFLAGS = @LIBPTHREAD_LDFLAGS@
+downloads_dpi_CXXFLAGS = @LIBFLTK_CXXFLAGS@
bookmarks_dpi_SOURCES = bookmarks.c dpiutil.c dpiutil.h
-if DLGUI
downloads_dpi_SOURCES = downloads.cc dpiutil.c dpiutil.h
-else
-downloads_dpi_SOURCES = downloads-old.c dpiutil.c dpiutil.h
-endif
ftp_filter_dpi_SOURCES = ftp.c dpiutil.c dpiutil.h
https_filter_dpi_SOURCES = https.c dpiutil.c dpiutil.h
hello_filter_dpi_SOURCES = hello.c dpiutil.c dpiutil.h
+vsource_filter_dpi_SOURCES = vsource.c dpiutil.c dpiutil.h
file_dpi_SOURCES = file.c dpiutil.c dpiutil.h
cookies_dpi_SOURCES = cookies.c dpiutil.c dpiutil.h
datauri_filter_dpi_SOURCES = datauri.c dpiutil.c dpiutil.h
diff --git a/dpi/Makefile.in b/dpi/Makefile.in
deleted file mode 100644
index 2632fe6..0000000
--- a/dpi/Makefile.in
+++ /dev/null
@@ -1,744 +0,0 @@
-# Makefile.in generated by automake 1.9.5 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005 Free Software Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-SOURCES = $(bookmarks_dpi_SOURCES) $(cookies_dpi_SOURCES) $(datauri_filter_dpi_SOURCES) $(downloads_dpi_SOURCES) $(file_dpi_SOURCES) $(ftp_filter_dpi_SOURCES) $(hello_filter_dpi_SOURCES) $(https_filter_dpi_SOURCES)
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ..
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-target_triplet = @target@
-bookmarks_PROGRAMS = bookmarks.dpi$(EXEEXT)
-downloads_PROGRAMS = downloads.dpi$(EXEEXT)
-ftp_PROGRAMS = ftp.filter.dpi$(EXEEXT)
-https_PROGRAMS = https.filter.dpi$(EXEEXT)
-hello_PROGRAMS = hello.filter.dpi$(EXEEXT)
-file_PROGRAMS = file.dpi$(EXEEXT)
-cookies_PROGRAMS = cookies.dpi$(EXEEXT)
-datauri_PROGRAMS = datauri.filter.dpi$(EXEEXT)
-subdir = dpi
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/configure.in
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-am__installdirs = "$(DESTDIR)$(bookmarksdir)" \
- "$(DESTDIR)$(cookiesdir)" "$(DESTDIR)$(datauridir)" \
- "$(DESTDIR)$(downloadsdir)" "$(DESTDIR)$(filedir)" \
- "$(DESTDIR)$(ftpdir)" "$(DESTDIR)$(hellodir)" \
- "$(DESTDIR)$(httpsdir)"
-bookmarksPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
-cookiesPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
-datauriPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
-downloadsPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
-filePROGRAMS_INSTALL = $(INSTALL_PROGRAM)
-ftpPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
-helloPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
-httpsPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
-PROGRAMS = $(bookmarks_PROGRAMS) $(cookies_PROGRAMS) \
- $(datauri_PROGRAMS) $(downloads_PROGRAMS) $(file_PROGRAMS) \
- $(ftp_PROGRAMS) $(hello_PROGRAMS) $(https_PROGRAMS)
-am_bookmarks_dpi_OBJECTS = bookmarks.$(OBJEXT) dpiutil.$(OBJEXT)
-bookmarks_dpi_OBJECTS = $(am_bookmarks_dpi_OBJECTS)
-bookmarks_dpi_DEPENDENCIES = ../dpip/libDpip.a
-am_cookies_dpi_OBJECTS = cookies.$(OBJEXT) dpiutil.$(OBJEXT)
-cookies_dpi_OBJECTS = $(am_cookies_dpi_OBJECTS)
-cookies_dpi_DEPENDENCIES = ../dpip/libDpip.a
-am_datauri_filter_dpi_OBJECTS = datauri.$(OBJEXT) dpiutil.$(OBJEXT)
-datauri_filter_dpi_OBJECTS = $(am_datauri_filter_dpi_OBJECTS)
-datauri_filter_dpi_DEPENDENCIES = ../dpip/libDpip.a
-am__downloads_dpi_SOURCES_DIST = downloads-old.c dpiutil.c dpiutil.h \
- downloads.cc
-@DLGUI_FALSE@am_downloads_dpi_OBJECTS = downloads-old.$(OBJEXT) \
-@DLGUI_FALSE@ dpiutil.$(OBJEXT)
-@DLGUI_TRUE@am_downloads_dpi_OBJECTS = downloads.$(OBJEXT) \
-@DLGUI_TRUE@ dpiutil.$(OBJEXT)
-downloads_dpi_OBJECTS = $(am_downloads_dpi_OBJECTS)
-@DLGUI_FALSE@downloads_dpi_DEPENDENCIES = ../dpip/libDpip.a
-@DLGUI_TRUE@downloads_dpi_DEPENDENCIES = ../dpip/libDpip.a
-am_file_dpi_OBJECTS = file.$(OBJEXT) dpiutil.$(OBJEXT)
-file_dpi_OBJECTS = $(am_file_dpi_OBJECTS)
-file_dpi_DEPENDENCIES = ../dpip/libDpip.a
-am_ftp_filter_dpi_OBJECTS = ftp.$(OBJEXT) dpiutil.$(OBJEXT)
-ftp_filter_dpi_OBJECTS = $(am_ftp_filter_dpi_OBJECTS)
-ftp_filter_dpi_DEPENDENCIES = ../dpip/libDpip.a
-am_hello_filter_dpi_OBJECTS = hello.$(OBJEXT) dpiutil.$(OBJEXT)
-hello_filter_dpi_OBJECTS = $(am_hello_filter_dpi_OBJECTS)
-hello_filter_dpi_DEPENDENCIES = ../dpip/libDpip.a
-am_https_filter_dpi_OBJECTS = https.$(OBJEXT) dpiutil.$(OBJEXT)
-https_filter_dpi_OBJECTS = $(am_https_filter_dpi_OBJECTS)
-https_filter_dpi_DEPENDENCIES = ../dpip/libDpip.a
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
- -o $@
-SOURCES = $(bookmarks_dpi_SOURCES) $(cookies_dpi_SOURCES) \
- $(datauri_filter_dpi_SOURCES) $(downloads_dpi_SOURCES) \
- $(file_dpi_SOURCES) $(ftp_filter_dpi_SOURCES) \
- $(hello_filter_dpi_SOURCES) $(https_filter_dpi_SOURCES)
-DIST_SOURCES = $(bookmarks_dpi_SOURCES) $(cookies_dpi_SOURCES) \
- $(datauri_filter_dpi_SOURCES) \
- $(am__downloads_dpi_SOURCES_DIST) $(file_dpi_SOURCES) \
- $(ftp_filter_dpi_SOURCES) $(hello_filter_dpi_SOURCES) \
- $(https_filter_dpi_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
-AMTAR = @AMTAR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLGUI_FALSE = @DLGUI_FALSE@
-DLGUI_TRUE = @DLGUI_TRUE@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-GLIB_CFLAGS = @GLIB_CFLAGS@
-GLIB_CONFIG = @GLIB_CONFIG@
-GLIB_LIBS = @GLIB_LIBS@
-GTK_CFLAGS = @GTK_CFLAGS@
-GTK_CONFIG = @GTK_CONFIG@
-GTK_LIBS = @GTK_LIBS@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LDFLAGS = @LDFLAGS@
-LIBFLTK_CXXFLAGS = @LIBFLTK_CXXFLAGS@
-LIBFLTK_LIBS = @LIBFLTK_LIBS@
-LIBJPEG_CPPFLAGS = @LIBJPEG_CPPFLAGS@
-LIBJPEG_LDFLAGS = @LIBJPEG_LDFLAGS@
-LIBJPEG_LIBS = @LIBJPEG_LIBS@
-LIBOBJS = @LIBOBJS@
-LIBPNG_CFLAGS = @LIBPNG_CFLAGS@
-LIBPNG_LIBS = @LIBPNG_LIBS@
-LIBPTHREAD_LDFLAGS = @LIBPTHREAD_LDFLAGS@
-LIBPTHREAD_LIBS = @LIBPTHREAD_LIBS@
-LIBS = @LIBS@
-LIBSSL_LIBS = @LIBSSL_LIBS@
-LIBZ_LIBS = @LIBZ_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-OBJEXT = @OBJEXT@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-RANLIB = @RANLIB@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-datadir = @datadir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
-AM_CFLAGS = @GLIB_CFLAGS@
-AM_CXXFLAGS = @GLIB_CFLAGS@
-bookmarksdir = $(libdir)/dillo/dpi/bookmarks
-downloadsdir = $(libdir)/dillo/dpi/downloads
-ftpdir = $(libdir)/dillo/dpi/ftp
-httpsdir = $(libdir)/dillo/dpi/https
-hellodir = $(libdir)/dillo/dpi/hello
-filedir = $(libdir)/dillo/dpi/file
-cookiesdir = $(libdir)/dillo/dpi/cookies
-datauridir = $(libdir)/dillo/dpi/datauri
-bookmarks_dpi_LDADD = @GLIB_LIBS@ ../dpip/libDpip.a
-@DLGUI_FALSE@downloads_dpi_LDADD = @GLIB_LIBS@ ../dpip/libDpip.a
-@DLGUI_TRUE@downloads_dpi_LDADD = @GLIB_LIBS@ @LIBFLTK_LIBS@ ../dpip/libDpip.a
-ftp_filter_dpi_LDADD = @GLIB_LIBS@ ../dpip/libDpip.a
-https_filter_dpi_LDADD = @GLIB_LIBS@ @LIBSSL_LIBS@ ../dpip/libDpip.a
-hello_filter_dpi_LDADD = @GLIB_LIBS@ ../dpip/libDpip.a
-file_dpi_LDADD = @GLIB_LIBS@ @LIBPTHREAD_LIBS@ ../dpip/libDpip.a
-cookies_dpi_LDADD = @GLIB_LIBS@ ../dpip/libDpip.a
-datauri_filter_dpi_LDADD = @GLIB_LIBS@ ../dpip/libDpip.a
-file_dpi_LDFLAGS = @LIBPTHREAD_LDFLAGS@
-bookmarks_dpi_SOURCES = bookmarks.c dpiutil.c dpiutil.h
-@DLGUI_FALSE@downloads_dpi_SOURCES = downloads-old.c dpiutil.c dpiutil.h
-@DLGUI_TRUE@downloads_dpi_SOURCES = downloads.cc dpiutil.c dpiutil.h
-ftp_filter_dpi_SOURCES = ftp.c dpiutil.c dpiutil.h
-https_filter_dpi_SOURCES = https.c dpiutil.c dpiutil.h
-hello_filter_dpi_SOURCES = hello.c dpiutil.c dpiutil.h
-file_dpi_SOURCES = file.c dpiutil.c dpiutil.h
-cookies_dpi_SOURCES = cookies.c dpiutil.c dpiutil.h
-datauri_filter_dpi_SOURCES = datauri.c dpiutil.c dpiutil.h
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .cc .o .obj
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
- && exit 0; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu dpi/Makefile'; \
- cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu dpi/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-install-bookmarksPROGRAMS: $(bookmarks_PROGRAMS)
- @$(NORMAL_INSTALL)
- test -z "$(bookmarksdir)" || $(mkdir_p) "$(DESTDIR)$(bookmarksdir)"
- @list='$(bookmarks_PROGRAMS)'; for p in $$list; do \
- p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- if test -f $$p \
- ; then \
- f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " $(INSTALL_PROGRAM_ENV) $(bookmarksPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bookmarksdir)/$$f'"; \
- $(INSTALL_PROGRAM_ENV) $(bookmarksPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bookmarksdir)/$$f" || exit 1; \
- else :; fi; \
- done
-
-uninstall-bookmarksPROGRAMS:
- @$(NORMAL_UNINSTALL)
- @list='$(bookmarks_PROGRAMS)'; for p in $$list; do \
- f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " rm -f '$(DESTDIR)$(bookmarksdir)/$$f'"; \
- rm -f "$(DESTDIR)$(bookmarksdir)/$$f"; \
- done
-
-clean-bookmarksPROGRAMS:
- -test -z "$(bookmarks_PROGRAMS)" || rm -f $(bookmarks_PROGRAMS)
-install-cookiesPROGRAMS: $(cookies_PROGRAMS)
- @$(NORMAL_INSTALL)
- test -z "$(cookiesdir)" || $(mkdir_p) "$(DESTDIR)$(cookiesdir)"
- @list='$(cookies_PROGRAMS)'; for p in $$list; do \
- p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- if test -f $$p \
- ; then \
- f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " $(INSTALL_PROGRAM_ENV) $(cookiesPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(cookiesdir)/$$f'"; \
- $(INSTALL_PROGRAM_ENV) $(cookiesPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(cookiesdir)/$$f" || exit 1; \
- else :; fi; \
- done
-
-uninstall-cookiesPROGRAMS:
- @$(NORMAL_UNINSTALL)
- @list='$(cookies_PROGRAMS)'; for p in $$list; do \
- f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " rm -f '$(DESTDIR)$(cookiesdir)/$$f'"; \
- rm -f "$(DESTDIR)$(cookiesdir)/$$f"; \
- done
-
-clean-cookiesPROGRAMS:
- -test -z "$(cookies_PROGRAMS)" || rm -f $(cookies_PROGRAMS)
-install-datauriPROGRAMS: $(datauri_PROGRAMS)
- @$(NORMAL_INSTALL)
- test -z "$(datauridir)" || $(mkdir_p) "$(DESTDIR)$(datauridir)"
- @list='$(datauri_PROGRAMS)'; for p in $$list; do \
- p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- if test -f $$p \
- ; then \
- f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " $(INSTALL_PROGRAM_ENV) $(datauriPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(datauridir)/$$f'"; \
- $(INSTALL_PROGRAM_ENV) $(datauriPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(datauridir)/$$f" || exit 1; \
- else :; fi; \
- done
-
-uninstall-datauriPROGRAMS:
- @$(NORMAL_UNINSTALL)
- @list='$(datauri_PROGRAMS)'; for p in $$list; do \
- f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " rm -f '$(DESTDIR)$(datauridir)/$$f'"; \
- rm -f "$(DESTDIR)$(datauridir)/$$f"; \
- done
-
-clean-datauriPROGRAMS:
- -test -z "$(datauri_PROGRAMS)" || rm -f $(datauri_PROGRAMS)
-install-downloadsPROGRAMS: $(downloads_PROGRAMS)
- @$(NORMAL_INSTALL)
- test -z "$(downloadsdir)" || $(mkdir_p) "$(DESTDIR)$(downloadsdir)"
- @list='$(downloads_PROGRAMS)'; for p in $$list; do \
- p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- if test -f $$p \
- ; then \
- f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " $(INSTALL_PROGRAM_ENV) $(downloadsPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(downloadsdir)/$$f'"; \
- $(INSTALL_PROGRAM_ENV) $(downloadsPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(downloadsdir)/$$f" || exit 1; \
- else :; fi; \
- done
-
-uninstall-downloadsPROGRAMS:
- @$(NORMAL_UNINSTALL)
- @list='$(downloads_PROGRAMS)'; for p in $$list; do \
- f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " rm -f '$(DESTDIR)$(downloadsdir)/$$f'"; \
- rm -f "$(DESTDIR)$(downloadsdir)/$$f"; \
- done
-
-clean-downloadsPROGRAMS:
- -test -z "$(downloads_PROGRAMS)" || rm -f $(downloads_PROGRAMS)
-install-filePROGRAMS: $(file_PROGRAMS)
- @$(NORMAL_INSTALL)
- test -z "$(filedir)" || $(mkdir_p) "$(DESTDIR)$(filedir)"
- @list='$(file_PROGRAMS)'; for p in $$list; do \
- p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- if test -f $$p \
- ; then \
- f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " $(INSTALL_PROGRAM_ENV) $(filePROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(filedir)/$$f'"; \
- $(INSTALL_PROGRAM_ENV) $(filePROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(filedir)/$$f" || exit 1; \
- else :; fi; \
- done
-
-uninstall-filePROGRAMS:
- @$(NORMAL_UNINSTALL)
- @list='$(file_PROGRAMS)'; for p in $$list; do \
- f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " rm -f '$(DESTDIR)$(filedir)/$$f'"; \
- rm -f "$(DESTDIR)$(filedir)/$$f"; \
- done
-
-clean-filePROGRAMS:
- -test -z "$(file_PROGRAMS)" || rm -f $(file_PROGRAMS)
-install-ftpPROGRAMS: $(ftp_PROGRAMS)
- @$(NORMAL_INSTALL)
- test -z "$(ftpdir)" || $(mkdir_p) "$(DESTDIR)$(ftpdir)"
- @list='$(ftp_PROGRAMS)'; for p in $$list; do \
- p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- if test -f $$p \
- ; then \
- f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " $(INSTALL_PROGRAM_ENV) $(ftpPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(ftpdir)/$$f'"; \
- $(INSTALL_PROGRAM_ENV) $(ftpPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(ftpdir)/$$f" || exit 1; \
- else :; fi; \
- done
-
-uninstall-ftpPROGRAMS:
- @$(NORMAL_UNINSTALL)
- @list='$(ftp_PROGRAMS)'; for p in $$list; do \
- f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " rm -f '$(DESTDIR)$(ftpdir)/$$f'"; \
- rm -f "$(DESTDIR)$(ftpdir)/$$f"; \
- done
-
-clean-ftpPROGRAMS:
- -test -z "$(ftp_PROGRAMS)" || rm -f $(ftp_PROGRAMS)
-install-helloPROGRAMS: $(hello_PROGRAMS)
- @$(NORMAL_INSTALL)
- test -z "$(hellodir)" || $(mkdir_p) "$(DESTDIR)$(hellodir)"
- @list='$(hello_PROGRAMS)'; for p in $$list; do \
- p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- if test -f $$p \
- ; then \
- f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " $(INSTALL_PROGRAM_ENV) $(helloPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(hellodir)/$$f'"; \
- $(INSTALL_PROGRAM_ENV) $(helloPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(hellodir)/$$f" || exit 1; \
- else :; fi; \
- done
-
-uninstall-helloPROGRAMS:
- @$(NORMAL_UNINSTALL)
- @list='$(hello_PROGRAMS)'; for p in $$list; do \
- f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " rm -f '$(DESTDIR)$(hellodir)/$$f'"; \
- rm -f "$(DESTDIR)$(hellodir)/$$f"; \
- done
-
-clean-helloPROGRAMS:
- -test -z "$(hello_PROGRAMS)" || rm -f $(hello_PROGRAMS)
-install-httpsPROGRAMS: $(https_PROGRAMS)
- @$(NORMAL_INSTALL)
- test -z "$(httpsdir)" || $(mkdir_p) "$(DESTDIR)$(httpsdir)"
- @list='$(https_PROGRAMS)'; for p in $$list; do \
- p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- if test -f $$p \
- ; then \
- f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " $(INSTALL_PROGRAM_ENV) $(httpsPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(httpsdir)/$$f'"; \
- $(INSTALL_PROGRAM_ENV) $(httpsPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(httpsdir)/$$f" || exit 1; \
- else :; fi; \
- done
-
-uninstall-httpsPROGRAMS:
- @$(NORMAL_UNINSTALL)
- @list='$(https_PROGRAMS)'; for p in $$list; do \
- f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " rm -f '$(DESTDIR)$(httpsdir)/$$f'"; \
- rm -f "$(DESTDIR)$(httpsdir)/$$f"; \
- done
-
-clean-httpsPROGRAMS:
- -test -z "$(https_PROGRAMS)" || rm -f $(https_PROGRAMS)
-bookmarks.dpi$(EXEEXT): $(bookmarks_dpi_OBJECTS) $(bookmarks_dpi_DEPENDENCIES)
- @rm -f bookmarks.dpi$(EXEEXT)
- $(LINK) $(bookmarks_dpi_LDFLAGS) $(bookmarks_dpi_OBJECTS) $(bookmarks_dpi_LDADD) $(LIBS)
-cookies.dpi$(EXEEXT): $(cookies_dpi_OBJECTS) $(cookies_dpi_DEPENDENCIES)
- @rm -f cookies.dpi$(EXEEXT)
- $(LINK) $(cookies_dpi_LDFLAGS) $(cookies_dpi_OBJECTS) $(cookies_dpi_LDADD) $(LIBS)
-datauri.filter.dpi$(EXEEXT): $(datauri_filter_dpi_OBJECTS) $(datauri_filter_dpi_DEPENDENCIES)
- @rm -f datauri.filter.dpi$(EXEEXT)
- $(LINK) $(datauri_filter_dpi_LDFLAGS) $(datauri_filter_dpi_OBJECTS) $(datauri_filter_dpi_LDADD) $(LIBS)
-downloads.dpi$(EXEEXT): $(downloads_dpi_OBJECTS) $(downloads_dpi_DEPENDENCIES)
- @rm -f downloads.dpi$(EXEEXT)
- $(CXXLINK) $(downloads_dpi_LDFLAGS) $(downloads_dpi_OBJECTS) $(downloads_dpi_LDADD) $(LIBS)
-file.dpi$(EXEEXT): $(file_dpi_OBJECTS) $(file_dpi_DEPENDENCIES)
- @rm -f file.dpi$(EXEEXT)
- $(LINK) $(file_dpi_LDFLAGS) $(file_dpi_OBJECTS) $(file_dpi_LDADD) $(LIBS)
-ftp.filter.dpi$(EXEEXT): $(ftp_filter_dpi_OBJECTS) $(ftp_filter_dpi_DEPENDENCIES)
- @rm -f ftp.filter.dpi$(EXEEXT)
- $(LINK) $(ftp_filter_dpi_LDFLAGS) $(ftp_filter_dpi_OBJECTS) $(ftp_filter_dpi_LDADD) $(LIBS)
-hello.filter.dpi$(EXEEXT): $(hello_filter_dpi_OBJECTS) $(hello_filter_dpi_DEPENDENCIES)
- @rm -f hello.filter.dpi$(EXEEXT)
- $(LINK) $(hello_filter_dpi_LDFLAGS) $(hello_filter_dpi_OBJECTS) $(hello_filter_dpi_LDADD) $(LIBS)
-https.filter.dpi$(EXEEXT): $(https_filter_dpi_OBJECTS) $(https_filter_dpi_DEPENDENCIES)
- @rm -f https.filter.dpi$(EXEEXT)
- $(LINK) $(https_filter_dpi_LDFLAGS) $(https_filter_dpi_OBJECTS) $(https_filter_dpi_LDADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bookmarks.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cookies.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/datauri.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/downloads-old.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/downloads.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dpiutil.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftp.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hello.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/https.Po@am__quote@
-
-.c.o:
-@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(COMPILE) -c $<
-
-.c.obj:
-@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
-
-.cc.o:
-@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
-@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
-
-.cc.obj:
-@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
-@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-uninstall-info-am:
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique; \
- fi
-ctags: CTAGS
-CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- test -z "$(CTAGS_ARGS)$$tags$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$tags $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && cd $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) $$here
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
- list='$(DISTFILES)'; for file in $$list; do \
- case $$file in \
- $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
- $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
- esac; \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test "$$dir" != "$$file" && test "$$dir" != "."; then \
- dir="/$$dir"; \
- $(mkdir_p) "$(distdir)$$dir"; \
- else \
- dir=''; \
- fi; \
- if test -d $$d/$$file; then \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
- fi; \
- cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
- else \
- test -f $(distdir)/$$file \
- || cp -p $$d/$$file $(distdir)/$$file \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-all-am: Makefile $(PROGRAMS)
-installdirs:
- for dir in "$(DESTDIR)$(bookmarksdir)" "$(DESTDIR)$(cookiesdir)" "$(DESTDIR)$(datauridir)" "$(DESTDIR)$(downloadsdir)" "$(DESTDIR)$(filedir)" "$(DESTDIR)$(ftpdir)" "$(DESTDIR)$(hellodir)" "$(DESTDIR)$(httpsdir)"; do \
- test -z "$$dir" || $(mkdir_p) "$$dir"; \
- done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-bookmarksPROGRAMS clean-cookiesPROGRAMS \
- clean-datauriPROGRAMS clean-downloadsPROGRAMS \
- clean-filePROGRAMS clean-ftpPROGRAMS clean-generic \
- clean-helloPROGRAMS clean-httpsPROGRAMS mostlyclean-am
-
-distclean: distclean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-info: info-am
-
-info-am:
-
-install-data-am: install-bookmarksPROGRAMS install-cookiesPROGRAMS \
- install-datauriPROGRAMS install-downloadsPROGRAMS \
- install-filePROGRAMS install-ftpPROGRAMS install-helloPROGRAMS \
- install-httpsPROGRAMS
-
-install-exec-am:
-
-install-info: install-info-am
-
-install-man:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-bookmarksPROGRAMS uninstall-cookiesPROGRAMS \
- uninstall-datauriPROGRAMS uninstall-downloadsPROGRAMS \
- uninstall-filePROGRAMS uninstall-ftpPROGRAMS \
- uninstall-helloPROGRAMS uninstall-httpsPROGRAMS \
- uninstall-info-am
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean \
- clean-bookmarksPROGRAMS clean-cookiesPROGRAMS \
- clean-datauriPROGRAMS clean-downloadsPROGRAMS \
- clean-filePROGRAMS clean-ftpPROGRAMS clean-generic \
- clean-helloPROGRAMS clean-httpsPROGRAMS ctags distclean \
- distclean-compile distclean-generic distclean-tags distdir dvi \
- dvi-am html html-am info info-am install install-am \
- install-bookmarksPROGRAMS install-cookiesPROGRAMS install-data \
- install-data-am install-datauriPROGRAMS \
- install-downloadsPROGRAMS install-exec install-exec-am \
- install-filePROGRAMS install-ftpPROGRAMS install-helloPROGRAMS \
- install-httpsPROGRAMS install-info install-info-am install-man \
- install-strip installcheck installcheck-am installdirs \
- maintainer-clean maintainer-clean-generic mostlyclean \
- mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
- tags uninstall uninstall-am uninstall-bookmarksPROGRAMS \
- uninstall-cookiesPROGRAMS uninstall-datauriPROGRAMS \
- uninstall-downloadsPROGRAMS uninstall-filePROGRAMS \
- uninstall-ftpPROGRAMS uninstall-helloPROGRAMS \
- uninstall-httpsPROGRAMS uninstall-info-am
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/dpi/bookmarks.c b/dpi/bookmarks.c
index c5aa2f9..6e9cb3d 100644
--- a/dpi/bookmarks.c
+++ b/dpi/bookmarks.c
@@ -3,16 +3,16 @@
*
* NOTE: this code illustrates how to make a dpi-program.
*
- * Copyright 2002-2006 Jorge Arellano Cid
+ * Copyright 2002-2007 Jorge Arellano Cid
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
*/
-/* Todo: this server is not assembling the received packets.
+/* TODO: this server is not assembling the received packets.
* This means it currently expects dillo to send full dpi tags
* within the socket; if that fails, everything stops.
* This is not hard to fix, mainly is a matter of expecting the
@@ -37,12 +37,12 @@
#include "../dpip/dpip.h"
#include "dpiutil.h"
-#include
-
-/* This one is tricky, some sources state it should include the byte
- * for the terminating NULL, and others say it shouldn't. */
-# define D_SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) \
- + strlen ((ptr)->sun_path))
+
+/*
+ * Debugging macros
+ */
+#define _MSG(...)
+#define MSG(...) printf("[bookmarks dpi]: " __VA_ARGS__)
#define DOCTYPE \
"\n"
@@ -54,17 +54,17 @@
* - ' is escaped as %27 in URLs and saved escaped.
*/
typedef struct {
- gint key;
- gint section;
- gchar *url;
- gchar *title;
+ int key;
+ int section;
+ char *url;
+ char *title;
} BmRec;
typedef struct {
- gint section;
- gchar *title;
-
- gint o_sec; /* private, for normalization */
+ int section;
+ char *title;
+
+ int o_sec; /* private, for normalization */
} BmSec;
@@ -74,11 +74,11 @@
static char *Header = "Content-type: text/html\n\n";
static char *BmFile = NULL;
static time_t BmFileTimeStamp = 0;
-static GSList *B_bms = NULL;
-static gint bm_key = 0;
-
-static GSList *B_secs = NULL;
-static gint sec_key = 0;
+static Dlist *B_bms = NULL;
+static int bm_key = 0;
+
+static Dlist *B_secs = NULL;
+static int sec_key = 0;
static int MODIFY_PAGE_NUM = 1;
@@ -90,62 +90,64 @@
/* -- HTML templates ------------------------------------------------------- */
-char *mainpage_header =
+static const char *mainpage_header =
DOCTYPE
"\n"
"\n"
"Bookmarks\n"
"\n"
-"\n"
+"\n"
"\n"
" \n"
" \n"
" \n"
-" Bookmarks:: | \n"
-" \n"
+" | Bookmarks :: | \n"
+" \n"
" [modify]\n"
" | \n"
" | \n"
" \n"
" \n";
-char *modifypage_header =
+static const char *modifypage_header =
DOCTYPE
"\n"
"\n"
"Bookmarks\n"
"\n"
-"\n"
+"\n"
"\n"
" \n"
" \n"
" \n"
-" Bookmarks :: modify | \n"
+" Bookmarks :: modify | \n"
+" \n"
+" [cancel]\n"
+" | \n"
+" \n"
" | \n"
" \n"
"\n"
-" | \n"
" \n";
-char *modifypage_middle1 =
+static const char *modifypage_middle1 =
" | \n"
" \n";
-char *mainpage_section_card_header =
+static const char *mainpage_section_card_header =
" \n"
" \n"
" \n"
@@ -196,7 +198,7 @@
" %s \n"
" | \n";
-char *modifypage_section_card_header =
+static const char *modifypage_section_card_header =
" \n"
" \n"
" \n";
-char *modifypage_section_card_footer =
+static const char *modifypage_section_card_footer =
" \n"
" \n";
-char *mainpage_footer =
+static const char *mainpage_footer =
" | \n"
" \n"
"\n"
"\n"
"\n";
-char *modifypage_footer =
+static const char *modifypage_footer =
" \n"
" \n"
"\n"
@@ -237,21 +239,28 @@
"\n";
/* ------------------------------------------------------------------------- */
-char *modifypage_add_section_page =
+static const char *modifypage_add_section_page =
DOCTYPE
"\n"
"\n"
"Bookmarks\n"
"\n"
-"\n"
+"\n"
"\n"
" \n"
" \n"
-" Modify bookmarks:: add section\n"
-" | |
\n"
+" \n"
+" \n"
+" Modify bookmarks :: add section\n"
+" | \n"
+" \n"
+" [cancel]\n"
+" | \n"
+"
\n"
+"
\n"
"\n"
"
\n"
-"