当前位置:网站首页>GUI engine evaluation index

GUI engine evaluation index

2020-11-06 01:47:57 lixianjing

GUI Engine evaluation indicators

github Open source on GUI There are at least dozens of engines , How to evaluate their merits and demerits , How to choose what you need GUI engine ? This is a tough task , Everyone's needs are different ,GUI Developers have different intentions , It's hard to find a uniform standard to choose the best GUI.QT Is the most powerful , Not one of them. , But not necessarily for you .

Anyway , There are always some indicators that can provide valuable reference , Although these indicators are used in different scenarios , Different company backgrounds , Different personal preferences , They also have a very different weight . But it doesn't erase the value of these indicators , The key is how to adjust their proportion according to their own needs .

stay 《 This open source 6 Thousand lines UI frame , Can beat QT,MFC Do you ?》 In this article , Zhuge is not bright Of 37 I was greatly inspired by the question , Developing AWTK In the process of , Reread this article many times , This article can be called GUI The guiding light for engine developers .

If you don't mind , To enliven the atmosphere , I will refer to the indicators mentioned in this article as 《 Zhuge is not bright - Li Xianjing GUI Engine evaluation indicators 》, Put Zhuge in front of you , Thank you to him , Put my name in it , It's up to me to take the blame from some people .

Let's start , It's a good introduction . It will be improved in the future , I hope you will choose your own GUI The engine indicators are added in .

1. Basic indicators

1.1 The mentality of developers

When you use their GUI when , They are thanking you for your support , Still think you owe them ? If they're not grateful , You'd better not use . otherwise , When there is a problem , How can you expect them to help you with this ?

1.2 Help document

Is there a 《API manual 》、《 User manual 》、《 common problem 》、《 Porting documents 》 and 《HowTo》, Whether the document is updated regularly ?

1.3 Sample code

Is there a simple introductory example 、 Usage of various controls 、 Examples of full functionality ?

1.4 Code style.

Directory name 、 file name 、 Class name 、 Function name 、 Function parameter 、 Local variable name 、 Global variable name 、 Are comments and indentations consistent .

1.5 programing language

about GUI For the engine , It is important to support multiple programming languages , Can meet the needs of different developers . For users ,GUI Whether you provide the programming language you need is the most important .

1.6 Supported platforms

about GUI For the engine , It's important to support multiple platforms , Can meet the needs of different developers . For users , It's also important to support multiple platforms , You're developing embedded systems now , You may want to develop a APP Control your device , There's no need to waste time learning different GUI.

GUI Whether to support the interface style of the target platform , Whether to provide cross platform runtime , Whether the basic native functions of the platform are packaged , Can new features be extended .

1.7 Visual interface design tool

You can lower the threshold of what you see in the interface development , Improve development efficiency .

1.8 Whether visual interface design tools should be used GUI Developed by itself

Use this GUI Self developed interface design tools , It can be verified that GUI Whether its function is strong and stable .

In addition, it should be used GUI Self developed interface design tools , In order to make the interface design tools easy to use . such as TabControl Control , You can switch pages at design time , The only way to do it is to use it GUI The interface design tool developed by itself is easy to implement .

1.9 Run in the development environment

The operating environment and development environment are often different , If you have to deploy it every time to see the effect , The speed of development must not come up .

1.10 use XML/JSON Wait for data to describe the interface

XML/JSON It's declarative syntax , Not only is it easier to write by hand than to write a program , It is also convenient to use the support of tools .

For embedded low-end embedded systems ,XML/JSON The efficiency is not high , The best way is to convert the runtime to an efficient binary format . It's like code , Before compiling the code for people to see , The compiled code is shown to the machine .

1.11 use XML/CSS Wait for data to describe the style of the interface

XML/JSON It's declarative syntax , Not only is it easier to write by hand than to write a program , It is also convenient to use the support of tools .

Change the interface style from UI Description files and code are stripped out , It's also good for later maintenance , After all, interface effects are the easiest to change .

For embedded low-end embedded systems ,XML/JSON The efficiency is not high , The best way is to convert the runtime to an efficient binary format . It's like code , Before compiling the code for people to see , The compiled code is shown to the machine .

1.12 Font format

Do you support dot matrix fonts ? Do you support vector fonts ? Do you support custom font formats ? Do you support loading only part of fonts into memory ? Are the supporting tools complete ?

1.13 Image format

Support common png/jpg/gif/bmp Format ? Support SVG Equal vector graphics ? Can I extend support for new formats ?

