summaryrefslogtreecommitdiff
path: root/build/mkprops.pl
blob: 5464053556ec3b9a0a92decc0dbb55acc5056fff (plain)
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/usr/bin/perl

use warnings;
use strict;

# Auto-generate stub handlers for CSS properties.

my @PROPS = split(/ /, "azimuth background_attachment background_color background_image background_position background_repeat border_bottom_color border_bottom_style border_bottom_width border_collapse border_left_color border_left_style border_left_width border_right_color border_right_style border_right_width border_spacing border_top_color border_top_style border_top_width bottom caption_side clear clip color content counter_increment counter_reset cue_after cue_before cursor direction display elevation empty_cells float font_family font_size font_style font_variant font_weight height left letter_spacing line_height list_style_image list_style_position list_style_type margin_bottom margin_left margin_right margin_top max_height max_width min_height min_width orphans outline_color outline_style outline_width overflow padding_bottom padding_left padding_right padding_top page_break_after page_break_before page_break_inside pause_after pause_before pitch_range pitch play_during position quotes richness right speak_header speak_numeral speak_punctuation speak speech_rate stress table_layout text_align text_decoration text_indent text_transform top unicode_bidi vertical_align visibility voice_family volume white_space widows width word_spacing z_index");

print <<EOF
/*
 * This file is part of LibCSS.
 * Licensed under the MIT License,
 *                http://www.opensource.org/licenses/mit-license.php
 * Copyright 2008 John-Mark Bell <jmb\@netsurf-browser.org>
 */

#ifndef css_parse_css21props_c_
#define css_parse_css21props_c_

EOF
;

foreach my $prop (@PROPS) {
print <<EOF
static css_error parse_$prop(css_css21 *c,
		const parserutils_vector *vector, int *ctx, 
		css_style **result);
EOF
}

print <<EOF

/**
 * Type of property handler function
 */
typedef css_error (*css_prop_handler)(css_css21 *c, 
		const parserutils_vector *vector, int *ctx, 
		css_style **result);

/**
 * Dispatch table of property handlers, indexed by property enum
 */
static const css_prop_handler property_handlers[LAST_KNOWN - FIRST_PROP] =
{
EOF
;

foreach my $prop (@PROPS) {
	print "\tparse_$prop,\n";
}

print "};\n";

foreach my $prop (@PROPS) {
print <<EOF

css_error parse_$prop(css_css21 *c, 
		const parserutils_vector *vector, int *ctx, 
		css_style **result)
{
	UNUSED(c);
	UNUSED(vector);
	UNUSED(ctx);
	UNUSED(result);

	return CSS_OK;
}
EOF
}

print "\n#endif\n";