bloc: a modern core for highly dynamic graphics

26
Bloc: a new Morphic framework Alain Plantec Lab-STICC - University of Brest, France

Upload: esug

Post on 22-Jan-2018

396 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: Bloc: a Modern Core for Highly Dynamic Graphics

Bloc: a new Morphic framework

Alain Plantec Lab-STICC - University of Brest, France

Page 2: Bloc: a Modern Core for Highly Dynamic Graphics

Bloc in aNutshell• Every morph has an affine matrix (zoom/rotation)

• A morph dynamically assembles listeners and has views.

• Views and morphs can be composed via layout

• A morph lives in a space / universe

• It can schedule alarms

• Close to JavaFX

Page 3: Bloc: a Modern Core for Highly Dynamic Graphics
Page 4: Bloc: a Modern Core for Highly Dynamic Graphics

Reinvent the UI

• Be in par with Javascript and Java graphical frameworks

• A foundation for upper-layers (widgets…)

Page 5: Bloc: a Modern Core for Highly Dynamic Graphics

Time to revisit Morphic• Flexible

• Malleable

• But

• global coordinates

• complex protocol / code and logic are often unclear

• too much inheritance-based

Page 6: Bloc: a Modern Core for Highly Dynamic Graphics

Bloc

• Based on Miro and Miro2 experience

• Now at its fourth iteration

• Vector from the ground (rotation, zoom, translation)

• One constraint: morphic should be able to run inside :)

Page 7: Bloc: a Modern Core for Highly Dynamic Graphics
Page 8: Bloc: a Modern Core for Highly Dynamic Graphics
Page 9: Bloc: a Modern Core for Highly Dynamic Graphics
Page 10: Bloc: a Modern Core for Highly Dynamic Graphics

Morph + View

Page 11: Bloc: a Modern Core for Highly Dynamic Graphics

Morph + View

Affine transformation

+ layout protocol + redrawing

Page 12: Bloc: a Modern Core for Highly Dynamic Graphics

Morph + View

Composition with local coordinate

Page 13: Bloc: a Modern Core for Highly Dynamic Graphics

Morph + View

extent management +

rendering

Page 14: Bloc: a Modern Core for Highly Dynamic Graphics

Morph + View

Events management

Page 15: Bloc: a Modern Core for Highly Dynamic Graphics

The Bloc infrastructure

Page 16: Bloc: a Modern Core for Highly Dynamic Graphics

The Bloc infrastructure

Morphic HandMorph

Page 17: Bloc: a Modern Core for Highly Dynamic Graphics

The Bloc infrastructure

Morphic WorldState

Page 18: Bloc: a Modern Core for Highly Dynamic Graphics

Event listeners

Page 19: Bloc: a Modern Core for Highly Dynamic Graphics

Alarms

[ self inform: ‘Pharo is great’] asAlarm schedule.

Page 20: Bloc: a Modern Core for Highly Dynamic Graphics

Alarms| alarm | alarm := [ self inform: ‘Pharo is great’] asAlarm. alarm delay: 300. alarm period: 100. alarm schedule. [ (Delay forSeconds: 5) wait. alarm unschedule ] fork

Page 21: Bloc: a Modern Core for Highly Dynamic Graphics

Alarms| alarm morph | morph := BlRectangleView new asMorph. morph openInWorld. alarm := (WeakMessageSend receiver: morph selector: #color:) asAlarm. alarm period: 100. alarm argument: [Color random]. alarm schedule. [ (Delay forSeconds: 5) wait.

morph delete ] fork

Page 22: Bloc: a Modern Core for Highly Dynamic Graphics

Architecture

Athens

Bloc

Brick

OSWindowVMEvent

Page 23: Bloc: a Modern Core for Highly Dynamic Graphics

Glimpse @ Brick

Page 24: Bloc: a Modern Core for Highly Dynamic Graphics

Bloc roadmap

• New graphic core of “Pharo 6.0”

• New foundation for new widgets (Brick)

Page 25: Bloc: a Modern Core for Highly Dynamic Graphics

Conclusion

• New framework with split responsibilities

• Dynamic addition of behavior and views

• Rethought event loop

• Multispaces

Page 26: Bloc: a Modern Core for Highly Dynamic Graphics