|
From: <br...@us...> - 2008-10-25 06:59:48
|
Revision: 3748
http://openvrml.svn.sourceforge.net/openvrml/?rev=3748&view=rev
Author: braden
Date: 2008-10-25 06:59:43 +0000 (Sat, 25 Oct 2008)
Log Message:
-----------
Ensure the XEmbed control host identifier is consistently treated as a 64-bit type.
Modified Paths:
--------------
branches/0.17/ChangeLog
branches/0.17/mozilla-plugin/src/Makefile.am
branches/0.17/mozilla-plugin/src/openvrml.cpp
branches/0.17/src/Makefile.am
branches/0.17/src/openvrml-player/curlbrowserhost.cpp
Modified: branches/0.17/ChangeLog
===================================================================
--- branches/0.17/ChangeLog 2008-10-25 04:32:33 UTC (rev 3747)
+++ branches/0.17/ChangeLog 2008-10-25 06:59:43 UTC (rev 3748)
@@ -1,5 +1,37 @@
2008-10-25 Braden McDaniel <br...@en...>
+ Ensure the XEmbed control host identifier is consistently treated
+ as a 64-bit type.
+
+ * mozilla-plugin/src/Makefile.am: Generate client code for
+ org.openvrml.Browser and org.openvrml.BrowserFactory.
+ * mozilla-plugin/src/openvrml.cpp
+ (get_browser(DBusGConnection *, const char *, const char *,
+ guint64, GError **)): Use the generated function
+ org_openvrml_BrowserFactory_create_control.
+ (plugin_instance::new_stream(NPMIMEType, NPStream *)): Use the
+ generated function org_openvrml_Browser_new_stream.
+ (plugin_instance::destroy_stream(NPStream *)): Cast the stream
+ identifier to guint64.
+ (plugin_instance::write(NPStream *, int32, void *)): Cast the
+ stream identifier to guint64.
+ * src/Makefile.am: Generate client code for org.openvrml.Browser
+ and org.openvrml.BrowserFactory.
+ * src/openvrml-player/curlbrowserhost.cpp
+ (openvrml_player_curl_browser_host_realize(GtkWidget *)): Use the
+ generated function org_openvrml_Browser_get_id.
+ (openvrml_player_curl_browser_host_curl_source_callback(gpointer)):
+ Cast the stream identifier to guint64.
+ (openvrml_player_curl_browser_host_curl_write(void *, size_t,
+ size_t, void *)): Use the generated function
+ org_openvrml_Browser_new_stream; cast the stream identifier to
+ guint64.
+ (get_browser(DBusGConnection *, const char *, const char *,
+ guint64, GError **)): Use the generated function
+ org_openvrml_BrowserFactory_create_control.
+
+2008-10-25 Braden McDaniel <br...@en...>
+
Fixed signature of openvrml_xembed_browser_factory_create_control
to use guint64 for the host_id.
Modified: branches/0.17/mozilla-plugin/src/Makefile.am
===================================================================
--- branches/0.17/mozilla-plugin/src/Makefile.am 2008-10-25 04:32:33 UTC (rev 3747)
+++ branches/0.17/mozilla-plugin/src/Makefile.am 2008-10-25 06:59:43 UTC (rev 3748)
@@ -7,7 +7,10 @@
if ENABLE_MOZILLA_PLUGIN
mozplugins_LTLIBRARIES = openvrml.la
-BUILT_SOURCES = browser-host-server-glue.h
+BUILT_SOURCES = \
+ browser-host-server-glue.h \
+ browser-factory-client-glue.h \
+ browser-client-glue.h
endif
openvrml_la_SOURCES = openvrml.cpp
@@ -23,6 +26,18 @@
--output=$@ \
$?
+browser-factory-client-glue.h: $(top_srcdir)/../src/openvrml-xembed/browser-factory.xml
+ $(LIBTOOL) --mode=execute $(DBUS_BINDING_TOOL) \
+ --mode=glib-client \
+ --output=$@ \
+ $?
+
+browser-client-glue.h: $(top_srcdir)/../src/openvrml-xembed/browser.xml
+ $(LIBTOOL) --mode=execute $(DBUS_BINDING_TOOL) \
+ --mode=glib-client \
+ --output=$@ \
+ $?
+
EXTRA_DIST = $(openvrml_la_SOURCES)
CLEANFILES = $(BUILT_SOURCES)
Modified: branches/0.17/mozilla-plugin/src/openvrml.cpp
===================================================================
--- branches/0.17/mozilla-plugin/src/openvrml.cpp 2008-10-25 04:32:33 UTC (rev 3747)
+++ branches/0.17/mozilla-plugin/src/openvrml.cpp 2008-10-25 06:59:43 UTC (rev 3748)
@@ -70,6 +70,8 @@
G_END_DECLS
# include "browser-host-server-glue.h"
+# include "browser-factory-client-glue.h"
+# include "browser-client-glue.h"
using namespace boost::multi_index::detail; // for scope_guard
@@ -135,7 +137,7 @@
void openvrml_np_browser_host_init(OpenvrmlNpBrowserHost * const host)
{
- static size_t count = 0;
+ static unsigned long count = 0;
host->path = g_strdup_printf("/org/openvrml/BrowserHost/%u/%lu",
getpid(), count++);
dbus_g_connection_register_g_object(
@@ -1170,16 +1172,13 @@
boost::ignore_unused_variable_warning(browser_factory_guard);
char * browser_path = 0;
- if (!dbus_g_proxy_call(browser_factory,
- "CreateControl",
- error,
- G_TYPE_STRING, host_name,
- DBUS_TYPE_G_OBJECT_PATH, host_path,
- G_TYPE_UINT64, host_id,
- G_TYPE_BOOLEAN, true,
- G_TYPE_INVALID,
- DBUS_TYPE_G_OBJECT_PATH, &browser_path,
- G_TYPE_INVALID)) {
+ if (!org_openvrml_BrowserFactory_create_control(browser_factory,
+ host_name,
+ host_path,
+ host_id,
+ true,
+ &browser_path,
+ error)) {
return 0;
}
@@ -1235,14 +1234,11 @@
GError * error = 0;
scope_guard error_guard = make_guard(g_error_free, boost::ref(error));
- gboolean result = dbus_g_proxy_call(this->browser,
- "NewStream",
- &error,
- G_TYPE_UINT64, stream,
- G_TYPE_STRING, type,
- G_TYPE_STRING, stream->url,
- G_TYPE_INVALID,
- G_TYPE_INVALID);
+ gboolean result = org_openvrml_Browser_new_stream(this->browser,
+ guint64(stream),
+ type,
+ stream->url,
+ &error);
if (!result) {
g_critical("Call to org.openvrml.Browser.NewStream failed: %s",
error->message);
@@ -1258,7 +1254,7 @@
dbus_g_proxy_call_no_reply(this->browser,
"DestroyStream",
- G_TYPE_UINT64, stream,
+ G_TYPE_UINT64, guint64(stream),
G_TYPE_INVALID);
return NPERR_NO_ERROR;
}
@@ -1275,7 +1271,7 @@
dbus_g_proxy_call_no_reply(this->browser,
"Write",
- G_TYPE_UINT64, stream,
+ G_TYPE_UINT64, guint64(stream),
DBUS_TYPE_G_UCHAR_ARRAY, &array,
G_TYPE_INVALID);
return len;
Modified: branches/0.17/src/Makefile.am
===================================================================
--- branches/0.17/src/Makefile.am 2008-10-25 04:32:33 UTC (rev 3747)
+++ branches/0.17/src/Makefile.am 2008-10-25 06:59:43 UTC (rev 3748)
@@ -234,7 +234,9 @@
if ENABLE_PLAYER
bin_PROGRAMS = openvrml-player/openvrml-player
BUILT_SOURCES += \
- openvrml-player/browser-host-server-glue.h
+ openvrml-player/browser-host-server-glue.h \
+ openvrml-player/browser-factory-client-glue.h \
+ openvrml-player/browser-client-glue.h
endif
openvrml_player_openvrml_player_CPPFLAGS = \
@@ -274,6 +276,18 @@
--output=$@ \
$?
+openvrml-player/browser-factory-client-glue.h: $(srcdir)/openvrml-xembed/browser-factory.xml
+ $(LIBTOOL) --mode=execute $(DBUS_BINDING_TOOL) \
+ --mode=glib-client \
+ --output=$@ \
+ $?
+
+openvrml-player/browser-client-glue.h: $(srcdir)/openvrml-xembed/browser.xml
+ $(LIBTOOL) --mode=execute $(DBUS_BINDING_TOOL) \
+ --mode=glib-client \
+ --output=$@ \
+ $?
+
EXTRA_DIST = \
libopenvrml/openvrml-config.h.in \
libopenvrml-gl/openvrml-gl-config.h.in \
Modified: branches/0.17/src/openvrml-player/curlbrowserhost.cpp
===================================================================
--- branches/0.17/src/openvrml-player/curlbrowserhost.cpp 2008-10-25 04:32:33 UTC (rev 3747)
+++ branches/0.17/src/openvrml-player/curlbrowserhost.cpp 2008-10-25 06:59:43 UTC (rev 3748)
@@ -21,6 +21,8 @@
# include <curl/curl.h>
# include <libgnomevfs/gnome-vfs.h>
# include <browser-host-server-glue.h>
+# include <browser-factory-client-glue.h>
+# include <browser-client-glue.h>
# include <dbus/dbus-glib-bindings.h>
# include <dbus/dbus-protocol.h>
# include <boost/concept_check.hpp>
@@ -90,7 +92,7 @@
browser_host->priv =
OPENVRML_PLAYER_CURL_BROWSER_HOST_GET_PRIVATE(browser_host);
- static size_t count = 0;
+ static unsigned long count = 0;
browser_host->priv->path =
g_strdup_printf("/org/openvrml/BrowserHost/%u/%lu",
getpid(), count++);
@@ -255,12 +257,8 @@
}
guint64 plug_id = 0;
- if (!dbus_g_proxy_call(browser_host->priv->browser,
- "GetId",
- &error,
- G_TYPE_INVALID,
- G_TYPE_UINT64, &plug_id,
- G_TYPE_INVALID)) {
+ if (!org_openvrml_Browser_get_id(browser_host->priv->browser, &plug_id,
+ &error)) {
g_critical("Call to org.openvrml.Browser.GetId failed: %s",
error->message);
return;
@@ -726,7 +724,7 @@
dbus_g_proxy_call_no_reply(
browser_host->priv->browser,
"DestroyStream",
- G_TYPE_UINT64, msg->easy_handle,
+ G_TYPE_UINT64, guint64(msg->easy_handle),
G_TYPE_INVALID);
}
@@ -795,15 +793,12 @@
GError * error = 0;
scope_guard error_guard = make_guard(g_error_free, boost::ref(error));
gboolean new_stream_result =
- dbus_g_proxy_call(
+ org_openvrml_Browser_new_stream(
stream_data.browser(),
- "NewStream",
- &error,
- G_TYPE_UINT64, stream_data.handle(),
- G_TYPE_STRING, (type ? type : "application/octet-stream"),
- G_TYPE_STRING, stream_data.url(),
- G_TYPE_INVALID,
- G_TYPE_INVALID);
+ guint64(stream_data.handle()),
+ (type ? type : "application/octet-stream"),
+ stream_data.url(),
+ &error);
if (!new_stream_result) {
g_critical("Call to org.openvrml.Browser.NewStream failed: %s",
error->message);
@@ -832,7 +827,7 @@
dbus_g_proxy_call_no_reply(stream_data.browser(),
"Write",
- G_TYPE_UINT64, stream_data.handle(),
+ G_TYPE_UINT64, guint64(stream_data.handle()),
DBUS_TYPE_G_UCHAR_ARRAY, &array,
G_TYPE_INVALID);
g_assert(size == 1);
@@ -863,16 +858,14 @@
boost::ignore_unused_variable_warning(browser_factory_guard);
char * browser_path = 0;
- if (!dbus_g_proxy_call(browser_factory,
- "CreateControl",
- error,
- G_TYPE_STRING, host_name,
- DBUS_TYPE_G_OBJECT_PATH, host_path,
- G_TYPE_UINT64, host_id,
- G_TYPE_BOOLEAN, false,
- G_TYPE_INVALID,
- DBUS_TYPE_G_OBJECT_PATH, &browser_path,
- G_TYPE_INVALID)) {
+ if (!org_openvrml_BrowserFactory_create_control(
+ browser_factory,
+ host_name,
+ host_path,
+ host_id,
+ false,
+ &browser_path,
+ error)) {
return 0;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|