about summary refs log blame commit diff stats
path: root/src/DefaultStyle.c
blob: 3dc17f75b3e0e8fc717448cb07113d188b9f81f9 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline */
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
.highlight .c1 { color: #888888 } /* Comment.Single */
.highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #333333 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #666666 } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #008800 } /* Keyword.Pseudo */
.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */
.highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */
.highlight .na { color: #336699 } /* Name.Attribute */
.highlight .nb { color: #003388 } /* Name.Builtin */
.highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */
.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */
.highlight .nd { color: #555555 } /* Name.Decorator */
.highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */
.highlight .nl { color: #336699; font-style: italic } /* Name.Label */
.highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */
.highlight .py { color: #336699; font-weight: bold } /* Name.Property */
.highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #336699 } /* Name.Variable */
.highlight .ow { color: #008800 } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */
.highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */
.highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */
.highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */
.highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */
.highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */
.highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */
.highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */
.highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */
.highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */
.highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */
.highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */
.highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */
.highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */
.highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */
.highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */
.highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */
.highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */
.highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */
.highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */
.highlight .vc { color: #336699 } /* Name.Variable.Class */
.highlight .vg { color: #dd7700 } /* Name.Variable.Global */
.highlight .vi { color: #3333bb } /* Name.Variable.Instance */
.highlight .vm { color: #336699 } /* Name.Variable.Magic */
.highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
Guidelines on Code Modification
===============================

Coding Style
------------

* Use syntax compatible to both python 2.6 and 3.1.
* Use docstrings with pydoc in mind
* Follow the style guide for python code:
    http://www.python.org/dev/peps/pep-0008/
* Although this guide suggests otherwise, tabs are used for indentation
    of code and docstrings.  In other documents (readme, etc), use spaces.
* Test the code with unit tests where it makes sense


Patches
-------

Send patches, created with "git format-patch", to the email adress

    romanz@lavabit.com

If you plan to do major changes, or many changes over time, I encourage
you to create a fork on GitHub, Gitorious or any other site.


Starting Points
---------------

Good places to read about ranger internals are:
ranger/core/actions.py
ranger/core/environment.py
ranger/fsobject/fsobject.py

About the UI:
ranger/gui/widgets/browsercolumn.py
ranger/gui/widgets/browserview.py
ranger/gui/defaultui.py


Common Changes
--------------

* Change which files are previewed in the auto preview:
In ranger/gui/widget/browsercolumn.py
the constant PREVIEW_BLACKLIST

* Adding options:
In ranger/defaults/options.py
add the default value, like: my_option = True
In ranger/shared/settings.py
add the name of your option to the constant ALLOWED_SETTINGS

The setting is now accessible at self.settings.my_option,
assuming <self> is a "SettingsAware" object.

* Changing commands, adding aliases:
ranger/defaults/commands.py
or ~/.config/ranger/commands.py

* Adding colorschemes:
Copy ranger/colorschemes/default.py to ranger/colorschemes/myscheme.py
and modify it according to your needs.  Alternatively, mimic the jungle
colorscheme.  It subclasses the default scheme and just modifies a few things.
In ranger/defaults/options.py (or ~/.config/ranger/options.py), change
    colorscheme = 'default'
to: colorscheme = 'myscheme'

* Change which files are considered to be "hidden":
In ranger/defaults/options.py
change the hidden_filter regular expression.

* Change the key map:
Modify ranger/defaults/keys.py.  This should be self-explanatory.
Check out ranger/core/actions.py for the most common actions, of course
you can also use your own functions.

* Change the file type => application associations:
In ranger/defaults/apps.py
modify the method app_default.
The variable "f" is a filesystem-object with attributes like mimetype,
extension, etc.  For a full list, check ranger/fsobject/fsobject.py

* Change the file extension => mime type associations:
Modify ranger/data/mime.types


Version Numbering
-----------------

X.Y.Z, where:

* X: Major version, milestone
* Y: Minor version, even number => stable version
* Z: Revision, may be omitted if zero
313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504























































































































































































































































































































































































































































































































                                                                             
/*
 * $LynxId: DefaultStyle.c,v 1.20 2009/11/27 13:04:27 tom Exp $
 *
 *	A real style sheet for the Character Grid browser
 *
 *	The dimensions are all in characters!
 */

#include <HTUtils.h>
#include <HTFont.h>
#include <HTStyle.h>

#include <LYGlobalDefs.h>
#include <LYLeaks.h>

/*	Tab arrays:
*/
static const HTTabStop tabs_8[] =
{
    {0, 8},
    {0, 16},
    {0, 24},
    {0, 32},
    {0, 40},
    {0, 48},
    {0, 56},
    {0, 64},
    {0, 72},
    {0, 80},
    {0, 88},
    {0, 96},
    {0, 104},
    {0, 112},
    {0, 120},
    {0, 128},
    {0, 136},
    {0, 144},
    {0, 152},
    {0, 160},
    {0, 168},
    {0, 176},
    {0, 0}			/* Terminate */
};

/* Template:
 *	link to next, name, name id (enum), tag,
 *	font, size, colour, superscript, anchor id,
 *	indents: 1st, left, right, alignment	lineheight, descent,	tabs,
 *	word wrap, free format, space: before, after, flags.
 */

static HTStyle HTStyleNormal =
HTStyleInit(
	       0, Normal, "P",
	       HT_FONT, 1, HT_BLACK, 0, 0,
	       3, 3, 6, HT_LEFT, 1, 0, tabs_8,
	       YES, YES, 1, 0, 0);

static HTStyle HTStyleDivCenter =
HTStyleInit(
	       &HTStyleNormal, DivCenter, "DCENTER",
	       HT_FONT, 1, HT_BLACK, 0, 0,
	       3, 3, 6, HT_CENTER, 1, 0, tabs_8,
	       YES, YES, 1, 0, 0);

static HTStyle HTStyleDivLeft =
HTStyleInit(
	       &HTStyleDivCenter, DivLeft, "DLEFT",
	       HT_FONT, 1, HT_BLACK, 0, 0,
	       3, 3, 6, HT_LEFT, 1, 0, tabs_8,
	       YES, YES, 1, 0, 0);

static HTStyle HTStyleDivRight =
HTStyleInit(
	       &HTStyleDivLeft, DivRight, "DRIGHT",
	       HT_FONT, 1, HT_BLACK, 0, 0,
	       3, 3, 6, HT_RIGHT, 1, 0, tabs_8,
	       YES, YES, 1, 0, 0);

static HTStyle HTStyleBanner =
HTStyleInit(
	       &HTStyleDivRight, Banner, "BANNER",
	       HT_FONT, 1, HT_BLACK, 0, 0,
	       3, 3, 6, HT_LEFT, 1, 0, tabs_8,
	       YES, YES, 1, 0, 0);

static HTStyle HTStyleBlockquote =
HTStyleInit(
	       &HTStyleBanner, Blockquote, "BLOCKQUOTE",
	       HT_FONT, 1, HT_BLACK, 0, 0,
	       5, 5, 7, HT_LEFT, 1, 0, tabs_8,
	       YES, YES, 1, 0, 0);

static HTStyle HTStyleBq =
HTStyleInit(			/* HTML 3.0 BLOCKQUOTE - FM */
	       &HTStyleBlockquote, Bq, "BQ",
	       HT_FONT, 1, HT_BLACK, 0, 0,
	       5, 5, 7, HT_LEFT, 1, 0, tabs_8,
	       YES, YES, 1, 0, 0);

static HTStyle HTStyleFootnote =
HTStyleInit(			/* HTML 3.0 FN - FM */
	       &HTStyleBq, Footnote, "FN",
	       HT_FONT, 1, HT_BLACK, 0, 0,
	       5, 5, 7, HT_LEFT, 1, 0, tabs_8,
	       YES, YES, 1, 0, 0);

static HTStyle HTStyleList =
HTStyleInit(
	       &HTStyleFootnote, List, "UL",
	       HT_FONT, 1, HT_BLACK, 0, 0,
	       3, 7, 6, HT_LEFT, 1, 0, 0,
	       YES, YES, 0, 0, 0);

static HTStyle HTStyleList1 =
HTStyleInit(
	       &HTStyleList, List1, "UL",
	       HT_FONT, 1, HT_BLACK, 0, 0,
	       8, 12, 6, HT_LEFT, 1, 0, 0,
	       YES, YES, 0, 0, 0);

static HTStyle HTStyleList2 =
HTStyleInit(
	       &HTStyleList1, List2, "UL",
	       HT_FONT, 1, HT_BLACK, 0, 0,
	       13, 17, 6, HT_LEFT, 1, 0, 0,
	       YES, YES, 0, 0, 0);

static HTStyle HTStyleList3 =
HTStyleInit(
	       &HTStyleList2, List3, "UL",
	       HT_FONT, 1, HT_BLACK, 0, 0,
	       18, 22, 6, HT_LEFT, 1, 0, 0,
	       YES, YES, 0, 0, 0);

static HTStyle HTStyleList4 =
HTStyleInit(
	       &HTStyleList3, List4, "UL",
	       HT_FONT, 1, HT_BLACK, 0, 0,
	       23, 27, 6, HT_LEFT, 1, 0, 0,
	       YES, YES, 0, 0, 0);

static HTStyle HTStyleList5 =
HTStyleInit(
	       &HTStyleList4, List5, "UL",
	       HT_FONT, 1, HT_BLACK, 0, 0,
	       28, 32, 6, HT_LEFT, 1, 0, 0,
	       YES, YES, 0, 0, 0);

static HTStyle HTStyleList6 =
HTStyleInit(
	       &HTStyleList5, List6, "UL",
	       HT_FONT, 1, HT_BLACK, 0, 0,
	       33, 37, 6, HT_LEFT, 1, 0, 0,
	       YES, YES, 0, 0, 0);

static HTStyle HTStyleMenu =
HTStyleInit(
	       &HTStyleList6, Menu, "MENU",
	       HT_FONT, 1, HT_BLACK, 0, 0,
	       3, 7, 6, HT_LEFT, 1, 0, 0,
	       YES, YES, 0, 0, 0
);

static HTStyle HTStyleMenu1 =
HTStyleInit(
	       &HTStyleMenu, Menu1, "MENU",
	       HT_FONT, 1, HT_BLACK, 0, 0,
	       8, 12, 6, HT_LEFT, 1, 0, 0,
	       YES, YES, 0, 0, 0
);

static HTStyle HTStyleMenu2 =
HTStyleInit(
	       &HTStyleMenu1, Menu2, "MENU",
	       HT_FONT, 1, HT_BLACK, 0, 0,
	       13, 17, 6, HT_LEFT, 1, 0, 0,
	       YES, YES, 0, 0, 0
);

static HTStyle HTStyleMenu3 =
HTStyleInit(
	       &HTStyleMenu2, Menu3, "MENU",
	       HT_FONT, 1, HT_BLACK, 0, 0,
	       18, 22, 6, HT_LEFT, 1, 0, 0,
	       YES, YES, 0, 0, 0
);

static HTStyle HTStyleMenu4 =
HTStyleInit(
	       &HTStyleMenu3, Menu4, "MENU",
	       HT_FONT, 1, HT_BLACK, 0, 0,
	       23, 27, 6, HT_LEFT, 1, 0, 0,
	       YES, YES, 0, 0, 0
);

static HTStyle HTStyleMenu5 =
HTStyleInit(
	       &HTStyleMenu4, Menu5, "MENU",
	       HT_FONT, 1, HT_BLACK, 0, 0,
	       28, 33, 6, HT_LEFT, 1, 0, 0,
	       YES, YES, 0, 0, 0
);

static HTStyle HTStyleMenu6 =
HTStyleInit(
	       &HTStyleMenu5, Menu6, "MENU",
	       HT_FONT, 1, HT_BLACK, 0, 0,
	       33, 38, 6, HT_LEFT, 1, 0, 0,
	       YES, YES, 0, 0, 0
);

static HTStyle HTStyleGlossary =
HTStyleInit(
	       &HTStyleMenu6, Glossary, "DL",
	       HT_FONT, 1, HT_BLACK, 0, 0,
	       3, 10, 6, HT_LEFT, 1, 0, 0,
	       YES, YES, 1, 1, 0
);

static HTStyle HTStyleGlossary1 =
HTStyleInit(
	       &HTStyleGlossary, Glossary1, "DL",
	       HT_FONT, 1, HT_BLACK, 0, 0,
	       8, 16, 6, HT_LEFT, 1, 0, 0,
	       YES, YES, 1, 1, 0
);

static HTStyle HTStyleGlossary2 =
HTStyleInit(
	       &HTStyleGlossary1, Glossary2, "DL",
	       HT_FONT, 1, HT_BLACK, 0, 0,
	       14, 22, 6, HT_LEFT, 1, 0, 0,
	       YES, YES, 1, 1, 0
);

static HTStyle HTStyleGlossary3 =
HTStyleInit(
	       &HTStyleGlossary2, Glossary3, "DL",
	       HT_FONT, 1, HT_BLACK, 0, 0,
	       20, 28, 6, HT_LEFT, 1, 0, 0,
	       YES, YES, 1, 1, 0
);

static HTStyle HTStyleGlossary4 =
HTStyleInit(
	       &HTStyleGlossary3, Glossary4, "DL",
	       HT_FONT, 1, HT_BLACK, 0, 0,
	       26, 34, 6, HT_LEFT, 1, 0, 0,
	       YES, YES, 1, 1, 0
);

static HTStyle HTStyleGlossary5 =
HTStyleInit(
	       &HTStyleGlossary4, Glossary5, "DL",
	       HT_FONT, 1, HT_BLACK, 0, 0,
	       32, 40, 6, HT_LEFT, 1, 0, 0,
	       YES, YES, 1, 1, 0
);

static HTStyle HTStyleGlossary6 =
HTStyleInit(
	       &HTStyleGlossary5, Glossary6, "DL",
	       HT_FONT, 1, HT_BLACK, 0, 0,
	       38, 46, 6, HT_LEFT, 1, 0, 0,
	       YES, YES, 1, 1, 0
);

static HTStyle HTStyleGlossaryCompact =
HTStyleInit(
	       &HTStyleGlossary6, GlossaryCompact, "DLC",
	       HT_FONT, 1, HT_BLACK, 0, 0,
	       3, 10, 6, HT_LEFT, 1, 0, 0,
	       YES, YES, 0, 0, 0
);

static HTStyle HTStyleGlossaryCompact1 =
HTStyleInit(
	       &HTStyleGlossaryCompact,
	       GlossaryCompact1, "DLC",
	       HT_FONT, 1, HT_BLACK, 0, 0,
	       8, 15, 6, HT_LEFT, 1, 0, 0,
	       YES, YES, 0, 0, 0
);

static HTStyle HTStyleGlossaryCompact2 =
HTStyleInit(
	       &HTStyleGlossaryCompact1,
	       GlossaryCompact2, "DLC",
	       HT_FONT, 1, HT_BLACK, 0, 0,
	       13, 20, 6, HT_LEFT, 1, 0, 0,
	       YES, YES, 0, 0, 0
);

static HTStyle HTStyleGlossaryCompact3 =
HTStyleInit(
	       &HTStyleGlossaryCompact2,
	       GlossaryCompact3, "DLC",
	       HT_FONT, 1, HT_BLACK, 0, 0,
	       18, 25, 6, HT_LEFT, 1, 0, 0,
	       YES, YES, 0, 0, 0
);

static HTStyle HTStyleGlossaryCompact4 =
HTStyleInit(
	       &HTStyleGlossaryCompact3,
	       GlossaryCompact4, "DLC",
	       HT_FONT, 1, HT_BLACK, 0, 0,
	       23, 30, 6, HT_LEFT, 1, 0, 0,
	       YES, YES, 0, 0, 0
);

static HTStyle HTStyleGlossaryCompact5 =
HTStyleInit(
	       &HTStyleGlossaryCompact4,
	       GlossaryCompact5, "DLC",
	       HT_FONT, 1, HT_BLACK, 0, 0,
	       28, 35, 6, HT_LEFT, 1, 0, 0,
	       YES, YES, 0, 0, 0
);

static HTStyle HTStyleGlossaryCompact6 =
HTStyleInit(
	       &HTStyleGlossaryCompact5,
	       GlossaryCompact6, "DLC",
	       HT_FONT, 1, HT_BLACK, 0, 0,
	       33, 40, 6, HT_LEFT, 1, 0, 0,
	       YES, YES, 0, 0, 0
);

static HTStyle HTStyleExample =
HTStyleInit(
	       &HTStyleGlossaryCompact6,
	       Example, "XMP",
	       HT_FONT, 1, HT_BLACK, 0, 0,
	       0, 0, 0, HT_LEFT, 1, 0, tabs_8,
	       NO, NO, 0, 0, 0
);

static HTStyle HTStylePreformatted =
HTStyleInit(
	       &HTStyleExample,
	       Preformatted, "PRE",
	       HT_FONT, 1, HT_BLACK, 0, 0,
	       0, 0, 0, HT_LEFT, 1, 0, tabs_8,
	       NO, NO, 0, 0, 0
);

static HTStyle HTStyleListing =
HTStyleInit(
	       &HTStylePreformatted, Listing, "LISTING",
	       HT_FONT, 1, HT_BLACK, 0, 0,
	       0, 0, 0, HT_LEFT, 1, 0, tabs_8,
	       NO, NO, 0, 0, 0);

static HTStyle HTStyleAddress =
HTStyleInit(
	       &HTStyleListing, Address, "ADDRESS",
	       HT_FONT, 1, HT_BLACK, 0, 0,
	       4, 4, 7, HT_LEFT, 1, 0, tabs_8,
	       YES, YES, 2, 0, 0);

static HTStyle HTStyleNote =
HTStyleInit(			/* HTML 3.0 NOTE - FM */
	       &HTStyleAddress, Note, "NOTE",
	       HT_FONT, 1, HT_BLACK, 0, 0,
	       5, 5, 7, HT_LEFT, 1, 0, tabs_8,
	       YES, YES, 1, 0, 0);

static HTStyle HTStyleHeading1 =
HTStyleInit(
	       &HTStyleNote, Heading1, "H1",
	       HT_FONT + HT_BOLD, 1, HT_BLACK, 0, 0,
	       0, 0, 0, HT_CENTER, 1, 0, 0,
	       YES, YES, 1, 1, 0);

static HTStyle HTStyleHeading2 =
HTStyleInit(
	       &HTStyleHeading1, Heading2, "H2",
	       HT_FONT + HT_BOLD, 1, HT_BLACK, 0, 0,
	       0, 0, 0, HT_LEFT, 1, 0, 0,
	       YES, YES, 1, 1, 0);

static HTStyle HTStyleHeading3 =
HTStyleInit(
	       &HTStyleHeading2, Heading3, "H3",
	       HT_FONT + HT_BOLD, 1, HT_BLACK, 0, 0,
	       2, 2, 0, HT_LEFT, 1, 0, 0,
	       YES, YES, 1, 0, 0);

static HTStyle HTStyleHeading4 =
HTStyleInit(
	       &HTStyleHeading3, Heading4, "H4",
	       HT_FONT + HT_BOLD, 1, HT_BLACK, 0, 0,
	       4, 4, 0, HT_LEFT, 1, 0, 0,
	       YES, YES, 1, 0, 0);

static HTStyle HTStyleHeading5 =
HTStyleInit(
	       &HTStyleHeading4, Heading5, "H5",
	       HT_FONT + HT_BOLD, 1, HT_BLACK, 0, 0,
	       6, 6, 0, HT_LEFT, 1, 0, 0,
	       YES, YES, 1, 0, 0);

static HTStyle HTStyleHeading6 =
HTStyleInit(
	       &HTStyleHeading5, Heading6, "H6",
	       HT_FONT + HT_BOLD, 1, HT_BLACK, 0, 0,
	       8, 8, 0, HT_LEFT, 1, 0, 0,
	       YES, YES, 1, 0, 0);

static HTStyle HTStyleHeadingCenter =
HTStyleInit(
	       &HTStyleHeading6, HeadingCenter, "HCENTER",
	       HT_FONT + HT_BOLD, 1, HT_BLACK, 0, 0,
	       0, 0, 3, HT_CENTER, 1, 0, tabs_8,
	       YES, YES, 1, 0, 0);

static HTStyle HTStyleHeadingLeft =
HTStyleInit(
	       &HTStyleHeadingCenter, HeadingLeft, "HLEFT",
	       HT_FONT + HT_BOLD, 1, HT_BLACK, 0, 0,
	       0, 0, 3, HT_LEFT, 1, 0, tabs_8,
	       YES, YES, 1, 0, 0);

static HTStyle HTStyleHeadingRight =
HTStyleInit(
	       &HTStyleHeadingLeft, HeadingRight, "HRIGHT",
	       HT_FONT + HT_BOLD, 1, HT_BLACK, 0, 0,
	       0, 0, 3, HT_RIGHT, 1, 0, tabs_8,
	       YES, YES, 1, 0, 0);

/* Style sheet points to the last in the list:
*/
static HTStyleSheet sheet =
{"default.style",
 &HTStyleHeadingRight};		/* sheet */

static HTStyle *st_array[ST_HeadingRight + 1] =
{NULL};

static HTStyleSheet *result = NULL;

#ifdef LY_FIND_LEAKS
static void FreeDefaultStyle(void)
{
    HTStyle *style;

    while ((style = result->styles) != 0) {
	result->styles = style->next;
	FREE(style);
    }
    FREE(result);
}
#endif /* LY_FIND_LEAKS */

HTStyleSheet *DefaultStyle(HTStyle ***result_array)
{
    HTStyle *p, *q;

    /*
     * The first time we're called, allocate a copy of the 'sheet' linked
     * list.  Thereafter, simply copy the data from 'sheet' into our copy
     * (preserving the copy's linked-list pointers).  We do this to reset the
     * parameters of a style that might be altered while processing a page.
     */
    if (result == 0) {		/* allocate & copy */
	result = HTStyleSheetNew();
	*result = sheet;
	result->styles = 0;
#ifdef LY_FIND_LEAKS
	atexit(FreeDefaultStyle);
#endif
	for (p = sheet.styles; p != 0; p = p->next) {
	    q = HTStyleNew();
	    *q = *p;
	    if (no_margins) {
		q->indent1st = 0;
		q->leftIndent = 0;
		q->rightIndent = 0;
	    }
	    st_array[q->id] = q;
	    q->next = result->styles;
	    result->styles = q;
	}
    } else {			/* recopy the data */
	for (q = result->styles, p = sheet.styles;
	     p != 0 && q != 0;
	     p = p->next, q = q->next) {
	    HTStyle *r = q->next;

	    *q = *p;
	    if (no_margins) {
		q->indent1st = 0;
		q->leftIndent = 0;
		q->rightIndent = 0;
	    }
	    st_array[q->id] = q;
	    q->next = r;
	}
    }
    *result_array = st_array;
    return result;
}