├── .gitignore ├── .travis.yml ├── CHANGELOG.md ├── CMakeLists.txt ├── INSTALL.md ├── LICENSE ├── Makefile ├── Makefile.bin.cfg ├── Makefile.cfg ├── README.md ├── api_breaking_changes.md ├── debian ├── changelog ├── compat ├── control ├── copyright ├── docs ├── libmodest-dev.install ├── libmodest.install ├── rules └── source │ └── format ├── devel └── osx │ ├── Modest.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcuserdata │ │ │ └── alexanderborisov.xcuserdatad │ │ │ ├── UserInterfaceState.xcuserstate │ │ │ └── WorkspaceSettings.xcsettings │ └── xcuserdata │ │ └── alexanderborisov.xcuserdatad │ │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ │ └── xcschemes │ │ ├── Modest.xcscheme │ │ └── xcschememanagement.plist │ └── Modest │ └── main.c ├── docs ├── README_RU.md ├── _config.yml ├── img │ ├── myhtml_life_cycle_with_thread.png │ └── myhtml_life_cycle_without_threads.png ├── index.html └── stylesheets │ ├── github-light.css │ ├── normalize.css │ └── stylesheet.css ├── examples ├── Makefile ├── modest │ ├── Makefile.mk │ ├── css_property_to_node.c │ ├── css_real_and_default_property_to_node.c │ ├── selectors_find_nodes_low_level.c │ ├── selectors_prepare_low_level.c │ └── style_attr_low_level.c ├── mycss │ ├── Makefile.mk │ ├── css_low_level.c │ ├── declaration_low_level.c │ ├── detect_charset_encoding_high_level.c │ ├── example.h │ ├── incoming_buffer_high_level.c │ ├── selectors_low_level.c │ ├── stylesheet_low_level.c │ ├── token_type_convert_high_level.c │ ├── tokenizer_buffer_high_level.c │ ├── tokenizer_chunk_high_level.c │ └── tokenizer_high_level.c ├── myencoding │ ├── Makefile.mk │ ├── detect_encoding_by_trigrams.c │ ├── detect_encoding_in_meta.c │ ├── encoding_by_name.c │ └── example.h ├── myfont │ ├── Makefile.mk │ └── glyph_metrics.c ├── myhtml │ ├── Makefile.mk │ ├── attributes_high_level.c │ ├── callback_tree_node_high_level.c │ ├── chunks_high_level.c │ ├── custom_tree_high_level.c │ ├── example.h │ ├── fragment_high_level.c │ ├── get_title_high_level.c │ ├── get_title_low_level.c │ ├── html2sexpr.c │ ├── insert_in_appropriate_place_high_level.c │ ├── modify_and_serialize.c │ ├── nodes_by_attr_key_high_level.c │ ├── nodes_by_attr_value_high_level.c │ ├── parse_without_whitespace.c │ ├── print_tree_high_level.c │ ├── serialization_high_level.c │ ├── string_manipulate_high_level.c │ ├── tokenizer_colorize_high_level.c │ └── tokenizer_colorize_low_level.c └── myurl │ ├── Makefile.mk │ ├── url_data.c │ ├── url_parse.c │ └── url_relative.c ├── include ├── modest │ ├── declaration.h │ ├── finder │ │ ├── finder.h │ │ ├── match.h │ │ ├── myosi.h │ │ ├── pseudo_class.h │ │ ├── resource.h │ │ ├── thread.h │ │ └── type.h │ ├── glue.h │ ├── layer │ │ └── layer.h │ ├── modest.h │ ├── myosi.h │ ├── node │ │ ├── node.h │ │ ├── property.h │ │ ├── raw_property.h │ │ └── serialization.h │ ├── render │ │ ├── begin.h │ │ ├── binding.h │ │ ├── tree.h │ │ └── tree_node.h │ └── style │ │ ├── default.h │ │ ├── default_entries.h │ │ ├── default_resources.h │ │ ├── map.h │ │ ├── map_resource.h │ │ ├── raw.h │ │ ├── sheet.h │ │ └── type.h ├── mycore │ ├── incoming.h │ ├── myosi.h │ ├── mystring.h │ ├── mythread.h │ ├── perf.h │ ├── thread_queue.h │ ├── utils.h │ └── utils │ │ ├── avl_tree.h │ │ ├── mchar_async.h │ │ ├── mcobject.h │ │ ├── mcobject_async.h │ │ ├── mcsimple.h │ │ ├── mcsync.h │ │ ├── mctree.h │ │ ├── mhash.h │ │ └── resources.h ├── mycss │ ├── an_plus_b.h │ ├── api.h │ ├── check.h │ ├── convert.h │ ├── declaration │ │ ├── default.h │ │ ├── default_entries.h │ │ ├── default_resources.h │ │ ├── entry.h │ │ ├── entry_destroy.h │ │ ├── entry_destroy_resources.h │ │ ├── init.h │ │ ├── myosi.h │ │ ├── parser.h │ │ ├── serialization.h │ │ ├── serialization_resources.h │ │ └── state.h │ ├── entry.h │ ├── media │ │ ├── init.h │ │ ├── myosi.h │ │ └── state.h │ ├── mycss.h │ ├── myosi.h │ ├── mystring.h │ ├── namespace │ │ ├── init.h │ │ ├── myosi.h │ │ ├── parser.h │ │ ├── serialization.h │ │ └── state.h │ ├── parser.h │ ├── property │ │ ├── const.h │ │ ├── init.h │ │ ├── myosi.h │ │ ├── parser.h │ │ ├── resources.h │ │ ├── resources_name.h │ │ ├── serialization.h │ │ └── shared.h │ ├── selectors │ │ ├── function.h │ │ ├── function_parser.h │ │ ├── function_resource.h │ │ ├── init.h │ │ ├── list.h │ │ ├── myosi.h │ │ ├── myosi_resource.h │ │ ├── parser.h │ │ ├── pseudo.h │ │ ├── pseudo_resource.h │ │ ├── serialization.h │ │ ├── state.h │ │ ├── value.h │ │ └── value_resource.h │ ├── stack.h │ ├── stylesheet.h │ ├── syntax_ending.h │ ├── tokenizer.h │ ├── tokenizer_end.h │ ├── tokenizer_global.h │ ├── tokenizer_resource.h │ └── values │ │ ├── color.h │ │ ├── color_const.h │ │ ├── color_parser.h │ │ ├── color_resources.h │ │ ├── consume.h │ │ ├── destroy.h │ │ ├── image.h │ │ ├── image_resources.h │ │ ├── resources.h │ │ ├── serialization.h │ │ ├── units.h │ │ ├── units_resources.h │ │ └── values.h ├── myencoding │ ├── detect_resource.h │ ├── encoding.h │ ├── myosi.h │ ├── mystring.h │ └── resource.h ├── myfont │ ├── cmap.h │ ├── glyf.h │ ├── head.h │ ├── hhea.h │ ├── hmtx.h │ ├── loca.h │ ├── maxp.h │ ├── myfont.h │ ├── myosi.h │ ├── name.h │ ├── os_2.h │ ├── pclt.h │ ├── vhea.h │ └── vmtx.h ├── myhtml │ ├── api.h │ ├── callback.h │ ├── charef.h │ ├── charef_resource.h │ ├── data_process.h │ ├── def.h │ ├── myhtml.h │ ├── mynamespace.h │ ├── mynamespace_resource.h │ ├── myosi.h │ ├── mystring.h │ ├── parser.h │ ├── rules.h │ ├── serialization.h │ ├── stream.h │ ├── tag.h │ ├── tag_const.h │ ├── token.h │ ├── tokenizer.h │ ├── tokenizer_doctype.h │ ├── tokenizer_end.h │ ├── tokenizer_script.h │ └── tree.h ├── myunicode │ └── myosi.h └── myurl │ ├── host.h │ ├── myosi.h │ ├── parser.h │ ├── path.h │ ├── punycode.h │ ├── resources.h │ ├── scheme.h │ ├── scheme_const.h │ ├── scheme_resources.h │ ├── serialization.h │ ├── url.h │ └── utils.h ├── modest.pc.in ├── modestConfig.cmake.in ├── source ├── modest │ ├── Makefile.mk │ ├── declaration.c │ ├── declaration.h │ ├── finder │ │ ├── finder.c │ │ ├── finder.h │ │ ├── match.c │ │ ├── match.h │ │ ├── myosi.h │ │ ├── pseudo_class.c │ │ ├── pseudo_class.h │ │ ├── resource.h │ │ ├── thread.c │ │ ├── thread.h │ │ ├── type.c │ │ └── type.h │ ├── glue.c │ ├── glue.h │ ├── layer │ │ ├── layer.c │ │ └── layer.h │ ├── modest.c │ ├── modest.h │ ├── myosi.h │ ├── node │ │ ├── node.c │ │ ├── node.h │ │ ├── property.c │ │ ├── property.h │ │ ├── raw_property.c │ │ ├── raw_property.h │ │ ├── serialization.c │ │ └── serialization.h │ ├── render │ │ ├── begin.c │ │ ├── begin.h │ │ ├── binding.c │ │ ├── binding.h │ │ ├── tree.c │ │ ├── tree.h │ │ ├── tree_node.c │ │ └── tree_node.h │ └── style │ │ ├── default.c │ │ ├── default.h │ │ ├── default_entries.h │ │ ├── default_resources.h │ │ ├── map.c │ │ ├── map.h │ │ ├── map_resource.h │ │ ├── raw.c │ │ ├── raw.h │ │ ├── sheet.c │ │ ├── sheet.h │ │ ├── type.c │ │ └── type.h ├── mycore │ ├── Makefile.mk │ ├── incoming.c │ ├── incoming.h │ ├── myosi.c │ ├── myosi.h │ ├── mystring.c │ ├── mystring.h │ ├── mythread.c │ ├── mythread.h │ ├── perf.h │ ├── thread_queue.c │ ├── thread_queue.h │ ├── utils.c │ ├── utils.h │ └── utils │ │ ├── avl_tree.c │ │ ├── avl_tree.h │ │ ├── mchar_async.c │ │ ├── mchar_async.h │ │ ├── mcobject.c │ │ ├── mcobject.h │ │ ├── mcobject_async.c │ │ ├── mcobject_async.h │ │ ├── mcsimple.c │ │ ├── mcsimple.h │ │ ├── mcsync.c │ │ ├── mcsync.h │ │ ├── mctree.c │ │ ├── mctree.h │ │ ├── mhash.c │ │ ├── mhash.h │ │ └── resources.h ├── mycss │ ├── Makefile.mk │ ├── an_plus_b.c │ ├── an_plus_b.h │ ├── api.h │ ├── check.c │ ├── check.h │ ├── convert.c │ ├── convert.h │ ├── declaration │ │ ├── default.c │ │ ├── default.h │ │ ├── default_entries.h │ │ ├── default_resources.h │ │ ├── entry.c │ │ ├── entry.h │ │ ├── entry_destroy.c │ │ ├── entry_destroy.h │ │ ├── entry_destroy_resources.h │ │ ├── init.c │ │ ├── init.h │ │ ├── myosi.h │ │ ├── parser.c │ │ ├── parser.h │ │ ├── serialization.c │ │ ├── serialization.h │ │ ├── serialization_resources.h │ │ ├── state.c │ │ └── state.h │ ├── entry.c │ ├── entry.h │ ├── media │ │ ├── init.c │ │ ├── init.h │ │ ├── myosi.h │ │ ├── state.c │ │ └── state.h │ ├── mycss.c │ ├── mycss.h │ ├── myosi.h │ ├── mystring.c │ ├── mystring.h │ ├── namespace │ │ ├── init.c │ │ ├── init.h │ │ ├── myosi.h │ │ ├── parser.c │ │ ├── parser.h │ │ ├── serialization.c │ │ ├── serialization.h │ │ ├── state.c │ │ └── state.h │ ├── parser.c │ ├── parser.h │ ├── property │ │ ├── const.h │ │ ├── init.c │ │ ├── init.h │ │ ├── myosi.h │ │ ├── parser.c │ │ ├── parser.h │ │ ├── parser_background.c │ │ ├── parser_image.c │ │ ├── parser_text_decoration.c │ │ ├── parser_url.c │ │ ├── resources.h │ │ ├── resources_name.h │ │ ├── serialization.c │ │ ├── serialization.h │ │ ├── shared.c │ │ └── shared.h │ ├── selectors │ │ ├── function.c │ │ ├── function.h │ │ ├── function_parser.c │ │ ├── function_parser.h │ │ ├── function_resource.h │ │ ├── init.c │ │ ├── init.h │ │ ├── list.c │ │ ├── list.h │ │ ├── myosi.h │ │ ├── myosi_resource.h │ │ ├── parser.c │ │ ├── parser.h │ │ ├── pseudo.c │ │ ├── pseudo.h │ │ ├── pseudo_resource.h │ │ ├── serialization.c │ │ ├── serialization.h │ │ ├── state.c │ │ ├── state.h │ │ ├── value.c │ │ ├── value.h │ │ └── value_resource.h │ ├── stack.c │ ├── stack.h │ ├── stylesheet.c │ ├── stylesheet.h │ ├── syntax │ │ ├── ending.h │ │ └── syntax.h │ ├── syntax_ending.h │ ├── tokenizer.c │ ├── tokenizer.h │ ├── tokenizer_end.c │ ├── tokenizer_end.h │ ├── tokenizer_global.c │ ├── tokenizer_global.h │ ├── tokenizer_resource.h │ └── values │ │ ├── color.c │ │ ├── color.h │ │ ├── color_const.h │ │ ├── color_parser.c │ │ ├── color_parser.h │ │ ├── color_resources.h │ │ ├── consume.c │ │ ├── consume.h │ │ ├── destroy.c │ │ ├── destroy.h │ │ ├── image.c │ │ ├── image.h │ │ ├── image_resources.h │ │ ├── resources.h │ │ ├── serialization.c │ │ ├── serialization.h │ │ ├── units.c │ │ ├── units.h │ │ ├── units_resources.h │ │ ├── values.c │ │ └── values.h ├── myencoding │ ├── Makefile.mk │ ├── detect.c │ ├── detect_resource.h │ ├── encoding.c │ ├── encoding.h │ ├── myosi.h │ ├── mystring.c │ ├── mystring.h │ └── resource.h ├── myfont │ ├── Makefile.mk │ ├── cmap.c │ ├── cmap.h │ ├── glyf.c │ ├── glyf.h │ ├── head.c │ ├── head.h │ ├── hhea.c │ ├── hhea.h │ ├── hmtx.c │ ├── hmtx.h │ ├── loca.c │ ├── loca.h │ ├── maxp.c │ ├── maxp.h │ ├── myfont.c │ ├── myfont.h │ ├── myosi.c │ ├── myosi.h │ ├── name.c │ ├── name.h │ ├── os_2.c │ ├── os_2.h │ ├── pclt.c │ ├── pclt.h │ ├── vhea.c │ ├── vhea.h │ ├── vmtx.c │ └── vmtx.h ├── myhtml │ ├── Makefile.mk │ ├── api.h │ ├── callback.c │ ├── callback.h │ ├── charef.c │ ├── charef.h │ ├── charef_resource.h │ ├── data_process.c │ ├── data_process.h │ ├── def.h │ ├── myhtml.c │ ├── myhtml.h │ ├── mynamespace.c │ ├── mynamespace.h │ ├── mynamespace_resource.h │ ├── myosi.h │ ├── mystring.c │ ├── mystring.h │ ├── parser.c │ ├── parser.h │ ├── rules.c │ ├── rules.h │ ├── serialization.c │ ├── serialization.h │ ├── stream.c │ ├── stream.h │ ├── tag.c │ ├── tag.h │ ├── tag_const.h │ ├── tag_init.c │ ├── token.c │ ├── token.h │ ├── tokenizer.c │ ├── tokenizer.h │ ├── tokenizer_doctype.c │ ├── tokenizer_doctype.h │ ├── tokenizer_end.c │ ├── tokenizer_end.h │ ├── tokenizer_script.c │ ├── tokenizer_script.h │ ├── tree.c │ └── tree.h ├── myport │ ├── posix │ │ ├── Makefile.mk │ │ ├── Rules.mk │ │ └── mycore │ │ │ ├── io.c │ │ │ ├── memory.c │ │ │ ├── perf.c │ │ │ ├── thread.c │ │ │ └── utils │ │ │ └── mcsync.c │ └── windows_nt │ │ ├── Makefile.mk │ │ ├── Rules.mk │ │ └── mycore │ │ ├── io.c │ │ ├── memory.c │ │ ├── perf.c │ │ ├── thread.c │ │ └── utils │ │ └── mcsync.c ├── myunicode │ ├── Makefile.mk │ ├── myosi.c │ └── myosi.h └── myurl │ ├── Makefile.mk │ ├── host.c │ ├── host.h │ ├── myosi.c │ ├── myosi.h │ ├── parser.c │ ├── parser.h │ ├── parser_end.c │ ├── path.c │ ├── path.h │ ├── punycode.c │ ├── punycode.h │ ├── resources.h │ ├── scheme.c │ ├── scheme.h │ ├── scheme_const.h │ ├── scheme_resources.h │ ├── serialization.c │ ├── serialization.h │ ├── url.c │ ├── url.h │ ├── utils.c │ └── utils.h ├── test ├── Makefile ├── mycore │ ├── Makefile.mk │ ├── data │ │ └── encoding │ │ │ └── detect_meta.html │ ├── encoding_detect_meta.c │ └── utils │ │ └── avl_tree.c ├── mycss │ ├── Makefile.mk │ ├── data │ │ └── declaration │ │ │ ├── height.html │ │ │ └── width.html │ └── declaration.c ├── myencoding │ ├── Makefile.mk │ ├── data │ │ └── encoding │ │ │ └── detect_meta.html │ └── encoding_detect_meta.c ├── myhtml │ ├── Makefile.mk │ ├── commoncrawl.c │ └── pseudo_class_contains.c └── myurl │ ├── Makefile.mk │ ├── data │ ├── fragment.test │ ├── hostname.test │ ├── ipv4.test │ ├── ipv6.test │ ├── mailto.test │ ├── miscellaneous.test │ ├── path.test │ ├── port.test │ ├── query.test │ ├── relative.test │ ├── relative_win.test │ └── scheme.test │ └── url.c ├── third_party └── font │ ├── Arkhip.otf │ ├── Arkhip.ttf │ └── readme.txt └── utils ├── MyCSS ├── an+b.pl ├── begin.pl ├── color.pl ├── data │ ├── an+b.txt │ ├── begin.txt │ ├── color.txt │ ├── media.txt │ ├── namespace.txt │ ├── property.txt │ ├── rules.txt │ ├── selectors_grammar.txt │ ├── selectors_grammar_work.txt │ └── units.txt ├── declaration.pl ├── functions.pl ├── image.pl ├── media.pl ├── mycss_first_char.pl ├── namespace.pl ├── pseudo.pl ├── pseudo_element.pl ├── rules.pl ├── selectors.pl ├── tmpl │ ├── color_const.h │ ├── color_resources.h │ ├── declaration_default_resources.h │ ├── declaration_destroy_resources.h │ ├── declaration_serialization_resources.h │ ├── image_resources.h │ ├── property_const.h │ ├── property_resources.h │ └── property_resources_name.h └── units.pl ├── MyHTML ├── autodetect_single_byte.pl ├── encoding.pl ├── encoding_name.pl ├── entities.pl ├── forall.pl ├── namespace.pl ├── tags_init.pl ├── tags_style_default.pl ├── tmpl │ ├── default_resources.h │ ├── encoding │ │ ├── encodings.json │ │ └── indexes.json │ ├── encoding_for_detector │ │ ├── index-ibm866.txt │ │ ├── index-iso-8859-5.txt │ │ ├── index-koi8-r.txt │ │ ├── index-windows-1251.txt │ │ ├── index-x-mac-cyrillic.txt │ │ └── trigram.data │ ├── tag_const.h │ ├── tag_init.c │ ├── tags.txt │ ├── url_resources.h │ ├── url_scheme_const.h │ └── url_scheme_resources.h ├── url.pl └── url_resources.pl └── ext ├── MyCSS ├── CFunction.pm ├── Grammar.pm └── Token.pm └── MyHTML └── Base.pm /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.o 3 | *.exe 4 | *~ 5 | modest.pc 6 | uninstal.mk 7 | debian/.debhelper/ 8 | debian/debhelper-build-stamp 9 | debian/files 10 | debian/libmodest-dev.debhelper.log 11 | debian/libmodest-dev.substvars 12 | debian/libmodest-dev/ 13 | debian/libmodest.debhelper.log 14 | debian/libmodest.substvars 15 | debian/libmodest/ 16 | debian/tmp/ 17 | examples/myhtml/attributes_high_level 18 | examples/myhtml/fragment_high_level 19 | examples/myhtml/get_title_low_level 20 | examples/myhtml/insert_in_appropriate_place_high_level 21 | examples/myhtml/parse_without_whitespace 22 | examples/myhtml/string_manipulate_high_level 23 | lib/ 24 | test/mycore/utils/avl_tree 25 | test/mycss/declaration 26 | test/myencoding/encoding_detect_meta 27 | test/myhtml/commoncrawl 28 | test/myurl/url 29 | test_suite/ 30 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: c 2 | compiler: 3 | - clang 4 | - gcc 5 | install: skip 6 | script: make -j4 7 | -------------------------------------------------------------------------------- /INSTALL.md: -------------------------------------------------------------------------------- 1 | # Modest: Build and Installation 2 | 3 | ## GNU Make 4 | 5 | In root directory of project (`/`): 6 | ```bash 7 | make 8 | make test 9 | sudo make install 10 | ``` 11 | 12 | Flags that can be passed to make: 13 | - `prefix`, default /usr/local 14 | - `OS`, if not defined try to get from "uname -s" 15 | - `PROJECT_OPTIMIZATION_LEVEL`, default -O2 16 | - `MyCORE_BUILD_WITHOUT_THREADS`, YES or (NO or undefined), default undefined 17 | - `MyCORE_BUILD_DEBUG`, YES or (NO or undefined), default undefined 18 | - `MyCORE_WITH_PERF`, YES or (NO or undefined), default undefined, try build with timers (rdtsc or some), OS dependent, may not work on some systems, 19 | - `PROJECT_INSTALL_HEADER`, default "include" 20 | - `PROJECT_INSTALL_LIBRARY`, default "lib" 21 | - `PROJECT_INSTALL_WITHOUT_HEADERS`, YES or (NO or undefined), default undefined 22 | 23 | *for example*: 24 | ```bash 25 | make -j4 prefix=/usr MyCORE_BUILD_WITHOUT_THREADS=YES 26 | sudo make install 27 | ``` 28 | 29 | Makefile rules: 30 | - `all` —- build all components (libraries, examples, tests) (default) 31 | - `library` -- build only static and shared library 32 | - `shared` -- build only shared library 33 | - `static` -- build only static library 34 | - `clean` -- clean up current build directory 35 | - `clone` -- copy all headers from source to include directories and modify local include (`#include "..."`) to global (`#include <...>`) 36 | - `clean_api` -- remove all headers from include directory 37 | - `create` -- create directories for binary, libraries, tests 38 | - `test` -- run all tests 39 | - `modules` -- print modules name, description, dependencies 40 | - `install` -- install libraries and headers on your system 41 | - `uninstall` -- delete libraries and headers on your system 42 | - `make-pc-file` -- create pkg-config file 43 | 44 | *for example*: 45 | ```bash 46 | make shared 47 | ``` 48 | -------------------------------------------------------------------------------- /Makefile.bin.cfg: -------------------------------------------------------------------------------- 1 | BINARY_BUILD_OS := UNDEF 2 | 3 | # library config 4 | BINARY_PATH_RELATIVE ?= . 5 | include $(BINARY_PATH_RELATIVE)/Makefile.cfg 6 | 7 | # uses 8 | BINARY_LIBRARIES += $(BINARY_PATH_RELATIVE)/$(call MODEST_LIBRARY_STATIC) 9 | 10 | # flags 11 | BINARY_OPTIMIZATION_LEVEL ?= -O2 12 | BINARY_CFLAGS += -I$(BINARY_PATH_RELATIVE)/$(INCLUDE_DIR_API) 13 | BINARY_LDFLAGS += 14 | BINARY_BUILD_OS ?= UNDEF 15 | 16 | #******************************* 17 | # Windows_NT 18 | #******************* 19 | ifeq ($(OS),Windows_NT) 20 | BINARY_CFLAGS += -Wno-unused-variable -Wno-unused-function -std=c99 21 | 22 | BINARY_BUILD_OS := $(OS) 23 | endif 24 | # end of Windows_NT 25 | 26 | #******************************* 27 | # Darwin, Mac OS X 28 | #******************* 29 | ifeq ($(OS),Darwin) 30 | BINARY_CFLAGS += -fPIC 31 | BINARY_CFLAGS += $(BINARY_OPTIMIZATION_LEVEL) -Wno-unused-variable -Wno-unused-function -std=c99 32 | 33 | BINARY_BUILD_OS := $(OS) 34 | endif 35 | # end of Darwin, Mac OS X 36 | 37 | #******************************* 38 | # POSIX 39 | #******************* 40 | ifeq ($(BINARY_BUILD_OS),UNDEF) 41 | BINARY_CFLAGS += -fPIC 42 | BINARY_CFLAGS += -D_POSIX_C_SOURCE=199309L 43 | BINARY_CFLAGS += $(BINARY_OPTIMIZATION_LEVEL) -Wno-unused-variable -Wno-unused-function -std=c99 44 | BINARY_LIBRARIES += -lm 45 | 46 | # build without threads 47 | ifneq ($(MODEST_BUILD_WITHOUT_THREADS),YES) 48 | BINARY_LIBRARIES += -pthread 49 | endif 50 | 51 | BINARY_BUILD_OS := $(OS) 52 | endif 53 | # end of POSIX 54 | -------------------------------------------------------------------------------- /debian/changelog: -------------------------------------------------------------------------------- 1 | modest (1.0.0) stable; urgency=medium 2 | 3 | * Initial release 4 | 5 | -- Alexander Borisov Tue, 21 Mar 2017 14:46:45 +0200 6 | -------------------------------------------------------------------------------- /debian/compat: -------------------------------------------------------------------------------- 1 | 9 2 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: modest 2 | Section: libs 3 | Priority: optional 4 | Maintainer: Alexander Fedyashov 5 | Standards-Version: 3.9.5 6 | Vcs-Git: git://github.com/lexborisov/Modest.git 7 | Vcs-Browser: https://github.com/lexborisov/Modest 8 | Homepage: https://github.com/lexborisov/Modest 9 | Build-Depends: 10 | debhelper (>= 9) 11 | 12 | Package: libmodest 13 | Architecture: any 14 | Multi-Arch: same 15 | Pre-Depends: ${misc:Pre-Depends} 16 | Depends: 17 | ${misc:Depends}, 18 | ${shlibs:Depends} 19 | Description: Modest — a pure C HTML renderer 20 | Modest is a fast HTML renderer implemented as a pure C99 library with no 21 | outside dependencies. 22 | 23 | Package: libmodest-dev 24 | Section: libdevel 25 | Architecture: any 26 | Depends: 27 | libmodest (= ${binary:Version}), 28 | ${misc:Depends} 29 | Description: Modest — a pure C HTML renderer (development files) 30 | Modest is a fast HTML renderer implemented as a pure C99 library with no 31 | outside dependencies. 32 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | Format: http://dep.debian.net/deps/dep5/ 2 | Files: * 3 | Copyright: 2015-2018 Alexander Borisov 4 | License: LGPL 5 | . 6 | This is free software; you can redistribute it and/or modify it under the 7 | terms of the GNU Leser General Public License as published by the Free 8 | Software Foundation; either version 2.1, or (at your option) any later 9 | version. 10 | . 11 | This software is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | General Public License for more details. 15 | . 16 | On Debian systems, you can find the GNU Lesser General Public License 17 | version 2.1 in the file /usr/share/common-licenses/LGPL-2.1. -------------------------------------------------------------------------------- /debian/docs: -------------------------------------------------------------------------------- 1 | README.md 2 | -------------------------------------------------------------------------------- /debian/libmodest-dev.install: -------------------------------------------------------------------------------- 1 | usr/include 2 | usr/lib/libmodest.so 3 | usr/lib/libmodest_static.a 4 | usr/lib/pkgconfig 5 | -------------------------------------------------------------------------------- /debian/libmodest.install: -------------------------------------------------------------------------------- 1 | usr/lib/libmodest-*.so 2 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | 3 | # Uncomment this to turn on verbose mode. 4 | # export DH_VERBOSE=1 5 | 6 | %: 7 | dh $@ --parallel 8 | 9 | override_dh_auto_build: 10 | dh_auto_build -- prefix=/usr 11 | 12 | override_dh_auto_install: 13 | dh_auto_install -- prefix=/usr 14 | -------------------------------------------------------------------------------- /debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (native) 2 | -------------------------------------------------------------------------------- /devel/osx/Modest.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /devel/osx/Modest.xcodeproj/project.xcworkspace/xcuserdata/alexanderborisov.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lexborisov/Modest/2540a03259fc62fe15f47e85c20b2eedd5af66de/devel/osx/Modest.xcodeproj/project.xcworkspace/xcuserdata/alexanderborisov.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /devel/osx/Modest.xcodeproj/project.xcworkspace/xcuserdata/alexanderborisov.xcuserdatad/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildLocationStyle 6 | UseAppPreferences 7 | CustomBuildLocationType 8 | RelativeToDerivedData 9 | DerivedDataLocationStyle 10 | Default 11 | IssueFilterStyle 12 | ShowActiveSchemeOnly 13 | LiveSourceIssuesEnabled 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /devel/osx/Modest.xcodeproj/xcuserdata/alexanderborisov.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /devel/osx/Modest.xcodeproj/xcuserdata/alexanderborisov.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Modest.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 0E750EDE1D9AF1D500337E9B 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /docs/_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-cayman -------------------------------------------------------------------------------- /docs/img/myhtml_life_cycle_with_thread.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lexborisov/Modest/2540a03259fc62fe15f47e85c20b2eedd5af66de/docs/img/myhtml_life_cycle_with_thread.png -------------------------------------------------------------------------------- /docs/img/myhtml_life_cycle_without_threads.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lexborisov/Modest/2540a03259fc62fe15f47e85c20b2eedd5af66de/docs/img/myhtml_life_cycle_without_threads.png -------------------------------------------------------------------------------- /examples/modest/Makefile.mk: -------------------------------------------------------------------------------- 1 | modest_dirs := . 2 | modest_objs := $(call BINARY_UTILS_OBJS,modest,$(modest_dirs)) 3 | 4 | modest_all: $(modest_objs) 5 | 6 | modest_clean: 7 | rm -f $(modest_objs) 8 | -------------------------------------------------------------------------------- /examples/mycss/Makefile.mk: -------------------------------------------------------------------------------- 1 | mycss_dirs := . 2 | mycss_objs := $(call BINARY_UTILS_OBJS,mycss,$(mycss_dirs)) 3 | 4 | mycss_all: $(mycss_objs) 5 | 6 | mycss_clean: 7 | rm -f $(mycss_objs) 8 | -------------------------------------------------------------------------------- /examples/mycss/detect_charset_encoding_high_level.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | #include 26 | 27 | int main(int argc, const char * argv[]) 28 | { 29 | char *css = "@charset \"cp1251\"; #best-id {}"; 30 | 31 | myencoding_t encoding = mycss_encoding_check_charset_rule(css, strlen(css)); 32 | 33 | if(encoding == MyENCODING_WINDOWS_1251) 34 | printf("Detected Encoding: windows-1251\n"); 35 | else 36 | printf("Detected Encoding: something wrong\n"); 37 | 38 | return 0; 39 | } 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /examples/mycss/example.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: vincent.torri@gmail.com (Vincent Torri) 19 | */ 20 | 21 | #ifndef MyCSS_EXAMPLE_EXAMPLE_H 22 | #define MyCSS_EXAMPLE_EXAMPLE_H 23 | #pragma once 24 | 25 | /* Format */ 26 | #ifdef _WIN32 27 | #define MyCORE_FMT_Z "%Iu" 28 | #else 29 | #define MyCORE_FMT_Z "%zu" 30 | #endif 31 | 32 | #endif /* MyCSS_EXAMPLE_EXAMPLE_H */ 33 | -------------------------------------------------------------------------------- /examples/myencoding/Makefile.mk: -------------------------------------------------------------------------------- 1 | myencoding_dirs := . 2 | myencoding_objs := $(call BINARY_UTILS_OBJS,myencoding,$(myencoding_dirs)) 3 | 4 | myencoding_all: $(myencoding_objs) 5 | 6 | myencoding_clean: 7 | rm -f $(myencoding_objs) 8 | -------------------------------------------------------------------------------- /examples/myencoding/encoding_by_name.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | #include 26 | 27 | int main(int argc, const char * argv[]) 28 | { 29 | const char *name = "cp1251"; 30 | myencoding_t encoding; 31 | 32 | if(myencoding_by_name(name, strlen(name), &encoding)) 33 | { 34 | if(encoding == MyENCODING_WINDOWS_1251) { 35 | printf("Detected Encoding: windows-1251\n"); 36 | return 0; 37 | } 38 | } 39 | 40 | printf("Detected Encoding: something wrong\n"); 41 | 42 | return 0; 43 | } 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /examples/myencoding/example.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: vincent.torri@gmail.com (Vincent Torri) 19 | */ 20 | 21 | #ifndef MyHTML_EXAMPLE_EXAMPLE_H 22 | #define MyHTML_EXAMPLE_EXAMPLE_H 23 | #pragma once 24 | 25 | /* Format */ 26 | #ifdef _WIN32 27 | #define MyCORE_FMT_Z "%Iu" 28 | #else 29 | #define MyCORE_FMT_Z "%zu" 30 | #endif 31 | 32 | #endif /* MyHTML_EXAMPLE_EXAMPLE_H */ 33 | -------------------------------------------------------------------------------- /examples/myfont/Makefile.mk: -------------------------------------------------------------------------------- 1 | myfont_dirs := . 2 | myfont_objs := $(call BINARY_UTILS_OBJS,myfont,$(myfont_dirs)) 3 | 4 | myfont_all: $(myfont_objs) 5 | 6 | myfont_clean: 7 | rm -f $(myfont_objs) 8 | -------------------------------------------------------------------------------- /examples/myhtml/Makefile.mk: -------------------------------------------------------------------------------- 1 | myhtml_dirs := . 2 | myhtml_objs := $(call BINARY_UTILS_OBJS,myhtml,$(myhtml_dirs)) 3 | 4 | myhtml_all: $(myhtml_objs) 5 | 6 | myhtml_clean: 7 | rm -f $(myhtml_objs) 8 | -------------------------------------------------------------------------------- /examples/myhtml/example.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: vincent.torri@gmail.com (Vincent Torri) 19 | */ 20 | 21 | #ifndef MyHTML_EXAMPLE_EXAMPLE_H 22 | #define MyHTML_EXAMPLE_EXAMPLE_H 23 | #pragma once 24 | 25 | /* Format */ 26 | #ifdef _WIN32 27 | #define MyCORE_FMT_Z "%Iu" 28 | #else 29 | #define MyCORE_FMT_Z "%zu" 30 | #endif 31 | 32 | #endif /* MyHTML_EXAMPLE_EXAMPLE_H */ 33 | -------------------------------------------------------------------------------- /examples/myurl/Makefile.mk: -------------------------------------------------------------------------------- 1 | myurl_dirs := . 2 | myurl_objs := $(call BINARY_UTILS_OBJS,myurl,$(myurl_dirs)) 3 | 4 | myurl_all: $(myurl_objs) 5 | 6 | myurl_clean: 7 | rm -f $(myurl_objs) 8 | -------------------------------------------------------------------------------- /include/modest/declaration.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MODEST_DECLARATION_H 22 | #define MODEST_DECLARATION_H 23 | #pragma once 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | mycss_declaration_entry_t * modest_declaration_by_type(modest_t* modest, myhtml_tree_node_t* node, mycss_property_type_t type); 35 | 36 | #ifdef __cplusplus 37 | } /* extern "C" */ 38 | #endif 39 | 40 | #endif /* MODEST_DECLARATION_H */ 41 | -------------------------------------------------------------------------------- /include/modest/glue.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MODEST_GLUE_H 22 | #define MODEST_GLUE_H 23 | #pragma once 24 | 25 | #include 26 | #include 27 | 28 | #ifdef __cplusplus 29 | extern "C" { 30 | #endif 31 | 32 | void modest_glue_callback_myhtml_insert_node(myhtml_tree_t* tree, myhtml_tree_node_t* node, void* ctx); 33 | 34 | #ifdef __cplusplus 35 | } /* extern "C" */ 36 | #endif 37 | 38 | #endif /* MODEST_GLUE_H */ 39 | -------------------------------------------------------------------------------- /include/modest/node/property.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MODEST_NODE_PROPERTY_H 22 | #define MODEST_NODE_PROPERTY_H 23 | #pragma once 24 | 25 | #include 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | #ifdef __cplusplus 32 | } /* extern "C" */ 33 | #endif 34 | 35 | #endif /* MODEST_NODE_PROPERTY_H */ 36 | -------------------------------------------------------------------------------- /include/modest/node/raw_property.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MODEST_NODE_RAW_PROPERTY_H 22 | #define MODEST_NODE_RAW_PROPERTY_H 23 | #pragma once 24 | 25 | #include 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | #define modest_node_raw_property(mnode, property_type) (mnode->raw_style == NULL || mnode->raw_declaration[property_type] == NULL ? NULL : mnode->raw_declaration[property_type]->declaration) 32 | 33 | 34 | #ifdef __cplusplus 35 | } /* extern "C" */ 36 | #endif 37 | 38 | #endif /* MODEST_NODE_RAW_PROPERTY_H */ 39 | -------------------------------------------------------------------------------- /include/modest/node/serialization.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MODEST_NODE_SERIALIZATION_H 22 | #define MODEST_NODE_SERIALIZATION_H 23 | #pragma once 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | struct modest_node_serialization_context { 36 | modest_t* modest; 37 | mycore_callback_serialize_f callback; 38 | void* context; 39 | bool is_use; 40 | } 41 | typedef modest_node_serialization_context_t; 42 | 43 | bool modest_node_raw_serialization(modest_t* modest, modest_node_t* mnode, mycore_callback_serialize_f callback, void* context); 44 | 45 | #ifdef __cplusplus 46 | } /* extern "C" */ 47 | #endif 48 | 49 | #endif /* MODEST_NODE_SERIALIZATION_H */ 50 | -------------------------------------------------------------------------------- /include/modest/render/begin.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MODEST_RENDER_BEGIN_H 22 | #define MODEST_RENDER_BEGIN_H 23 | #pragma once 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | 34 | 35 | #ifdef __cplusplus 36 | } /* extern "C" */ 37 | #endif 38 | 39 | #endif /* MODEST_RENDER_BEGIN_H */ 40 | -------------------------------------------------------------------------------- /include/modest/render/binding.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MODEST_RENDER_BINDING_H 22 | #define MODEST_RENDER_BINDING_H 23 | #pragma once 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | #include 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | modest_render_tree_node_t * modest_render_binding(modest_t* modest, modest_render_tree_t* render_tree, myhtml_tree_t* html_tree); 39 | modest_render_tree_node_t * modest_layer_binding_node(modest_t* modest, modest_render_tree_t* render_tree, 40 | modest_render_tree_node_t* render_root, myhtml_tree_node_t* html_node); 41 | 42 | #ifdef __cplusplus 43 | } /* extern "C" */ 44 | #endif 45 | 46 | #endif /* MODEST_RENDER_BINDING_H */ 47 | -------------------------------------------------------------------------------- /include/modest/style/default_entries.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MODEST_STYLE_DEFAULT_ENTRIES_H 22 | #define MODEST_STYLE_DEFAULT_ENTRIES_H 23 | #pragma once 24 | 25 | static mycss_declaration_entry_t modest_style_default_entry_display_none = { 26 | MyCSS_PROPERTY_TYPE_DISPLAY, 27 | MyCSS_PROPERTY_DISPLAY_NONE, 28 | NULL, 29 | false, 30 | MyCSS_DECLARATION_FLAGS_READ_ONLY, 31 | NULL, NULL 32 | }; 33 | 34 | static mycss_declaration_entry_t modest_style_default_entry_display_block = { 35 | MyCSS_PROPERTY_TYPE_DISPLAY, 36 | MyCSS_PROPERTY_DISPLAY_BLOCK, 37 | NULL, 38 | false, 39 | MyCSS_DECLARATION_FLAGS_READ_ONLY, 40 | NULL, NULL 41 | }; 42 | 43 | #endif /* MODEST_STYLE_DEFAULT_ENTRIES_H */ 44 | -------------------------------------------------------------------------------- /include/modest/style/raw.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MODEST_STYLE_RAW_H 22 | #define MODEST_STYLE_RAW_H 23 | #pragma once 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | typedef struct modest_style_raw_declaration modest_style_raw_declaration_t; 34 | typedef struct modest_style_raw_specificity modest_style_raw_specificity_t; 35 | 36 | struct modest_style_raw_specificity { 37 | unsigned int x; 38 | unsigned int a; 39 | unsigned int b; 40 | unsigned int c; 41 | }; 42 | 43 | struct modest_style_raw_declaration { 44 | mycss_declaration_entry_t* declaration; 45 | modest_style_raw_specificity_t spec; 46 | }; 47 | 48 | modest_style_raw_declaration_t * modest_style_raw_declaration_create(modest_t* modest); 49 | 50 | #ifdef __cplusplus 51 | } /* extern "C" */ 52 | #endif 53 | 54 | #endif /* MODEST_STYLE_RAW_H */ 55 | -------------------------------------------------------------------------------- /include/modest/style/type.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MODEST_STYLE_TYPE_H 22 | #define MODEST_STYLE_TYPE_H 23 | #pragma once 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | typedef struct modest_style_type_length modest_style_type_length_t; 35 | typedef struct modest_style_type_display modest_style_type_display_t; 36 | 37 | struct modest_style_type_length { 38 | float value; 39 | }; 40 | 41 | struct modest_style_type_display { 42 | mycss_property_display_t value; 43 | }; 44 | 45 | 46 | void * modest_style_type_create(modest_t* modest, size_t size); 47 | mystatus_t modest_style_type_init(modest_t* modest, void *data); 48 | 49 | #ifdef __cplusplus 50 | } /* extern "C" */ 51 | #endif 52 | 53 | #endif /* MODEST_STYLE_TYPE_H */ 54 | -------------------------------------------------------------------------------- /include/mycore/perf.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2015-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyCORE_PERF_H 22 | #define MyCORE_PERF_H 23 | #pragma once 24 | 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | #include 31 | 32 | #ifdef MyCORE_WITH_PERF 33 | void * mycore_perf_create(void); 34 | void mycore_perf_clean(void* perf); 35 | void mycore_perf_destroy(void* perf); 36 | 37 | mycore_status_t myhtml_perf_begin(void* perf); 38 | mycore_status_t myhtml_perf_end(void* perf); 39 | double myhtml_perf_in_sec(void* perf); 40 | 41 | unsigned long long mycore_perf_clock(void); 42 | unsigned long long mycore_perf_frequency(void); 43 | #endif /* MyCORE_WITH_PERF */ 44 | 45 | #ifdef __cplusplus 46 | } /* extern "C" */ 47 | #endif 48 | 49 | #endif /* MyCORE_PERF_H */ 50 | -------------------------------------------------------------------------------- /include/mycss/check.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyHTML_MyCSS_CHECK_H 22 | #define MyHTML_MyCSS_CHECK_H 23 | #pragma once 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | #include 30 | #include 31 | #include 32 | 33 | bool mycss_check_three_code_points_would_start_identifier(mycss_entry_t* entry, mycss_token_t* token, const char* css, size_t css_offset, size_t css_size); 34 | bool mycss_check_two_code_points_valid_escape(mycss_entry_t* entry, mycss_token_t* token, const char* css, size_t css_offset, size_t css_size); 35 | bool mycss_check_three_code_points_would_start_number(mycss_entry_t* entry, mycss_token_t* token, const char* css, size_t css_offset, size_t css_size); 36 | 37 | #ifdef __cplusplus 38 | } /* extern "C" */ 39 | #endif 40 | 41 | #endif /* MyHTML_MyCSS_CHECK_H */ 42 | -------------------------------------------------------------------------------- /include/mycss/convert.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyHTML_MyCSS_CONVERT_H 22 | #define MyHTML_MyCSS_CONVERT_H 23 | #pragma once 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | #include 30 | #include 31 | #include 32 | 33 | const char * mycss_convert_split_dimension_string(mycore_string_t* str, double* value, bool* is_float); 34 | 35 | size_t mycss_convert_data_to_integer(const char* data, size_t size, long* return_num); 36 | size_t mycss_convert_data_to_double(const char *data, size_t size, double *return_num, bool* is_float); 37 | size_t mycss_convert_unicode_range_to_codepoint(const char *data, size_t size, size_t *start, size_t *end); 38 | size_t mycss_convert_hex_to_codepoint(const char *data, size_t size, size_t *codepoint, unsigned int max_consumed); 39 | 40 | #ifdef __cplusplus 41 | } /* extern "C" */ 42 | #endif 43 | 44 | #endif /* MyHTML_MyCSS_CONVERT_H */ 45 | -------------------------------------------------------------------------------- /include/mycss/declaration/default.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyCSS_DECLARATION_DEFAULT_H 22 | #define MyCSS_DECLARATION_DEFAULT_H 23 | #pragma once 24 | 25 | #include 26 | #include 27 | 28 | #ifdef __cplusplus 29 | extern "C" { 30 | #endif 31 | 32 | mycss_declaration_entry_t * mycss_declaration_default_by_type(mycss_property_type_t property_type); 33 | 34 | #ifdef __cplusplus 35 | } /* extern "C" */ 36 | #endif 37 | 38 | #endif /* MyCSS_DECLARATION_DEFAULT_H */ 39 | -------------------------------------------------------------------------------- /include/mycss/declaration/parser.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyHTML_MyCSS_DECLARATION_PARSER_H 22 | #define MyHTML_MyCSS_DECLARATION_PARSER_H 23 | #pragma once 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | #include 30 | #include 31 | #include 32 | 33 | void mycss_declaration_parser_begin(mycss_entry_t* entry, mycss_token_t* token); 34 | void mycss_declaration_parser_ident(mycss_entry_t* entry, mycss_token_t* token); 35 | void mycss_declaration_parser_end(mycss_entry_t* entry, mycss_token_t* token); 36 | 37 | #ifdef __cplusplus 38 | } /* extern "C" */ 39 | #endif 40 | 41 | #endif /* MyHTML_MyCSS_DECLARATION_PARSER_H */ 42 | -------------------------------------------------------------------------------- /include/mycss/media/init.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyHTML_MyCSS_MEDIA_INIT_H 22 | #define MyHTML_MyCSS_MEDIA_INIT_H 23 | #pragma once 24 | 25 | #include 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | mycss_media_t * mycss_media_create(void); 32 | mystatus_t mycss_media_init(mycss_entry_t* entry, mycss_media_t* media); 33 | mystatus_t mycss_media_clean_all(mycss_media_t* media); 34 | mycss_media_t * mycss_media_destroy(mycss_media_t* media, bool self_destroy); 35 | 36 | #ifdef __cplusplus 37 | } /* extern "C" */ 38 | #endif 39 | 40 | #endif /* MyHTML_MyCSS_MEDIA_INIT_H */ 41 | -------------------------------------------------------------------------------- /include/mycss/media/myosi.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyHTML_MyCSS_MEDIA_MYOSI_H 22 | #define MyHTML_MyCSS_MEDIA_MYOSI_H 23 | #pragma once 24 | 25 | #include 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | typedef struct mycss_media mycss_media_t; 32 | 33 | 34 | struct mycss_media { 35 | mystatus_t error; 36 | }; 37 | 38 | 39 | #ifdef __cplusplus 40 | } /* extern "C" */ 41 | #endif 42 | 43 | #endif /* MyHTML_MyCSS_MEDIA_MYOSI_H */ 44 | -------------------------------------------------------------------------------- /include/mycss/media/state.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyHTML_MyCSS_MEDIA_STATE_H 22 | #define MyHTML_MyCSS_MEDIA_STATE_H 23 | #pragma once 24 | 25 | #include 26 | #include 27 | 28 | #ifdef __cplusplus 29 | extern "C" { 30 | #endif 31 | 32 | bool mycss_media_state_begin(mycss_entry_t* entry, mycss_token_t* token, bool last_response); 33 | 34 | #ifdef __cplusplus 35 | } /* extern "C" */ 36 | #endif 37 | 38 | #endif /* MyHTML_MyCSS_MEDIA_STATE_H */ 39 | -------------------------------------------------------------------------------- /include/mycss/namespace/parser.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyHTML_MyCSS_NAMESPACE_PARSER_H 22 | #define MyHTML_MyCSS_NAMESPACE_PARSER_H 23 | #pragma once 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | #include 30 | #include 31 | #include 32 | #include 33 | 34 | void mycss_namespace_parser_begin(mycss_entry_t* entry); 35 | 36 | void mycss_namespace_parser_name(mycss_entry_t* entry, mycss_token_t* token); 37 | void mycss_namespace_parser_url(mycss_entry_t* entry, mycss_token_t* token); 38 | void mycss_namespace_parser_end(mycss_entry_t* entry, mycss_token_t* token); 39 | void mycss_namespace_parser_expectations_error(mycss_entry_t* entry, mycss_token_t* token); 40 | 41 | 42 | #ifdef __cplusplus 43 | } /* extern "C" */ 44 | #endif 45 | 46 | #endif /* MyHTML_MyCSS_NAMESPACE_PARSER_H */ 47 | -------------------------------------------------------------------------------- /include/mycss/namespace/serialization.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyHTML_MyCSS_NAMESPACE_SERIALIZATION_H 22 | #define MyHTML_MyCSS_NAMESPACE_SERIALIZATION_H 23 | #pragma once 24 | 25 | #include 26 | #include 27 | 28 | #ifdef __cplusplus 29 | extern "C" { 30 | #endif 31 | 32 | void mycss_namespace_serialization_stylesheet(mycss_namespace_stylesheet_t* ns_stylesheet, mycore_callback_serialize_f callback, void* context); 33 | void mycss_namespace_serialization_entry(mycss_namespace_t* ns, mycss_namespace_entry_t* ns_entry, mycore_callback_serialize_f callback, void* context, bool with_vbar); 34 | 35 | #ifdef __cplusplus 36 | } /* extern "C" */ 37 | #endif 38 | 39 | #endif /* MyHTML_MyCSS_NAMESPACE_SERIALIZATION_H */ 40 | -------------------------------------------------------------------------------- /include/mycss/property/init.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyHTML_MyCSS_PROPERTY_INIT_H 22 | #define MyHTML_MyCSS_PROPERTY_INIT_H 23 | #pragma once 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | const mycss_property_index_static_entry_t * mycss_property_index_entry_by_name(const char* name, size_t length); 35 | mycss_property_type_t mycss_property_type_by_name(const char *name, size_t length); 36 | 37 | const mycss_property_value_index_static_entry_t * mycss_property_value_index_entry_by_name(const char* name, size_t length); 38 | mycss_property_value_t mycss_property_value_type_by_name(const char *name, size_t length); 39 | 40 | void mycss_property_print(mycss_property_type_t prop_type, FILE* fh); 41 | void mycss_property_value_print(unsigned int value_type, void* value, FILE* fh); 42 | 43 | #ifdef __cplusplus 44 | } /* extern "C" */ 45 | #endif 46 | 47 | #endif /* MyHTML_MyCSS_PROPERTY_INIT_H */ 48 | -------------------------------------------------------------------------------- /include/mycss/property/myosi.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyHTML_MyCSS_PROPERTY_MYOSI_H 22 | #define MyHTML_MyCSS_PROPERTY_MYOSI_H 23 | #pragma once 24 | 25 | #include 26 | #include 27 | 28 | #ifdef __cplusplus 29 | extern "C" { 30 | #endif 31 | 32 | struct mycss_property_index_static_entry { 33 | const char* name; 34 | size_t name_length; 35 | 36 | mycss_property_type_t type; 37 | mycss_parser_token_f parser; 38 | 39 | size_t next; 40 | size_t curr; 41 | } 42 | typedef mycss_property_index_static_entry_t; 43 | 44 | struct mycss_property_value_index_static_entry { 45 | const char* name; 46 | size_t name_length; 47 | 48 | mycss_property_value_t type; 49 | 50 | size_t next; 51 | size_t curr; 52 | } 53 | typedef mycss_property_value_index_static_entry_t; 54 | 55 | #ifdef __cplusplus 56 | } /* extern "C" */ 57 | #endif 58 | 59 | #endif /* MyHTML_MyCSS_PROPERTY_MYOSI_H */ 60 | -------------------------------------------------------------------------------- /include/mycss/property/serialization.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyHTML_MyCSS_PROPERTY_SERIALIZATION_H 22 | #define MyHTML_MyCSS_PROPERTY_SERIALIZATION_H 23 | #pragma once 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | void mycss_property_serialization_type_name(mycss_property_type_t prop_type, mycore_callback_serialize_f callback, void* context); 34 | void mycss_property_serialization_value(unsigned int value_type, void* value, mycore_callback_serialize_f callback, void* context); 35 | 36 | #ifdef __cplusplus 37 | } /* extern "C" */ 38 | #endif 39 | 40 | #endif /* MyHTML_MyCSS_PROPERTY_SERIALIZATION_H */ 41 | -------------------------------------------------------------------------------- /include/mycss/selectors/myosi_resource.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyHTML_MyCSS_SELECTORS_MYOSI_RESOURCE_H 22 | #define MyHTML_MyCSS_SELECTORS_MYOSI_RESOURCE_H 23 | #pragma once 24 | 25 | static const char mycss_selectors_resource_matcher_names_map[][3] = { 26 | "=", "~=", "|=", "^=", "$=", "*=" 27 | }; 28 | 29 | static const char mycss_selectors_resource_combinator_names_map[][3] = { 30 | "", " ", ">", "+", "~", "||" 31 | }; 32 | 33 | #endif /* MyHTML_MyCSS_SELECTORS_MYOSI_RESOURCE_H */ 34 | -------------------------------------------------------------------------------- /include/mycss/selectors/pseudo.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyHTML_MyCSS_SELECTORS_PSEUDO_H 22 | #define MyHTML_MyCSS_SELECTORS_PSEUDO_H 23 | #pragma once 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | #include 30 | #include 31 | 32 | struct mycss_selectots_pseudo_begin_entry { 33 | const char* name; 34 | size_t length; 35 | 36 | int sub_type; 37 | 38 | size_t next; 39 | size_t curr; 40 | } 41 | typedef mycss_selectots_pseudo_begin_entry_t; 42 | 43 | 44 | mycss_selectors_sub_type_pseudo_class_t mycss_pseudo_class_by_name(const char *name, size_t length); 45 | mycss_selectors_sub_type_pseudo_element_t mycss_pseudo_element_by_name(const char *name, size_t length); 46 | const mycss_selectots_pseudo_begin_entry_t * mycss_pseudo_begin_entry_by_name(const char* name, size_t length, size_t static_size, const mycss_selectots_pseudo_begin_entry_t* pseudo); 47 | 48 | #ifdef __cplusplus 49 | } /* extern "C" */ 50 | #endif 51 | 52 | #endif /* MyHTML_MyCSS_SELECTORS_PSEUDO_H */ 53 | -------------------------------------------------------------------------------- /include/mycss/selectors/serialization.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyHTML_MyCSS_SELECTORS_SERIALIZATION_H 22 | #define MyHTML_MyCSS_SELECTORS_SERIALIZATION_H 23 | #pragma once 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | #include 30 | #include 31 | #include 32 | 33 | void mycss_selectors_serialization_chain(mycss_selectors_t* selectors, mycss_selectors_entry_t* selector, mycore_callback_serialize_f callback, void* context); 34 | bool mycss_selectors_serialization_list(mycss_selectors_t* selectors, mycss_selectors_list_t* selectors_list, mycore_callback_serialize_f callback, void* context); 35 | bool mycss_selectors_serialization_selector(mycss_selectors_t* selectors, mycss_selectors_entry_t* selector, mycore_callback_serialize_f callback, void* context); 36 | 37 | #ifdef __cplusplus 38 | } /* extern "C" */ 39 | #endif 40 | 41 | #endif /* MyHTML_MyCSS_SELECTORS_SERIALIZATION_H */ 42 | -------------------------------------------------------------------------------- /include/mycss/stack.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyCSS_STACK_H 22 | #define MyCSS_STACK_H 23 | #pragma once 24 | 25 | #include 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | struct mycss_stack_entry { 32 | void *value; 33 | mycss_parser_token_f parser; 34 | } 35 | typedef mycss_stack_entry_t; 36 | 37 | struct mycss_stack { 38 | mycss_stack_entry_t* entries; 39 | size_t entries_length; 40 | size_t entries_size; 41 | } 42 | typedef mycss_stack_t; 43 | 44 | mycss_stack_t * mycss_stack_create(void); 45 | mystatus_t mycss_stack_init(mycss_stack_t *stack, size_t size); 46 | void mycss_stack_clean(mycss_stack_t *stack); 47 | mycss_stack_t * mycss_stack_destroy(mycss_stack_t *stack, bool self_destroy); 48 | 49 | mystatus_t mycss_stack_push(mycss_stack_t *stack, void* value, mycss_parser_token_f parser); 50 | mycss_stack_entry_t * mycss_stack_pop(mycss_stack_t *stack); 51 | mycss_stack_entry_t * mycss_stack_current(mycss_stack_t *stack); 52 | 53 | #ifdef __cplusplus 54 | } /* extern "C" */ 55 | #endif 56 | 57 | #endif /* MyCSS_STACK_H */ 58 | -------------------------------------------------------------------------------- /include/mycss/syntax_ending.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyCSS_SYNTAX_ENDING_H 22 | #define MyCSS_SYNTAX_ENDING_H 23 | #pragma once 24 | 25 | #ifdef __cplusplus 26 | //extern "C" { 27 | #endif 28 | 29 | #include 30 | #include 31 | #include 32 | 33 | bool mycss_syntax_list_of_rules(mycss_entry_t* entry, mycss_token_t* token, bool last_response); 34 | 35 | #ifdef __cplusplus 36 | } /* extern "C" */ 37 | #endif 38 | 39 | #endif /* MyCSS_SYNTAX_ENDING_H */ 40 | -------------------------------------------------------------------------------- /include/mycss/values/consume.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyHTML_MyCSS_VALUES_CONSUME_H 22 | #define MyHTML_MyCSS_VALUES_CONSUME_H 23 | #pragma once 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | bool mycss_values_consume_length(mycss_entry_t* entry, mycss_token_t* token); 35 | bool mycss_values_consume_percentage(mycss_entry_t* entry, mycss_token_t* token); 36 | 37 | #ifdef __cplusplus 38 | } /* extern "C" */ 39 | #endif 40 | 41 | #endif /* MyHTML_MyCSS_VALUES_CONSUME_H */ 42 | -------------------------------------------------------------------------------- /include/mycss/values/resources.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyHTML_MyCSS_VALUES_RESOURCES_H 22 | #define MyHTML_MyCSS_VALUES_RESOURCES_H 23 | #pragma once 24 | 25 | 26 | 27 | #endif /* MyHTML_MyCSS_VALUES_RESOURCES_H */ 28 | -------------------------------------------------------------------------------- /include/myfont/hmtx.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyFONT_HMTX_H 22 | #define MyFONT_HMTX_H 23 | #pragma once 24 | 25 | #include 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | struct myfont_long_hor_metric { 32 | uint16_t advanceWidth; 33 | int16_t lsb; 34 | } 35 | typedef myfont_long_hor_metric_t; 36 | 37 | // table hhea 38 | struct myfont_table_hmtx { 39 | myfont_long_hor_metric_t *hMetrics; 40 | int16_t *leftSideBearing; 41 | } 42 | typedef myfont_table_hmtx_t; 43 | 44 | #include 45 | 46 | struct myfont_font; 47 | 48 | mystatus_t myfont_load_table_hmtx(myfont_font_t* mf, uint8_t* data, size_t data_size); 49 | 50 | #ifdef __cplusplus 51 | } /* extern "C" */ 52 | #endif 53 | 54 | #endif /* MyFONT_HMTX_H */ 55 | -------------------------------------------------------------------------------- /include/myfont/loca.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyFONT_LOCA_H 22 | #define MyFONT_LOCA_H 23 | #pragma once 24 | 25 | #include 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | // table pclt 32 | struct myfont_table_loca { 33 | uint32_t *offsets; 34 | } 35 | typedef myfont_table_loca_t; 36 | 37 | #include 38 | 39 | struct myfont_font; 40 | 41 | mystatus_t myfont_load_table_loca(myfont_font_t *mf, uint8_t* data, size_t data_size); 42 | 43 | uint32_t myfont_loca_get_offset(myfont_font_t *mf, uint16_t glyph_index); 44 | 45 | #ifdef __cplusplus 46 | } /* extern "C" */ 47 | #endif 48 | 49 | #endif /* MyFONT_LOCA_H */ 50 | -------------------------------------------------------------------------------- /include/myfont/maxp.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyFONT_MAXP_H 22 | #define MyFONT_MAXP_H 23 | #pragma once 24 | 25 | #include 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | struct myfont_table_maxp { 32 | uint32_t version; 33 | uint16_t numGlyphs; 34 | uint16_t maxPoints; 35 | uint16_t maxContours; 36 | uint16_t maxCompositePoints; 37 | uint16_t maxCompositeContours; 38 | uint16_t maxZones; 39 | uint16_t maxTwilightPoints; 40 | uint16_t maxStorage; 41 | uint16_t maxFunctionDefs; 42 | uint16_t maxInstructionDefs; 43 | uint16_t maxStackElements; 44 | uint16_t maxSizeOfInstructions; 45 | uint16_t maxComponentElements; 46 | uint16_t maxComponentDepth; 47 | } 48 | typedef myfont_table_maxp_t; 49 | 50 | #include 51 | 52 | struct myfont_font; 53 | 54 | mystatus_t myfont_load_table_maxp(myfont_font_t *mf, uint8_t* data, size_t data_size); 55 | 56 | #ifdef __cplusplus 57 | } /* extern "C" */ 58 | #endif 59 | 60 | #endif /* MyFONT_MAXP_H */ 61 | -------------------------------------------------------------------------------- /include/myfont/pclt.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyFONT_PCLT_H 22 | #define MyFONT_PCLT_H 23 | #pragma once 24 | 25 | #include 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | // table pclt 32 | struct myfont_table_pclt { 33 | int32_t version; 34 | uint32_t fontNumber; 35 | uint16_t pitch; 36 | uint16_t xHeight; 37 | uint16_t style; 38 | uint16_t typeFamily; 39 | uint16_t capHeight; 40 | uint16_t symbolSet; 41 | char typeface[16]; 42 | char characterComplement[8]; 43 | char fileName[6]; 44 | char strokeWeight; 45 | char widthType; 46 | uint8_t serifStyle; 47 | uint8_t reserved; 48 | } 49 | typedef myfont_table_pclt_t; 50 | 51 | #include 52 | 53 | struct myfont_font; 54 | 55 | mystatus_t myfont_load_table_pclt(myfont_font_t* mf, uint8_t* data, size_t data_size); 56 | 57 | #ifdef __cplusplus 58 | } /* extern "C" */ 59 | #endif 60 | 61 | #endif /* MyFONT_PCLT_H */ 62 | -------------------------------------------------------------------------------- /include/myfont/vmtx.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyFONT_VMTX_H 22 | #define MyFONT_VMTX_H 23 | #pragma once 24 | 25 | #include 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | struct myfont_long_ver_metric { 32 | uint16_t advanceHeight; 33 | int16_t topSideBearing; 34 | } 35 | typedef myfont_long_ver_metric_t; 36 | 37 | // table vmtx 38 | struct myfont_table_vmtx { 39 | myfont_long_ver_metric_t *vMetrics; 40 | int16_t *topSideBearing; 41 | } 42 | typedef myfont_table_vmtx_t; 43 | 44 | #include 45 | 46 | struct myfont_font; 47 | 48 | mystatus_t myfont_load_table_vmtx(myfont_font_t* mf, uint8_t* data, size_t data_size); 49 | 50 | #ifdef __cplusplus 51 | } /* extern "C" */ 52 | #endif 53 | 54 | #endif /* MyFONT_VMTX_H */ 55 | -------------------------------------------------------------------------------- /include/myhtml/charef.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2015-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyHTML_CHAREF_H 22 | #define MyHTML_CHAREF_H 23 | #pragma once 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | #include 30 | 31 | struct charef_entry { 32 | unsigned char ch; 33 | size_t next; 34 | size_t cur_pos; 35 | size_t codepoints[2]; 36 | size_t codepoints_len; 37 | } 38 | typedef charef_entry_t; 39 | 40 | struct charef_entry_result { 41 | const charef_entry_t *curr_entry; 42 | const charef_entry_t *last_entry; 43 | size_t last_offset; 44 | int is_done; 45 | } 46 | typedef charef_entry_result_t; 47 | 48 | const charef_entry_t * myhtml_charef_find(const char *begin, size_t *offset, size_t size, size_t *data_size); 49 | const charef_entry_t * myhtml_charef_find_by_pos(size_t pos, const char *begin, size_t *offset, size_t size, charef_entry_result_t *result); 50 | const charef_entry_t * myhtml_charef_get_first_position(const char begin); 51 | 52 | #ifdef __cplusplus 53 | } /* extern "C" */ 54 | #endif 55 | 56 | #endif /* charef_h */ 57 | -------------------------------------------------------------------------------- /include/myhtml/rules.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2015-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyHTML_RULES_H 22 | #define MyHTML_RULES_H 23 | #pragma once 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | #include 30 | #include 31 | #include 32 | 33 | mystatus_t myhtml_rules_init(myhtml_t* myhtml); 34 | void myhtml_rules_stop_parsing(myhtml_tree_t* tree); 35 | 36 | bool myhtml_rules_tree_dispatcher(myhtml_tree_t* tree, myhtml_token_node_t* token); 37 | bool myhtml_insertion_mode_in_body_other_end_tag(myhtml_tree_t* tree, myhtml_token_node_t* token); 38 | bool myhtml_insertion_mode_in_body(myhtml_tree_t* tree, myhtml_token_node_t* token); 39 | bool myhtml_insertion_mode_in_template(myhtml_tree_t* tree, myhtml_token_node_t* token); 40 | 41 | #ifdef __cplusplus 42 | } /* extern "C" */ 43 | #endif 44 | 45 | #endif /* myhtml_rules_h */ 46 | -------------------------------------------------------------------------------- /include/myunicode/myosi.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyUNICODE_MYOSI_H 22 | #define MyUNICODE_MYOSI_H 23 | #pragma once 24 | 25 | #include 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | #ifdef __cplusplus 32 | } /* extern "C" */ 33 | #endif 34 | 35 | #endif /* MyUNICODE_MYOSI_H */ 36 | -------------------------------------------------------------------------------- /include/myurl/punycode.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin avl_treet, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyURL_PUNYCODE_H 22 | #define MyURL_PUNYCODE_H 23 | #pragma once 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | enum myurl_punycode_const { 34 | MyURL_PUNYCODE_CONST_BASE = 36, 35 | MyURL_PUNYCODE_CONST_TMIN = 1, 36 | MyURL_PUNYCODE_CONST_TMAX = 26, 37 | MyURL_PUNYCODE_CONST_SKEW = 38, 38 | MyURL_PUNYCODE_CONST_DAMP = 700, 39 | MyURL_PUNYCODE_CONST_INITIAL_BIAS = 72, 40 | MyURL_PUNYCODE_CONST_INITIAL_N = 0x80, 41 | MyURL_PUNYCODE_CONST_DELIMITER = 0x2D 42 | }; 43 | 44 | #ifdef __cplusplus 45 | } /* extern "C" */ 46 | #endif 47 | 48 | #endif /* MyURL_PUNYCODE_H */ 49 | -------------------------------------------------------------------------------- /include/myurl/scheme_const.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyURL_SCHEME_CONST_H 22 | #define MyURL_SCHEME_CONST_H 23 | #pragma once 24 | 25 | enum myurl_scheme_id { 26 | MyURL_SCHEME_ID_UNDEF = 0x0000, 27 | MyURL_SCHEME_ID_ABOUT = 0x0001, 28 | MyURL_SCHEME_ID_BLOB = 0x0002, 29 | MyURL_SCHEME_ID_DATA = 0x0003, 30 | MyURL_SCHEME_ID_FILE = 0x0004, 31 | MyURL_SCHEME_ID_FILESYSTEM = 0x0005, 32 | MyURL_SCHEME_ID_FTP = 0x0006, 33 | MyURL_SCHEME_ID_GOPHER = 0x0007, 34 | MyURL_SCHEME_ID_HTTP = 0x0008, 35 | MyURL_SCHEME_ID_HTTPS = 0x0009, 36 | MyURL_SCHEME_ID_WS = 0x000a, 37 | MyURL_SCHEME_ID_WSS = 0x000b, 38 | MyURL_SCHEME_ID_LAST_ENTRY = 0x000c 39 | } 40 | typedef myurl_scheme_id_t; 41 | 42 | 43 | #endif /* MyURL_SCHEME_CONST_H */ 44 | -------------------------------------------------------------------------------- /modest.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | includedir=${prefix}/@includedir@ 4 | libdir=${prefix}/@libdir@ 5 | 6 | Name: @libname@ 7 | Description: @description@ 8 | Version: @version@ 9 | Cflags: @cflags@ 10 | Libs: -L${libdir} -l@libname@ -lm 11 | -------------------------------------------------------------------------------- /modestConfig.cmake.in: -------------------------------------------------------------------------------- 1 | @PACKAGE_INIT@ 2 | 3 | #include(CMakeFindDependencyMacro) 4 | # NOTE Had to use find_package because find_dependency does not support COMPONENTS or MODULE until 3.8.0 5 | #find_package(Boost 1.55 REQUIRED COMPONENTS regex) 6 | 7 | # prevent including it several times 8 | if(NOT @PROJECT_NAME@_FOUND) 9 | include("@PACKAGE_MODEST_INSTALL_CONFIGDIR@/@PROJECT_NAME@.cmake") 10 | check_required_components(@PROJECT_NAME@}) 11 | endif() -------------------------------------------------------------------------------- /source/modest/Makefile.mk: -------------------------------------------------------------------------------- 1 | modest_dirs := . finder style node layer render utils 2 | modest_objs := $(call MODEST_UTILS_OBJS,modest,$(modest_dirs)) 3 | 4 | modest_description := calculating, compare, renderer 5 | modest_dependencies := mycore mycss myencoding myfont myhtml myport myunicode myurl 6 | 7 | modest_all: $(modest_objs) 8 | 9 | modest_clean: 10 | rm -f $(modest_objs) 11 | 12 | modest_clone: 13 | $(call MODEST_UTILS_HDRS_CLONE,modest,$(modest_dirs)) 14 | -------------------------------------------------------------------------------- /source/modest/declaration.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #include "modest/declaration.h" 22 | 23 | mycss_declaration_entry_t * modest_declaration_by_type(modest_t* modest, myhtml_tree_node_t* node, mycss_property_type_t type) 24 | { 25 | mycss_declaration_entry_t *declr = modest_node_declaration_by_type(modest, node->data, type); 26 | 27 | if(declr) 28 | return declr; 29 | 30 | if((declr = modest_style_default_declaration_by_html_node(modest, node, type))) 31 | return declr; 32 | 33 | return mycss_declaration_default_by_type(type); 34 | } 35 | 36 | 37 | -------------------------------------------------------------------------------- /source/modest/declaration.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MODEST_DECLARATION_H 22 | #define MODEST_DECLARATION_H 23 | #pragma once 24 | 25 | #include "modest/myosi.h" 26 | #include "modest/node/node.h" 27 | #include "modest/style/default.h" 28 | #include "mycss/declaration/default.h" 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | mycss_declaration_entry_t * modest_declaration_by_type(modest_t* modest, myhtml_tree_node_t* node, mycss_property_type_t type); 35 | 36 | #ifdef __cplusplus 37 | } /* extern "C" */ 38 | #endif 39 | 40 | #endif /* MODEST_DECLARATION_H */ 41 | -------------------------------------------------------------------------------- /source/modest/glue.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #include "modest/glue.h" 22 | 23 | void modest_glue_callback_myhtml_insert_node(myhtml_tree_t* tree, myhtml_tree_node_t* node, void* ctx) 24 | { 25 | if(node->tag_id == MyHTML_TAG__TEXT) 26 | return; 27 | 28 | modest_t *modest = (modest_t*)ctx; 29 | 30 | /* create modest node */ 31 | modest_node_t *m_node = modest_node_create(modest); 32 | if(m_node == NULL) 33 | return; 34 | 35 | modest_node_init(modest, m_node); 36 | 37 | node->data = m_node; 38 | } 39 | 40 | 41 | -------------------------------------------------------------------------------- /source/modest/glue.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MODEST_GLUE_H 22 | #define MODEST_GLUE_H 23 | #pragma once 24 | 25 | #include "modest/myosi.h" 26 | #include "modest/node/node.h" 27 | 28 | #ifdef __cplusplus 29 | extern "C" { 30 | #endif 31 | 32 | void modest_glue_callback_myhtml_insert_node(myhtml_tree_t* tree, myhtml_tree_node_t* node, void* ctx); 33 | 34 | #ifdef __cplusplus 35 | } /* extern "C" */ 36 | #endif 37 | 38 | #endif /* MODEST_GLUE_H */ 39 | -------------------------------------------------------------------------------- /source/modest/layer/layer.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #include "modest/layer/layer.h" 22 | 23 | modest_layer_t * modest_layer_create(modest_layout_t* layout) 24 | { 25 | void *layer = mcobject_malloc(layout->mc_nodes, NULL); 26 | 27 | if(layer) { 28 | memset(layer, 0, sizeof(modest_layer_t)); 29 | } 30 | 31 | return layer; 32 | } 33 | 34 | void modest_layer_clean(modest_layer_t* layer) 35 | { 36 | memset(layer, 0, sizeof(modest_layer_t)); 37 | } 38 | 39 | modest_layer_t * modest_layer_destroy(modest_layout_t* layout, modest_layer_t* layer) 40 | { 41 | mcobject_free(layout->mc_nodes, layer); 42 | return NULL; 43 | } 44 | -------------------------------------------------------------------------------- /source/modest/node/property.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #include "modest/node/property.h" 22 | 23 | 24 | -------------------------------------------------------------------------------- /source/modest/node/property.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MODEST_NODE_PROPERTY_H 22 | #define MODEST_NODE_PROPERTY_H 23 | #pragma once 24 | 25 | #include "modest/node/node.h" 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | #ifdef __cplusplus 32 | } /* extern "C" */ 33 | #endif 34 | 35 | #endif /* MODEST_NODE_PROPERTY_H */ 36 | -------------------------------------------------------------------------------- /source/modest/node/raw_property.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #include "modest/node/raw_property.h" 22 | 23 | 24 | -------------------------------------------------------------------------------- /source/modest/node/raw_property.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MODEST_NODE_RAW_PROPERTY_H 22 | #define MODEST_NODE_RAW_PROPERTY_H 23 | #pragma once 24 | 25 | #include "modest/node/node.h" 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | #define modest_node_raw_property(mnode, property_type) (mnode->raw_style == NULL || mnode->raw_declaration[property_type] == NULL ? NULL : mnode->raw_declaration[property_type]->declaration) 32 | 33 | 34 | #ifdef __cplusplus 35 | } /* extern "C" */ 36 | #endif 37 | 38 | #endif /* MODEST_NODE_RAW_PROPERTY_H */ 39 | -------------------------------------------------------------------------------- /source/modest/node/serialization.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MODEST_NODE_SERIALIZATION_H 22 | #define MODEST_NODE_SERIALIZATION_H 23 | #pragma once 24 | 25 | #include "modest/myosi.h" 26 | #include "modest/node/node.h" 27 | #include "modest/node/raw_property.h" 28 | #include "mycss/myosi.h" 29 | #include "mycss/declaration/serialization.h" 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | struct modest_node_serialization_context { 36 | modest_t* modest; 37 | mycore_callback_serialize_f callback; 38 | void* context; 39 | bool is_use; 40 | } 41 | typedef modest_node_serialization_context_t; 42 | 43 | bool modest_node_raw_serialization(modest_t* modest, modest_node_t* mnode, mycore_callback_serialize_f callback, void* context); 44 | 45 | #ifdef __cplusplus 46 | } /* extern "C" */ 47 | #endif 48 | 49 | #endif /* MODEST_NODE_SERIALIZATION_H */ 50 | -------------------------------------------------------------------------------- /source/modest/render/begin.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #include "modest/render/begin.h" 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /source/modest/render/begin.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MODEST_RENDER_BEGIN_H 22 | #define MODEST_RENDER_BEGIN_H 23 | #pragma once 24 | 25 | #include "modest/modest.h" 26 | #include "modest/style/type.h" 27 | #include "modest/render/tree.h" 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | 34 | 35 | #ifdef __cplusplus 36 | } /* extern "C" */ 37 | #endif 38 | 39 | #endif /* MODEST_RENDER_BEGIN_H */ 40 | -------------------------------------------------------------------------------- /source/modest/render/binding.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MODEST_RENDER_BINDING_H 22 | #define MODEST_RENDER_BINDING_H 23 | #pragma once 24 | 25 | #include "modest/myosi.h" 26 | #include "modest/modest.h" 27 | #include "modest/node/node.h" 28 | #include "modest/render/tree.h" 29 | #include "modest/render/tree_node.h" 30 | #include "modest/declaration.h" 31 | 32 | #include "myhtml/tree.h" 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | modest_render_tree_node_t * modest_render_binding(modest_t* modest, modest_render_tree_t* render_tree, myhtml_tree_t* html_tree); 39 | modest_render_tree_node_t * modest_layer_binding_node(modest_t* modest, modest_render_tree_t* render_tree, 40 | modest_render_tree_node_t* render_root, myhtml_tree_node_t* html_node); 41 | 42 | #ifdef __cplusplus 43 | } /* extern "C" */ 44 | #endif 45 | 46 | #endif /* MODEST_RENDER_BINDING_H */ 47 | -------------------------------------------------------------------------------- /source/modest/style/default_entries.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MODEST_STYLE_DEFAULT_ENTRIES_H 22 | #define MODEST_STYLE_DEFAULT_ENTRIES_H 23 | #pragma once 24 | 25 | static mycss_declaration_entry_t modest_style_default_entry_display_none = { 26 | MyCSS_PROPERTY_TYPE_DISPLAY, 27 | MyCSS_PROPERTY_DISPLAY_NONE, 28 | NULL, 29 | false, 30 | MyCSS_DECLARATION_FLAGS_READ_ONLY, 31 | NULL, NULL 32 | }; 33 | 34 | static mycss_declaration_entry_t modest_style_default_entry_display_block = { 35 | MyCSS_PROPERTY_TYPE_DISPLAY, 36 | MyCSS_PROPERTY_DISPLAY_BLOCK, 37 | NULL, 38 | false, 39 | MyCSS_DECLARATION_FLAGS_READ_ONLY, 40 | NULL, NULL 41 | }; 42 | 43 | #endif /* MODEST_STYLE_DEFAULT_ENTRIES_H */ 44 | -------------------------------------------------------------------------------- /source/modest/style/raw.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #include "modest/style/raw.h" 22 | 23 | modest_style_raw_declaration_t * modest_style_raw_declaration_create(modest_t* modest) 24 | { 25 | modest_style_raw_declaration_t* raw_decl = (modest_style_raw_declaration_t*)mcobject_malloc(modest->mraw_style_declaration_obj, NULL); 26 | 27 | if(raw_decl == NULL) 28 | return NULL; 29 | 30 | memset(raw_decl, 0, sizeof(modest_style_raw_declaration_t)); 31 | 32 | return raw_decl; 33 | } 34 | 35 | 36 | -------------------------------------------------------------------------------- /source/modest/style/raw.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MODEST_STYLE_RAW_H 22 | #define MODEST_STYLE_RAW_H 23 | #pragma once 24 | 25 | #include "modest/myosi.h" 26 | #include "modest/modest.h" 27 | #include "mycore/utils/mcobject.h" 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | typedef struct modest_style_raw_declaration modest_style_raw_declaration_t; 34 | typedef struct modest_style_raw_specificity modest_style_raw_specificity_t; 35 | 36 | struct modest_style_raw_specificity { 37 | unsigned int x; 38 | unsigned int a; 39 | unsigned int b; 40 | unsigned int c; 41 | }; 42 | 43 | struct modest_style_raw_declaration { 44 | mycss_declaration_entry_t* declaration; 45 | modest_style_raw_specificity_t spec; 46 | }; 47 | 48 | modest_style_raw_declaration_t * modest_style_raw_declaration_create(modest_t* modest); 49 | 50 | #ifdef __cplusplus 51 | } /* extern "C" */ 52 | #endif 53 | 54 | #endif /* MODEST_STYLE_RAW_H */ 55 | -------------------------------------------------------------------------------- /source/modest/style/sheet.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #include "modest/style/sheet.h" 22 | 23 | modest_style_sheet_t * modest_style_sheet_create(modest_t* modest) 24 | { 25 | modest_style_sheet_t* m_stylesheet = (modest_style_sheet_t*)mcobject_async_malloc(modest->mstylesheet_obj, modest->mstylesheet_node_id, NULL); 26 | 27 | if(m_stylesheet == NULL) 28 | return NULL; 29 | 30 | memset(m_stylesheet, 0, sizeof(modest_style_sheet_t)); 31 | 32 | return m_stylesheet; 33 | } 34 | 35 | mystatus_t modest_style_sheet_init(modest_t* modest, modest_style_sheet_t* m_stylesheet) 36 | { 37 | return MODEST_STATUS_OK; 38 | } 39 | 40 | 41 | -------------------------------------------------------------------------------- /source/modest/style/type.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #include "modest/style/type.h" 22 | 23 | void * modest_style_type_create(modest_t* modest, size_t size) 24 | { 25 | void* data = (void*)mchar_async_malloc(modest->mstyle_type_obj, modest->mstyle_type_node_id, size); 26 | 27 | if(data == NULL) 28 | return NULL; 29 | 30 | memset(data, 0, size); 31 | 32 | return data; 33 | } 34 | 35 | mystatus_t modest_style_type_init(modest_t* modest, void *data) 36 | { 37 | return MODEST_STATUS_OK; 38 | } 39 | -------------------------------------------------------------------------------- /source/modest/style/type.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MODEST_STYLE_TYPE_H 22 | #define MODEST_STYLE_TYPE_H 23 | #pragma once 24 | 25 | #include "modest/myosi.h" 26 | #include "modest/modest.h" 27 | #include "mycss/declaration/myosi.h" 28 | #include "mycore/utils/mchar_async.h" 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | typedef struct modest_style_type_length modest_style_type_length_t; 35 | typedef struct modest_style_type_display modest_style_type_display_t; 36 | 37 | struct modest_style_type_length { 38 | float value; 39 | }; 40 | 41 | struct modest_style_type_display { 42 | mycss_property_display_t value; 43 | }; 44 | 45 | 46 | void * modest_style_type_create(modest_t* modest, size_t size); 47 | mystatus_t modest_style_type_init(modest_t* modest, void *data); 48 | 49 | #ifdef __cplusplus 50 | } /* extern "C" */ 51 | #endif 52 | 53 | #endif /* MODEST_STYLE_TYPE_H */ 54 | -------------------------------------------------------------------------------- /source/mycore/Makefile.mk: -------------------------------------------------------------------------------- 1 | mycore_dirs := . utils 2 | mycore_objs := $(call MODEST_UTILS_OBJS,mycore,$(mycore_dirs)) 3 | 4 | mycore_description := base module, it is used by all other modules 5 | mycore_dependencies := 6 | 7 | mycore_all: $(mycore_objs) 8 | 9 | mycore_clean: 10 | rm -f $(mycore_objs) 11 | 12 | mycore_clone: 13 | $(call MODEST_UTILS_HDRS_CLONE,mycore,$(mycore_dirs)) 14 | -------------------------------------------------------------------------------- /source/mycore/myosi.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2015-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #include "mycore/myosi.h" 22 | 23 | -------------------------------------------------------------------------------- /source/mycore/perf.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2015-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyCORE_PERF_H 22 | #define MyCORE_PERF_H 23 | #pragma once 24 | 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | #include "mycore/myosi.h" 31 | 32 | #ifdef MyCORE_WITH_PERF 33 | void * mycore_perf_create(void); 34 | void mycore_perf_clean(void* perf); 35 | void mycore_perf_destroy(void* perf); 36 | 37 | mycore_status_t myhtml_perf_begin(void* perf); 38 | mycore_status_t myhtml_perf_end(void* perf); 39 | double myhtml_perf_in_sec(void* perf); 40 | 41 | unsigned long long mycore_perf_clock(void); 42 | unsigned long long mycore_perf_frequency(void); 43 | #endif /* MyCORE_WITH_PERF */ 44 | 45 | #ifdef __cplusplus 46 | } /* extern "C" */ 47 | #endif 48 | 49 | #endif /* MyCORE_PERF_H */ 50 | -------------------------------------------------------------------------------- /source/mycss/Makefile.mk: -------------------------------------------------------------------------------- 1 | mycss_dirs := . selectors namespace media values property declaration 2 | mycss_objs := $(call MODEST_UTILS_OBJS,mycss,$(mycss_dirs)) 3 | 4 | mycss_description := CSS parser and modules by https://drafts.csswg.org/ 5 | mycss_dependencies := mycore myencoding myport 6 | 7 | mycss_all: $(mycss_objs) 8 | 9 | mycss_clean: 10 | rm -f $(mycss_objs) 11 | 12 | mycss_clone: 13 | $(call MODEST_UTILS_HDRS_CLONE,mycss,$(mycss_dirs)) 14 | -------------------------------------------------------------------------------- /source/mycss/check.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyHTML_MyCSS_CHECK_H 22 | #define MyHTML_MyCSS_CHECK_H 23 | #pragma once 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | #include "mycss/myosi.h" 30 | #include "mycss/mycss.h" 31 | #include "mycss/entry.h" 32 | 33 | bool mycss_check_three_code_points_would_start_identifier(mycss_entry_t* entry, mycss_token_t* token, const char* css, size_t css_offset, size_t css_size); 34 | bool mycss_check_two_code_points_valid_escape(mycss_entry_t* entry, mycss_token_t* token, const char* css, size_t css_offset, size_t css_size); 35 | bool mycss_check_three_code_points_would_start_number(mycss_entry_t* entry, mycss_token_t* token, const char* css, size_t css_offset, size_t css_size); 36 | 37 | #ifdef __cplusplus 38 | } /* extern "C" */ 39 | #endif 40 | 41 | #endif /* MyHTML_MyCSS_CHECK_H */ 42 | -------------------------------------------------------------------------------- /source/mycss/convert.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyHTML_MyCSS_CONVERT_H 22 | #define MyHTML_MyCSS_CONVERT_H 23 | #pragma once 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | #include "mycss/myosi.h" 30 | #include "mycss/entry.h" 31 | #include "myhtml/mystring.h" 32 | 33 | const char * mycss_convert_split_dimension_string(mycore_string_t* str, double* value, bool* is_float); 34 | 35 | size_t mycss_convert_data_to_integer(const char* data, size_t size, long* return_num); 36 | size_t mycss_convert_data_to_double(const char *data, size_t size, double *return_num, bool* is_float); 37 | size_t mycss_convert_unicode_range_to_codepoint(const char *data, size_t size, size_t *start, size_t *end); 38 | size_t mycss_convert_hex_to_codepoint(const char *data, size_t size, size_t *codepoint, unsigned int max_consumed); 39 | 40 | #ifdef __cplusplus 41 | } /* extern "C" */ 42 | #endif 43 | 44 | #endif /* MyHTML_MyCSS_CONVERT_H */ 45 | -------------------------------------------------------------------------------- /source/mycss/declaration/default.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #include "mycss/declaration/default.h" 22 | #include "mycss/declaration/default_resources.h" 23 | 24 | mycss_declaration_entry_t * mycss_declaration_default_by_type(mycss_property_type_t property_type) 25 | { 26 | if(property_type < MyCSS_PROPERTY_TYPE_LAST_ENTRY) 27 | return mycss_declaration_default_entry_index_type[ property_type ]; 28 | 29 | return NULL; 30 | } 31 | 32 | 33 | -------------------------------------------------------------------------------- /source/mycss/declaration/default.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyCSS_DECLARATION_DEFAULT_H 22 | #define MyCSS_DECLARATION_DEFAULT_H 23 | #pragma once 24 | 25 | #include "mycss/declaration/myosi.h" 26 | #include "mycss/values/values.h" 27 | 28 | #ifdef __cplusplus 29 | extern "C" { 30 | #endif 31 | 32 | mycss_declaration_entry_t * mycss_declaration_default_by_type(mycss_property_type_t property_type); 33 | 34 | #ifdef __cplusplus 35 | } /* extern "C" */ 36 | #endif 37 | 38 | #endif /* MyCSS_DECLARATION_DEFAULT_H */ 39 | -------------------------------------------------------------------------------- /source/mycss/declaration/parser.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyHTML_MyCSS_DECLARATION_PARSER_H 22 | #define MyHTML_MyCSS_DECLARATION_PARSER_H 23 | #pragma once 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | #include "mycss/entry.h" 30 | #include "mycss/property/init.h" 31 | #include "mycss/declaration/entry.h" 32 | 33 | void mycss_declaration_parser_begin(mycss_entry_t* entry, mycss_token_t* token); 34 | void mycss_declaration_parser_ident(mycss_entry_t* entry, mycss_token_t* token); 35 | void mycss_declaration_parser_end(mycss_entry_t* entry, mycss_token_t* token); 36 | 37 | #ifdef __cplusplus 38 | } /* extern "C" */ 39 | #endif 40 | 41 | #endif /* MyHTML_MyCSS_DECLARATION_PARSER_H */ 42 | -------------------------------------------------------------------------------- /source/mycss/media/init.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #include "mycss/media/init.h" 22 | 23 | mycss_media_t * mycss_media_create(void) 24 | { 25 | return (mycss_media_t*)mycore_calloc(1, sizeof(mycss_media_t)); 26 | } 27 | 28 | mystatus_t mycss_media_init(mycss_entry_t* entry, mycss_media_t* media) 29 | { 30 | return MyCSS_STATUS_OK; 31 | } 32 | 33 | mystatus_t mycss_media_clean_all(mycss_media_t* media) 34 | { 35 | return MyCSS_STATUS_OK; 36 | } 37 | 38 | mycss_media_t * mycss_media_destroy(mycss_media_t* media, bool self_destroy) 39 | { 40 | if(media == NULL) 41 | return NULL; 42 | 43 | if(self_destroy) { 44 | mycore_free(media); 45 | return NULL; 46 | } 47 | 48 | return media; 49 | } 50 | 51 | 52 | -------------------------------------------------------------------------------- /source/mycss/media/init.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyHTML_MyCSS_MEDIA_INIT_H 22 | #define MyHTML_MyCSS_MEDIA_INIT_H 23 | #pragma once 24 | 25 | #include "mycss/media/myosi.h" 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | mycss_media_t * mycss_media_create(void); 32 | mystatus_t mycss_media_init(mycss_entry_t* entry, mycss_media_t* media); 33 | mystatus_t mycss_media_clean_all(mycss_media_t* media); 34 | mycss_media_t * mycss_media_destroy(mycss_media_t* media, bool self_destroy); 35 | 36 | #ifdef __cplusplus 37 | } /* extern "C" */ 38 | #endif 39 | 40 | #endif /* MyHTML_MyCSS_MEDIA_INIT_H */ 41 | -------------------------------------------------------------------------------- /source/mycss/media/myosi.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyHTML_MyCSS_MEDIA_MYOSI_H 22 | #define MyHTML_MyCSS_MEDIA_MYOSI_H 23 | #pragma once 24 | 25 | #include "mycss/myosi.h" 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | typedef struct mycss_media mycss_media_t; 32 | 33 | 34 | struct mycss_media { 35 | mystatus_t error; 36 | }; 37 | 38 | 39 | #ifdef __cplusplus 40 | } /* extern "C" */ 41 | #endif 42 | 43 | #endif /* MyHTML_MyCSS_MEDIA_MYOSI_H */ 44 | -------------------------------------------------------------------------------- /source/mycss/media/state.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyHTML_MyCSS_MEDIA_STATE_H 22 | #define MyHTML_MyCSS_MEDIA_STATE_H 23 | #pragma once 24 | 25 | #include "mycss/media/myosi.h" 26 | #include "mycss/entry.h" 27 | 28 | #ifdef __cplusplus 29 | extern "C" { 30 | #endif 31 | 32 | bool mycss_media_state_begin(mycss_entry_t* entry, mycss_token_t* token, bool last_response); 33 | 34 | #ifdef __cplusplus 35 | } /* extern "C" */ 36 | #endif 37 | 38 | #endif /* MyHTML_MyCSS_MEDIA_STATE_H */ 39 | -------------------------------------------------------------------------------- /source/mycss/namespace/parser.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyHTML_MyCSS_NAMESPACE_PARSER_H 22 | #define MyHTML_MyCSS_NAMESPACE_PARSER_H 23 | #pragma once 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | #include "mycss/entry.h" 30 | #include "mycss/namespace/myosi.h" 31 | #include "myhtml/mynamespace.h" 32 | #include "mycore/utils/mctree.h" 33 | 34 | void mycss_namespace_parser_begin(mycss_entry_t* entry); 35 | 36 | void mycss_namespace_parser_name(mycss_entry_t* entry, mycss_token_t* token); 37 | void mycss_namespace_parser_url(mycss_entry_t* entry, mycss_token_t* token); 38 | void mycss_namespace_parser_end(mycss_entry_t* entry, mycss_token_t* token); 39 | void mycss_namespace_parser_expectations_error(mycss_entry_t* entry, mycss_token_t* token); 40 | 41 | 42 | #ifdef __cplusplus 43 | } /* extern "C" */ 44 | #endif 45 | 46 | #endif /* MyHTML_MyCSS_NAMESPACE_PARSER_H */ 47 | -------------------------------------------------------------------------------- /source/mycss/namespace/serialization.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyHTML_MyCSS_NAMESPACE_SERIALIZATION_H 22 | #define MyHTML_MyCSS_NAMESPACE_SERIALIZATION_H 23 | #pragma once 24 | 25 | #include "mycss/entry.h" 26 | #include "mycss/namespace/myosi.h" 27 | 28 | #ifdef __cplusplus 29 | extern "C" { 30 | #endif 31 | 32 | void mycss_namespace_serialization_stylesheet(mycss_namespace_stylesheet_t* ns_stylesheet, mycore_callback_serialize_f callback, void* context); 33 | void mycss_namespace_serialization_entry(mycss_namespace_t* ns, mycss_namespace_entry_t* ns_entry, mycore_callback_serialize_f callback, void* context, bool with_vbar); 34 | 35 | #ifdef __cplusplus 36 | } /* extern "C" */ 37 | #endif 38 | 39 | #endif /* MyHTML_MyCSS_NAMESPACE_SERIALIZATION_H */ 40 | -------------------------------------------------------------------------------- /source/mycss/property/init.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyHTML_MyCSS_PROPERTY_INIT_H 22 | #define MyHTML_MyCSS_PROPERTY_INIT_H 23 | #pragma once 24 | 25 | #include "mycss/property/myosi.h" 26 | #include "mycss/property/parser.h" 27 | #include "mycss/values/serialization.h" 28 | #include "mycore/utils.h" 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | const mycss_property_index_static_entry_t * mycss_property_index_entry_by_name(const char* name, size_t length); 35 | mycss_property_type_t mycss_property_type_by_name(const char *name, size_t length); 36 | 37 | const mycss_property_value_index_static_entry_t * mycss_property_value_index_entry_by_name(const char* name, size_t length); 38 | mycss_property_value_t mycss_property_value_type_by_name(const char *name, size_t length); 39 | 40 | void mycss_property_print(mycss_property_type_t prop_type, FILE* fh); 41 | void mycss_property_value_print(unsigned int value_type, void* value, FILE* fh); 42 | 43 | #ifdef __cplusplus 44 | } /* extern "C" */ 45 | #endif 46 | 47 | #endif /* MyHTML_MyCSS_PROPERTY_INIT_H */ 48 | -------------------------------------------------------------------------------- /source/mycss/property/myosi.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyHTML_MyCSS_PROPERTY_MYOSI_H 22 | #define MyHTML_MyCSS_PROPERTY_MYOSI_H 23 | #pragma once 24 | 25 | #include "mycss/myosi.h" 26 | #include "mycss/property/const.h" 27 | 28 | #ifdef __cplusplus 29 | extern "C" { 30 | #endif 31 | 32 | struct mycss_property_index_static_entry { 33 | const char* name; 34 | size_t name_length; 35 | 36 | mycss_property_type_t type; 37 | mycss_parser_token_f parser; 38 | 39 | size_t next; 40 | size_t curr; 41 | } 42 | typedef mycss_property_index_static_entry_t; 43 | 44 | struct mycss_property_value_index_static_entry { 45 | const char* name; 46 | size_t name_length; 47 | 48 | mycss_property_value_t type; 49 | 50 | size_t next; 51 | size_t curr; 52 | } 53 | typedef mycss_property_value_index_static_entry_t; 54 | 55 | #ifdef __cplusplus 56 | } /* extern "C" */ 57 | #endif 58 | 59 | #endif /* MyHTML_MyCSS_PROPERTY_MYOSI_H */ 60 | -------------------------------------------------------------------------------- /source/mycss/property/serialization.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyHTML_MyCSS_PROPERTY_SERIALIZATION_H 22 | #define MyHTML_MyCSS_PROPERTY_SERIALIZATION_H 23 | #pragma once 24 | 25 | #include "mycss/property/myosi.h" 26 | #include "mycss/property/init.h" 27 | #include "mycss/values/serialization.h" 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | void mycss_property_serialization_type_name(mycss_property_type_t prop_type, mycore_callback_serialize_f callback, void* context); 34 | void mycss_property_serialization_value(unsigned int value_type, void* value, mycore_callback_serialize_f callback, void* context); 35 | 36 | #ifdef __cplusplus 37 | } /* extern "C" */ 38 | #endif 39 | 40 | #endif /* MyHTML_MyCSS_PROPERTY_SERIALIZATION_H */ 41 | -------------------------------------------------------------------------------- /source/mycss/selectors/myosi_resource.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyHTML_MyCSS_SELECTORS_MYOSI_RESOURCE_H 22 | #define MyHTML_MyCSS_SELECTORS_MYOSI_RESOURCE_H 23 | #pragma once 24 | 25 | static const char mycss_selectors_resource_matcher_names_map[][3] = { 26 | "=", "~=", "|=", "^=", "$=", "*=" 27 | }; 28 | 29 | static const char mycss_selectors_resource_combinator_names_map[][3] = { 30 | "", " ", ">", "+", "~", "||" 31 | }; 32 | 33 | #endif /* MyHTML_MyCSS_SELECTORS_MYOSI_RESOURCE_H */ 34 | -------------------------------------------------------------------------------- /source/mycss/selectors/pseudo.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyHTML_MyCSS_SELECTORS_PSEUDO_H 22 | #define MyHTML_MyCSS_SELECTORS_PSEUDO_H 23 | #pragma once 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | #include "mycss/entry.h" 30 | #include "mycss/selectors/myosi.h" 31 | 32 | struct mycss_selectots_pseudo_begin_entry { 33 | const char* name; 34 | size_t length; 35 | 36 | int sub_type; 37 | 38 | size_t next; 39 | size_t curr; 40 | } 41 | typedef mycss_selectots_pseudo_begin_entry_t; 42 | 43 | 44 | mycss_selectors_sub_type_pseudo_class_t mycss_pseudo_class_by_name(const char *name, size_t length); 45 | mycss_selectors_sub_type_pseudo_element_t mycss_pseudo_element_by_name(const char *name, size_t length); 46 | const mycss_selectots_pseudo_begin_entry_t * mycss_pseudo_begin_entry_by_name(const char* name, size_t length, size_t static_size, const mycss_selectots_pseudo_begin_entry_t* pseudo); 47 | 48 | #ifdef __cplusplus 49 | } /* extern "C" */ 50 | #endif 51 | 52 | #endif /* MyHTML_MyCSS_SELECTORS_PSEUDO_H */ 53 | -------------------------------------------------------------------------------- /source/mycss/selectors/serialization.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyHTML_MyCSS_SELECTORS_SERIALIZATION_H 22 | #define MyHTML_MyCSS_SELECTORS_SERIALIZATION_H 23 | #pragma once 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | #include "mycss/selectors/myosi.h" 30 | #include "mycss/namespace/serialization.h" 31 | #include "mycss/declaration/serialization.h" 32 | 33 | void mycss_selectors_serialization_chain(mycss_selectors_t* selectors, mycss_selectors_entry_t* selector, mycore_callback_serialize_f callback, void* context); 34 | bool mycss_selectors_serialization_list(mycss_selectors_t* selectors, mycss_selectors_list_t* selectors_list, mycore_callback_serialize_f callback, void* context); 35 | bool mycss_selectors_serialization_selector(mycss_selectors_t* selectors, mycss_selectors_entry_t* selector, mycore_callback_serialize_f callback, void* context); 36 | 37 | #ifdef __cplusplus 38 | } /* extern "C" */ 39 | #endif 40 | 41 | #endif /* MyHTML_MyCSS_SELECTORS_SERIALIZATION_H */ 42 | -------------------------------------------------------------------------------- /source/mycss/stack.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyCSS_STACK_H 22 | #define MyCSS_STACK_H 23 | #pragma once 24 | 25 | #include "mycss/myosi.h" 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | struct mycss_stack_entry { 32 | void *value; 33 | mycss_parser_token_f parser; 34 | } 35 | typedef mycss_stack_entry_t; 36 | 37 | struct mycss_stack { 38 | mycss_stack_entry_t* entries; 39 | size_t entries_length; 40 | size_t entries_size; 41 | } 42 | typedef mycss_stack_t; 43 | 44 | mycss_stack_t * mycss_stack_create(void); 45 | mystatus_t mycss_stack_init(mycss_stack_t *stack, size_t size); 46 | void mycss_stack_clean(mycss_stack_t *stack); 47 | mycss_stack_t * mycss_stack_destroy(mycss_stack_t *stack, bool self_destroy); 48 | 49 | mystatus_t mycss_stack_push(mycss_stack_t *stack, void* value, mycss_parser_token_f parser); 50 | mycss_stack_entry_t * mycss_stack_pop(mycss_stack_t *stack); 51 | mycss_stack_entry_t * mycss_stack_current(mycss_stack_t *stack); 52 | 53 | #ifdef __cplusplus 54 | } /* extern "C" */ 55 | #endif 56 | 57 | #endif /* MyCSS_STACK_H */ 58 | -------------------------------------------------------------------------------- /source/mycss/syntax/ending.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyCSS_SYNTAX_ENDING_H 22 | #define MyCSS_SYNTAX_ENDING_H 23 | #pragma once 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | #include "mycss/myosi.h" 30 | #include "mycss/mycss.h" 31 | #include "mycss/entry.h" 32 | 33 | bool mycss_syntax_endings_list_of_rules_return(mycss_entry_t* entry, mycss_token_t* token); 34 | bool mycss_syntax_endings_list_of_rules_qualified_rule_left_qb(mycss_entry_t* entry, mycss_token_t* token); 35 | bool mycss_syntax_endings_list_of_rules_at_rule_qb(mycss_entry_t* entry, mycss_token_t* token); 36 | bool mycss_syntax_endings_component_value_and_simple_block_left_curly_bracket(mycss_entry_t* entry, mycss_token_t* token); 37 | bool mycss_syntax_endings_component_value_and_simple_block_left_square_bracket(mycss_entry_t* entry, mycss_token_t* token); 38 | bool mycss_syntax_endings_component_value_and_simple_block_left_parenthesis(mycss_entry_t* entry, mycss_token_t* token); 39 | 40 | #ifdef __cplusplus 41 | } /* extern "C" */ 42 | #endif 43 | 44 | #endif /* MyCSS_SYNTAX_ENDING_H */ 45 | -------------------------------------------------------------------------------- /source/mycss/syntax/syntax.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyCSS_SYNTAX_H 22 | #define MyCSS_SYNTAX_H 23 | #pragma once 24 | 25 | #ifdef __cplusplus 26 | //extern "C" { 27 | #endif 28 | 29 | #include "mycss/myosi.h" 30 | #include "mycss/mycss.h" 31 | #include "mycss/entry.h" 32 | #include "mycss/syntax_ending.h" 33 | 34 | bool mycss_syntax_list_of_rules(mycss_entry_t* entry, mycss_token_t* token, bool last_response); 35 | 36 | #ifdef __cplusplus 37 | } /* extern "C" */ 38 | #endif 39 | 40 | #endif /* MyCSS_SYNTAX_H */ 41 | -------------------------------------------------------------------------------- /source/mycss/syntax_ending.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyCSS_SYNTAX_ENDING_H 22 | #define MyCSS_SYNTAX_ENDING_H 23 | #pragma once 24 | 25 | #ifdef __cplusplus 26 | //extern "C" { 27 | #endif 28 | 29 | #include "mycss/myosi.h" 30 | #include "mycss/mycss.h" 31 | #include "mycss/entry.h" 32 | 33 | bool mycss_syntax_list_of_rules(mycss_entry_t* entry, mycss_token_t* token, bool last_response); 34 | 35 | #ifdef __cplusplus 36 | } /* extern "C" */ 37 | #endif 38 | 39 | #endif /* MyCSS_SYNTAX_ENDING_H */ 40 | -------------------------------------------------------------------------------- /source/mycss/values/consume.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyHTML_MyCSS_VALUES_CONSUME_H 22 | #define MyHTML_MyCSS_VALUES_CONSUME_H 23 | #pragma once 24 | 25 | #include "mycss/myosi.h" 26 | #include "mycss/entry.h" 27 | #include "mycss/values/values.h" 28 | #include "mycss/values/units.h" 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | bool mycss_values_consume_length(mycss_entry_t* entry, mycss_token_t* token); 35 | bool mycss_values_consume_percentage(mycss_entry_t* entry, mycss_token_t* token); 36 | 37 | #ifdef __cplusplus 38 | } /* extern "C" */ 39 | #endif 40 | 41 | #endif /* MyHTML_MyCSS_VALUES_CONSUME_H */ 42 | -------------------------------------------------------------------------------- /source/mycss/values/resources.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyHTML_MyCSS_VALUES_RESOURCES_H 22 | #define MyHTML_MyCSS_VALUES_RESOURCES_H 23 | #pragma once 24 | 25 | 26 | 27 | #endif /* MyHTML_MyCSS_VALUES_RESOURCES_H */ 28 | -------------------------------------------------------------------------------- /source/myencoding/Makefile.mk: -------------------------------------------------------------------------------- 1 | myencoding_dirs := . 2 | myencoding_objs := $(call MODEST_UTILS_OBJS,myencoding,$(myencoding_dirs)) 3 | 4 | myencoding_description := work with character encodings, detecting encoding, convert encodings by https://encoding.spec.whatwg.org/ 5 | myencoding_dependencies := mycore myport 6 | 7 | myencoding_all: $(myencoding_objs) 8 | 9 | myencoding_clean: 10 | rm -f $(myencoding_objs) 11 | 12 | myencoding_clone: 13 | $(call MODEST_UTILS_HDRS_CLONE,myencoding,$(myencoding_dirs)) 14 | -------------------------------------------------------------------------------- /source/myfont/Makefile.mk: -------------------------------------------------------------------------------- 1 | myfont_dirs := . 2 | myfont_objs := $(call MODEST_UTILS_OBJS,myfont,$(myfont_dirs)) 3 | 4 | myfont_description := work with font, metrics, calculating size and more by https://www.microsoft.com/en-us/Typography/SpecificationsOverview.aspx 5 | myfont_dependencies := mycore myport 6 | 7 | myfont_all: $(myfont_objs) 8 | 9 | myfont_clean: 10 | rm -f $(myfont_objs) 11 | 12 | myfont_clone: 13 | $(call MODEST_UTILS_HDRS_CLONE,myfont,$(myfont_dirs)) 14 | -------------------------------------------------------------------------------- /source/myfont/hhea.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyFONT_HHEA_H 22 | #define MyFONT_HHEA_H 23 | #pragma once 24 | 25 | #include "myfont/myosi.h" 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | // table hhea 32 | struct myfont_table_hhea { 33 | int32_t version; 34 | int16_t Ascender; 35 | int16_t Descender; 36 | int16_t LineGap; 37 | uint16_t advanceWidthMax; 38 | int16_t minLeftSideBearing; 39 | int16_t minRightSideBearing; 40 | int16_t xMaxExtent; 41 | int16_t caretSlopeRise; 42 | int16_t caretSlopeRun; 43 | int16_t caretOffset; 44 | int16_t reserved1; 45 | int16_t reserved2; 46 | int16_t reserved3; 47 | int16_t reserved4; 48 | int16_t metricDataFormat; 49 | uint16_t numberOfHMetrics; 50 | } 51 | typedef myfont_table_hhea_t; 52 | 53 | #include "myfont/myfont.h" 54 | 55 | struct myfont_font; 56 | 57 | mystatus_t myfont_load_table_hhea(myfont_font_t *mf, uint8_t* data, size_t data_size); 58 | 59 | #ifdef __cplusplus 60 | } /* extern "C" */ 61 | #endif 62 | 63 | #endif /* MyFONT_HHEA_H */ 64 | -------------------------------------------------------------------------------- /source/myfont/hmtx.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyFONT_HMTX_H 22 | #define MyFONT_HMTX_H 23 | #pragma once 24 | 25 | #include "myfont/myosi.h" 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | struct myfont_long_hor_metric { 32 | uint16_t advanceWidth; 33 | int16_t lsb; 34 | } 35 | typedef myfont_long_hor_metric_t; 36 | 37 | // table hhea 38 | struct myfont_table_hmtx { 39 | myfont_long_hor_metric_t *hMetrics; 40 | int16_t *leftSideBearing; 41 | } 42 | typedef myfont_table_hmtx_t; 43 | 44 | #include "myfont/myfont.h" 45 | 46 | struct myfont_font; 47 | 48 | mystatus_t myfont_load_table_hmtx(myfont_font_t* mf, uint8_t* data, size_t data_size); 49 | 50 | #ifdef __cplusplus 51 | } /* extern "C" */ 52 | #endif 53 | 54 | #endif /* MyFONT_HMTX_H */ 55 | -------------------------------------------------------------------------------- /source/myfont/loca.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyFONT_LOCA_H 22 | #define MyFONT_LOCA_H 23 | #pragma once 24 | 25 | #include "myfont/myosi.h" 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | // table pclt 32 | struct myfont_table_loca { 33 | uint32_t *offsets; 34 | } 35 | typedef myfont_table_loca_t; 36 | 37 | #include "myfont/myfont.h" 38 | 39 | struct myfont_font; 40 | 41 | mystatus_t myfont_load_table_loca(myfont_font_t *mf, uint8_t* data, size_t data_size); 42 | 43 | uint32_t myfont_loca_get_offset(myfont_font_t *mf, uint16_t glyph_index); 44 | 45 | #ifdef __cplusplus 46 | } /* extern "C" */ 47 | #endif 48 | 49 | #endif /* MyFONT_LOCA_H */ 50 | -------------------------------------------------------------------------------- /source/myfont/maxp.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyFONT_MAXP_H 22 | #define MyFONT_MAXP_H 23 | #pragma once 24 | 25 | #include "myfont/myosi.h" 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | struct myfont_table_maxp { 32 | uint32_t version; 33 | uint16_t numGlyphs; 34 | uint16_t maxPoints; 35 | uint16_t maxContours; 36 | uint16_t maxCompositePoints; 37 | uint16_t maxCompositeContours; 38 | uint16_t maxZones; 39 | uint16_t maxTwilightPoints; 40 | uint16_t maxStorage; 41 | uint16_t maxFunctionDefs; 42 | uint16_t maxInstructionDefs; 43 | uint16_t maxStackElements; 44 | uint16_t maxSizeOfInstructions; 45 | uint16_t maxComponentElements; 46 | uint16_t maxComponentDepth; 47 | } 48 | typedef myfont_table_maxp_t; 49 | 50 | #include "myfont/myfont.h" 51 | 52 | struct myfont_font; 53 | 54 | mystatus_t myfont_load_table_maxp(myfont_font_t *mf, uint8_t* data, size_t data_size); 55 | 56 | #ifdef __cplusplus 57 | } /* extern "C" */ 58 | #endif 59 | 60 | #endif /* MyFONT_MAXP_H */ 61 | -------------------------------------------------------------------------------- /source/myfont/pclt.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyFONT_PCLT_H 22 | #define MyFONT_PCLT_H 23 | #pragma once 24 | 25 | #include "myfont/myosi.h" 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | // table pclt 32 | struct myfont_table_pclt { 33 | int32_t version; 34 | uint32_t fontNumber; 35 | uint16_t pitch; 36 | uint16_t xHeight; 37 | uint16_t style; 38 | uint16_t typeFamily; 39 | uint16_t capHeight; 40 | uint16_t symbolSet; 41 | char typeface[16]; 42 | char characterComplement[8]; 43 | char fileName[6]; 44 | char strokeWeight; 45 | char widthType; 46 | uint8_t serifStyle; 47 | uint8_t reserved; 48 | } 49 | typedef myfont_table_pclt_t; 50 | 51 | #include "myfont/myfont.h" 52 | 53 | struct myfont_font; 54 | 55 | mystatus_t myfont_load_table_pclt(myfont_font_t* mf, uint8_t* data, size_t data_size); 56 | 57 | #ifdef __cplusplus 58 | } /* extern "C" */ 59 | #endif 60 | 61 | #endif /* MyFONT_PCLT_H */ 62 | -------------------------------------------------------------------------------- /source/myfont/vmtx.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyFONT_VMTX_H 22 | #define MyFONT_VMTX_H 23 | #pragma once 24 | 25 | #include "myfont/myosi.h" 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | struct myfont_long_ver_metric { 32 | uint16_t advanceHeight; 33 | int16_t topSideBearing; 34 | } 35 | typedef myfont_long_ver_metric_t; 36 | 37 | // table vmtx 38 | struct myfont_table_vmtx { 39 | myfont_long_ver_metric_t *vMetrics; 40 | int16_t *topSideBearing; 41 | } 42 | typedef myfont_table_vmtx_t; 43 | 44 | #include "myfont/myfont.h" 45 | 46 | struct myfont_font; 47 | 48 | mystatus_t myfont_load_table_vmtx(myfont_font_t* mf, uint8_t* data, size_t data_size); 49 | 50 | #ifdef __cplusplus 51 | } /* extern "C" */ 52 | #endif 53 | 54 | #endif /* MyFONT_VMTX_H */ 55 | -------------------------------------------------------------------------------- /source/myhtml/Makefile.mk: -------------------------------------------------------------------------------- 1 | myhtml_dirs := . 2 | myhtml_objs := $(call MODEST_UTILS_OBJS,myhtml,$(myhtml_dirs)) 3 | 4 | myhtml_description := HTML parser by https://html.spec.whatwg.org/multipage/ 5 | myhtml_dependencies := mycore myencoding myport 6 | 7 | myhtml_all: $(myhtml_objs) 8 | 9 | myhtml_clean: 10 | rm -f $(myhtml_objs) 11 | 12 | myhtml_clone: 13 | $(call MODEST_UTILS_HDRS_CLONE,myhtml,$(myhtml_dirs)) 14 | -------------------------------------------------------------------------------- /source/myhtml/charef.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2015-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyHTML_CHAREF_H 22 | #define MyHTML_CHAREF_H 23 | #pragma once 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | #include "myhtml/myosi.h" 30 | 31 | struct charef_entry { 32 | unsigned char ch; 33 | size_t next; 34 | size_t cur_pos; 35 | size_t codepoints[2]; 36 | size_t codepoints_len; 37 | } 38 | typedef charef_entry_t; 39 | 40 | struct charef_entry_result { 41 | const charef_entry_t *curr_entry; 42 | const charef_entry_t *last_entry; 43 | size_t last_offset; 44 | int is_done; 45 | } 46 | typedef charef_entry_result_t; 47 | 48 | const charef_entry_t * myhtml_charef_find(const char *begin, size_t *offset, size_t size, size_t *data_size); 49 | const charef_entry_t * myhtml_charef_find_by_pos(size_t pos, const char *begin, size_t *offset, size_t size, charef_entry_result_t *result); 50 | const charef_entry_t * myhtml_charef_get_first_position(const char begin); 51 | 52 | #ifdef __cplusplus 53 | } /* extern "C" */ 54 | #endif 55 | 56 | #endif /* charef_h */ 57 | -------------------------------------------------------------------------------- /source/myhtml/rules.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2015-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyHTML_RULES_H 22 | #define MyHTML_RULES_H 23 | #pragma once 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | #include "myhtml/myosi.h" 30 | #include "myhtml/myhtml.h" 31 | #include "myhtml/tree.h" 32 | 33 | mystatus_t myhtml_rules_init(myhtml_t* myhtml); 34 | void myhtml_rules_stop_parsing(myhtml_tree_t* tree); 35 | 36 | bool myhtml_rules_tree_dispatcher(myhtml_tree_t* tree, myhtml_token_node_t* token); 37 | bool myhtml_insertion_mode_in_body_other_end_tag(myhtml_tree_t* tree, myhtml_token_node_t* token); 38 | bool myhtml_insertion_mode_in_body(myhtml_tree_t* tree, myhtml_token_node_t* token); 39 | bool myhtml_insertion_mode_in_template(myhtml_tree_t* tree, myhtml_token_node_t* token); 40 | 41 | #ifdef __cplusplus 42 | } /* extern "C" */ 43 | #endif 44 | 45 | #endif /* myhtml_rules_h */ 46 | -------------------------------------------------------------------------------- /source/myport/posix/Makefile.mk: -------------------------------------------------------------------------------- 1 | myport_dirs := mycore/. mycore/utils 2 | myport_objs := $(call MODEST_UTILS_OBJS,$(call MyPORT_SELECTED_PORT),$(myport_dirs)) 3 | 4 | myport_all: $(myport_objs) 5 | 6 | myport_clean: 7 | rm -f $(myport_objs) 8 | 9 | myport_clone: 10 | -------------------------------------------------------------------------------- /source/myport/posix/Rules.mk: -------------------------------------------------------------------------------- 1 | #******************************* 2 | # For unix and linux see POSIX rules in /Makefile.cfg 3 | #******************* 4 | #******************************* 5 | # Darwin, Mac OS X 6 | #******************* 7 | ifeq ($(OS),Darwin) 8 | MODEST_CLONE_SED_HEADER_COMMAND = find $(INCLUDE_DIR_API) -name "*.h" -exec sed -i '.bak' -E 's/^[ \t]*\#[ \t]*include[ \t]*"([^"]+)"/\#include <\1>/g' {} \; 9 | 10 | MODEST_CFLAGS += -fPIC 11 | MODEST_CFLAGS += $(PROJECT_OPTIMIZATION_LEVEL) -Wno-unused-variable -Wno-unused-function -std=c99 12 | LIB_NAME_SUFFIX := .dylib 13 | 14 | MODEST_BUILD_SHARED_AFTER += ln -sf $(call MODEST_LIBRARY_NAME_WITH_VERSION) $(call MODEST_LIBRARY) $(MODEST_UTILS_NEW_LINE) 15 | MODEST_BUILD_SHARED_AFTER += ln -sf $(call MODEST_LIBRARY_NAME_WITH_VERSION) $(call MODEST_LIBRARY_WITH_VERSION_MAJOR) $(MODEST_UTILS_NEW_LINE) 16 | MODEST_BUILD_SHARED_AFTER += ln -sf $(call MODEST_LIBRARY_NAME_WITH_VERSION) $(call MODEST_LIBRARY_WITH_VERSION_MAJOR_MINOR) $(MODEST_UTILS_NEW_LINE) 17 | 18 | MODEST_BUILD_CLEAN_AFTER += rm -f $(call MODEST_LIBRARY) $(MODEST_UTILS_NEW_LINE) 19 | MODEST_BUILD_CLEAN_AFTER += rm -f $(call MODEST_LIBRARY_WITH_VERSION_MAJOR) $(MODEST_UTILS_NEW_LINE) 20 | MODEST_BUILD_CLEAN_AFTER += rm -f $(call MODEST_LIBRARY_WITH_VERSION_MAJOR_MINOR) $(MODEST_UTILS_NEW_LINE) 21 | 22 | # Need set 23 | MODEST_BUILD_OS := $(OS) 24 | # this name eq source/myport/ 25 | MODEST_PORT_NAME := posix 26 | endif 27 | # end of Darwin, Mac OS X 28 | -------------------------------------------------------------------------------- /source/myport/posix/mycore/memory.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2015-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #include "mycore/myosi.h" 22 | 23 | void * mycore_malloc(size_t size) 24 | { 25 | return malloc(size); 26 | } 27 | 28 | void * mycore_realloc(void* dst, size_t size) 29 | { 30 | return realloc(dst, size); 31 | } 32 | 33 | void * mycore_calloc(size_t num, size_t size) 34 | { 35 | return calloc(num, size); 36 | } 37 | 38 | void * mycore_free(void* dst) 39 | { 40 | free(dst); 41 | return NULL; 42 | } 43 | -------------------------------------------------------------------------------- /source/myport/windows_nt/Makefile.mk: -------------------------------------------------------------------------------- 1 | myport_dirs := mycore/. mycore/utils 2 | myport_objs := $(call MODEST_UTILS_OBJS,$(call MyPORT_SELECTED_PORT),$(myport_dirs)) 3 | 4 | myport_all: $(myport_objs) 5 | 6 | myport_clean: 7 | rm -f $(myport_objs) 8 | 9 | myport_clone: 10 | -------------------------------------------------------------------------------- /source/myport/windows_nt/Rules.mk: -------------------------------------------------------------------------------- 1 | #******************************* 2 | # Windows_NT 3 | #******************* 4 | ifeq ($(OS),Windows_NT) 5 | LIB_NAME_SUFFIX := .dll 6 | LIB_NAME_SUFFIX_STATIC := .dll.a 7 | 8 | MODEST_LIBRARY_NAME_WITH_VERSION := lib$(LIB_NAME)-$(PROJECT_VERSION_MAJOR)$(LIB_NAME_SUFFIX) 9 | 10 | MODEST_CFLAGS += -Wno-unused-variable -Wno-unused-function -std=c99 11 | MODEST_LDFLAGS += -Wl,--out-implib,$(call MODEST_LIBRARY_STATIC) 12 | 13 | MODEST_BUILD_SHARED_AFTER += cp $(call MODEST_LIBRARY_WITH_VERSION) $(BINARY_DIR_BASE) $(MODEST_UTILS_NEW_LINE) 14 | MODEST_BUILD_CLEAN_AFTER += rm -f $(BINARY_DIR_BASE)/$(call MODEST_LIBRARY_NAME_WITH_VERSION) $(MODEST_UTILS_NEW_LINE) 15 | 16 | # Need set 17 | MODEST_BUILD_OS := $(OS) 18 | # this name eq source/myport/ 19 | MODEST_PORT_NAME := windows_nt 20 | endif 21 | # end of Windows_NT 22 | -------------------------------------------------------------------------------- /source/myport/windows_nt/mycore/memory.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2015-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #include "mycore/myosi.h" 22 | 23 | void * mycore_malloc(size_t size) 24 | { 25 | return malloc(size); 26 | } 27 | 28 | void * mycore_realloc(void* dst, size_t size) 29 | { 30 | return realloc(dst, size); 31 | } 32 | 33 | void * mycore_calloc(size_t num, size_t size) 34 | { 35 | return calloc(num, size); 36 | } 37 | 38 | void * mycore_free(void* dst) 39 | { 40 | free(dst); 41 | return NULL; 42 | } 43 | -------------------------------------------------------------------------------- /source/myunicode/Makefile.mk: -------------------------------------------------------------------------------- 1 | myunicode_dirs := . 2 | myunicode_objs := $(call MODEST_UTILS_OBJS,myunicode,$(myunicode_dirs)) 3 | 4 | myunicode_description := unicode normalization, case work and other 5 | myunicode_dependencies := mycore myport 6 | 7 | myunicode_all: $(myunicode_objs) 8 | 9 | myunicode_clean: 10 | rm -f $(myunicode_objs) 11 | 12 | myunicode_clone: 13 | $(call MODEST_UTILS_HDRS_CLONE,myunicode,$(myunicode_dirs)) 14 | -------------------------------------------------------------------------------- /source/myunicode/myosi.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #include "myunicode/myosi.h" 22 | 23 | void * myunicode_callback_malloc(size_t size, void* ctx) 24 | { 25 | return mycore_malloc(size); 26 | } 27 | 28 | void * myunicode_callback_realloc(void* value, size_t size, void* ctx) 29 | { 30 | return mycore_realloc(value, size); 31 | } 32 | 33 | void * myunicode_callback_free(void* value, void* ctx) 34 | { 35 | return mycore_free(value); 36 | } 37 | -------------------------------------------------------------------------------- /source/myunicode/myosi.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyUNICODE_MYOSI_H 22 | #define MyUNICODE_MYOSI_H 23 | #pragma once 24 | 25 | #include "myhtml/myosi.h" 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | #ifdef __cplusplus 32 | } /* extern "C" */ 33 | #endif 34 | 35 | #endif /* MyUNICODE_MYOSI_H */ 36 | -------------------------------------------------------------------------------- /source/myurl/Makefile.mk: -------------------------------------------------------------------------------- 1 | myurl_dirs := . 2 | myurl_objs := $(call MODEST_UTILS_OBJS,myurl,$(myurl_dirs)) 3 | 4 | myurl_description := URL parser by https://url.spec.whatwg.org/ 5 | myurl_dependencies := mycore myport 6 | 7 | myurl_all: $(myurl_objs) 8 | 9 | myurl_clean: 10 | rm -f $(myurl_objs) 11 | 12 | myurl_clone: 13 | $(call MODEST_UTILS_HDRS_CLONE,myurl,$(myurl_dirs)) 14 | -------------------------------------------------------------------------------- /source/myurl/myosi.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #include "myurl/myosi.h" 22 | #include "myurl/url.h" 23 | 24 | void * myurl_callback_malloc(size_t size, void* ctx) 25 | { 26 | return mycore_malloc(size); 27 | } 28 | 29 | void * myurl_callback_realloc(void* value, size_t size, void* ctx) 30 | { 31 | return mycore_realloc(value, size); 32 | } 33 | 34 | void * myurl_callback_free(void* value, void* ctx) 35 | { 36 | mycore_free(value); 37 | return NULL; 38 | } 39 | -------------------------------------------------------------------------------- /source/myurl/punycode.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin avl_treet, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyURL_PUNYCODE_H 22 | #define MyURL_PUNYCODE_H 23 | #pragma once 24 | 25 | #include "myurl/myosi.h" 26 | #include "myhtml/mystring.h" 27 | #include "myencoding/encoding.h" 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | enum myurl_punycode_const { 34 | MyURL_PUNYCODE_CONST_BASE = 36, 35 | MyURL_PUNYCODE_CONST_TMIN = 1, 36 | MyURL_PUNYCODE_CONST_TMAX = 26, 37 | MyURL_PUNYCODE_CONST_SKEW = 38, 38 | MyURL_PUNYCODE_CONST_DAMP = 700, 39 | MyURL_PUNYCODE_CONST_INITIAL_BIAS = 72, 40 | MyURL_PUNYCODE_CONST_INITIAL_N = 0x80, 41 | MyURL_PUNYCODE_CONST_DELIMITER = 0x2D 42 | }; 43 | 44 | #ifdef __cplusplus 45 | } /* extern "C" */ 46 | #endif 47 | 48 | #endif /* MyURL_PUNYCODE_H */ 49 | -------------------------------------------------------------------------------- /source/myurl/scheme_const.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016-2017 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyURL_SCHEME_CONST_H 22 | #define MyURL_SCHEME_CONST_H 23 | #pragma once 24 | 25 | enum myurl_scheme_id { 26 | MyURL_SCHEME_ID_UNDEF = 0x0000, 27 | MyURL_SCHEME_ID_ABOUT = 0x0001, 28 | MyURL_SCHEME_ID_BLOB = 0x0002, 29 | MyURL_SCHEME_ID_DATA = 0x0003, 30 | MyURL_SCHEME_ID_FILE = 0x0004, 31 | MyURL_SCHEME_ID_FILESYSTEM = 0x0005, 32 | MyURL_SCHEME_ID_FTP = 0x0006, 33 | MyURL_SCHEME_ID_GOPHER = 0x0007, 34 | MyURL_SCHEME_ID_HTTP = 0x0008, 35 | MyURL_SCHEME_ID_HTTPS = 0x0009, 36 | MyURL_SCHEME_ID_WS = 0x000a, 37 | MyURL_SCHEME_ID_WSS = 0x000b, 38 | MyURL_SCHEME_ID_LAST_ENTRY = 0x000c 39 | } 40 | typedef myurl_scheme_id_t; 41 | 42 | 43 | #endif /* MyURL_SCHEME_CONST_H */ 44 | -------------------------------------------------------------------------------- /test/mycore/Makefile.mk: -------------------------------------------------------------------------------- 1 | mycore_dirs := utils 2 | mycore_objs := $(call BINARY_UTILS_OBJS,mycore,$(mycore_dirs)) 3 | 4 | mycore_all: $(mycore_objs) 5 | 6 | mycore_clean: 7 | rm -f $(mycore_objs) 8 | -------------------------------------------------------------------------------- /test/mycss/Makefile.mk: -------------------------------------------------------------------------------- 1 | mycss_dirs := . 2 | mycss_objs := $(call BINARY_UTILS_OBJS,mycss,$(mycss_dirs)) 3 | 4 | mycss_all: $(mycss_objs) 5 | 6 | mycss_clean: 7 | rm -f $(mycss_objs) 8 | 9 | mycss_declaration := $(TEST_DIR_RELATIVE)/mycss/data/declaration 10 | -------------------------------------------------------------------------------- /test/mycss/data/declaration/height.html: -------------------------------------------------------------------------------- 1 | 10% 2 | unset 3 | -------------------------------------------------------------------------------- /test/mycss/data/declaration/width.html: -------------------------------------------------------------------------------- 1 | 10% 2 | unset 3 | -------------------------------------------------------------------------------- /test/myencoding/Makefile.mk: -------------------------------------------------------------------------------- 1 | myencoding_dirs := . 2 | myencoding_objs := $(call BINARY_UTILS_OBJS,myencoding,$(myencoding_dirs)) 3 | 4 | myencoding_all: $(myencoding_objs) 5 | 6 | myencoding_clean: 7 | rm -f $(myencoding_objs) 8 | 9 | myencoding_encoding_detect_meta := $(TEST_DIR_RELATIVE)/myencoding/data/encoding/detect_meta.html 10 | -------------------------------------------------------------------------------- /test/myhtml/Makefile.mk: -------------------------------------------------------------------------------- 1 | myhtml_dirs := . 2 | myhtml_objs := $(call BINARY_UTILS_OBJS,myhtml,$(myhtml_dirs)) 3 | 4 | myhtml_all: $(myhtml_objs) 5 | 6 | myhtml_clean: 7 | rm -f $(myhtml_objs) 8 | -------------------------------------------------------------------------------- /test/myurl/Makefile.mk: -------------------------------------------------------------------------------- 1 | myurl_dirs := . 2 | myurl_objs := $(call BINARY_UTILS_OBJS,myurl,$(myurl_dirs)) 3 | 4 | myurl_all: $(myurl_objs) 5 | 6 | myurl_clean: 7 | rm -f $(myurl_objs) 8 | 9 | myurl_url := $(TEST_DIR_RELATIVE)/myurl/data 10 | -------------------------------------------------------------------------------- /test/myurl/data/fragment.test: -------------------------------------------------------------------------------- 1 | type 1 2 | 3 | %URL:http://example.com#hash 4 | %EXPECT:http://example.com/#hash 5 | 6 | %URL:http://example.com/#hash 7 | %EXPECT:http://example.com/#hash 8 | 9 | %URL:http://example.com/path#hash 10 | %EXPECT:http://example.com/path#hash 11 | 12 | %URL:http://example.com/path/#hash 13 | %EXPECT:http://example.com/path/#hash 14 | 15 | %URL:http://example.com/path/#hash万 16 | %EXPECT:http://example.com/path/#hash%E4%B8%87 17 | 18 | %URL:http://example.com/path/#ha万sh 19 | %EXPECT:http://example.com/path/#ha%E4%B8%87sh 20 | 21 | %URL:http://example.com/?abc#hash 22 | %EXPECT:http://example.com/?abc#hash 23 | 24 | %URL:http://example.com/?abc#hash-link 25 | %EXPECT:http://example.com/?abc#hash-link 26 | -------------------------------------------------------------------------------- /test/myurl/data/hostname.test: -------------------------------------------------------------------------------- 1 | type 1 2 | 3 | %URL:http://example.com/ 4 | %EXPECT:http://example.com/ 5 | 6 | %URL:http://example.com./ 7 | %EXPECT:http://example.com./ 8 | 9 | %URL:http://. 10 | %EXPECT:http://./ 11 | 12 | %URL:http://./ 13 | %EXPECT:http://./ 14 | 15 | %URL:https://a. 16 | %EXPECT:https://a./ 17 | 18 | %URL:http://+-****/ 19 | %EXPECT:http://+-****/ 20 | -------------------------------------------------------------------------------- /test/myurl/data/mailto.test: -------------------------------------------------------------------------------- 1 | type 1 2 | 3 | %URL:mailto:addr1 4 | %EXPECT:mailto:addr1 5 | 6 | %URL:mailto:addr1@foo.com 7 | %EXPECT:mailto:addr1@foo.com 8 | 9 | %URL:mailto:addr1 10 | %EXPECT:mailto:addr1 11 | 12 | %URL:mailto:addr1?to=jon 13 | %EXPECT:mailto:addr1?to=jon 14 | 15 | %URL:mailto:addr1,addr2 16 | %EXPECT:mailto:addr1,addr2 17 | 18 | %URL:mailto:addr1, addr2 19 | %EXPECT:mailto:addr1, addr2 20 | 21 | %URL:mailto:addr1%2caddr2 22 | %EXPECT:mailto:addr1%2caddr2 23 | 24 | %URL:mailto:������ 25 | %EXPECT:mailto:%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD 26 | 27 | %URL:mailto:addr1? 28 | %EXPECT:mailto:addr1? 29 | -------------------------------------------------------------------------------- /test/myurl/data/miscellaneous.test: -------------------------------------------------------------------------------- 1 | type 1 2 | 3 | %URL:http://user%40example.com/ 4 | %EXPECT:http://user@example.com/ 5 | 6 | %URL:http://user%3Ainfo%40/ 7 | %EXPECT:http://user:info@/ 8 | 9 | %URL:http://user@/ 10 | %EXPECT: 11 | 12 | %URL:$:foo/bar 13 | %EXPECT: 14 | 15 | %URL:mailto::foo@bar.com 16 | %EXPECT:mailto::foo@bar.com 17 | 18 | %URL:html://lastmac@12345:example.com 19 | %EXPECT: 20 | 21 | %URL:html://lastmac:12345@example.com 22 | %EXPECT:html://lastmac:12345@example.com 23 | 24 | %URL:html://lastmac:1@2345@example.com 25 | %EXPECT:html://lastmac:1%402345@example.com 26 | 27 | %URL:html://lastmac:1@2345@@example.com 28 | %EXPECT:html://lastmac:1%402345%40@example.com 29 | 30 | %URL:html://lastmac:@1@2345@@example.com 31 | %EXPECT:html://lastmac:%401%402345%40@example.com 32 | 33 | %URL:html://:@1@2345@@example.com 34 | %EXPECT:html://:%401%402345%40@example.com 35 | 36 | %URL:html://:@example.com 37 | %EXPECT:html://example.com 38 | 39 | %URL:html://lastmac:@example.com 40 | %EXPECT:html://lastmac@example.com 41 | 42 | %URL:html://lastmac:::::123@example.com 43 | %EXPECT:html://lastmac:%3A%3A%3A%3A123@example.com 44 | -------------------------------------------------------------------------------- /test/myurl/data/port.test: -------------------------------------------------------------------------------- 1 | type 1 2 | 3 | %URL:http://www.example.com:hahaha/ 4 | %EXPECT: 5 | 6 | %URL:http://www.example.com: hah aha/ 7 | %EXPECT: 8 | 9 | %URL:http://www.example.com:-1/ 10 | %EXPECT: 11 | 12 | %URL:http://www.example.com:-1/ 13 | %EXPECT: 14 | 15 | %URL:http://www.example.com:123/ 16 | %EXPECT:http://www.example.com:123/ 17 | 18 | %URL:http://www.example.com:80/ 19 | %EXPECT:http://www.example.com/ 20 | 21 | %URL:http://www.example.com:/ 22 | %EXPECT:http://www.example.com/ 23 | 24 | %URL:http://www.example.com:/ 25 | %EXPECT:http://www.example.com/ 26 | 27 | %URL:http://www.example.com:15615156165165165/ 28 | %EXPECT: 29 | 30 | %URL:https://www.example.com:443/ 31 | %EXPECT:https://www.example.com/ 32 | 33 | %URL:https://www.example.com:442/ 34 | %EXPECT:https://www.example.com:442/ 35 | -------------------------------------------------------------------------------- /test/myurl/data/query.test: -------------------------------------------------------------------------------- 1 | type 1 2 | 3 | %URL:http://example.com?abc 4 | %EXPECT:http://example.com/?abc 5 | 6 | %URL:http://example.com/?abc 7 | %EXPECT:http://example.com/?abc 8 | 9 | %URL:http://example.com/?key=value 10 | %EXPECT:http://example.com/?key=value 11 | 12 | %URL:http://example.com/?key=value&hohoho=hahaha 13 | %EXPECT:http://example.com/?key=value&hohoho=hahaha 14 | 15 | %URL:http://example.com/?key=val ue 16 | %EXPECT:http://example.com/?key=val%20ue 17 | 18 | %URL:http://example.com/?key=val万ue 19 | %EXPECT:http://example.com/?key=val%E4%B8%87ue 20 | 21 | %URL:http://example.com/?key=v 22 | al万u e 23 | %EXPECT:http://example.com/?key=val%E4%B8%87ue 24 | 25 | %URL:http://example.com/?abc#hash 26 | %EXPECT:http://example.com/?abc#hash 27 | -------------------------------------------------------------------------------- /test/myurl/data/relative_win.test: -------------------------------------------------------------------------------- 1 | type 3 2 | 3 | %URL:http://host/ 4 | %BASE:file:///C:/foo 5 | %EXPECT:http://host/ 6 | 7 | %URL:bar 8 | %BASE:file:///C:/foo 9 | %EXPECT:file:///C:/bar 10 | 11 | %URL:../../../bar.html 12 | %BASE:file:///C:/foo 13 | %EXPECT:file:///bar.html 14 | 15 | %URL:/../bar.html 16 | %BASE:file:///C:/foo 17 | %EXPECT:file:///C:/bar.html 18 | 19 | %URL:\\\\another\\path 20 | %BASE:http://host/a 21 | %EXPECT:http://another//path 22 | 23 | %URL://c:/foo 24 | %BASE:file:///C:/something 25 | %EXPECT:file:///c:/foo 26 | 27 | %URL://localhost/c:/foo 28 | %BASE:file:///C:/something 29 | %EXPECT:file:///c:/foo 30 | 31 | %URL:c: 32 | %BASE:file:///C:/foo 33 | %EXPECT:c: 34 | 35 | %URL:c:/foo 36 | %BASE:file:///C:/foo 37 | %EXPECT:c:/foo 38 | 39 | %URL:c:\\foo 40 | %BASE:http://host/a 41 | %EXPECT:c:\\foo 42 | 43 | %URL:/z:/bar 44 | %BASE:file:///C:/foo 45 | %EXPECT:file:///C:/z:/bar 46 | 47 | %URL:/bar 48 | %BASE:file:///C:/foo 49 | %EXPECT:file:///C:/bar 50 | 51 | %URL:/bar 52 | %BASE:file://localhost/C:/foo 53 | %EXPECT:file:///C:/bar 54 | 55 | %URL:/bar 56 | %BASE:file:///localhost/C:/foo 57 | %EXPECT:file:///bar 58 | 59 | %URL:/bar 60 | %BASE:file:///localhost/C:/foo 61 | %EXPECT:file:///bar 62 | 63 | %URL:bar 64 | %BASE:file:///localhost/C:/foo 65 | %EXPECT:file:///localhost/C:/bar 66 | 67 | %URL:/bar 68 | %BASE:file:///C:/foo/com/ 69 | %EXPECT:file:///C:/bar 70 | 71 | %URL://somehost/path 72 | %BASE:file:///C:/something 73 | %EXPECT:file://somehost/path 74 | 75 | %URL:/\\//somehost/path 76 | %BASE:file:///C:/something 77 | %EXPECT:file://///somehost/path 78 | -------------------------------------------------------------------------------- /third_party/font/Arkhip.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lexborisov/Modest/2540a03259fc62fe15f47e85c20b2eedd5af66de/third_party/font/Arkhip.otf -------------------------------------------------------------------------------- /third_party/font/Arkhip.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lexborisov/Modest/2540a03259fc62fe15f47e85c20b2eedd5af66de/third_party/font/Arkhip.ttf -------------------------------------------------------------------------------- /third_party/font/readme.txt: -------------------------------------------------------------------------------- 1 | Free Font 2 | From: http://arkhipfont.ru/ 3 | -------------------------------------------------------------------------------- /utils/MyCSS/data/an+b.txt: -------------------------------------------------------------------------------- 1 | = | | | | | | | [ | ] | | | | | [ | ] | | | | | [ | ] 2 | -------------------------------------------------------------------------------- /utils/MyCSS/data/begin.txt: -------------------------------------------------------------------------------- 1 | = | 2 | 3 | = ? [ | ] 4 | = 5 | 6 | = | | | | | 7 | = | ? 8 | = ? 9 | = ? 10 | = 11 | = 12 | = <[-token ws> <]-token ws> | <[-token ws> [ | ] ? <]-token ws> 13 | = | | | | | 14 | = 15 | = | <)-token ws> 16 | = 17 | -------------------------------------------------------------------------------- /utils/MyCSS/data/media.txt: -------------------------------------------------------------------------------- 1 | = | [ | ]? [ ]? 2 | = 3 | 4 | = | | | 5 | = | | 6 | = 7 | = [ ]+ 8 | = [ ]+ 9 | = <(-token ws> <)-token ws> | | 10 | 11 | = <(-token ws> [ | | ] <)-token ws> 12 | = 13 | = 14 | = [ | ]? ? | [ | ]? ? | ? ? | ? ? 15 | = 16 | = | | | 17 | 18 | = <)-token> | <(-token ws> <)-token ws> -------------------------------------------------------------------------------- /utils/MyCSS/data/namespace.txt: -------------------------------------------------------------------------------- 1 | = ? [ | ] 2 | = 3 | -------------------------------------------------------------------------------- /utils/MyCSS/data/rules.txt: -------------------------------------------------------------------------------- 1 | = <}-token ws> 2 | -------------------------------------------------------------------------------- /utils/MyCSS/data/selectors_grammar.txt: -------------------------------------------------------------------------------- 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 | = 'i' 40 | 41 | = ':' | 42 | ':' ')' 43 | 44 | = ':' -------------------------------------------------------------------------------- /utils/MyCSS/data/units.txt: -------------------------------------------------------------------------------- 1 | length-relative: em, ex, ch, ic, rem, vw, vh, vi, vb, vmin, vmax 2 | length-absolute: cm, mm, q, in, pt, pc, px 3 | angel: deg, grad, rad, turn 4 | time: s, ms 5 | frequency: Hz, kHz 6 | resolution: dpi, dpcm, dppx 7 | -------------------------------------------------------------------------------- /utils/MyCSS/tmpl/color_const.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2015-2016 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyCSS_VALUES_COLOR_CONST_H 22 | #define MyCSS_VALUES_COLOR_CONST_H 23 | #pragma once 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | %BODY% 30 | 31 | #ifdef __cplusplus 32 | } /* extern "C" */ 33 | #endif 34 | 35 | #endif /* MyCSS_VALUES_COLOR_CONST_H */ 36 | 37 | 38 | -------------------------------------------------------------------------------- /utils/MyCSS/tmpl/color_resources.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyCSS_VALUES_COLOR_RESOURCES_H 22 | #define MyCSS_VALUES_COLOR_RESOURCES_H 23 | #pragma once 24 | 25 | %DEFINED% 26 | 27 | %BODY% 28 | 29 | #endif /* MyCSS_VALUES_COLOR_RESOURCES_H */ 30 | -------------------------------------------------------------------------------- /utils/MyCSS/tmpl/declaration_default_resources.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyCSS_DECLARATION_DEFAULT_RESOURCES_H 22 | #define MyCSS_DECLARATION_DEFAULT_RESOURCES_H 23 | #pragma once 24 | 25 | #include "mycss/declaration/default_entries.h" 26 | 27 | %BODY% 28 | 29 | #endif /* MyCSS_DECLARATION_DEFAULT_RESOURCES_H */ 30 | -------------------------------------------------------------------------------- /utils/MyCSS/tmpl/declaration_destroy_resources.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyCSS_DECLARATION_ENTRY_DESTROY_RESOURCES_H 22 | #define MyCSS_DECLARATION_ENTRY_DESTROY_RESOURCES_H 23 | #pragma once 24 | 25 | %BODY% 26 | 27 | #endif /* MyCSS_DECLARATION_ENTRY_DESTROY_RESOURCES_H */ 28 | -------------------------------------------------------------------------------- /utils/MyCSS/tmpl/declaration_serialization_resources.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyHTML_MyCSS_DECLARATION_SERIALIZATION_RESOURCES_H 22 | #define MyHTML_MyCSS_DECLARATION_SERIALIZATION_RESOURCES_H 23 | #pragma once 24 | 25 | %BODY% 26 | 27 | #endif /* MyHTML_MyCSS_DECLARATION_SERIALIZATION_RESOURCES_H */ 28 | -------------------------------------------------------------------------------- /utils/MyCSS/tmpl/image_resources.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyCSS_VALUES_IMAGE_RESOURCES_H 22 | #define MyCSS_VALUES_IMAGE_RESOURCES_H 23 | #pragma once 24 | 25 | %DEFINED% 26 | 27 | %BODY% 28 | 29 | #endif /* MyCSS_VALUES_IMAGE_RESOURCES_H */ 30 | -------------------------------------------------------------------------------- /utils/MyCSS/tmpl/property_const.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2015-2016 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyHTML_MyCSS_PROPERTY_CONST_H 22 | #define MyHTML_MyCSS_PROPERTY_CONST_H 23 | #pragma once 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | %BODY% 30 | 31 | #ifdef __cplusplus 32 | } /* extern "C" */ 33 | #endif 34 | 35 | #endif /* MyHTML_MyCSS_PROPERTY_CONST_H */ 36 | 37 | 38 | -------------------------------------------------------------------------------- /utils/MyCSS/tmpl/property_resources.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyHTML_MyCSS_PROPERTY_RESOURCES_H 22 | #define MyHTML_MyCSS_PROPERTY_RESOURCES_H 23 | #pragma once 24 | 25 | %DEFINED% 26 | 27 | %BODY% 28 | 29 | #endif /* MyHTML_MyCSS_PROPERTY_RESOURCES_H */ 30 | -------------------------------------------------------------------------------- /utils/MyCSS/tmpl/property_resources_name.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyCSS_PROPERTY_RESOURCES_NAME_H 22 | #define MyCSS_PROPERTY_RESOURCES_NAME_H 23 | #pragma once 24 | 25 | %BODY% 26 | 27 | #endif /* MyCSS_PROPERTY_RESOURCES_NAME_H */ 28 | -------------------------------------------------------------------------------- /utils/MyHTML/forall.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | BEGIN { 4 | use FindBin; 5 | push @INC, $FindBin::Bin. "/../ext/"; 6 | }; 7 | 8 | use utf8; 9 | use strict; 10 | use MyHTML::Base; 11 | 12 | my $utils = MyHTML::Base->new(); 13 | 14 | my $enum = q~ 15 | xlink:actuate xlink actuate XLink namespace 16 | xlink:arcrole xlink arcrole XLink namespace 17 | xlink:href xlink href XLink namespace 18 | xlink:role xlink role XLink namespace 19 | xlink:show xlink show XLink namespace 20 | xlink:title xlink title XLink namespace 21 | xlink:type xlink type XLink namespace 22 | xml:lang xml lang XML namespace 23 | xml:space xml space XML namespace 24 | xmlns (none) xmlns XMLNS namespace 25 | xmlns:xlink xmlns xlink XMLNS namespace 26 | 27 | ~; 28 | 29 | my @list; my $count = 0; 30 | foreach my $line (split /\n/, $enum) { 31 | $line =~ s/^\s+//; 32 | $line =~ s/\s+$//; 33 | next if $line eq ""; 34 | 35 | my ($key, $prefix, $value, $namespace) = split /\t/, $line; 36 | 37 | print "{\"$key\", ", length($key), ", \"$value\", ", length($value), "},\n"; 38 | } 39 | 40 | -------------------------------------------------------------------------------- /utils/MyHTML/tmpl/default_resources.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MODEST_STYLE_DEFAULT_RESOURCES_H 22 | #define MODEST_STYLE_DEFAULT_RESOURCES_H 23 | #pragma once 24 | 25 | %BODY% 26 | 27 | #endif /* MODEST_STYLE_DEFAULT_RESOURCES_H */ 28 | -------------------------------------------------------------------------------- /utils/MyHTML/tmpl/tag_const.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2015-2016 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyHTML_TAG_CONST_H 22 | #define MyHTML_TAG_CONST_H 23 | #pragma once 24 | 25 | %DEFINED% 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | enum myhtml_tags { 32 | %BODY% 33 | }; 34 | 35 | #ifdef __cplusplus 36 | } /* extern "C" */ 37 | #endif 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /utils/MyHTML/tmpl/url_resources.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyHTML_URL_RESOURCES_H 22 | #define MyHTML_URL_RESOURCES_H 23 | #pragma once 24 | 25 | %BODY% 26 | #endif /* MyHTML_URL_RESOURCES_H */ 27 | -------------------------------------------------------------------------------- /utils/MyHTML/tmpl/url_scheme_const.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyHTML_URL_SCHEME_CONST_H 22 | #define MyHTML_URL_SCHEME_CONST_H 23 | #pragma once 24 | 25 | %BODY% 26 | 27 | #endif /* MyHTML_URL_SCHEME_CONST_H */ 28 | -------------------------------------------------------------------------------- /utils/MyHTML/tmpl/url_scheme_resources.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016 Alexander Borisov 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | Author: lex.borisov@gmail.com (Alexander Borisov) 19 | */ 20 | 21 | #ifndef MyHTML_URL_SCHEME_RESOURCES_H 22 | #define MyHTML_URL_SCHEME_RESOURCES_H 23 | #pragma once 24 | 25 | #define %DEFINE% 26 | 27 | %BODY% 28 | 29 | #endif /* MyHTML_URL_SCHEME_RESOURCES_H */ 30 | --------------------------------------------------------------------------------