Arun Thondapu
Eclipse SWT Project Co-Lead
Equinox (Launcher) Committer
IBM
3/12/2015EclipseCon NA 2015
1
Motivation
Evolution of GTK+
Porting SWT to GTK+ 3
Challenges
Solutions
Collaboration
WIP
What’s Next ??
Wayland support
Broadway, HTML 5
GTK+ 4
3/12/2015EclipseCon NA 2015 2
Linux vs Others
Significant changes in underlying windowing system (GTK+)
Separate API and ABI incompatible streams
How to be on the “bleeding edge”
Need parallel streams of development and maintenance
Open and diverse nature of Linux distributions = support for a large range of GTK+ versions
3/12/2015EclipseCon NA 2015 3
3/12/2015EclipseCon NA 2015 4"GTK+ software architecture" by Shmuel Csaba Otto Traian. Licensed under CC BY-SA 4.0 via Wikimedia Commons -
http://commons.wikimedia.org/wiki/File:GTK%2B_software_architecture.svg#mediaviewer/File:GTK%2B_software_architecture.svg
Originally designed and used in the GNU Image Manipulation Program (GIMP) as a replacement of the Motif toolkit.
GTK+ 2.0
improved text rendering using Pango
a new theme engine
improved accessibility using ATK
complete transition to Unicode using UTF-8 strings
more flexible API and new widgets
usage of Cairo graphics library for rendering vector graphics (since version 2.8)
3/12/2015EclipseCon NA 2015 5
GTK+ 3
cairo drawing throughout, GDK no longer wraps the antiquated X11 drawing API
modern input device handling via XInput2
new theming API with CSS syntax for theme configuration and animations
multiple backend support for GDK (including experimental support for Wayland and HTML5)
integration of D-Bus support in GIO
use GIO for launching applications
new widgets, such as a switch and an application chooser
improved support for touch and gestures
3/12/2015EclipseCon NA 2015 6
Primary goal was a seamless user experience on a wide variety of Linux versions irrespective of underlying versions of GTK+ shipped by them.
to be as backward compatible as possible
in contrast to most native GTK+ apps including GNOME
3/12/2015EclipseCon NA 2015 7
libgtk-x11-2.0.so.0
libswt-pi-gtk-****.so libswt-pi3-gtk-****.so
libgtk-3.so.0
Do not include individual headers
Do not use deprecated symbols
Use accessor functions instead of direct access
Replace GDK_<keyname> with GDK_KEY_<keyname>
Use GIO for launching applications instead of the gdk_spawn family of functions
Use cairo for drawing
GdkGC and GdkImage are removed
gdk_draw family of functions are gone
GtkWidget “expose-event” signal has been replaced by a new “draw” signal
3/12/2015EclipseCon NA 2015 8
The modern GTK+ drawing model
3/12/2015EclipseCon NA 2015 9
Many great and diverse contributions from community (led by Red Hat team) towards the GTK+ 3 port
Much more stable and usable now
Please continue to test, report bugs and contribute patches!
3/12/2015EclipseCon NA 2015 10
Working on resolving most major outstanding problems before Mars
Bugzilla summary tags – GTK3, GTK 3.10
Lots more stuff being deprecated and replaced by GTK+
GdkColor is being replaced by GdkRGBA
Many enhancements as well but we may not be able to adopt right now, stability is the major concern
Lack of backwards-compatibility in major updates continues to be an issue
Can we aggressively drop support for older versions of GTK+ 2.x?
3/12/2015EclipseCon NA 2015 11
Mars drops support for GTK+ < 2.18
How to find out which version of GTK+ is being used by my Eclipse or SWT application?
Use the Java property org.eclipse.swt.internal.gtk.version
Prevent linking against GTK+ 2.x and GTK+ 3.x in the same process
Leads to unexpected hangs or hard-to-diagnose crashes
3/12/2015EclipseCon NA 2015 12
Eclipse Mars
GTK+ 3 always (assuming it is installed and available)
Eclipse Luna, SR1 & SR2
GTK+ < 3.10 => GTK3
GTK+ >= 3.10 => GTK2
3/12/2015EclipseCon NA 2015 13
Webkit is embedded by default on Linux but XULRunner is also supported
libwebkitgtk-1.0-0 vs. libwebkitgtk-3.0-0
libwebkitgtk-1.0-0 is not installed by default on some distros => Luna and earlier do not have an active browser in Eclipse!
libwebkit2gtk-3.0-25 vs. libwebkit2gtk-4.0-37
XULRunner does not have a GTK+ 3 port yet…
3/12/2015EclipseCon NA 2015 14
Wayland is intended as a simpler replacement for X, easier to develop and maintain.
Origins in initial effort towards X12.
Hardware and applications are constantly evolving, X11 extensions are unable to fill in the gaps anymore.
Design and build a new display server from scratch focusing on modern platforms.
3/12/2015EclipseCon NA 2015 15
Wayland is a display protocol for a compositor to talk to its clients as well as a C library implementation of that protocol.
Weston reference implementation is the only Wayland compositor as of now.
Eliminates needless complexity and improves performance compared to X11.
Smaller footprint.
Designed to work well with non-PC interfaces (embedded devices, tablets and phones).
Shipped on a number of embedded products, phones, and tablets.
For the desktop, GNOME and KDE ports to Wayland (and of course the protocol itself) are currently WIP.
3/12/2015EclipseCon NA 2015 16
3/12/2015EclipseCon NA 2015 17
3/12/2015EclipseCon NA 2015 18
3/12/2015EclipseCon NA 2015 19
• Rudimentary support available at
this stage
• Google Summer of Code 2014
project by Joshua Barkovic
3/12/2015EclipseCon NA 2015 20
GDK Broadway backend provides support for displaying GTK+ applications in a web browser, using HTML5 and web sockets.
GDK_BACKEND = broadway
http://127.0.0.1:8080
Works only with GTK3
Use multiple GTK+ applications in the same web browser window, by using the Broadway server, broadwayd, that ships with GTK+.
broadwayd :5
BROADWAY_DISPLAY - Specifies the Broadway display number.
BROADWAY_DISPLAY=:5 gedit
3/12/2015EclipseCon NA 2015 21
3/12/2015EclipseCon NA 2015 22
Can SWT itself use web (HTML5) based elements to build the UI of the application instead of the OS's native widgets?
Eclipse running inside a web browser?
Allows CSS customization of UI.
Eclipse integration with Orion and Flux in a browser.
3/12/2015EclipseCon NA 2015 23
Animations
Effects
Transformations
Event bubbling
No more GDK windows
Multimedia
3/12/2015EclipseCon NA 2015 24
Scene graph
Improved CSS support
Better cross-platform story
Better support for application development
Touch and gesture support
Focus on HIG
3/12/2015EclipseCon NA 2015 25
“GTK+ 4 shall be as
rock-stable (and
hence "boring") as
GTK+ 2”
3/12/2015EclipseCon NA 2015 26
3/12/2015EclipseCon NA 2015 27
3/12/2015EclipseCon NA 2015 28
+1 0 -1Sign in:
www.eclipsecon.org
Evaluate the sessions
3/12/2015EclipseCon NA 2015
29