Deprecated: Function create_function() is deprecated in /home/bluekitc/public_html/ringwald.ch/libxine-java/pmwiki.php on line 456

Deprecated: Function create_function() is deprecated in /home/bluekitc/public_html/ringwald.ch/libxine-java/pmwiki.php on line 456

Deprecated: Function create_function() is deprecated in /home/bluekitc/public_html/ringwald.ch/libxine-java/pmwiki.php on line 456

Deprecated: Function create_function() is deprecated in /home/bluekitc/public_html/ringwald.ch/libxine-java/pmwiki.php on line 456

Deprecated: Function create_function() is deprecated in /home/bluekitc/public_html/ringwald.ch/libxine-java/pmwiki.php on line 456

Deprecated: Function create_function() is deprecated in /home/bluekitc/public_html/ringwald.ch/libxine-java/pmwiki.php on line 456
libxine-java - Java binding for the xine multimedia library : Main - SWT browse

SWT Support Status

To support any Windowing Toolkit, the "only" task is to get a handle to a native widget (X11 window, NSView, win32 Window) and let xine draw into it. For AWT/Swing, this is documented by Sun nicely (look for the term JAWT). For SWT, it looks like it is used rarely and not documented. There are two options to embed or draw into a native widget in SWT:

  • The SWT Composite widget on Linux/GTK+ provides an SWT.EMBEDDED style. If this style is specified, SWT creates a GtkSocket which can be accessed by the embeddedHandle field. GtkSocket allows to embed a native X11 window from any Windowing Toolkit, as long as it supports the XEmbed protocol. The SWT.EMBEDDED style is only supported on Linux/GTK+.
  • The SWT Canvas and SWT Composite widgets have a public handle field which is the native handle. This is a HWND on Windows, a GtkWidget on Linux/GTK+ and a Pane on Mac OS X Carbon.

GtkSocket Experience

The C++ examples in the gtkmm documentation worked fine. My C version of them worked, when used without SWT. But the native plug did not show in the SWT Composite. See this post on the eclipse.platform.org newsgroup if you have an idea how to fix this.

Native Drawing in an SWT Canvas

The second approach basically works for SWT/GTK+. A native function can directly use the Canvas.handle as a GtkWidet pointer. This pointer is enough to get the native X11 Window XID via

 gdk_x11_drawable_get_xid ( GDK_DRAWABLE(drawable->window)

A PaintControlListener and a ControlListener are required to catch redraw and resize events.
See Native drawing on SWT/GTK+ for a detailed example on this.

The SVN version of libxine-java already supports SWT incl. Fullscreen mode in an alpha state. Try example/MuXineSWT.java for the first SWT libxine-java video player. Stay tuned..