Jun 2003, Frank de Lange <frank@unternet.org>

=====================
Browser Tabs in Dillo
=====================

Dillo can display several documents in a single window through the use
of browser tabs. To use this feature, it has to be compiled in (this
is the default).

If you do not want to use this feature, you can disable it by using
the configure option --disable-tabs. This will reduce the size of the
binary by about 7500 bytes (see below), so it can not be said that the
tab feature is a space hog...

Tabs can be opened through the File->New Tab menu option, by using the
accelerator key (normally <CTRL>T) or through the tab popup menu
(right mouse button click on any tab). A document can be opened in a
new tab through the link popup menu, by holding down the control key
when clicking a link, or - if the preference 'tab_on_middle_click' is
set to 'YES' - by middle-clicking a link. By setting the
tab_load_in_background preference to YES, tabs can be loaded in the
background, leaving the current tab in focus. To close a tab, use the
File->Close Tab menu option or its associated accelerator (normally
<CTRL>W). You can switch tabs in several ways:

 - by clicking on the tab label (duh...)
 - by selecting 'Previous Tab' or 'Next Tab' from the View menu
 - by using the accelerator keys for the View menu options, normally
   defined as "<CTRL>-," (previous tab) and "<CTRL>-." (next tab)

Tab Preferences
===============

There are several preference settings related to browser tabs which
can be used to customize the behaviour of this feature. These are:

 tab_load_in_background (NO/YES; default NO)

  This defines the behaviour of the 'Open Link in new Tab' option from
  the Link Options popup menu. When this is set to 'YES', the new tab is
  opened in the background, leaving the current tab unchanged. 

 tab_on_middle_click (NO/YES; default NO)

  Setting this to 'YES' will open a document in a new tab (instead of
  a new window) on link-middle-click.

 tab_bar_show_fullscreen (NO/YES; default NO)

  This defines whether the tab bar (sometimes also called the 'gutter')
  will be visible even when the browser is in full screen mode.

 tab_bar_show_single_tab (NO/YES; default NO)

  This defines whether the tab bar will be shown when there is only a
  single tab loaded in the window. Set it to YES to always show the tab
  bar, even when there is only one tab in the browser window.

 tab_bar_scroller (NO/YES), default NO)

  This controls the behaviour of the tab bar when there are more tabs than
  will fit. If this is set to YES, a pair of scrolling arrows will be added
  and only a limited number of tabs are shown in the tab bar. To get to the
  other tabs, use the scroll arrows or the accellerator keys (default <CTRL>,
  for previous tab, <CTRL>. for next tab)

 tab_bar_homogeneous (NO/YES, default YES)

  This defines whether all tabs will be of the same width. Setting it to
  NO makes each tabs as wide as it needs to be to contain the tab
  title, setting it to YES makes all tabs of equal width.

 tab_title_compress (NO/YES, default YES)

  This defines whether the tab titles will be compressed to fit the
  available space in the tab bar. If set to NO, tab titles will be
  shortened instead. The compression algorithm is configurable
  using the following two preferences:

   compress_vowels (default: aeiouyAEIOUY)

    This defines which vowels are considered 'expendable' by the tab
    title compression algorithm. The tab title will be shortened by
    removing characters matching this pattern, starting from the end
    of the tab title. Adjust this to taste or language if needed.

   compress_common_prefixes
      (default: "index of ;re: ;fwd: ;www.;welcome to ;the ")

    semicolon-separated string of common prefixes, the compression
    algorithm begins by trying to discard anything from the title
    which matched this pattern.

Of course, these preferences are ONLY available when Dillo has been
compiled with tab support. If you use a version of Dillo which does
not have tab support and you have one or more of these preferences in
your dillorc, it will complain about 'unexpected string constants'
when it encounters these option settings.


Miscellaneous
=============

More about title compression
----------------------------

For title compression and shortening to work correctly, Dillo has to
figure out how wide the average character in the GTK theme used for
GtkLabel widgets is. There is no easy way to find this information in
GTK, so a somewhat hackish approach is followed instead. When Dillo
initiates the tab browser, it temporarily creates a text label with a
predefined, 'representative' text sample (defined in src/tab:
D_QUICK_BROWN_FOX, default "The Quick Brown Fox Jumped Over The Lazy
Dog". This approach works for indo-european languages using the
single-byte character sets, but I have not tried it with any other
character sets. So, if you use Dillo with any other character set, you
might want to change this string to something more representative for
your language group.

Dillo Binary Sizes with and without tabs
----------------------------------------

I did some comparisons of binary sizes for Dillo with the tab feature
enabled and disabled, with several compiler settings, (before) and
after applying the tab patch. These are the results:

         CFLAGS
-------------------------------------------------------------------------
tabs    | -g        -g stripped -O2     -O2 stripped -Os     -Os stripped
........|----------------------------------------------------------------
enabled | 3558892   390204      384453  316444       359821  291868
        |
disabled| 3468465   381916      374382  308188       350454  284316
        |
(before)| 3332856   377920      373773  308000       349141  283424

Versions and settings
---------------------
gcc:     3.2.2
binutils:2.13.90.0.18