1.14 typewriting

Do you support Pinyin input ? Soft keyboard support T9 Input method ? Support hard keyboard T9 Input method ? Do you support speech input ? Is handwriting input supported ? Can I extend support for new input ?

1.15 Basic architecture model

Whether support is built in MVC、MVP and MVVM And so on ? Do you support Vue、React Similar to the development of small programs ?

2. Functional indicators

2.1 HD screen

Whether to support high-definition screen ? stay PC The interface is getting sticky when running on , The font gets smaller when running on a mobile phone , They don't support high-definition screen features . If you don't support high-definition screen, you don't need to talk about cross platform .

2.2 Vectorgraph API

Vectorgraph API It's very important , Powerful vector graphics API Can achieve a lot of magical effects . Personally feel HTML5 Canvas 2D API It's the best vector graph API. use cairo、skia、agge and nanovg These open source libraries are easy to implement similar API.

GUI Be sure to provide an abstract interface , In different circumstances , It can seamlessly switch to the optimal implementation scheme . For example, in the embedded platform agge, In embedded linux For platform cairo, stay PC On the use of skia or nanovg.

2.3 Window animation

Whether to support window animation ? Whether the types of window animation are enough ? Whether you can expand your own window animation . How efficient is window animation ? Is it convenient to use window animation ?

2.4 Control animation

Whether to support control animation ? Support those controls animation ? Do you support custom control animation ? Control animation is convenient to use ? What are the parameters of control animation ? Can I stop 、 Pause and play control animation .

2.5 Whether the built-in controls are rich

Whether there are controls you need now and controls that you may use in the future .

2.6 Control combination is convenient

yes , we have GUI The control is divided into leaf node control and container control ,label、image、edit and button All leaf node controls . It's not very flexible , Go to button Put a picture or an animation , Go to label Put a picture in it , Go to edit Put one in it " eliminate "/" lookup " Of button, Isn't it convenient , Why limit it ?

2.7 Custom control

None of them GUI Can meet all the needs , If you don't support custom controls, it's a pity . Such a simple need , There are GUI But it needs to be modified GUI The code for the engine , That's not fun .

2.8 Layout (layout) Parameters

Control control layout through layout parameters , You can make your application work on screens of different sizes . Whether layout parameters are supported , Whether the layout function is powerful , Whether the custom layout can be extended ?

2.9 Control custom properties

If the control supports custom properties , Users can store their own data in the control , You can avoid using global variables , It's a very convenient feature .

If the control supports custom properties , Yes GUI It's also easy to expand , such as AWTK-MVVM User defined properties are used for binding rules of , If you will AWTK-MVVM Migration to Qt It's easy , because Qt Also supports custom attributes , To transplant to emwin It's a lot of trouble .

2.10 Control :label

label It's the simplest control , It's not easy to do well . Like fried rice is the basic skill of a cook ,label Namely GUI Basic skills of developers . Support style( typeface 、 Various parameters such as color and alignment ) Do you ? Support unicode Line break rules of ? Do you support scrolling ? Do you support ellipsis display ? Support bidi Algorithm ? Support animation ( Like typing and dialing ). Does scrolling support scrolling only when you get focus ?

Of course label and scroll_label It's better to divide it into two controls , It's easy to implement and doesn't need to support some unnecessary features on the low-end platform . All in all , Users need to have these functions when they need them .

2.11 Control :image

Do you support rotation and scaling ? Do you support rotation and scaling animation ? Support the center 、 tile 、x tile 、y tile 、 squared paper for practicing calligraphy 、 Sangongge 、 Scaling and scaling and other rendering effects ? Do you support displaying text ? Do you support clicking ? Do you support checking ?

2.12 Control :edit

Support edit It's not hard to , It's not easy to do well : Support copy 、 Cut and paste ? Do you support Undo and redo ? Do you support keyboard and mouse selection ? Support input method ? Can you automatically select the soft keyboard according to various input types ? Can I customize the soft keyboard ? Can you specify whether the software disk automatically opens when you get the focus ? Can you specify whether the software disk automatically closes when you lose focus ? Do you support setting validation functions ? Does it support automatically repairing input values when losing focus ? Support for missing focus prompt input error ? Support input prompt ? Support prompt when input changes ? Support time 、 Date and IP Address and other formats input ?

2.13 Control :button

Whether to support long press ? Whether to support setting long press time ? Whether to support repeated trigger ? Whether icons are supported ? Whether child controls are supported ( Like pictures and animations )?

