About me

我的相片
I'm a web and software developer from Kaohsiung, Taiwan.
I design and implement user interfaces, also contribute to open source projects.
http://penkia.net/portfolio

2014年2月20日 星期四

Enable Touchscreen Support on Oxide

Wow, So Viewport, Very Gesture

Oxide WebView merged touchscreen support in revision.378, oxide-qt package lands in PPA, so I updated the EGLFS patch accordingly.

How to Use It

To enable pinch gesture and viewport, you'll need a SharedGLContext created to do accelerated compositing, so the tool oxideqmlscene comes in handy:

$ export OXIDE_FORCE_FORM_FACTOR=tablet

$ cat << EOF > web.qml
import QtQuick 2.0
import com.canonical.Oxide 0.1
WebView { 
width: 800; height: 600
url: 'http://duckduckgo.com'
}
EOF

$ oxideqmlscene web.qml 

And there you go. Technical preview of SlateKit Base also upgraded: slatekit-base-tp-02202014.iso (97MB)

2014年2月8日 星期六

Introducing SlateKit Base - Technical Preview

SlateKit Base technical preview is now available for download:

What?

SlateKit Base is a small Linux distribution (binary compatible with Ubuntu 14.04 amd64), with specially configured Qt 5.2.0, Mesa 10.0.1, two web engine/renderer: the default QtWebKit, and Oxide, which based on Chromium/Blink.

The whole graphical stacks are merely framebuffer (both KMS and uvesafb), EGL surface, and Qt/QtQuick has made rest of the user interface. No X11, Mir nor Wayland are being used.

Why?

The purpose of SlateKit Base is for demonstrating the capabilities of SlateKit project. Most of the key components of SlateKit are preloaded, including the Web Browser, On-Screen Keyboard, and Input Method. I'll add Launcher and Network Manager into next release.

How Do I Get This Thing Running?

As always, this image works on VirtualBox, default it boots into command line with 1024x768-32 screen resolution by using uvesafb driver, you can switch screen resolution with boot parameter like: screen=800x600-32. Network can be configure by:

# ifconfig eth0 up 
# udhcpc -s /etc/udhcpc.script 

Then start the web browser by oxide or slatekit-shell command:

# oxide 

Oxide example file is located under /usr/share/SlateKit/Oxide/web.qml, and SlateKit Shell is /usr/share/SlateKit/Shell/qml/Shell.qml. Don't forget to turn off VirtualBox's mouse integration (Command + I) if you're on Mac OSX.

Can I Use It on Real Device?

This release comes with limited driver selection. If you have Intel, nVidia or AMD/ATi device that supported by KMS, you can create a bootable USB drive using dd command, and try booting SlateKit Base on it with following boot parameter:

boot: slatekit debug=1 

And start udev:

# udevd --daemon
# udevadm trigger  
If everything works fine it will drop you into a command line with native framebuffer resolution, then you can launch the browser as usual.

Contact

If you have any thought, question, demo or hardware support request, please feel free to send me a mail or contact me on Twitter @penk.

Happy Hacking!
penk

2014年2月4日 星期二

Oxide WebView on EGLFS QPA

Oxide WebView is a QML wrapper of Chromium content API, just like QtWebEngine. I've been following Chris' development for a while now, it's (surprisingly) usable if you consider its early stage. For those who doesn't want to build Chromium but would like to try, here's the package oxide-qt PPA for amd64/i386 and armhf architecture.

Oxide was designed to be a replacement of QtWebKit and using on Ubuntu Touch, so it's no surprise it supports Mir, Ubuntu (legacy) and XCB QPA by default. As a big fan of Qt's EGLFS plugin, I couldn't be happier to have a Chromium rendered web browser running on bare-metal with nothing but framebuffer and EGL.

So here it is, enable_oxide_on_eglfs.patch. To use it you'll need a fbdev backend enabled Mesa, also Qt 5.2 configured with -opengl es2, and start qmlscene like:

export QT_QPA_PLATFORM=eglfs
export EGL_PLATFORM=fbdev
export EGL_DRIVER=egl_gallium 

qmlscene ./web.qml

Which web.qml may look like this:

import QtQuick 2.0
import com.canonical.Oxide 0.1

WebView {
    width: 800
    height: 600
    url: "https://duckduckgo.com"
}

My talk proposal of SlateKit just got accepted by FOSSASIA 2014, so more information on this matter will be published here later. Stay tuned. :-)

2014年1月7日 星期二

LiveReload for QML

If you're like me, don't use QtCreator much, prefer command line and usually have a simple QtQuick view, then this is for you: https://github.com/penk/qml-livereload

QML LiveReload takes QFileSystemWatcher to monitor file changes, and lively updates the view when possible. It's no match for what QtCreator does but comes handy for simple projects.

Update:

Works on remote device too:

2013年12月24日 星期二

How to Pack a Qt Web Browser on Mac OSX

Copy QtWebProcess into app bundle (in our case, SlateKit.app):

mkdir -p SlateKit.app/Contents/libexec
cp ~/Qt5.2.0/5.2.0/clang_64/libexec/QtWebProcess SlateKit.app/Contents/libexec/

Set QPA and plugin path:

cat > SlateKit.app/Contents/libexec/qt.conf << EOF
[Paths]
Plugins = ../../PlugIns
Imports = ../../Resources/qml
Qml2Imports = ../../Resources/qml
EOF

Make the app bundle self-contained:

~/Qt5.2.0/5.2.0/clang_64/bin/macdeployqt SlateKit.app -qmldir=qml/ -executable=SlateKit.app/Contents/libexec/QtWebProcess -verbose=3 -dmg

Note there's a known bug of macdeployqt before Qt 5.1, here is a patched one.

More SlateKit Shell packages

In addition to the PPA and deb package, SlateKit Shell has been packed into several formats:

This can already be found on the Ubuntu Touch Software Centre:

2013年6月16日 星期日

SlateKit's handwriting recognition ported to Ubuntu Touch

One of the major components of SlakteKit project is its handwriting recognition input method. It's a usable fully open source solution, consists of Tegaki model, Zinnia engine and a simple QML Canvas stroke detection.

With a patch to maliit-keyboard, and my qtdeclarative5-zinnia-plugin package, it's now being ported to Ubuntu Touch:

I'll keep polishing the keyboard layout and settings of maliit. You can follow me on Twitter or the discussion thread at Ubuntu App Developers for updates.

Happy hacking,
penk