gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] [sr #107543] Building the Gnash libraries into my applica


From: Nutchanon Wetchasit
Subject: [Gnash-commit] [sr #107543] Building the Gnash libraries into my application
Date: Sun, 29 May 2016 09:47:15 +0000 (UTC)
User-agent: Opera/9.80 (Windows NT 5.1; U; en) Presto/2.10.229 Version/11.64

Follow-up Comment #1, sr #107543 (project gnash):

This support thread is quite old, but since I have never found anyone writing
example on how to do this, I'm going to document it here in case anyone need
it.

As you probably know, Gnash is divided into few libraries (libgnashbase,
libgnashcore, libgnashsound, libgnashmedia, libgnashdevice, and
libgnashrender), and player applications (gtk-gnash, qt-gnash, sdl-gnash,
fb-gnash, and dump-gnash).

*But* if you are going to just play SWF file, I'd personally *advice against*
using Gnash's internal libraries directly (they are not documented, and prone
to changes).

Instead, invoke Gnash as an external application, and instruct it to display
output inside your program, using toolkit's XEmbed
<https://www.freedesktop.org/wiki/Specifications/xembed-spec/> feature.
(Gnash's Firefox plugin worked this way too).

To do so, your application must place an XEmbed widget on the screen, obtain
X11 window ID from your widget, then start Gnash externally with `--xid`
parameter supplying the window ID you just obtained. Once Gnash started, the
SWF will display inside your application's widget, and user could interact
with it the same way as you did in Gnash.

For Qt4 application (your case), the XEmbed container widget is
QX11EmbedContainer <http://doc.qt.io/qt-4.8/qx11embedcontainer.html> class. To
obtain X11 window ID of the widget, use `QWidget::winId()`
<http://doc.qt.io/qt-4.8/qwidget.html#winId>

For GTK2 application, the XEmbed container widget is GtkSocket
<https://developer.gnome.org/gtk2/2.24/GtkSocket.html> class.
To obtain X11 window ID of the widget, use `gtk_socket_get_id()`
<https://developer.gnome.org/gtk2/2.24/GtkSocket.html#gtk-socket-get-id>.

As you used Qt, it is better if you run `qt4-gnash` rather than `gtk-gnash` or
plain `gnash`, as GTK Gnash has some resizing problem when embeded into Qt4
application.

When you are finished with the SWF-displaying screen, don't forget to kill
Gnash process that you have launched too.


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/support/?107543>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]