Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. #!/usr/bin/perl
  2.  
  3. use warnings;
  4. use strict;
  5.  
  6. # Auto-generate stub handlers for CSS properties.
  7.  
  8. 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");
  9.  
  10. print <<EOF
  11. /*
  12.  * This file is part of LibCSS.
  13.  * Licensed under the MIT License,
  14.  *                http://www.opensource.org/licenses/mit-license.php
  15.  * Copyright 2008 John-Mark Bell <jmb\@netsurf-browser.org>
  16.  */
  17.  
  18. #ifndef css_parse_css21props_c_
  19. #define css_parse_css21props_c_
  20.  
  21. EOF
  22. ;
  23.  
  24. foreach my $prop (@PROPS) {
  25. print <<EOF
  26. static css_error parse_$prop(css_css21 *c,
  27.                 const parserutils_vector *vector, int *ctx,
  28.                 css_style **result);
  29. EOF
  30. }
  31.  
  32. print <<EOF
  33.  
  34. /**
  35.  * Type of property handler function
  36.  */
  37. typedef css_error (*css_prop_handler)(css_css21 *c,
  38.                 const parserutils_vector *vector, int *ctx,
  39.                 css_style **result);
  40.  
  41. /**
  42.  * Dispatch table of property handlers, indexed by property enum
  43.  */
  44. static const css_prop_handler property_handlers[LAST_KNOWN - FIRST_PROP] =
  45. {
  46. EOF
  47. ;
  48.  
  49. foreach my $prop (@PROPS) {
  50.         print "\tparse_$prop,\n";
  51. }
  52.  
  53. print "};\n";
  54.  
  55. foreach my $prop (@PROPS) {
  56. print <<EOF
  57.  
  58. css_error parse_$prop(css_css21 *c,
  59.                 const parserutils_vector *vector, int *ctx,
  60.                 css_style **result)
  61. {
  62.         UNUSED(c);
  63.         UNUSED(vector);
  64.         UNUSED(ctx);
  65.         UNUSED(result);
  66.  
  67.         return CSS_OK;
  68. }
  69. EOF
  70. }
  71.  
  72. print "\n#endif\n";
  73.  
  74.