Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/npplayerbin0 -> 288729 bytes
-rw-r--r--nspluginwrapper-1.3.0-xid.patch88
-rwxr-xr-xswfactivity.py21
3 files changed, 103 insertions, 6 deletions
diff --git a/bin/npplayer b/bin/npplayer
new file mode 100755
index 0000000..48b9bbc
--- /dev/null
+++ b/bin/npplayer
Binary files differ
diff --git a/nspluginwrapper-1.3.0-xid.patch b/nspluginwrapper-1.3.0-xid.patch
new file mode 100644
index 0000000..c757e42
--- /dev/null
+++ b/nspluginwrapper-1.3.0-xid.patch
@@ -0,0 +1,88 @@
+diff -ur nspluginwrapper-1.3.0-clean/src/npw-player.c nspluginwrapper-1.3.0-xid/src/npw-player.c
+--- nspluginwrapper-1.3.0-clean/src/npw-player.c 2009-12-05 00:02:45.540599262 -0500
++++ nspluginwrapper-1.3.0-xid/src/npw-player.c 2009-12-05 00:32:05.814668671 -0500
+@@ -53,6 +53,7 @@
+
+ static gboolean g_verbose = FALSE;
+ static guint g_backend = BACKEND_GTK;
++static guint g_xid = 0;
+ static guint g_n_plugins = 0;
+
+ typedef struct _Plugin Plugin;
+@@ -511,7 +512,7 @@
+ static inline NPIdentifier
+ pack_int_identifier (int32_t value)
+ {
+-
++
+ return GUINT_TO_POINTER ((((uint32_t)value) << 1) | NP_IDENTIFIER_INT);
+ }
+
+@@ -1638,7 +1639,7 @@
+ continue;
+
+ StreamInstance *pstream;
+-
++
+ CURL *handle = msg->easy_handle;
+ if (curl_easy_getinfo (handle, CURLINFO_PRIVATE, &pstream) == CURLE_OK)
+ {
+@@ -2213,6 +2214,7 @@
+ g_print ("Options:\n");
+ g_print (" -v|--verbose enable verbose mode\n");
+ g_print (" -f|--fullscreen start in fullscreen mode\n");
++ g_print (" --xid N embed in window with xid N\n");
+ g_print ("\n");
+
+ g_print ("Common attributes include:\n");
+@@ -2490,6 +2492,14 @@
+ is_fullscreen = FALSE;
+ else if (strcmp (arg, "--fullscreen") == 0)
+ is_fullscreen = TRUE;
++ else if (strcmp (arg, "--xid") == 0)
++ {
++ if (++i < argc)
++ {
++ g_xid = atoi(argv[i]);
++ npw_printf ("attaching to xid %d\n", g_xid);
++ }
++ }
+ else if (strcmp (arg, "--plugin") == 0)
+ {
+ if (plugin_desc)
+@@ -2581,7 +2591,34 @@
+
+ g_timeout_add (100, (GSourceFunc)player_app_run, app);
+
+- if (TRUE)
++ if (g_xid)
++ {
++ GtkWidget *window = gtk_plug_new ((GdkNativeWindow)g_xid);
++ if ((app->window = window) == NULL)
++ g_error ("could not create plug widget - bad xid?");
++
++ gtk_widget_set_size_request (window, display_width, display_height);
++ gtk_widget_show (window);
++
++ /* Ensure focus window is this window not gtk's proxy for non XEMBED case */
++ XWindowAttributes xattrs;
++ XGetWindowAttributes (GDK_DISPLAY (), GDK_WINDOW_XWINDOW (window->window), &xattrs);
++ XSelectInput (GDK_DISPLAY (),
++ GDK_WINDOW_XWINDOW (window->window),
++ xattrs.your_event_mask | SubstructureNotifyMask);
++ gdk_window_add_filter (window->window, on_window_filter_cb, app);
++ XSync (GDK_DISPLAY (), False);
++
++ g_signal_connect (window, "destroy",
++ G_CALLBACK (on_window_destroy_cb), NULL);
++ g_signal_connect (window, "key-press-event",
++ G_CALLBACK (on_key_press_event_cb), app);
++ g_signal_connect (window, "configure-event",
++ G_CALLBACK (on_configure_event_cb), app);
++ g_signal_connect (window, "window-state-event",
++ G_CALLBACK (on_window_state_event_cb), app);
++ }
++ else
+ {
+ GtkWidget *window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+ if ((app->window = window) == NULL)
diff --git a/swfactivity.py b/swfactivity.py
index 8205e3f..bfc2ff4 100755
--- a/swfactivity.py
+++ b/swfactivity.py
@@ -44,10 +44,19 @@ class SWFActivity(activity.Activity):
self.set_canvas(socket)
self.show_all()
- args = [
- 'gnash',
- '-x', str(socket.get_id()),
- os.path.join(activity.get_bundle_path(), SWFNAME)
- ]
- self._process = subprocess.Popen(args)
+ try:
+ args = [
+ os.path.join(activity.get_bundle_path(), 'bin', 'npplayer'),
+ '--xid', str(socket.get_id()),
+ 'src='+os.path.join(activity.get_bundle_path(), SWFNAME)
+ ]
+ self._process = subprocess.Popen(args)
+
+ except OSError:
+ args = [
+ 'gnash',
+ '-x', str(socket.get_id()),
+ os.path.join(activity.get_bundle_path(), SWFNAME)
+ ]
+ self._process = subprocess.Popen(args)