about summary refs log tree commit diff stats
path: root/dwm.h
Commit message (Expand)AuthorAgeFilesLines
* several additions in mouse handling ;)Anselm R. Garbe2006-07-161-2/+2
* changing XFlush into XSyncAnselm R. Garbe2006-07-151-0/+5
* sanitized other stuffAnselm R. Garbe2006-07-151-3/+1
* proceeded with cleaning up, sorting functions, etcAnselm R. Garbe2006-07-151-20/+19
* rearranged several stuffAnselm R. Garbe2006-07-151-14/+22
* sanitized namesAnselm R. Garbe2006-07-141-12/+12
* rearrangedAnselm R. Garbe2006-07-141-19/+12
* removed a bunch of lines through swap removalAnselm R. Garbe2006-07-141-2/+1
* searching for a better way to discard enter notifiesAnselm R. Garbe2006-07-141-6/+0
* implemented dwm reading status text from stdin Anselm R. Garbe2006-07-141-2/+2
* made barclick to select the specific tagAnselm R. Garbe2006-07-141-0/+1
* implemented bar for dwm (I miss status text), I plan that status text is read...Anselm R. Garbe2006-07-141-4/+7
* added mini stuffAnselm R. Garbe2006-07-131-3/+6
* fixed several things, nearly feature completeAnselm R. Garbe2006-07-131-1/+1
* new stuffAnselm R. Garbe2006-07-131-8/+16
* several other additions/fixes, dwm is quite usable alreadyAnselm R. Garbe2006-07-131-3/+5
* implemented tagging a clientAnselm R. Garbe2006-07-131-11/+19
* added xlock command (I need it regularly)Anselm R. Garbe2006-07-131-1/+2
* changed default colorsAnselm R. Garbe2006-07-131-0/+136
a> 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 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;
}