summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dcopc/dcopc.c8
-rw-r--r--dcopc/dcopobject.c2
-rw-r--r--dcopc/marshal.c27
-rw-r--r--xparts/mozilla/kmozilla.c3
-rw-r--r--xparts/src/gtk/gtkbrowserextension.c2
-rw-r--r--xparts/src/gtk/gtkpart.c4
-rw-r--r--xparts/src/kde/xparthost_kpart.cpp2
7 files changed, 38 insertions, 10 deletions
diff --git a/dcopc/dcopc.c b/dcopc/dcopc.c
index 119371bf..5db11c1d 100644
--- a/dcopc/dcopc.c
+++ b/dcopc/dcopc.c
@@ -115,7 +115,7 @@ static void reply_struct_init( reply_struct *s )
dcop_client_free_error_msg = FALSE; \
}
-#define CLIENT_CLASS(obj) DCOP_CLIENT_CLASS(GTK_OBJECT(obj)->klass)
+#define CLIENT_CLASS(obj) DCOP_CLIENT_CLASS(GTK_OBJECT_GET_CLASS(obj))
static gchar *dcop_client_server_address = 0;
static gchar *dcop_client_error_msg = 0;
@@ -936,7 +936,7 @@ gboolean dcop_client_receive( DcopClient *client,
if ( P->default_object && strlen( P->default_object ) != 0 )
{
o = dcop_object_lookup( P->default_object );
- if ( o && DCOP_OBJECT_CLASS(GTK_OBJECT(o)->klass)->process( o, fun, data, reply_type, reply_data ) )
+ if ( o && DCOP_OBJECT_CLASS(GTK_OBJECT_GET_CLASS(o))->process( o, fun, data, reply_type, reply_data ) )
return TRUE;
}
@@ -957,7 +957,7 @@ gboolean dcop_client_receive( DcopClient *client,
{
o = (DcopObject *)it->data;
- if ( !DCOP_OBJECT_CLASS(GTK_OBJECT(o)->klass)->process( o, fun, data, reply_type, reply_data ) )
+ if ( !DCOP_OBJECT_CLASS(GTK_OBJECT_GET_CLASS(o))->process( o, fun, data, reply_type, reply_data ) )
{
g_list_free( match_list );
g_free( partial_id );
@@ -979,7 +979,7 @@ gboolean dcop_client_receive( DcopClient *client,
o = dcop_object_lookup( obj );
if ( !o )
return FALSE;
- return DCOP_OBJECT_CLASS(GTK_OBJECT(o)->klass)->process( o, fun, data, reply_type, reply_data );
+ return DCOP_OBJECT_CLASS(GTK_OBJECT_GET_CLASS(o))->process( o, fun, data, reply_type, reply_data );
}
static inline gboolean is_ident_char( gchar x )
diff --git a/dcopc/dcopobject.c b/dcopc/dcopobject.c
index ff9d5309..6694282b 100644
--- a/dcopc/dcopobject.c
+++ b/dcopc/dcopobject.c
@@ -29,7 +29,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <string.h>
#include <stdlib.h>
-#define OBJECT_CLASS(obj) DCOP_OBJECT_CLASS(GTK_OBJECT(obj)->klass)
+#define OBJECT_CLASS(obj) DCOP_OBJECT_CLASS(GTK_OBJECT_GET_CLASS(obj))
typedef struct _DcopObjectPrivate DcopObjectPrivate;
diff --git a/dcopc/marshal.c b/dcopc/marshal.c
index e0de9296..4cc804de 100644
--- a/dcopc/marshal.c
+++ b/dcopc/marshal.c
@@ -27,6 +27,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <stdlib.h>
#include <string.h>
+/* The code in previous revisions was broken on little endian system, also see KDE bug #32463 */
+/* The current code was not tested on big endian system, so it could be another issue and big */
+/* endian systems would need the same code as the little endian ones */
+#include <endian.h>
+
dcop_data *dcop_data_new()
{
dcop_data *res = g_new( dcop_data, 1 );
@@ -90,10 +95,21 @@ gboolean dcop_marshal_uint32( dcop_data *data, unsigned int val )
g_assert( sizeof( unsigned int ) == 4 );
+#ifdef __BIG_ENDIAN__
buf[0] = val;
buf[1] = val >> 8;
buf[2] = val >> 16;
buf[3] = val >> 24;
+#endif
+#ifdef __LITTLE_ENDIAN__
+ buf[3] = val;
+ buf[2] = val >> 8;
+ buf[1] = val >> 16;
+ buf[0] = val >> 24;
+#endif
+#if (!defined(__LITTLE_ENDIAN) && !defined(__BIG_ENDIAN))
+#error "You cannot compile the DCOP C bindings without defining either __LITTLE_ENDIAN or __BIG_ENDIAN"
+#endif
return dcop_marshal_raw( data, buf, 4 );
}
@@ -105,10 +121,21 @@ gboolean dcop_demarshal_uint32( dcop_data *data, unsigned int *val )
if ( !dcop_data_check_size( data, 4 ) )
return FALSE;
+#ifdef __BIG_ENDIAN__
*val = (data->cur[3] << 24) |
(data->cur[2] << 16) |
(data->cur[1] << 8) |
data->cur[0];
+#endif
+#ifdef __LITTLE_ENDIAN__
+ *val = (data->cur[0] << 24) |
+ (data->cur[1] << 16) |
+ (data->cur[2] << 8) |
+ data->cur[3];
+#endif
+#if (!defined(__LITTLE_ENDIAN) && !defined(__BIG_ENDIAN))
+#error "You cannot compile the DCOP C bindings without defining either __LITTLE_ENDIAN or __BIG_ENDIAN"
+#endif
data->cur += 4;
return TRUE;
diff --git a/xparts/mozilla/kmozilla.c b/xparts/mozilla/kmozilla.c
index f405ef36..35aa14ed 100644
--- a/xparts/mozilla/kmozilla.c
+++ b/xparts/mozilla/kmozilla.c
@@ -113,8 +113,9 @@ gtk_kmozilla_init(GtkKmozilla *part)
gtk_xpart_set_widget( (GtkXPart *)part, w );
+ /* it seems the reload signal was removed
gtk_signal_connect(GTK_OBJECT(part), "reload",
- GTK_SIGNAL_FUNC(handle_reload), NULL);
+ GTK_SIGNAL_FUNC(handle_reload), NULL); */
gtk_signal_connect(GTK_OBJECT(moz), "open_uri",
GTK_SIGNAL_FUNC(open_url_request), NULL);
diff --git a/xparts/src/gtk/gtkbrowserextension.c b/xparts/src/gtk/gtkbrowserextension.c
index 420bb3d5..7e2310e6 100644
--- a/xparts/src/gtk/gtkbrowserextension.c
+++ b/xparts/src/gtk/gtkbrowserextension.c
@@ -121,7 +121,7 @@ gboolean gtk_xbrowserextension_dcop_process( DcopObject *obj, const char *fun, d
{
GtkXBrowserExtension *part = GTK_XBROWSEREXTENSION(obj);
GtkXBrowserExtensionPrivate *d = (GtkXBrowserExtensionPrivate *)part->data;
- GtkXBrowserExtensionClass *klass = GTK_XBROWSEREXTENSION_CLASS(GTK_OBJECT(part)->klass);
+ GtkXBrowserExtensionClass *klass = GTK_XBROWSEREXTENSION_CLASS(GTK_OBJECT_GET_CLASS(part));
if ( strcmp( fun, "saveState()" ) == 0 )
{
diff --git a/xparts/src/gtk/gtkpart.c b/xparts/src/gtk/gtkpart.c
index 655b7aa5..2a214123 100644
--- a/xparts/src/gtk/gtkpart.c
+++ b/xparts/src/gtk/gtkpart.c
@@ -22,7 +22,7 @@ struct _GtkXPartPrivate {
};
#define P ((GtkXPartPrivate *)(part->data))
-#define CLASS(obj) GTK_XPART_CLASS(GTK_OBJECT(obj)->klass)
+#define CLASS(obj) GTK_XPART_CLASS(GTK_OBJECT_GET_CLASS(obj))
/* class and instance initialization */
@@ -131,7 +131,7 @@ gboolean gtk_xpart_dcop_process( DcopObject *obj, const char *fun, dcop_data *da
{
GtkXPart *part = GTK_XPART(obj);
GtkXPartPrivate *d = (GtkXPartPrivate *)part->data;
- GtkXPartClass *klass = GTK_XPART_CLASS(GTK_OBJECT(part)->klass);
+ GtkXPartClass *klass = GTK_XPART_CLASS(GTK_OBJECT_GET_CLASS(part));
gboolean b;
if ( strcmp( fun, "windowId()" ) == 0 )
diff --git a/xparts/src/kde/xparthost_kpart.cpp b/xparts/src/kde/xparthost_kpart.cpp
index 77def3ff..807ada77 100644
--- a/xparts/src/kde/xparthost_kpart.cpp
+++ b/xparts/src/kde/xparthost_kpart.cpp
@@ -42,11 +42,11 @@ DCOPRef XPartHost_KPart::registerXPart( const DCOPRef &part )
assert( m_stub == 0 );
m_stub = new XPart_stub( part.app(), part.object() );
+ m_stub->show();
kdDebug() << "embedding window " << m_stub->windowId() << endl;
embed->embed( static_cast<WId>( m_stub->windowId() ) );
- m_stub->show();
embed->show();
DCOPRef ref = m_stub->queryExtension("browserextension");
if( !ref.isNull() ) {