Page 1 of 1

gui_engine, statically-linked GUI apps for the initrd

Posted: Sun Jan 15, 2023 12:47 am
by BarryK

The title says it all. See more details in my blog post:

https://bkhome.org/news/202301/guiengin ... nitrd.html

I posted a thank you to the author of gui_engine:

https://github.com/AlxHnr/gui_engine/issues/3

It is a dead project, but the C code is so small, a quick look at it, reckon anyone with a smattering of C coding ability could take-on improving it.

Adding sdl-ttf would be good, though that requires freetype -- I wonder how much that will bump the size, statically-linked?


Re: gui_engine, statically-linked GUI apps for the initrd

Posted: Mon Jan 16, 2023 11:19 am
by BarryK

Re: gui_engine, statically-linked GUI apps for the initrd

Posted: Tue Jan 17, 2023 1:24 pm
by BarryK

Got around the road block, SDL_ttf now works:

https://bkhome.org/news/202301/back-in- ... dlttf.html

On to Lesson 08!


Re: gui_engine, statically-linked GUI apps for the initrd

Posted: Wed Jan 18, 2023 2:23 am
by BarryK

Lesson 08; introduces key presses:

https://bkhome.org/news/202301/learning ... on-08.html

So was able to add ESC key to exit from the gui_engine code.


Re: gui_engine, statically-linked GUI apps for the initrd

Posted: Wed Jan 18, 2023 9:05 am
by BarryK

The statically-linked example.c in gui_engine, with SDL_ttf, freetype and libpng linked in, the standalone binary is 560KB. Quite good I reckon.

Posted about it here:

https://bkhome.org/news/202301/statical ... 560kb.html

Now a ready-to-go basis for creating GUI apps in the initrd.


Re: gui_engine, statically-linked GUI apps for the initrd

Posted: Thu Jan 19, 2023 12:16 am
by BarryK

Getting started learning how gui_engine works, I created a map showing the function hierarchy:

gui-engine-funcs.png
gui-engine-funcs.png (78.91 KiB) Viewed 371 times

gui_engine is just one file, gui_engine.c, and the above map is of the functions in it. There is also gui_engine.h

The green boxes are the functions called from the 'example.c' file, to give an indication what ones are most relevant when creating an app.

Note, the map was created with Dia, exported to SVG then opened in Inkscape and exported to PNG, then opened in mtPaint and the size reduced by reducing number of colours and changing to indexed mode. Resulting 896x680 file is only 36KB.

Interesting, after uploading here, it is 79KB. I downloaded it and it is 79KB. The original is 36KB. Why is that?

Same image uploaded to my blog is 36KB:

https://bkhome.org/news/202301/images/g ... -funcs.png


Re: gui_engine, statically-linked GUI apps for the initrd

Posted: Fri Jan 20, 2023 10:44 am
by BarryK

More progress. Have learnt the basics of rendering TTF text, and made a start with gui_engine.

For now, have just done the window titlebar:

https://bkhome.org/news/202301/ttf-text ... ngine.html

ttf-titlebar.png
ttf-titlebar.png (9.93 KiB) Viewed 299 times

...an improvement over bitmap text!