π
<-
Chat plein-écran
[^]

GUI Toolkit NF (under development)

C, C++, ASM...

GUI Toolkit NF (under development)

Unread postby SlyVTT » 28 Jul 2021, 06:48

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

Image Image Image Image
User avatar
SlyVTTProgrammeur
Niveau 8: ER (Espèce Rare: nerd)
Niveau 8: ER (Espèce Rare: nerd)
Level up: 87.5%
 
Posts: 148
Images: 0
Joined: 19 Jan 2021, 09:41
Gender: Male
Calculator(s):

Re: GUI Toolkit NF (under development)

Unread postby SlyVTT » 28 Jul 2021, 20:42

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

Image Image Image Image
User avatar
SlyVTTProgrammeur
Niveau 8: ER (Espèce Rare: nerd)
Niveau 8: ER (Espèce Rare: nerd)
Level up: 87.5%
 
Posts: 148
Images: 0
Joined: 19 Jan 2021, 09:41
Gender: Male
Calculator(s):

Re: GUI Toolkit NF (under development)

Unread postby SlyVTT » 04 Aug 2021, 19:09

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 :p ) :
- 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 ? B-)

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.

Image Image

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 :D

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

Image Image Image Image
User avatar
SlyVTTProgrammeur
Niveau 8: ER (Espèce Rare: nerd)
Niveau 8: ER (Espèce Rare: nerd)
Level up: 87.5%
 
Posts: 148
Images: 0
Joined: 19 Jan 2021, 09:41
Gender: Male
Calculator(s):

Re: GUI Toolkit NF (under development)

Unread postby SlyVTT » 09 Aug 2021, 20:45

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 ...

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

Version made with the
"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
)
Image Image Image

Version made with the
"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
)
Image Image Image Image

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

Image Image Image Image
User avatar
SlyVTTProgrammeur
Niveau 8: ER (Espèce Rare: nerd)
Niveau 8: ER (Espèce Rare: nerd)
Level up: 87.5%
 
Posts: 148
Images: 0
Joined: 19 Jan 2021, 09:41
Gender: Male
Calculator(s):

Re: GUI Toolkit NF (under development)

Unread postby Adriweb » 09 Aug 2021, 20:50

Great job :D Looking forward to the next update.
Image
MyCalcs
: Help the community's calculator documentations by filling out your calculator info!
MyCalcs
: Aidez la communauté à documenter les calculatrices en donnant des infos sur votre calculatrice ![/url]
Inspired-Lua.org
: All about TI-Nspire Lua programming
User avatar
AdriwebAdmin
Niveau 16: CC2 (Commandeur des Calculatrices)
Niveau 16: CC2 (Commandeur des Calculatrices)
Level up: 58.5%
 
Posts: 13566
Images: 1101
Joined: 01 Jun 2007, 00:00
Location: France
Gender: Male
Calculator(s):
Twitter: adriweb
GitHub: adriweb


Return to Native: Ndless, Linux, ...

Who is online

Users browsing this forum: No registered users and 2 guests

-
Search
-
Social
-
Featured topics
Concours de rentrée 2021 - La Geste d'Alrys
Concours de rentrée 2021 - Synchro-donjon !
Comparaisons des meilleurs prix pour acheter sa calculatrice !
Remplace ton ancienne fx-92 Collège ou Graph 35 par la nouvelle Graph 35+E II programmable en Python ! Pour tout achat d'une nouvelle Graph 35 d'ici le 30 septembre 2021, Casio te rembourse 10€. En cas de retour de ta fx-92 Collège c'est 18€, et même ou 23€ si tu retournes ton ancienne Graph 35. Etiquette de retour fournie, pas de frais de port à payer, même les anciens modèles et machines non fonctionnelles sont acceptées. En partenariat avec les Restos du cœur.
Remplace ton ancienne fx-92 Collège ou Graph 35 par la Graph 90+E couleur. Pour tout achat, Casio te rembourse 10€ en cas de retour de ta fx-92 Collège, ou 15€ en cas de retour de ta Graph 35. Etiquette de retour fournie, pas de frais de port à payer, même les anciens modèles et machines non fonctionnelles sont acceptées. En partenariat avec les Restos du coeur.
10€ remboursés par Casio sur l'achat de ta calculatrice Graph 35 d'ici le 30 Septembre 2021
Reprise de ton ancienne fx-92 Collège à 5€ ou Graph 35 à 10€. Même non fonctionnelle ou ancien modèle. Etiquette de retour fournie, pas de frais de port à payer. En partenariat avec les Restos du coeur.
25€ remboursés par Casio sur l'achat de ta calculatrice fx-CP400 d'ici le 31 Octobre 2021
3€ remboursés par Casio sur l'achat de ta calculatrice fx-92 Collège d'ici le 30 Septembre 2021
Casio Graph 90+E ou Graph 35+E II avec couvercle personnalisé à gagner sur simple participation aux formations Casio de Septembre 2021.
Disque dur externe + écouteurs bluetooth + 2 superbes coques personnalisées pour Graph 90+E ou Graph 35+E II à gagner en répondant d'ici le 24 Septembre 2021 à la question : "Quelle est l'unité de tension électrique ?"
Coque NumWorks édition limitée Septembre 2021 à gagner.
123456789101112
-
Donations / Premium
For more contests, prizes, reviews, helping us pay the server and domains...
Donate
Discover the the advantages of a donor account !
JoinRejoignez the donors and/or premium!les donateurs et/ou premium !


Partner and ad
Notre partenaire Jarrety Calculatrices à acheter chez Calcuso
-
Stats.
509 utilisateurs:
>497 invités
>6 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)