diff --git a/docs/gen_dots.sh b/docs/gen_dots.sh index 1fe1d1679..5727c91a0 100755 --- a/docs/gen_dots.sh +++ b/docs/gen_dots.sh @@ -1,3 +1,6 @@ dot dots/* -Tpng -O mv dots/*.png images +dot dots/* -Tsvg -O +mv dots/*.svg images + diff --git a/docs/images/api_idl_usage.svg b/docs/images/api_idl_usage.svg new file mode 100644 index 000000000..575a892a9 --- /dev/null +++ b/docs/images/api_idl_usage.svg @@ -0,0 +1,95 @@ + + + + + + +G + + +idl + +JSON格式的IDL + + +quickjs + +QuickJS 绑定 + + +idl->quickjs + + +quickjs代码生成器 + + +jerryscript + +JerryScript 绑定 + + +idl->jerryscript + + +jerryscript代码生成器 + + +lua + +LUA 绑定 + + +idl->lua + + +lua代码生成器 + + +web + +WEB API + + +idl->web + + +web代码生成器 + + +other + +其它语言绑定 + + +idl->other + + +其它代码生成器 + + +doc + +文档 + + +idl->doc + + +文档生成工具 + + +comment + +API 注释 + + +comment->idl + + +注释提取工具 + + + diff --git a/docs/images/assets_overview.svg b/docs/images/assets_overview.svg new file mode 100644 index 000000000..ce616f1dc --- /dev/null +++ b/docs/images/assets_overview.svg @@ -0,0 +1,116 @@ + + + + + + +UML + +clusterAssetsManager + + + +asset_info_t + +asset_info_t + ++name ++data ++size ++type ++subtype + + +assets_manager_t + +assets_manager_t + + +assets_manager_t->asset_info_t + + + +fs + +fs + + +assets_manager_t->fs + + + + +rom_data + +rom_data + + +assets_manager_t->rom_data + + + + +network + +network + + +assets_manager_t->network + + + + +locale_info_t + +locale_info_t + + +locale_info_t->assets_manager_t + + + + +font_manager_t + +font_manager_t + + +font_manager_t->assets_manager_t + + + + +image_manager_t + +image_manager_t + + +image_manager_t->assets_manager_t + + + + +theme_t + +theme_t + + +theme_t->assets_manager_t + + + + +ui_loader_t + +ui_loader_t + + +ui_loader_t->assets_manager_t + + + + + diff --git a/docs/images/font_overview.svg b/docs/images/font_overview.svg new file mode 100644 index 000000000..3afd8a1d8 --- /dev/null +++ b/docs/images/font_overview.svg @@ -0,0 +1,109 @@ + + + + + + +G + +clusterFontManager + + + +glyph_t + +glyph_t + ++x ++y ++w ++h ++data + + +font_t + +font_t + ++match(...) ++find_glyph(...) : glyph_t + + +glyph_t->font_t + + + + +font_manager_t + +font_manager_t + ++get_font(...) : font_t + + +font_t->font_manager_t + + + +font_loader_t + +font_loader_t + ++load(...) : font_t + + +font_loader_t->font_t + + +load + + +font_loader_t->font_manager_t + + + +canvas_t + +canvas_t + + +canvas_t->font_manager_t + + +get_font + + +font_loader_ft_t + +font_loader_ft_t + + +font_loader_ft_t->font_loader_t + + + + +font_loader_stb_t + +font_loader_stb_t + + +font_loader_stb_t->font_loader_t + + + + +font_loader_bitmap_t + +font_loader_bitmap_t + + +font_loader_bitmap_t->font_loader_t + + + + + diff --git a/docs/images/idle_overview.svg b/docs/images/idle_overview.svg new file mode 100644 index 000000000..2b71a3ea0 --- /dev/null +++ b/docs/images/idle_overview.svg @@ -0,0 +1,28 @@ + + + + + + +UML + + +idle_t + +idle_t + + +idle_info_t + +idle_info_t + + +idle_t->idle_info_t + + + + + diff --git a/docs/images/image_overview.svg b/docs/images/image_overview.svg new file mode 100644 index 000000000..e0a8892cd --- /dev/null +++ b/docs/images/image_overview.svg @@ -0,0 +1,60 @@ + + + + + + +UML + +clusterImageManager + + + +bitmap_t + +bitmap_t + ++x ++y ++w ++h ++data + + +image_manager_t + +image_manager_t + ++ get_bitmap(...) + + +image_manager_t->bitmap_t + + + +image_loader_t + +image_loader_t + ++ load(...) + + +image_loader_t->image_manager_t + + + + +image_loader_stb_t + +image_loader_stb_t + + +image_loader_stb_t->image_loader_t + + + + + diff --git a/docs/images/input_method_overview.svg b/docs/images/input_method_overview.svg new file mode 100644 index 000000000..2bd5a1044 --- /dev/null +++ b/docs/images/input_method_overview.svg @@ -0,0 +1,99 @@ + + + + + + +UML + +cluster_1 + + + +input_method_t + +input_method_t + + +edit_t + +edit_t + + +input_method_t->edit_t + + + +input_engine_t + +input_engine_t + + +input_method_t->input_engine_t + + + + +input_method_default_t + +input_method_default_t + + +input_method_default_t->input_method_t + + + + +input_method_sdl_t + +input_method_sdl_t + + +input_method_sdl_t->input_method_t + + + + +input_method_null_t + +input_method_null_t + + +input_method_null_t->input_method_t + + + + +input_engine_pinyin_t + +input_engine_pinyin_t + + +input_engine_pinyin_t->input_engine_t + + + + +input_engine_null_t + +input_engine_null_t + + +input_engine_null_t->input_engine_t + + + + +keyboard_t + +keyboard_t + + +keyboard_t->input_method_default_t + + + + diff --git a/docs/images/layout_children_layouter.svg b/docs/images/layout_children_layouter.svg new file mode 100644 index 000000000..2cc9ea6c9 --- /dev/null +++ b/docs/images/layout_children_layouter.svg @@ -0,0 +1,71 @@ + + + + + + +G + +clusterFontManager + + + +children_layouter_factory + +children_layouter_factory + + +children_layouter + +children_layouter + + +children_layouter_factory->children_layouter + + + + +children_layouter_default + +children_layouter_default + + +children_layouter_default->children_layouter + + + + +children_layouter_list_view + +children_layouter_list_view + + +children_layouter_list_view->children_layouter + + + + +children_layouter_flex + +children_layouter_flex + + +children_layouter_flex->children_layouter + + + + +children_layouter_xxx + +children_layouter_xxx + + +children_layouter_xxx->children_layouter + + + + + diff --git a/docs/images/layout_overview.svg b/docs/images/layout_overview.svg new file mode 100644 index 000000000..b749dd180 --- /dev/null +++ b/docs/images/layout_overview.svg @@ -0,0 +1,38 @@ + + + + + + +G + + +self_layout + +self_layout + + +widget_t + +widget_t + + +self_layout->widget_t + + + + +children_layout + +children_layout + + +children_layout->widget_t + + + + + diff --git a/docs/images/layout_self_layouter.svg b/docs/images/layout_self_layouter.svg new file mode 100644 index 000000000..c4ef28680 --- /dev/null +++ b/docs/images/layout_self_layouter.svg @@ -0,0 +1,66 @@ + + + + + + +G + +clusterFontManager + + + +self_layouter_default + +self_layouter_default + + +self_layouter + +self_layouter + + +self_layouter_default->self_layouter + + + + +self_layouter_default->self_layouter + + + + +self_layouter_menu + +self_layouter_menu + + +self_layouter_menu->self_layouter + + + + +self_layouter_flex + +self_layouter_flex + + +self_layouter_flex->self_layouter + + + + +self_layouter_xxx + +self_layouter_xxx + + +self_layouter_xxx->self_layouter + + + + + diff --git a/docs/images/style_overview.svg b/docs/images/style_overview.svg new file mode 100644 index 000000000..d88f76146 --- /dev/null +++ b/docs/images/style_overview.svg @@ -0,0 +1,81 @@ + + + + + + +UML + +cluster_1 + + +cluster_0 + + + +style_t + +style_t + + +widget_t + +widget_t + + +style_t->widget_t + + + +style_factory_t + +style_factory_t + + +style_factory_t->style_t + + + + +style_factory_t->widget_t + + + +style_const_t + +style_const_t + + +style_const_t->style_t + + + + +style_mutable_t + +style_mutable_t + + +style_const_t->style_mutable_t + + + + +style_mutable_t->style_t + + + + +theme_t + +theme_t + + +theme_t->style_const_t + + + + diff --git a/docs/images/timer_overview.svg b/docs/images/timer_overview.svg new file mode 100644 index 000000000..2685c221e --- /dev/null +++ b/docs/images/timer_overview.svg @@ -0,0 +1,28 @@ + + + + + + +UML + + +timer_t + +timer_t + + +timer_info_t + +timer_info_t + + +timer_t->timer_info_t + + + + + diff --git a/docs/images/ui_loader_overview.svg b/docs/images/ui_loader_overview.svg new file mode 100644 index 000000000..6b8993be5 --- /dev/null +++ b/docs/images/ui_loader_overview.svg @@ -0,0 +1,89 @@ + + + + + + +UML + +cluster_1 + + + +ui_builder_t + +ui_builder_t + ++on_start(...) ++on_widget_start(...) ++on_widget_prop(...) ++on_widget_end(...) ++on_end(...) + + +ui_loader_t + +ui_loader_t + ++load(...) + + +ui_loader_t->ui_builder_t + + + + +ui_loader_default_t + +ui_loader_default_t + + +ui_loader_default_t->ui_loader_t + + + + +ui_loader_xml_t + +ui_loader_xml_t + + +ui_loader_xml_t->ui_loader_t + + + + +ui_builder_default_t + +ui_builder_default_t + + +ui_builder_default_t->ui_builder_t + + + + +ui_xml_writer_t + +ui_xml_writer_t + + +ui_xml_writer_t->ui_builder_t + + + + +ui_binary_writer_t + +ui_binary_writer_t + + +ui_binary_writer_t->ui_builder_t + + + + + diff --git a/docs/images/widget_overview.svg b/docs/images/widget_overview.svg index 5aeee4237..40cea6671 100644 --- a/docs/images/widget_overview.svg +++ b/docs/images/widget_overview.svg @@ -1,366 +1,588 @@ - - - + + G - + edit_t - - -edit_t - + +edit_t -widget_t - -widget_t +widget_t + +widget_t -edit_t->widget_t - - +edit_t->widget_t + + -image_base_t - - -image_base_t - +image_base_t + +image_base_t -image_base_t->widget_t - - +image_base_t->widget_t + + -window_base_t - - -window_base_t - +window_base_t + +window_base_t -window_base_t->widget_t - - +window_base_t->widget_t + + -label_t - - -label_t - +label_t + +label_t -label_t->widget_t - - +label_t->widget_t + + -button_t - - -button_t - +button_t + +button_t -button_t->widget_t - - +button_t->widget_t + + -color_tile_t - - -color_tile_t - +color_tile_t + +color_tile_t -color_tile_t->widget_t - - +color_tile_t->widget_t + + -combo_box_item_t - - -combo_box_item_t - +combo_box_item_t + +combo_box_item_t -combo_box_item_t->widget_t - - +combo_box_item_t->widget_t + + -slider_t - - -slider_t - +slider_t + +slider_t -slider_t->widget_t - - +slider_t->widget_t + + -progress_bar_t - - -progress_bar_t - +progress_bar_t + +progress_bar_t -progress_bar_t->widget_t - - +progress_bar_t->widget_t + + -app_bar_t - - -app_bar_t - +app_bar_t + +app_bar_t -app_bar_t->widget_t - - +app_bar_t->widget_t + + + + +app_bar_t->widget_t + + -row_t - - -row_t - +row_t + +row_t -row_t->widget_t - - +row_t->widget_t + + -column_t - - -column_t - +column_t + +column_t -column_t->widget_t - - +column_t->widget_t + + -grid_t - - -grid_t - +grid_t + +grid_t -grid_t->widget_t - - +grid_t->widget_t + + -grid_item_t - - -grid_item_t - +grid_item_t + +grid_item_t -grid_item_t->widget_t - - +grid_item_t->widget_t + + -group_box_t - - -group_box_t - +group_box_t + +group_box_t -group_box_t->widget_t - - +group_box_t->widget_t + + + + +group_box_t->widget_t + + -view_t - - -view_t - +view_t + +view_t -view_t->widget_t - - +view_t->widget_t + + -button_group_t - - -button_group_t - +button_group_t + +button_group_t -button_group_t->widget_t - - +button_group_t->widget_t + + -dialog_title_t - - -dialog_title_t - +dialog_title_t + +dialog_title_t -dialog_title_t->widget_t - - +dialog_title_t->widget_t + + -dialog_client_t - - -dialog_client_t - +dialog_client_t + +dialog_client_t -dialog_client_t->widget_t - - +dialog_client_t->widget_t + + -window_t - - -window_t - +window_t + +window_t -window_t->window_base_t - - +window_t->window_base_t + + -popup_t - - -popup_t - +popup_t + +popup_t -popup_t->window_base_t - - +popup_t->window_base_t + + -dialog_t - - -dialog_t - +dialog_t + +dialog_t -dialog_t->window_base_t - - +dialog_t->window_base_t + + -calibration_win_t - - -calibration_win_t - +calibration_win_t + +calibration_win_t -calibration_win_t->window_base_t - - +calibration_win_t->window_base_t + + -system_bar_t - - -system_bar_t - +system_bar_t + +system_bar_t -system_bar_t->window_base_t - - +system_bar_t->window_base_t + + + + +overlay_t + +overlay_t + + +overlay_t->window_base_t + + -image_t - - -image_t - +image_t + +image_t -image_t->image_base_t - - +image_t->image_base_t + + -gif_image_t - - -gif_image_t - +gif_image_t + +gif_image_t -gif_image_t->image_base_t - - +gif_image_t->image_base_t + + -svg_image_t - - -svg_image_t - +svg_image_t + +svg_image_t -svg_image_t->image_base_t - - +svg_image_t->image_base_t + + -combo_box_t - - -combo_box_t - +combo_box_t + +combo_box_t -combo_box_t->edit_t - - +combo_box_t->edit_t + + -spin_box_t - - -spin_box_t - +spin_box_t + +spin_box_t -spin_box_t->edit_t - - +spin_box_t->edit_t + + + + +tab_control_t + +tab_control_t + + +tab_control_t->widget_t + + + + +tab_button_t + +tab_button_t + + +tab_button_t->widget_t + + + + +tab_button_group_t + +tab_button_group_t + + +tab_button_group_t->widget_t + + + + +canvas_widget_t + +canvas_widget_t + + +canvas_widget_t->widget_t + + + + +color_picker_t + +color_picker_t + + +color_picker_t->widget_t + + + + +guage_t + +guage_t + + +guage_t->widget_t + + + + +guage_pointer_t + +guage_pointer_t + + +guage_pointer_t->widget_t + + + + +image_animation_t + +image_animation_t + + +image_animation_t->widget_t + + + + +image_value_t + +image_value_t + + +image_value_t->widget_t + + + + +keyboard_t + +keyboard_t + + +keyboard_t->widget_t + + + + +progress_circle_t + +progress_circle_t + + +progress_circle_t->widget_t + + + + +rich_text_t + +rich_text_t + + +rich_text_t->widget_t + + + + +slide_menu_t + +slide_menu_t + + +slide_menu_t->widget_t + + + + +slide_view_t + +slide_view_t + + +slide_view_t->widget_t + + + + +switch_t + +switch_t + + +switch_t->widget_t + + + + +text_selector_t + +text_selector_t + + +text_selector_t->widget_t + + + + +time_clock_t + +time_clock_t + + +time_clock_t->widget_t + + + + +digit_clock_t + +digit_clock_t + + +digit_clock_t->widget_t + + + + +list_view_t + +list_view_t + + +list_view_t->widget_t + + + + +list_view_h_t + +list_view_h_t + + +list_view_h_t->widget_t + + + + +list_item_t + +list_item_t + + +list_item_t->widget_t + + + + +scroll_bar_t + +scroll_bar_t + + +scroll_bar_t->widget_t + + + + +scroll_view_t + +scroll_view_t + + +scroll_view_t->widget_t + + + + +mledit_t + +mledit_t + + +mledit_t->widget_t + + + + +slide_indicator_t + +slide_indicator_t + + +slide_indicator_t->widget_t + + + + +line_number_t + +line_number_t + + +line_number_t->widget_t + + diff --git a/docs/script_binding.md b/docs/script_binding.md index 8ed0a861a..a36469f3e 100644 --- a/docs/script_binding.md +++ b/docs/script_binding.md @@ -17,7 +17,7 @@ 基于以上这些原因,我决定自己实现[AWTK](https://github.com/zlgopen/awtk)的脚本绑定机制。它的实现原理如下:用特定格式的API注释来描述要脚本化的API,用一个名为gen\_idl的工具把注释提取出来生成JSON的接口描述文件,然后用不同的代码产生器生成对应语言的绑定: -![1](images/api_idl_usage.png) +![1](images/api_idl_usage.svg) ### 参考