LCUI 2.0 release, C graphical interface development library

LCUI 2.0 was released. LCUI is a C language GUI development library that can be used to build a simple desktop application.

Update Summary

Bug fixes

  • builder:  Comment node should be ignored ( 460ee00 )
  • css:  using the value (uninitialized 44486f1 )
  • font:  font path to get the error ( # 187 ) ( 6d54685 )
  • font:  FontBitmap_Free () memory leak ( c47a6c0 )
  • gui:  root part is missing hover and active state ( 02c03c7 )
  • gui:  segmentation fault occurs when you resize an empty window ( # 199 ) ( 56ce0b5 )
  • the GUI:  TextCaret should remove the timer (after the destruction of a58b12d )
  • Linux:  InitLinuxKeybord () memory leak ( 61cadc8 )
  • timer:  After removing the timer, its callback will still be executed ( 43233b3 )
  • util:  dict type is not exported correctly ( 20abb19 )
  • windows:  not enabled by default touch support ( bc7710a )
  • Correct use of variables ( 513b3b9 )
  • The cursor position should be updated prior to the event processing section ( 83fc949 )

Refactoring

  • gui:  Add widget_background.h ( d69fbb0 )
  • gui:  Add widget_border.h ( 843232e )
  • gui:  Add widget_shadow.h ( 08ed51c )
  • gui:  Improved update process means ( 1a50aec )

new function

  • builder:  Output (For details on error f7ed3b8 )
  • css:  Add flexbox related properties parser ( 07d2911 )
  • display: 添加 LCUIDisplay_EnablePaintFlashing() (298ffa4)
  • display:  Flashing rendered rectangular area ( # 180 [ ) ( # 190 ) ( 5ad4fec )
  • display:  Set the minimum screen size is 320x240 ( 317df70 )
  • gui:  Add CSSFontStyle_IsEquals () ( 80d4149 )
  • gui:  adding an elastic box layout ( 3cbb246 )
  • gui:  parameters and timing of change runtask call on the part prototype () method ( f058916 )
  • gui:  rewriting system member layout ( 24e89aa )
  • gui:  scroll member will be destroyed after the container is reset ( 61e0f2c )
  • gui:  setting the pitch of the container (when the scroll bar is visible a436f41 )
  • the GUI:  unwrap () will is not sub-components to link and unlink trigger event ( 48344bc )
  • gui:  update rule change size TextView ( ea7e9d2 )
  • util:  using inline function instead of global variables ( 0991d14 )

Performance Improvements

  • display:  Main window size changed without the addition of an invalid region ( b0985a2 )
  • Run the display:  OpenMP will only render large areas enabled ( 1e57d9d )
  • gui:  invalid region of the collecting member improved manner ( e9ea262 )
  • gui:  Improved update process TextEdit member ( bbb7cbc )
  • gui:  Improved update process TextView member ( 6,824,735 )
  • Rendering is added OpenMP support member ( # 1 18 ) ( # 189 ) ( d858333 )
  • Improved collection methods ineffective area surface (Surface) a ( c81da29 )

Incompatible changes

  • util: DictType_StringKey  and  DictType_StringCopyKey have switched to the inline function instead of
  • display:  removed  LCUIDisplay_ShowRectBorder() and LCUIDisplay_HideRectBorder()
  • gui:  shadow user interface element has been changed to private
  • gui:  background operation of the interface member has been changed to private
  • gui:  Border operation of the interface member has been changed to private
  • GUI:  the TextView member must be operated at the UI thread
  • GUI:  runTask the prototype member () method takes two parameters, and will be called after each task to be processed
  • gui:  Some user interface components have been removed or renamed

Release Notes

Performance Optimization

New OpenMP support, rewrite component update, layout and dirty rectangle gathering process, the following is a detailed test report:

  • CPU: Intel Core i5 8300H @ 2.30GHz
  • Operating System:  Windows 10
  • Test program:  the Test / test_render.c
  • Test Content:  rendering a dynamic picture 600 1600x900, member 3600 comprises a transparent black mask layer
  • Test Results:
    • Open OpenMP support: takes 11.96 seconds, an average of 50.15 per second rendering, CPU usage of about 88%
    • OpenMP support is not turned on: takes 13.71 seconds, an average of 43.76 per second rendering, CPU usage by about 30%

test_render

Flex layout

LCUI Router App  interface higher demands on the layout of the system, some elements of the interface with adaptive features size, suitable for use Flex layout to achieve, but before LCUI layout system too simple to achieve this layout, to this end, the new version flex introduced a new layout system, support the use of flex-basis, flex-direction, flex-shrink, flex-grow, justify-content, align-items property control arrangement. The following is a test program results:

test_flex_layout

用浏览器打开 test/test_flex_layout.html 文件可对比 LCUI 和浏览器的 flex 布局效果。

需要注意的是,这个布局系统并不完善,由于前期设计考虑不够全面,在经过后续增加的各种布局测试后,布局规则已经变得有些混乱,目前只能保证测试程序内的布局能够得到预期的效果,有待后续重构。

社区动态

本次更新共计支出 71 美元用于悬赏,接受来自贡献者的 6 个拉取请求(Pull Request),新增 3 位贡献者:d4yvectormaximelkinvbalyasnyy。由于悬赏平台是国外的,其国外用户占比很高,这点数额的悬赏对国外开发者而言吸引力较低,要是国内也有面向开源项目的悬赏平台的话,或许就能够吸引更多的贡献者了,但以现在的环境来看这个想法不现实,因为国内的代码托管平台的重心在提高收入水平上,可没有多余的资源能浪费在这种低收益的事情上。

常见问题

为什么选择实现 flex 布局而不是一个全新的布局?

主要有两个原因:

  • 为了巩固职业技能。作者在日常开发中虽然用过 flex 布局,但对它的规则并不了解,遇到问题时只会无脑调整相关属性,可以趁此次重写 LCUI 的布局系统的机会来深入研究 flex 布局。
  • 为了节省开发成本和用户学习成本。flex 布局在 Web 前端领域很常见,有 W3C 规范文档,也有其他开发者写的相关技术文章,用户学习成本低。

怎么才 50 帧?没有达到每秒渲染 120 帧 4K 尺寸画面以上的性能还好意思拿出来秀?

这个问题就需要让熟悉各种图形库的开发者来解决了,对于作者而言折腾这种职业无关的技术只是浪费时间。如果你恰好能解决此问题,但又不想免费提供技术支持,可以建一个 issue,然后描述大致的实现方式并注明你期望的悬赏金额,届时其他人觉得不错的话可能会赞助一部分赏金。

后续有何计划?

Look at the project readme file .

Reference News: https://gitee.com/lc-soft/LCUI/releases/v2.0.0

Guess you like

Origin www.oschina.net/news/113791/lcui-2-0-released