Toplo, Bloc & Spec: A Graphic Layer for the Future

esug 103 views 31 slides Sep 04, 2024
Slide 1
Slide 1 of 31
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31

About This Presentation

Talk from ESUG 2024

Toplo, Bloc & Spec: A Graphic Layer for the Future. Pablo Tesone & Martín Dias

PDF: http://archive.esug.org/ESUG2024/day1/10-pablo-toplo.pdf


Slide Content

Pablo Tesone & Martín Dias - ESUG 2024 - Lille
Toplo, Bloc & Spec
A Graphic Layer for the Future
Consortium
1

2
Pablo Tesone
Pharo Consortium
Engineer
It’s us!
@tesonep
Martín Dias
Pharo Consortium
Engineer
@tinchodias
Just in the
presentation effort…
a lot of development
behind

3
a low-level UI
infrastructure &
framework for Pharo
geometry
(polygon)
a BlElement
background
border
transformation
(a matrix with
skew and translation)
What is Bloc?

What is Bloc?
Architecture
4
harfbuzz.dll
Alexandrie
SDL2.dll
OSWindow
Bloc
cairo.dll freetype.dll
applications
FFI

Why Cairo and SDL2?
Stay with simple FFI bindings to C libraries
•Works on all Pharo's platforms
•GPU acceleration
•Active gamer community
•Stable with active development. Support by
gnome community (it's the way to draw custom
widgets in gtk 3 and 4).
•Not GPU-optimized but we can use buffering,
layer composition and other techniques to
mitigate.
5

Improvements
•SVG importer bugfixing
•Cleanup (#Classes / Methods, Lines of code)
•Documentation improvements
•Improved Text Rendering
•Nicer Shadows, Polygons and Rounded figures
6

Performance & Stability
Running Faster and Reliable
•Performance Improvements
•Regression Testing
•CI Integration
•Correct Versioning & Repeatable Builds
7
How you see
the test fixture Mouse events were only
dispatched on the colored
regions
After the fix
!

Stable and Ready to Use
•Loadable from the menu in P12 & P13
•Compatible Versions for P11 / P12 / P13
8

Toplo
Widget Framework on Top of Bloc
9

10
Toplo
Widget Framework on Top of Bloc
•No New Revolutionary Concepts
•Keep it Simple
•Bloc has many of the features
•Bloc + Element States and Skins
•+ 18 Widgets ready to use
•Collaboration with

•No New Revolutionary Concepts
•Keep it Simple
•Bloc has many of the features
•Bloc + Element States and Skins
•+ 18 Widgets ready to use
•Collaboration with
11
Toplo
Widget Framework on Top of Bloc
Widgets: 600 Classes
~ 3000 Methods
Core: 200 Classes ~
2000 Methods
Tests: +1000

12
Toplo
Architecture Overview
ToElement
BlElement
ToTheme
ToSkinManager
ToSkin
<<Event Handler>>
ToSkinStateGenerator
ToSkinStateQueue
ToElementState
0..1
0..1
0..10..1
0..n
1
•Extending Bloc
•Adding Skin & States

Beautiful and Powerful
13

Beautiful and Powerful (2)
14

15
Toplo

16
Toplo

17
Toplo

Based in ANT Design
•https://ant.design/
•Rich Components
•UI / UX Designed
•Validated design values & guidelines
•Intended for Theming and Customization
18

What is a Skin in Toplo?
•Adapt properties of BlElements
•Visual (background, border, font, …)
•Structural (Layout, alignment, margin, padding)
•Composition (Adding / Removing Children)
19

When adaptations occur?
20
•On Skin Installation / Uninstallation
•On state changes
•Hovered, pressed, leave, …
•Checked, enabled, selected, …

When adaptations occur?
•On Skin Installation / Uninstallation
•On state changes
•Hovered, pressed, leave, …
•Checked, enabled, selected, …
21
Driven by Events.
A skin is a event
handler

Element State
•Dynamically created
•3 Kinds of States
•Skin Management (Install / Uninstall)
•Intrinsic States (checked, selected, focused, …)
•Transient States (Hovered, leave, enter, …)
•Skin contributes new states (ToSkinStateGenerator)
22

Element State
Generation
23
Mouse Click
ToCheckbox
ToCheckableEventHandler
event handler
ToCheckedSkinEventnew
Event Queueapply
enqueue
1
2
3
4
- Extends Bloc Events
- Events are handled
in the correct
rendering stage

Toplo StyleSheets
Declarative Skins
•A nice script version
•CSS Like rules
script = rule*

rule = selector property*

property = event_class property value
24
Still in
Development

Toplo - Spec
The power of Toplo, the ease of Spec
25

26
Toplo
& Spec

Toplo - Spec
The power of Toplo, the ease of Spec
27
•A new Backend for Spec
•Transparent
•Full support

Toplo - Spec
The power of Toplo, the ease of Spec
28
•A new Backend for Spec
•Transparent
•Full support
Still in
Development

Our Application Stack
29
harfbuzz.dll
Alexandrie
SDL2.dll
OSWindow
Bloc
cairo.dll freetype.dll
Toplo
FFI
Spec App
Spec - Toplo

Future
•Faster & More Stable Bloc
•More Widgets in Toplo (Tables / Trees)
•Full Implementation of Spec-Toplo
•Tests & Documentation
•Roassal in Bloc
30

Mailing-list: [email protected]
(subscribe at: http://sympa.inria.fr)
Discord: Pharo server / #bloc channel
Bloc: https://github.com/pharo-graphics/Bloc
Toplo: https://github.com/pharo-graphics/Toplo
Spec-Toplo: https://github.com/pharo-graphics/Spec-Toplo
31
STAY
TUNED!
Consortium