2.14 Control : soft keyboard

The soft keyboard uses XML/JSON Describe it ? You can customize the soft keyboard ( Keyboard layout and style ) Do you ? Do you need to modify the code to customize the soft keyboard ? Can soft keyboard switch focus with pure direction key ?

2.15 Control :table view

Support to put progress bar 、 Selection box 、 Button 、 Pictures and editors ? Support View and Model Separate ? Can we support tens of millions of data ?

2.16 Control :code editor

Some experts use two indicators to measure GUI The function of :1. Can you develop it with a notepad ? 2. Can you use it to develop an interface designer ? If the support code editor, You can use it to implement a more powerful Notepad .

2.17 style

Whether to support setting fillet radius ? Whether to support fillet setting for some corners ? Whether you can set the top, bottom, left and right borders respectively ? Whether to support custom state ?

2.18 The dialog is highlighted

When the dialog box pops up : Whether to support dialog darkening ? Whether to support dialog dynamic darkening ? Whether to support dynamic blurring of dialog box ? Whether to support the new highlight strategy .

2.19 Keyboard switch focus

Whether to support keyboard switching focus ? Whether to support switching focus from top to bottom, left and right ( Some devices only have direction keys and confirmation keys )? Whether to support setting the key value of switching focus ?

2.20 screenshots

Whether to support screen capture ?

2.21 Operational feedback

Do you support keystrokes ? Different control payment supports different keystrokes ? Whether to support touch screen vibration ?

2.22 Accessibility

Whether to support the overall enlargement of fonts ? Whether to support screen reading software ?

2.23 Storage interface

Is there a cross platform storage interface , Such as file system 、 Configuration information and database .

2.24 Resource management

Is there a unified resource management interface ? Resource management is also a troublesome thing : Such as the picture , It may be stored in flash in , It may be stored in the file system , It could also be on the server ; For normal screen and high-definition screen, different files need to be loaded ; Different languages may also need to load different files ; The same software runs on different systems , Different formats may have to be loaded , Some systems can only use bitmaps , Some systems can use png/jpg; Images need to be cached , The cache needs to be cleaned up . All these things , If you let the application handle , It will be a nightmare !

Powerful resource manager , You can block all these details , Make the application imperceptible . such as , You need "earth" This picture , You don't have to care about its location and format , Don't worry about the effects of screen density and language , The system automatically loads the best picture file .

3. performance

3.1 Efficient algorithms

Whether to support dirty rectangle algorithm 、3 framebuffer and Binary format . Used in development XML It is convenient for programmers to modify , Run time uses efficient binary format to improve efficiency .

3.2 2D Hardware acceleration

Whether to support common acceleration interfaces , Such as STM32 Of DMA2D and NXP Of PXP. Whether manufacturers can extend their own acceleration interface .

3.3 3D Hardware acceleration

Do you support OpenGL、DirectX、Vulkan and Metal etc. .

3.4 Low end platforms

What kind of hardware platform can support at least ? It's powerful and usually bulky , This is right GUI The configurability of is a great test .

3.5 Starting time

1 Seconds to start ?5 Seconds to start ? We'll have to wait half a minute ?

4. internationalization

4.1 Unicode.

Do you support UTF-8 and UTF-16 code ?

4.2 Multilingual input method .

Do you support T9 typewriting ? Whether the new input method can be supported ?

4.3 String translation .

Whether string translation is supported ? Whether to support real-time switching languages ( No need to restart )?

4.4 Picture translation .

Do you support picture translation ( When switching languages , Automatically switch some pictures )?

4.5 Two way typesetting of text .

Whether to support bidirectional typesetting of Arabic characters ?

4.6 Code conversion function .

Whether to provide cross platform code conversion function ?

5 Software quality

5.1 unit testing

Is there a complete unit test ? Whether all unit tests pass ?

5.2 Memory exhaustion processing flow

When memory runs out, it crashes directly ? Or let the app exit gracefully ?

5.3 Memory leak checking mechanism

Whether there is a memory leak checking mechanism ? Whether it can be used valgrind Check for memory leaks and overflows ?

5.4 Code static check .

Whether it has passed cppcheckinfer Or other static inspection tools ?

5.5 Event recording and playback function

Can events of user actions be recorded , And stress testing through playback ?

5.6 Appuim Carry out automatic test

Do you support Appuim, adopt javascript Such as script automation integration test ?

版权声明
本文为[lixianjing]所创,转载请带上原文链接,感谢