π
<-

## GUI Toolkit NF (under development)

C, C++, ASM...

### GUI Toolkit NF (under development)

Dear Ti-Planet Members,

I hope you are all doing well. Long time no write ... I have been extremely busy at work during these last two months and hence was tied up far from my keyboard, ... and from the GUI Toolkit effective development.
But now this period is over and I am returning back to coding, with new ideas ... and maybe more important, a new project.

During this period without coding, I thought a lot on how I can improve the Toolkit and solve some issues/misconceptions. I then decided to restart the project from scratch, taking benefit of building a new architecture able to reuse concepts that where proven to work and implement new ones for parts that where not very good in my first attempt.

So I am not coding the root of the
GUI Toolkit NF
(with NF standing for "New Foundation"). This is new the "hardware layer" that is under consideration with 3 managers recoded from scratch :
- KeyManager to handle the events linked to keys (all except one of the TouchPad) : all keys can be checked one by one (pressed status true/false) as well as Press Event / Release Event (transitional state)
- MouseManager to handle the events linked to the Touchpad (including the arrows and click keys) : for keys, same as above + position x/y of the mouse cursor. With user able to define the sensibility of the movement.
- Renderer able to render various geometrical primitives AND able to handle SDL or nGC (based on a #define preprocessor directive)

One of the problem of the first GUI Toolkit was that several instances of the keyboard/mouse handlers could be created by user, leading to some strange behavior. So now it is written using Singleton approach.

For the renderer, this is the very begining and I am learning how to use nGC.

As usual, more news to come very soon.

Regards and keep safe

Sly
Developing the GUI Toolkit for nSpire
see current revision here : https://github.com/SlyVTT/Widget-for-TI-NSpire

And for the GUI Toolkit NF (New Foundation), this is here https://github.com/SlyVTT/Widgets-Spire-NF

SlyVTTProgrammeur

Niveau 8: ER (Espèce Rare: nerd)
Level up: 77%

Posts: 138
Images: 0
Joined: 19 Jan 2021, 09:41
Gender:
Calculator(s):

### Re: GUI Toolkit NF (under development)

A new Github repository has been created accordingly.

Everything can be found her : https://github.com/SlyVTT/Widgets-Spire-NF

Sly
Developing the GUI Toolkit for nSpire
see current revision here : https://github.com/SlyVTT/Widget-for-TI-NSpire

And for the GUI Toolkit NF (New Foundation), this is here https://github.com/SlyVTT/Widgets-Spire-NF

SlyVTTProgrammeur

Niveau 8: ER (Espèce Rare: nerd)
Level up: 77%

Posts: 138
Images: 0
Joined: 19 Jan 2021, 09:41
Gender:
Calculator(s):

### Re: GUI Toolkit NF (under development)

Dear All,

This is a brief overview of the current status of the development of the GUI Toolkit NF.

One week after the start of the project, things are moving forward at a relatively good pace, considering that I do not spend that much time coding.
Right now, I am working on the foundation of the Toolkit, meaning the classes needed to properly interact with either the hardware and the main classes of the application.

The GUI Toolkit NF has reached an important milestone (in my development roadmap ) :
- the KeyManager class is now finished - all keys are correctly captured as well as transient events (Press and Release event)
- the MouseManager class is also now finished - cursor position and clicks are correctly captured as well as all arrow keys (*). As for KeyManager, all transient events for keys are also captured.

(*) as the arrow keys are physically linked to the touchpad, I was a bit concerned by the class to be used to track their status. I finally decided to use the MouseManager to be inline with the actual way of getting the information from the hardware and improve the performances.

- the two renderers used in the Toolkit, i.e. ScreenRenderer for on screen visual drawing and DepthBufferRenderer for off screen operations are working and are able to use both SDL and nGC.

We can choose the rendering mode by commuting a single #define preprocessing directive into a header file :
If SDL is used for rendering the primitive, we use :
Code: Select all
//RENDER_MODE To be set to 1 if SDL is used as the renderer, and to 0 otherwise#define RENDER_WITH_SDL 1

if nGC is chosen for rendering, we switch to :
Code: Select all
//RENDER_MODE To be set to 1 if SDL is used as the renderer, and to 0 otherwise#define RENDER_WITH_SDL 0

Quite easy, isn't it ?

Of course, this is a balance between performance / portability of code and size of the executable.

For example, the same application (very simple PoC as depicted by the following pictures) gives the following figures :
- compiled for use with SDL rendering : size of the executable : 280kb
- compiled for use with nGC rendering : size of the executable : 130kb

Visuals are very similar. This is the great part of my current job to have a sufficiently robust ScreenRenderer class able to perfectly translate the Toolkit Drawcalls either to SDL or nGC in a smooth way and without visual artefacts. Following are two pictures of the same program, compiled once for use with SDL and once for use with nGC.

As usual, the target is to get a simple way to code applications, so for the end user, it means a minimum code to write.

This simple app is coded with the following lines :

Code: Select all
#include "ToolkitNF/GUIToolkitNF.hpp"int main( void ){       WidgetApplication::Initialize();       DesktopWidget* desktop = new DesktopWidget( "I am a Desktop", 0, 0, SCREEN_WIDTH_GUI, SCREEN_HEIGHT_GUI, nullptr );       ButtonWidget* button = new ButtonWidget( "Hello World !!!", 25, 25, 250, 20, desktop );#if RENDER_WITH_SDL == 1       ButtonWidget* button2 = new ButtonWidget( "We are rendered with SDL", 25, 50, 250, 20, desktop );#else       ButtonWidget* button2 = new ButtonWidget( "We are rendered with GC", 25, 50, 250, 20, desktop );#endif       button2->Disable();       WidgetApplication::AddChild( desktop );       WidgetApplication::SetBackgroundPicture( "/documents/Widget/Wallpapers/002.bmp.tns" );       WidgetApplication::PrepareForRun();       while (!WidgetApplication::AskForClosure() && !button->IsPressed()  )       {              WidgetApplication::Run( WidgetApplication::Normal );       }       WidgetApplication::Close();       return 0;}

As you can read, the second button uses a condition to get its text content updated

Now the big part of my job is to convert all the code of all the widget of the GUI Toolkit (not NF) to the GUI Toolkit NF ... May be a bit long.

Ciao

Sly
Developing the GUI Toolkit for nSpire
see current revision here : https://github.com/SlyVTT/Widget-for-TI-NSpire

And for the GUI Toolkit NF (New Foundation), this is here https://github.com/SlyVTT/Widgets-Spire-NF

SlyVTTProgrammeur

Niveau 8: ER (Espèce Rare: nerd)
Level up: 77%

Posts: 138
Images: 0
Joined: 19 Jan 2021, 09:41
Gender:
Calculator(s):

### Re: GUI Toolkit NF (under development)

Hello,

This is a status of the current development of the
GUI Toolkit NF for the TI nSpire
, right before taking some days off for summer vacations.

The conversion of the Toolkit from the "old fashioned" structure to the new "NF concept" is moving forward and almost all the widgets of the revision 0.9b are now available for the GUI Toolkit NF. The only exception is the GraphicContextWidget that needs to be heavily reimplemented to be compliant with the NF structure. It may take some time (and also some brain juice), especially considering the version using the nGC library for which some very low level portions of code will be needed to create specific drawing primitives able to handle the context (= a memory buffer).

To demonstrate what the various versions of the toolkit(s) can actually do, I put hereafter some screenshots (all done through internal routines of the toolkits). The application is a simple text editor able to handle various styles. It is far from being finished and there are still bugs to track and some parts of the Toolkit routines to be correctly tuned...

... But this is enough speach, let's go for the pictures ...

"old fashion" GUI Toolkit rev 0.9beta
: size 576ko - Need SDL - Functional / very limited bugs (but still some )

"new" GUI Toolkit NF using SDL for rendering
: size 300ko - Need SDL - Some bugs to be corrected, making behaviour quite hazardous right now (but improving -
Under debugging phase
)

"new" GUI Toolkit NF using nGC for rendering
: size 147ko - No Need for SDL - Some bugs to be corrected (the same as for the above version, making behaviour quite hazardous right now (but improving -
Under debugging phase
+
Need for developping some conversion routines based on nGC
)

For the two NF versions, I tried to take the same screen captures, to let you see the (almost) similar rendering of the application. There are some artefacts in the drawing primitives (especially the rounded rectangles) in the nGC version that will be improved later on.

Performance wise, all versions behave almost similarly, but I need to perform some accurate benchmarks when all features will be correctly implemented without "big bugs".

I am still in the process of making something easily useable, this is tested on my machine (a CX II-T CAS with OS 5.2), but I would be very happy in the future (let says when its done) if some volunteers could test on some other hardware and/or OS version. The target is CX/CX-II (to have color rendering).

Let me know you toughts,

Ciao and Bonnes Vacances

Sly
Developing the GUI Toolkit for nSpire
see current revision here : https://github.com/SlyVTT/Widget-for-TI-NSpire

And for the GUI Toolkit NF (New Foundation), this is here https://github.com/SlyVTT/Widgets-Spire-NF

SlyVTTProgrammeur

Niveau 8: ER (Espèce Rare: nerd)
Level up: 77%

Posts: 138
Images: 0
Joined: 19 Jan 2021, 09:41
Gender:
Calculator(s):

### Re: GUI Toolkit NF (under development)

Great job Looking forward to the next update.

Niveau 16: CC2 (Commandeur des Calculatrices)
Level up: 58.3%

Posts: 13548
Images: 1101
Joined: 01 Jun 2007, 00:00
Location: France
Gender:
Calculator(s):

### Who is online

Users browsing this forum: No registered users and 1 guest

-
Search
-
Social
-
Featured topics
1234567891011
-
For more contests, prizes, reviews, helping us pay the server and domains...

Discover the the advantages of a donor account !

-
Stats.
682 utilisateurs:
>671 invités
>5 membres
>6 robots
Record simultané (sur 6 mois):
6892 utilisateurs (le 07/06/2017)

-
Other interesting websites
Texas Instruments Education
Global | France
(English / Français)
Banque de programmes TI
ticalc.org
(English)
La communauté TI-82
tout82.free.fr
(Français)