xwt, a cross-desktop ui library
DESCRIPTION
At Xamarin we have historically been a GTK+ shop but with our new multi-platform focus, we have recently developed Xwt, a cross-desktop UI library which allows us to write our UI code once and run it natively on GTK+, Cocoa and WPF. Come to learn how the API works, how it's built and, why not, help us improve it.TRANSCRIPT
![Page 1: Xwt, a cross-desktop UI library](https://reader034.vdocuments.mx/reader034/viewer/2022051412/54978392b479596a4d8b520d/html5/thumbnails/1.jpg)
Xwt
A cross-desktop UI toolkit
Jérémie Laval
@jeremie_laval
![Page 2: Xwt, a cross-desktop UI library](https://reader034.vdocuments.mx/reader034/viewer/2022051412/54978392b479596a4d8b520d/html5/thumbnails/2.jpg)
Quickie about me
I A Xamarin-ista
I Mono Contributor (classlib, Pfx, PLinq, …)
I MonoDevelop team (these days)
![Page 3: Xwt, a cross-desktop UI library](https://reader034.vdocuments.mx/reader034/viewer/2022051412/54978392b479596a4d8b520d/html5/thumbnails/3.jpg)
Xwt: WAT?
X-platform Widget Toolkit
One UI toolkit to rule them all
![Page 4: Xwt, a cross-desktop UI library](https://reader034.vdocuments.mx/reader034/viewer/2022051412/54978392b479596a4d8b520d/html5/thumbnails/4.jpg)
Why Xwt?
I Pushing native UI feature with minimal cost
I Goals:
I Long-term → Xwt-based MonoDevelopI Short-term → share UI features between VS and MD
I Create a nicer (hopefully!) API in the process
![Page 5: Xwt, a cross-desktop UI library](https://reader034.vdocuments.mx/reader034/viewer/2022051412/54978392b479596a4d8b520d/html5/thumbnails/5.jpg)
Xwt all the things
Xamarin Android Designer
![Page 6: Xwt, a cross-desktop UI library](https://reader034.vdocuments.mx/reader034/viewer/2022051412/54978392b479596a4d8b520d/html5/thumbnails/6.jpg)
Where we stand
I 2 main approaches: WxWidgets and Qt
I WxWidgets→ native widgets, limited to common denominator
I Qt→ fully emulated, look&feel through theming
I*
: Xwt strikes a balance of both
*( = Lluis Sanchez, Xwt creator, as Dogbert)
![Page 7: Xwt, a cross-desktop UI library](https://reader034.vdocuments.mx/reader034/viewer/2022051412/54978392b479596a4d8b520d/html5/thumbnails/7.jpg)
Design goals
I Not general purpose, solving a problem at hand
I Architecture:
I MVCI Gtk box modelI Cairo-like drawing API
I Can be easily integrated with existing UI code
![Page 8: Xwt, a cross-desktop UI library](https://reader034.vdocuments.mx/reader034/viewer/2022051412/54978392b479596a4d8b520d/html5/thumbnails/8.jpg)
Relationship with Gtk
I NIH, we borrow heavily from Gtk+ API
I : We love Gtk but…
I Simpler widget hierarchy
I No (Gtk,Gdk)Window dichotomy
I No container class
![Page 9: Xwt, a cross-desktop UI library](https://reader034.vdocuments.mx/reader034/viewer/2022051412/54978392b479596a4d8b520d/html5/thumbnails/9.jpg)
Where we differ
Miguel on WPF (2004): “The implementation details transpire everywhere”
![Page 10: Xwt, a cross-desktop UI library](https://reader034.vdocuments.mx/reader034/viewer/2022051412/54978392b479596a4d8b520d/html5/thumbnails/10.jpg)
General architecture
![Page 11: Xwt, a cross-desktop UI library](https://reader034.vdocuments.mx/reader034/viewer/2022051412/54978392b479596a4d8b520d/html5/thumbnails/11.jpg)
What it looks like?
![Page 12: Xwt, a cross-desktop UI library](https://reader034.vdocuments.mx/reader034/viewer/2022051412/54978392b479596a4d8b520d/html5/thumbnails/12.jpg)
Demo
Let's make a new widget: awesometacular arrow
![Page 13: Xwt, a cross-desktop UI library](https://reader034.vdocuments.mx/reader034/viewer/2022051412/54978392b479596a4d8b520d/html5/thumbnails/13.jpg)
Demo
Let's integrate Xwt with Gtk
![Page 14: Xwt, a cross-desktop UI library](https://reader034.vdocuments.mx/reader034/viewer/2022051412/54978392b479596a4d8b520d/html5/thumbnails/14.jpg)
Demo
Let's spicy up Xwt.Gtk with Xwt.Mac
![Page 15: Xwt, a cross-desktop UI library](https://reader034.vdocuments.mx/reader034/viewer/2022051412/54978392b479596a4d8b520d/html5/thumbnails/15.jpg)
The Future
I Sort out the WPF backend (layout, drawing, …)
I Animation support (CoreAnimation, Clutter, …)
I More widgets
![Page 16: Xwt, a cross-desktop UI library](https://reader034.vdocuments.mx/reader034/viewer/2022051412/54978392b479596a4d8b520d/html5/thumbnails/16.jpg)
The Good Stuff
I https://github.com/mono/xwt
I https://github.com/mono/xwt/wiki/Coding-Guidelines
I http://group.google.com/group/xwt-list
![Page 17: Xwt, a cross-desktop UI library](https://reader034.vdocuments.mx/reader034/viewer/2022051412/54978392b479596a4d8b520d/html5/thumbnails/17.jpg)
The End
Questions?