diff -ruN kdelibs-2.2.2.orig/arts/kde/libartskde_la_closure.cc kdelibs-2.2.2/arts/kde/libartskde_la_closure.cc
--- kdelibs-2.2.2.orig/arts/kde/libartskde_la_closure.cc	1970-01-01 03:00:00.000000000 +0300
+++ kdelibs-2.2.2/arts/kde/libartskde_la_closure.cc	2007-06-11 17:47:24.000000000 +0400
@@ -0,0 +1 @@
+int main() {return 0;}
diff -ruN kdelibs-2.2.2.orig/arts/mcop/anyref.cc kdelibs-2.2.2/arts/mcop/anyref.cc
--- kdelibs-2.2.2.orig/arts/mcop/anyref.cc	2000-12-08 04:15:01.000000000 +0300
+++ kdelibs-2.2.2/arts/mcop/anyref.cc	2007-06-11 17:33:43.000000000 +0400
@@ -21,7 +21,7 @@
     */
 
 #include "anyref.h"
-#include "core.h"
+#include "common.h"
 #include "startupmanager.h"
 #include "debug.h"
 #include <assert.h>
diff -ruN kdelibs-2.2.2.orig/arts/mcop/arts_export.h kdelibs-2.2.2/arts/mcop/arts_export.h
--- kdelibs-2.2.2.orig/arts/mcop/arts_export.h	1970-01-01 03:00:00.000000000 +0300
+++ kdelibs-2.2.2/arts/mcop/arts_export.h	2007-06-11 17:33:43.000000000 +0400
@@ -0,0 +1,54 @@
+/* mcop/arts_export.h.  Generated from arts_export.h.in by configure.  */
+/* This file is part of the KDE libraries
+    Copyright (c) 2002-2003 KDE Team
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+    Boston, MA 02111-1307, USA.
+*/
+
+#ifndef ARTS_EXPORT_H
+#define ARTS_EXPORT_H
+
+/* #undef __KDE_HAVE_GCC_VISIBILITY */
+
+/**
+ * The ARTS_NO_EXPORT macro marks the symbol of the given variable 
+ * to be hidden. A hidden symbol is stripped during the linking step, 
+ * so it can't be used from outside the resulting library, which is similar
+ * to static. However, static limits the visibility to the current 
+ * compilation unit. hidden symbols can still be used in multiple compilation
+ * units.
+ *
+ * \code
+ * int ARTS_NO_EXPORT foo;
+ * int ARTS_EXPORT bar;
+ * \end
+ */
+
+#if defined(__KDE_HAVE_GCC_VISIBILITY)
+/* Visibility is available for GCC newer than 3.4.
+ * See: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9283 
+ */
+#define ARTS_NO_EXPORT __attribute__ ((visibility("hidden")))
+#define ARTS_EXPORT __attribute__ ((visibility("default")))
+#elif defined(_WIN32)
+#define ARTS_NO_EXPORT
+#define ARTS_EXPORT __declspec(dllexport)
+#else
+#define ARTS_NO_EXPORT
+#define ARTS_EXPORT
+#endif
+
+#endif /* ARTS_EXPORTS */
diff -ruN kdelibs-2.2.2.orig/arts/mcop/core.cc kdelibs-2.2.2/arts/mcop/core.cc
--- kdelibs-2.2.2.orig/arts/mcop/core.cc	2001-05-09 02:19:54.000000000 +0400
+++ kdelibs-2.2.2/arts/mcop/core.cc	2007-06-11 17:33:43.000000000 +0400
@@ -1,6 +1,6 @@
 /* this file was generated by the MCOP idl compiler - DO NOT EDIT */
 
-#include "core.h"
+#include "common.h"
 
 // Implementation
 Arts::Header::Header()
@@ -48,6 +48,11 @@
 	stream.writeLong(messageType);
 }
 
+std::string Arts::Header::_typeName() const
+{
+	return "Arts::Header";
+}
+
 Arts::Invocation::Invocation()
 {
 }
@@ -93,6 +98,11 @@
 	stream.writeLong(requestID);
 }
 
+std::string Arts::Invocation::_typeName() const
+{
+	return "Arts::Invocation";
+}
+
 Arts::OnewayInvocation::OnewayInvocation()
 {
 }
@@ -135,6 +145,11 @@
 	stream.writeLong(methodID);
 }
 
+std::string Arts::OnewayInvocation::_typeName() const
+{
+	return "Arts::OnewayInvocation";
+}
+
 Arts::ServerHello::ServerHello()
 {
 }
@@ -183,6 +198,11 @@
 	stream.writeString(authSeed);
 }
 
+std::string Arts::ServerHello::_typeName() const
+{
+	return "Arts::ServerHello";
+}
+
 Arts::ClientHello::ClientHello()
 {
 }
@@ -228,6 +248,11 @@
 	stream.writeString(authData);
 }
 
+std::string Arts::ClientHello::_typeName() const
+{
+	return "Arts::ClientHello";
+}
+
 Arts::AuthAccept::AuthAccept()
 {
 }
@@ -267,6 +292,11 @@
 	stream.writeStringSeq(hints);
 }
 
+std::string Arts::AuthAccept::_typeName() const
+{
+	return "Arts::AuthAccept";
+}
+
 Arts::ObjectReference::ObjectReference()
 {
 }
@@ -312,6 +342,11 @@
 	stream.writeStringSeq(urls);
 }
 
+std::string Arts::ObjectReference::_typeName() const
+{
+	return "Arts::ObjectReference";
+}
+
 Arts::ParamDef::ParamDef()
 {
 }
@@ -357,6 +392,11 @@
 	stream.writeStringSeq(hints);
 }
 
+std::string Arts::ParamDef::_typeName() const
+{
+	return "Arts::ParamDef";
+}
+
 Arts::MethodDef::MethodDef()
 {
 }
@@ -408,6 +448,11 @@
 	stream.writeStringSeq(hints);
 }
 
+std::string Arts::MethodDef::_typeName() const
+{
+	return "Arts::MethodDef";
+}
+
 Arts::AttributeDef::AttributeDef()
 {
 }
@@ -456,6 +501,11 @@
 	stream.writeStringSeq(hints);
 }
 
+std::string Arts::AttributeDef::_typeName() const
+{
+	return "Arts::AttributeDef";
+}
+
 Arts::InterfaceDef::InterfaceDef()
 {
 }
@@ -510,6 +560,11 @@
 	stream.writeStringSeq(hints);
 }
 
+std::string Arts::InterfaceDef::_typeName() const
+{
+	return "Arts::InterfaceDef";
+}
+
 Arts::TypeComponent::TypeComponent()
 {
 }
@@ -555,6 +610,11 @@
 	stream.writeStringSeq(hints);
 }
 
+std::string Arts::TypeComponent::_typeName() const
+{
+	return "Arts::TypeComponent";
+}
+
 Arts::TypeDef::TypeDef()
 {
 }
@@ -600,6 +660,11 @@
 	stream.writeStringSeq(hints);
 }
 
+std::string Arts::TypeDef::_typeName() const
+{
+	return "Arts::TypeDef";
+}
+
 Arts::EnumComponent::EnumComponent()
 {
 }
@@ -645,6 +710,11 @@
 	stream.writeStringSeq(hints);
 }
 
+std::string Arts::EnumComponent::_typeName() const
+{
+	return "Arts::EnumComponent";
+}
+
 Arts::EnumDef::EnumDef()
 {
 }
@@ -690,6 +760,11 @@
 	stream.writeStringSeq(hints);
 }
 
+std::string Arts::EnumDef::_typeName() const
+{
+	return "Arts::EnumDef";
+}
+
 Arts::ModuleDef::ModuleDef()
 {
 }
@@ -741,6 +816,11 @@
 	stream.writeStringSeq(hints);
 }
 
+std::string Arts::ModuleDef::_typeName() const
+{
+	return "Arts::ModuleDef";
+}
+
 Arts::Any::Any()
 {
 }
@@ -783,6 +863,11 @@
 	stream.writeByteSeq(value);
 }
 
+std::string Arts::Any::_typeName() const
+{
+	return "Arts::Any";
+}
+
 Arts::TraderEntry::TraderEntry()
 {
 }
@@ -825,6 +910,11 @@
 	stream.writeStringSeq(lines);
 }
 
+std::string Arts::TraderEntry::_typeName() const
+{
+	return "Arts::TraderEntry";
+}
+
 Arts::InterfaceRepo_base *Arts::InterfaceRepo_base::_create(const std::string& subClass)
 {
 	Arts::Object_skel *skel = Arts::ObjectManager::the()->create(subClass);
@@ -917,7 +1007,7 @@
 	_connection->qSendBuffer(request);
 
 	result = Arts::Dispatcher::the()->waitForResult(requestID,_connection);
-	if(!result) return 0; // error occured
+	if(!result) return 0; // error occurred
 	long returnCode = result->readLong();
 	delete result;
 	return returnCode;
@@ -948,7 +1038,7 @@
 	_connection->qSendBuffer(request);
 
 	result = Arts::Dispatcher::the()->waitForResult(requestID,_connection);
-	if(!result) return Arts::InterfaceDef(); // error occured
+	if(!result) return Arts::InterfaceDef(); // error occurred
 	Arts::InterfaceDef _returnCode(*result);
 	delete result;
 	return _returnCode;
@@ -965,7 +1055,7 @@
 	_connection->qSendBuffer(request);
 
 	result = Arts::Dispatcher::the()->waitForResult(requestID,_connection);
-	if(!result) return Arts::TypeDef(); // error occured
+	if(!result) return Arts::TypeDef(); // error occurred
 	Arts::TypeDef _returnCode(*result);
 	delete result;
 	return _returnCode;
@@ -982,7 +1072,7 @@
 	_connection->qSendBuffer(request);
 
 	result = Arts::Dispatcher::the()->waitForResult(requestID,_connection);
-	if(!result) return Arts::EnumDef(); // error occured
+	if(!result) return Arts::EnumDef(); // error occurred
 	Arts::EnumDef _returnCode(*result);
 	delete result;
 	return _returnCode;
@@ -1000,7 +1090,7 @@
 
 	result = Arts::Dispatcher::the()->waitForResult(requestID,_connection);
 	std::vector<std::string> *_returnCode = new std::vector<std::string>;
-	if(!result) return _returnCode; // error occured
+	if(!result) return _returnCode; // error occurred
 	result->readStringSeq(*_returnCode);
 	delete result;
 	return _returnCode;
@@ -1017,7 +1107,7 @@
 
 	result = Arts::Dispatcher::the()->waitForResult(requestID,_connection);
 	std::vector<std::string> *_returnCode = new std::vector<std::string>;
-	if(!result) return _returnCode; // error occured
+	if(!result) return _returnCode; // error occurred
 	result->readStringSeq(*_returnCode);
 	delete result;
 	return _returnCode;
@@ -1034,7 +1124,7 @@
 
 	result = Arts::Dispatcher::the()->waitForResult(requestID,_connection);
 	std::vector<std::string> *_returnCode = new std::vector<std::string>;
-	if(!result) return _returnCode; // error occured
+	if(!result) return _returnCode; // error occurred
 	result->readStringSeq(*_returnCode);
 	delete result;
 	return _returnCode;
@@ -1051,7 +1141,7 @@
 
 	result = Arts::Dispatcher::the()->waitForResult(requestID,_connection);
 	std::vector<std::string> *_returnCode = new std::vector<std::string>;
-	if(!result) return _returnCode; // error occured
+	if(!result) return _returnCode; // error occurred
 	result->readStringSeq(*_returnCode);
 	delete result;
 	return _returnCode;
@@ -1286,7 +1376,7 @@
 	_connection->qSendBuffer(request);
 
 	result = Arts::Dispatcher::the()->waitForResult(requestID,_connection);
-	if(!result) return (Arts::TypeIdentification)0; // error occured
+	if(!result) return (Arts::TypeIdentification)0; // error occurred
 	Arts::TypeIdentification returnCode = (Arts::TypeIdentification)result->readLong();
 	delete result;
 	return returnCode;
@@ -1600,7 +1690,7 @@
 	_connection->qSendBuffer(request);
 
 	result = Arts::Dispatcher::the()->waitForResult(requestID,_connection);
-	if(!result) return 0; // error occured
+	if(!result) return 0; // error occurred
 	long returnCode = result->readLong();
 	delete result;
 	return returnCode;
@@ -1813,7 +1903,7 @@
 	_connection->qSendBuffer(request);
 
 	result = Arts::Dispatcher::the()->waitForResult(requestID,_connection);
-	if(!result) return (Arts::AttributeType)0; // error occured
+	if(!result) return (Arts::AttributeType)0; // error occurred
 	Arts::AttributeType returnCode = (Arts::AttributeType)result->readLong();
 	delete result;
 	return returnCode;
@@ -2103,7 +2193,7 @@
 	_connection->qSendBuffer(request);
 
 	result = Arts::Dispatcher::the()->waitForResult(requestID,_connection);
-	if(!result) return false; // error occured
+	if(!result) return false; // error occurred
 	bool returnCode = result->readBool();
 	delete result;
 	return returnCode;
@@ -2120,7 +2210,7 @@
 	_connection->qSendBuffer(request);
 
 	result = Arts::Dispatcher::the()->waitForResult(requestID,_connection);
-	if(!result) return""; // error occured
+	if(!result) return""; // error occurred
 	std::string returnCode;
 	result->readString(returnCode);
 	delete result;
@@ -2425,7 +2515,7 @@
 
 	result = Arts::Dispatcher::the()->waitForResult(requestID,_connection);
 	std::vector<std::string> *_returnCode = new std::vector<std::string>;
-	if(!result) return _returnCode; // error occured
+	if(!result) return _returnCode; // error occurred
 	result->readStringSeq(*_returnCode);
 	delete result;
 	return _returnCode;
@@ -2441,7 +2531,7 @@
 	_connection->qSendBuffer(request);
 
 	result = Arts::Dispatcher::the()->waitForResult(requestID,_connection);
-	if(!result) return""; // error occured
+	if(!result) return""; // error occurred
 	std::string returnCode;
 	result->readString(returnCode);
 	delete result;
@@ -2612,7 +2702,7 @@
 
 	result = Arts::Dispatcher::the()->waitForResult(requestID,_connection);
 	std::vector<Arts::TraderOffer> *_returnCode = new std::vector<Arts::TraderOffer>;
-	if(!result) return _returnCode; // error occured
+	if(!result) return _returnCode; // error occurred
 	Arts::readObjectSeq(*result,*_returnCode);
 	delete result;
 	return _returnCode;
@@ -2787,7 +2877,7 @@
 	_connection->qSendBuffer(request);
 
 	result = Arts::Dispatcher::the()->waitForResult(requestID,_connection);
-	if(!result) return""; // error occured
+	if(!result) return""; // error occurred
 	std::string returnCode;
 	result->readString(returnCode);
 	delete result;
@@ -2805,7 +2895,7 @@
 
 	result = Arts::Dispatcher::the()->waitForResult(requestID,_connection);
 	std::vector<Arts::TraderEntry> *_returnCode = new std::vector<Arts::TraderEntry>;
-	if(!result) return _returnCode; // error occured
+	if(!result) return _returnCode; // error occurred
 	Arts::readTypeSeq(*result,*_returnCode);
 	delete result;
 	return _returnCode;
@@ -2822,7 +2912,7 @@
 
 	result = Arts::Dispatcher::the()->waitForResult(requestID,_connection);
 	std::vector<Arts::ModuleDef> *_returnCode = new std::vector<Arts::ModuleDef>;
-	if(!result) return _returnCode; // error occured
+	if(!result) return _returnCode; // error occurred
 	Arts::readTypeSeq(*result,*_returnCode);
 	delete result;
 	return _returnCode;
diff -ruN kdelibs-2.2.2.orig/arts/mcop/core.h kdelibs-2.2.2/arts/mcop/core.h
--- kdelibs-2.2.2.orig/arts/mcop/core.h	2001-09-05 03:05:59.000000000 +0400
+++ kdelibs-2.2.2/arts/mcop/core.h	2007-06-11 17:33:43.000000000 +0400
@@ -4,16 +4,17 @@
 #define CORE_H
 
 #include "common.h"
+#include "arts_export.h"
 
 namespace Arts {
 enum HeaderMagic {MCOP_MAGIC = 1296256848};
 enum MessageType {mcopMessageInvalid = 0, mcopServerHello = 1, mcopClientHello = 2, mcopAuthAccept = 3, mcopInvocation = 4, mcopReturn = 5, mcopOnewayInvocation = 6};
-enum MethodType {methodOneway = 1, methodTwoway = 2};
+enum MethodType {methodOneway = 1, methodTwoway = 2, methodMax = 0xffffffff};
 enum AttributeType {streamIn = 1, streamOut = 2, streamMulti = 4, attributeStream = 8, attributeAttribute = 16, streamAsync = 32, streamDefault = 64};
 enum TypeIdentification {tiUnknown = 0, tiVoid = 1, tiLong = 2, tiByte = 3, tiString = 4, tiBoolean = 5, tiFloat = 6, tiEnum = 128, tiType = 129, tiInterface = 130};
-};
+}
 namespace Arts {
-class Header : public Arts::Type {
+class ARTS_EXPORT Header : public Arts::Type {
 public:
 	Header();
 	Header(Arts::HeaderMagic _a_magic, long _a_messageLength, Arts::MessageType _a_messageType);
@@ -27,9 +28,10 @@
 // marshalling functions
 	void readType(Arts::Buffer& stream);
 	void writeType(Arts::Buffer& stream) const;
+	std::string _typeName() const;
 };
 
-class Invocation : public Arts::Type {
+class ARTS_EXPORT Invocation : public Arts::Type {
 public:
 	Invocation();
 	Invocation(long _a_objectID, long _a_methodID, long _a_requestID);
@@ -43,9 +45,10 @@
 // marshalling functions
 	void readType(Arts::Buffer& stream);
 	void writeType(Arts::Buffer& stream) const;
+	std::string _typeName() const;
 };
 
-class OnewayInvocation : public Arts::Type {
+class ARTS_EXPORT OnewayInvocation : public Arts::Type {
 public:
 	OnewayInvocation();
 	OnewayInvocation(long _a_objectID, long _a_methodID);
@@ -58,9 +61,10 @@
 // marshalling functions
 	void readType(Arts::Buffer& stream);
 	void writeType(Arts::Buffer& stream) const;
+	std::string _typeName() const;
 };
 
-class ServerHello : public Arts::Type {
+class ARTS_EXPORT ServerHello : public Arts::Type {
 public:
 	ServerHello();
 	ServerHello(const std::string& _a_mcopVersion, const std::string& _a_serverID, const std::vector<std::string>& _a_authProtocols, const std::string& _a_authSeed);
@@ -75,9 +79,10 @@
 // marshalling functions
 	void readType(Arts::Buffer& stream);
 	void writeType(Arts::Buffer& stream) const;
+	std::string _typeName() const;
 };
 
-class ClientHello : public Arts::Type {
+class ARTS_EXPORT ClientHello : public Arts::Type {
 public:
 	ClientHello();
 	ClientHello(const std::string& _a_serverID, const std::string& _a_authProtocol, const std::string& _a_authData);
@@ -91,9 +96,10 @@
 // marshalling functions
 	void readType(Arts::Buffer& stream);
 	void writeType(Arts::Buffer& stream) const;
+	std::string _typeName() const;
 };
 
-class AuthAccept : public Arts::Type {
+class ARTS_EXPORT AuthAccept : public Arts::Type {
 public:
 	AuthAccept();
 	AuthAccept(const std::vector<std::string>& _a_hints);
@@ -105,9 +111,10 @@
 // marshalling functions
 	void readType(Arts::Buffer& stream);
 	void writeType(Arts::Buffer& stream) const;
+	std::string _typeName() const;
 };
 
-class ObjectReference : public Arts::Type {
+class ARTS_EXPORT ObjectReference : public Arts::Type {
 public:
 	ObjectReference();
 	ObjectReference(const std::string& _a_serverID, long _a_objectID, const std::vector<std::string>& _a_urls);
@@ -121,9 +128,10 @@
 // marshalling functions
 	void readType(Arts::Buffer& stream);
 	void writeType(Arts::Buffer& stream) const;
+	std::string _typeName() const;
 };
 
-class ParamDef : public Arts::Type {
+class ARTS_EXPORT ParamDef : public Arts::Type {
 public:
 	ParamDef();
 	ParamDef(const std::string& _a_type, const std::string& _a_name, const std::vector<std::string>& _a_hints);
@@ -137,9 +145,10 @@
 // marshalling functions
 	void readType(Arts::Buffer& stream);
 	void writeType(Arts::Buffer& stream) const;
+	std::string _typeName() const;
 };
 
-class MethodDef : public Arts::Type {
+class ARTS_EXPORT MethodDef : public Arts::Type {
 public:
 	MethodDef();
 	MethodDef(const std::string& _a_name, const std::string& _a_type, Arts::MethodType _a_flags, const std::vector<Arts::ParamDef>& _a_signature, const std::vector<std::string>& _a_hints);
@@ -155,9 +164,10 @@
 // marshalling functions
 	void readType(Arts::Buffer& stream);
 	void writeType(Arts::Buffer& stream) const;
+	std::string _typeName() const;
 };
 
-class AttributeDef : public Arts::Type {
+class ARTS_EXPORT AttributeDef : public Arts::Type {
 public:
 	AttributeDef();
 	AttributeDef(const std::string& _a_name, const std::string& _a_type, Arts::AttributeType _a_flags, const std::vector<std::string>& _a_hints);
@@ -172,9 +182,10 @@
 // marshalling functions
 	void readType(Arts::Buffer& stream);
 	void writeType(Arts::Buffer& stream) const;
+	std::string _typeName() const;
 };
 
-class InterfaceDef : public Arts::Type {
+class ARTS_EXPORT InterfaceDef : public Arts::Type {
 public:
 	InterfaceDef();
 	InterfaceDef(const std::string& _a_name, const std::vector<std::string>& _a_inheritedInterfaces, const std::vector<Arts::MethodDef>& _a_methods, const std::vector<Arts::AttributeDef>& _a_attributes, const std::vector<std::string>& _a_defaultPorts, const std::vector<std::string>& _a_hints);
@@ -191,9 +202,10 @@
 // marshalling functions
 	void readType(Arts::Buffer& stream);
 	void writeType(Arts::Buffer& stream) const;
+	std::string _typeName() const;
 };
 
-class TypeComponent : public Arts::Type {
+class ARTS_EXPORT TypeComponent : public Arts::Type {
 public:
 	TypeComponent();
 	TypeComponent(const std::string& _a_type, const std::string& _a_name, const std::vector<std::string>& _a_hints);
@@ -207,9 +219,10 @@
 // marshalling functions
 	void readType(Arts::Buffer& stream);
 	void writeType(Arts::Buffer& stream) const;
+	std::string _typeName() const;
 };
 
-class TypeDef : public Arts::Type {
+class ARTS_EXPORT TypeDef : public Arts::Type {
 public:
 	TypeDef();
 	TypeDef(const std::string& _a_name, const std::vector<Arts::TypeComponent>& _a_contents, const std::vector<std::string>& _a_hints);
@@ -223,9 +236,10 @@
 // marshalling functions
 	void readType(Arts::Buffer& stream);
 	void writeType(Arts::Buffer& stream) const;
+	std::string _typeName() const;
 };
 
-class EnumComponent : public Arts::Type {
+class ARTS_EXPORT EnumComponent : public Arts::Type {
 public:
 	EnumComponent();
 	EnumComponent(const std::string& _a_name, long _a_value, const std::vector<std::string>& _a_hints);
@@ -239,9 +253,10 @@
 // marshalling functions
 	void readType(Arts::Buffer& stream);
 	void writeType(Arts::Buffer& stream) const;
+	std::string _typeName() const;
 };
 
-class EnumDef : public Arts::Type {
+class ARTS_EXPORT EnumDef : public Arts::Type {
 public:
 	EnumDef();
 	EnumDef(const std::string& _a_name, const std::vector<Arts::EnumComponent>& _a_contents, const std::vector<std::string>& _a_hints);
@@ -255,9 +270,10 @@
 // marshalling functions
 	void readType(Arts::Buffer& stream);
 	void writeType(Arts::Buffer& stream) const;
+	std::string _typeName() const;
 };
 
-class ModuleDef : public Arts::Type {
+class ARTS_EXPORT ModuleDef : public Arts::Type {
 public:
 	ModuleDef();
 	ModuleDef(const std::string& _a_moduleName, const std::vector<Arts::EnumDef>& _a_enums, const std::vector<Arts::TypeDef>& _a_types, const std::vector<Arts::InterfaceDef>& _a_interfaces, const std::vector<std::string>& _a_hints);
@@ -273,9 +289,10 @@
 // marshalling functions
 	void readType(Arts::Buffer& stream);
 	void writeType(Arts::Buffer& stream) const;
+	std::string _typeName() const;
 };
 
-class Any : public Arts::Type {
+class ARTS_EXPORT Any : public Arts::Type {
 public:
 	Any();
 	Any(const std::string& _a_type, const std::vector<Arts::mcopbyte>& _a_value);
@@ -288,9 +305,10 @@
 // marshalling functions
 	void readType(Arts::Buffer& stream);
 	void writeType(Arts::Buffer& stream) const;
+	std::string _typeName() const;
 };
 
-class TraderEntry : public Arts::Type {
+class ARTS_EXPORT TraderEntry : public Arts::Type {
 public:
 	TraderEntry();
 	TraderEntry(const std::string& _a_interfaceName, const std::vector<std::string>& _a_lines);
@@ -303,9 +321,10 @@
 // marshalling functions
 	void readType(Arts::Buffer& stream);
 	void writeType(Arts::Buffer& stream) const;
+	std::string _typeName() const;
 };
 
-};
+}
 namespace Arts {
 class InterfaceRepo;
 class InterfaceRepoV2;
@@ -318,7 +337,7 @@
 class TraderQuery;
 class Loader;
 
-class InterfaceRepo_base : virtual public Arts::Object_base {
+class ARTS_EXPORT InterfaceRepo_base : virtual public Arts::Object_base {
 public:
 	static unsigned long _IID; // interface ID
 
@@ -349,7 +368,7 @@
 	virtual std::vector<std::string> * queryEnums() = 0;
 };
 
-class InterfaceRepo_stub : virtual public InterfaceRepo_base, virtual public Arts::Object_stub {
+class ARTS_EXPORT InterfaceRepo_stub : virtual public InterfaceRepo_base, virtual public Arts::Object_stub {
 protected:
 	InterfaceRepo_stub();
 
@@ -367,7 +386,7 @@
 	std::vector<std::string> * queryEnums();
 };
 
-class InterfaceRepo_skel : virtual public InterfaceRepo_base, virtual public Arts::Object_skel {
+class ARTS_EXPORT InterfaceRepo_skel : virtual public InterfaceRepo_base, virtual public Arts::Object_skel {
 public:
 	InterfaceRepo_skel();
 
@@ -378,10 +397,10 @@
 	void dispatch(Arts::Buffer *request, Arts::Buffer *result,long methodID);
 };
 
-};
+}
 #include "reference.h"
 namespace Arts {
-class InterfaceRepo : public Arts::Object {
+class ARTS_EXPORT InterfaceRepo : public Arts::Object {
 private:
 	static Arts::Object_base* _Creator();
 	InterfaceRepo_base *_cache;
@@ -432,7 +451,7 @@
 	inline std::vector<std::string> * queryEnums();
 };
 
-class InterfaceRepoV2_base : virtual public Arts::InterfaceRepo_base {
+class ARTS_EXPORT InterfaceRepoV2_base : virtual public Arts::InterfaceRepo_base {
 public:
 	static unsigned long _IID; // interface ID
 
@@ -455,7 +474,7 @@
 	virtual Arts::TypeIdentification identifyType(const std::string& name) = 0;
 };
 
-class InterfaceRepoV2_stub : virtual public InterfaceRepoV2_base, virtual public Arts::InterfaceRepo_stub {
+class ARTS_EXPORT InterfaceRepoV2_stub : virtual public InterfaceRepoV2_base, virtual public Arts::InterfaceRepo_stub {
 protected:
 	InterfaceRepoV2_stub();
 
@@ -465,7 +484,7 @@
 	Arts::TypeIdentification identifyType(const std::string& name);
 };
 
-class InterfaceRepoV2_skel : virtual public InterfaceRepoV2_base, virtual public Arts::InterfaceRepo_skel {
+class ARTS_EXPORT InterfaceRepoV2_skel : virtual public InterfaceRepoV2_base, virtual public Arts::InterfaceRepo_skel {
 public:
 	InterfaceRepoV2_skel();
 
@@ -476,10 +495,10 @@
 	void dispatch(Arts::Buffer *request, Arts::Buffer *result,long methodID);
 };
 
-};
+}
 #include "reference.h"
 namespace Arts {
-class InterfaceRepoV2 : public Arts::Object {
+class ARTS_EXPORT InterfaceRepoV2 : public Arts::Object {
 private:
 	static Arts::Object_base* _Creator();
 	InterfaceRepoV2_base *_cache;
@@ -532,7 +551,7 @@
 	inline Arts::TypeIdentification identifyType(const std::string& name);
 };
 
-class FlowSystemSender_base : virtual public Arts::Object_base {
+class ARTS_EXPORT FlowSystemSender_base : virtual public Arts::Object_base {
 public:
 	static unsigned long _IID; // interface ID
 
@@ -556,7 +575,7 @@
 	virtual void disconnect() = 0;
 };
 
-class FlowSystemSender_stub : virtual public FlowSystemSender_base, virtual public Arts::Object_stub {
+class ARTS_EXPORT FlowSystemSender_stub : virtual public FlowSystemSender_base, virtual public Arts::Object_stub {
 protected:
 	FlowSystemSender_stub();
 
@@ -567,7 +586,7 @@
 	void disconnect();
 };
 
-class FlowSystemSender_skel : virtual public FlowSystemSender_base, virtual public Arts::Object_skel {
+class ARTS_EXPORT FlowSystemSender_skel : virtual public FlowSystemSender_base, virtual public Arts::Object_skel {
 public:
 	FlowSystemSender_skel();
 
@@ -578,10 +597,10 @@
 	void dispatch(Arts::Buffer *request, Arts::Buffer *result,long methodID);
 };
 
-};
+}
 #include "reference.h"
 namespace Arts {
-class FlowSystemSender : public Arts::Object {
+class ARTS_EXPORT FlowSystemSender : public Arts::Object {
 private:
 	static Arts::Object_base* _Creator();
 	FlowSystemSender_base *_cache;
@@ -625,7 +644,7 @@
 	inline void disconnect();
 };
 
-class FlowSystemReceiver_base : virtual public Arts::Object_base {
+class ARTS_EXPORT FlowSystemReceiver_base : virtual public Arts::Object_base {
 public:
 	static unsigned long _IID; // interface ID
 
@@ -649,7 +668,7 @@
 	virtual void disconnect() = 0;
 };
 
-class FlowSystemReceiver_stub : virtual public FlowSystemReceiver_base, virtual public Arts::Object_stub {
+class ARTS_EXPORT FlowSystemReceiver_stub : virtual public FlowSystemReceiver_base, virtual public Arts::Object_stub {
 protected:
 	FlowSystemReceiver_stub();
 
@@ -660,7 +679,7 @@
 	void disconnect();
 };
 
-class FlowSystemReceiver_skel : virtual public FlowSystemReceiver_base, virtual public Arts::Object_skel {
+class ARTS_EXPORT FlowSystemReceiver_skel : virtual public FlowSystemReceiver_base, virtual public Arts::Object_skel {
 protected:
 	// emitters for change notifications
 	inline void receiveHandlerID_changed(long newValue) {
@@ -677,10 +696,10 @@
 	void dispatch(Arts::Buffer *request, Arts::Buffer *result,long methodID);
 };
 
-};
+}
 #include "reference.h"
 namespace Arts {
-class FlowSystemReceiver : public Arts::Object {
+class ARTS_EXPORT FlowSystemReceiver : public Arts::Object {
 private:
 	static Arts::Object_base* _Creator();
 	FlowSystemReceiver_base *_cache;
@@ -724,7 +743,7 @@
 	inline void disconnect();
 };
 
-class FlowSystem_base : virtual public Arts::Object_base {
+class ARTS_EXPORT FlowSystem_base : virtual public Arts::Object_base {
 public:
 	static unsigned long _IID; // interface ID
 
@@ -753,7 +772,7 @@
 	virtual Arts::FlowSystemReceiver createReceiver(Arts::Object destObject, const std::string& destPort, Arts::FlowSystemSender sender) = 0;
 };
 
-class FlowSystem_stub : virtual public FlowSystem_base, virtual public Arts::Object_stub {
+class ARTS_EXPORT FlowSystem_stub : virtual public FlowSystem_base, virtual public Arts::Object_stub {
 protected:
 	FlowSystem_stub();
 
@@ -769,7 +788,7 @@
 	Arts::FlowSystemReceiver createReceiver(Arts::Object destObject, const std::string& destPort, Arts::FlowSystemSender sender);
 };
 
-class FlowSystem_skel : virtual public FlowSystem_base, virtual public Arts::Object_skel {
+class ARTS_EXPORT FlowSystem_skel : virtual public FlowSystem_base, virtual public Arts::Object_skel {
 public:
 	FlowSystem_skel();
 
@@ -780,10 +799,10 @@
 	void dispatch(Arts::Buffer *request, Arts::Buffer *result,long methodID);
 };
 
-};
+}
 #include "reference.h"
 namespace Arts {
-class FlowSystem : public Arts::Object {
+class ARTS_EXPORT FlowSystem : public Arts::Object {
 private:
 	static Arts::Object_base* _Creator();
 	FlowSystem_base *_cache;
@@ -832,7 +851,7 @@
 	inline Arts::FlowSystemReceiver createReceiver(Arts::Object destObject, const std::string& destPort, Arts::FlowSystemSender sender);
 };
 
-class GlobalComm_base : virtual public Arts::Object_base {
+class ARTS_EXPORT GlobalComm_base : virtual public Arts::Object_base {
 public:
 	static unsigned long _IID; // interface ID
 
@@ -857,7 +876,7 @@
 	virtual void erase(const std::string& variable) = 0;
 };
 
-class GlobalComm_stub : virtual public GlobalComm_base, virtual public Arts::Object_stub {
+class ARTS_EXPORT GlobalComm_stub : virtual public GlobalComm_base, virtual public Arts::Object_stub {
 protected:
 	GlobalComm_stub();
 
@@ -869,7 +888,7 @@
 	void erase(const std::string& variable);
 };
 
-class GlobalComm_skel : virtual public GlobalComm_base, virtual public Arts::Object_skel {
+class ARTS_EXPORT GlobalComm_skel : virtual public GlobalComm_base, virtual public Arts::Object_skel {
 public:
 	GlobalComm_skel();
 
@@ -880,10 +899,10 @@
 	void dispatch(Arts::Buffer *request, Arts::Buffer *result,long methodID);
 };
 
-};
+}
 #include "reference.h"
 namespace Arts {
-class GlobalComm : public Arts::Object {
+class ARTS_EXPORT GlobalComm : public Arts::Object {
 private:
 	static Arts::Object_base* _Creator();
 	GlobalComm_base *_cache;
@@ -928,7 +947,7 @@
 	inline void erase(const std::string& variable);
 };
 
-class TmpGlobalComm_base : virtual public Arts::GlobalComm_base {
+class ARTS_EXPORT TmpGlobalComm_base : virtual public Arts::GlobalComm_base {
 public:
 	static unsigned long _IID; // interface ID
 
@@ -950,7 +969,7 @@
 
 };
 
-class TmpGlobalComm_stub : virtual public TmpGlobalComm_base, virtual public Arts::GlobalComm_stub {
+class ARTS_EXPORT TmpGlobalComm_stub : virtual public TmpGlobalComm_base, virtual public Arts::GlobalComm_stub {
 protected:
 	TmpGlobalComm_stub();
 
@@ -959,7 +978,7 @@
 
 };
 
-class TmpGlobalComm_skel : virtual public TmpGlobalComm_base, virtual public Arts::GlobalComm_skel {
+class ARTS_EXPORT TmpGlobalComm_skel : virtual public TmpGlobalComm_base, virtual public Arts::GlobalComm_skel {
 public:
 	TmpGlobalComm_skel();
 
@@ -970,10 +989,10 @@
 	void dispatch(Arts::Buffer *request, Arts::Buffer *result,long methodID);
 };
 
-};
+}
 #include "reference.h"
 namespace Arts {
-class TmpGlobalComm : public Arts::Object {
+class ARTS_EXPORT TmpGlobalComm : public Arts::Object {
 private:
 	static Arts::Object_base* _Creator();
 	TmpGlobalComm_base *_cache;
@@ -1019,7 +1038,7 @@
 	inline void erase(const std::string& variable);
 };
 
-class TraderOffer_base : virtual public Arts::Object_base {
+class ARTS_EXPORT TraderOffer_base : virtual public Arts::Object_base {
 public:
 	static unsigned long _IID; // interface ID
 
@@ -1043,7 +1062,7 @@
 	virtual std::vector<std::string> * getProperty(const std::string& name) = 0;
 };
 
-class TraderOffer_stub : virtual public TraderOffer_base, virtual public Arts::Object_stub {
+class ARTS_EXPORT TraderOffer_stub : virtual public TraderOffer_base, virtual public Arts::Object_stub {
 protected:
 	TraderOffer_stub();
 
@@ -1054,7 +1073,7 @@
 	std::vector<std::string> * getProperty(const std::string& name);
 };
 
-class TraderOffer_skel : virtual public TraderOffer_base, virtual public Arts::Object_skel {
+class ARTS_EXPORT TraderOffer_skel : virtual public TraderOffer_base, virtual public Arts::Object_skel {
 protected:
 	// emitters for change notifications
 	inline void interfaceName_changed(const std::string& newValue) {
@@ -1071,10 +1090,10 @@
 	void dispatch(Arts::Buffer *request, Arts::Buffer *result,long methodID);
 };
 
-};
+}
 #include "reference.h"
 namespace Arts {
-class TraderOffer : public Arts::Object {
+class ARTS_EXPORT TraderOffer : public Arts::Object {
 private:
 	static Arts::Object_base* _Creator();
 	TraderOffer_base *_cache;
@@ -1118,7 +1137,7 @@
 	inline std::vector<std::string> * getProperty(const std::string& name);
 };
 
-class TraderQuery_base : virtual public Arts::Object_base {
+class ARTS_EXPORT TraderQuery_base : virtual public Arts::Object_base {
 public:
 	static unsigned long _IID; // interface ID
 
@@ -1142,7 +1161,7 @@
 	virtual std::vector<Arts::TraderOffer> * query() = 0;
 };
 
-class TraderQuery_stub : virtual public TraderQuery_base, virtual public Arts::Object_stub {
+class ARTS_EXPORT TraderQuery_stub : virtual public TraderQuery_base, virtual public Arts::Object_stub {
 protected:
 	TraderQuery_stub();
 
@@ -1153,7 +1172,7 @@
 	std::vector<Arts::TraderOffer> * query();
 };
 
-class TraderQuery_skel : virtual public TraderQuery_base, virtual public Arts::Object_skel {
+class ARTS_EXPORT TraderQuery_skel : virtual public TraderQuery_base, virtual public Arts::Object_skel {
 public:
 	TraderQuery_skel();
 
@@ -1164,10 +1183,10 @@
 	void dispatch(Arts::Buffer *request, Arts::Buffer *result,long methodID);
 };
 
-};
+}
 #include "reference.h"
 namespace Arts {
-class TraderQuery : public Arts::Object {
+class ARTS_EXPORT TraderQuery : public Arts::Object {
 private:
 	static Arts::Object_base* _Creator();
 	TraderQuery_base *_cache;
@@ -1211,7 +1230,7 @@
 	inline std::vector<Arts::TraderOffer> * query();
 };
 
-class Loader_base : virtual public Arts::Object_base {
+class ARTS_EXPORT Loader_base : virtual public Arts::Object_base {
 public:
 	static unsigned long _IID; // interface ID
 
@@ -1237,7 +1256,7 @@
 	virtual Arts::Object loadObject(Arts::TraderOffer offer) = 0;
 };
 
-class Loader_stub : virtual public Loader_base, virtual public Arts::Object_stub {
+class ARTS_EXPORT Loader_stub : virtual public Loader_base, virtual public Arts::Object_stub {
 protected:
 	Loader_stub();
 
@@ -1250,7 +1269,7 @@
 	Arts::Object loadObject(Arts::TraderOffer offer);
 };
 
-class Loader_skel : virtual public Loader_base, virtual public Arts::Object_skel {
+class ARTS_EXPORT Loader_skel : virtual public Loader_base, virtual public Arts::Object_skel {
 protected:
 	// emitters for change notifications
 	inline void dataVersion_changed(const std::string& newValue) {
@@ -1267,10 +1286,10 @@
 	void dispatch(Arts::Buffer *request, Arts::Buffer *result,long methodID);
 };
 
-};
+}
 #include "reference.h"
 namespace Arts {
-class Loader : public Arts::Object {
+class ARTS_EXPORT Loader : public Arts::Object {
 private:
 	static Arts::Object_base* _Creator();
 	Loader_base *_cache;
@@ -1316,7 +1335,7 @@
 	inline Arts::Object loadObject(Arts::TraderOffer offer);
 };
 
-};
+}
 // Forward wrapper calls to _base classes:
 
 inline long Arts::InterfaceRepo::insertModule(const Arts::ModuleDef& newModule)
diff -ruN kdelibs-2.2.2.orig/arts/mcop/datapacket.h kdelibs-2.2.2/arts/mcop/datapacket.h
--- kdelibs-2.2.2.orig/arts/mcop/datapacket.h	2001-07-29 08:54:49.000000000 +0400
+++ kdelibs-2.2.2/arts/mcop/datapacket.h	2007-06-11 17:33:43.000000000 +0400
@@ -182,20 +182,20 @@
 	{
 		if(newCapacity > capacity)
 		{
-			delete[] contents;
+			delete[] this->contents;
 			capacity = newCapacity;
-			contents = new T[capacity];
+			this->contents = new T[capacity];
 		}
 	}
 	RawDataPacket(int capacity, GenericDataChannel *channel)
 		:DataPacket<T>(channel), capacity(capacity)
 	{
-		size = capacity;
-		contents = new T[capacity];
+		this->size = capacity;
+		this->contents = new T[capacity];
 	}
 	~RawDataPacket()
 	{
-		delete[] contents;
+		delete[] this->contents;
 	}
 };
 
diff -ruN kdelibs-2.2.2.orig/arts/mcop/dynamicrequest.cc kdelibs-2.2.2/arts/mcop/dynamicrequest.cc
--- kdelibs-2.2.2.orig/arts/mcop/dynamicrequest.cc	2000-09-29 02:42:37.000000000 +0400
+++ kdelibs-2.2.2/arts/mcop/dynamicrequest.cc	2007-06-11 17:33:43.000000000 +0400
@@ -21,7 +21,7 @@
     */
 
 #include "dynamicrequest.h"
-#include "core.h"
+#include "common.h"
 #include "debug.h"
 #include <iostream.h>
 
diff -ruN kdelibs-2.2.2.orig/arts/mcop/dynamicskeleton.h kdelibs-2.2.2/arts/mcop/dynamicskeleton.h
--- kdelibs-2.2.2.orig/arts/mcop/dynamicskeleton.h	2001-06-10 18:03:05.000000000 +0400
+++ kdelibs-2.2.2/arts/mcop/dynamicskeleton.h	2007-06-11 17:33:43.000000000 +0400
@@ -23,21 +23,34 @@
 #ifndef ARTS_MCOP_DYNAMICSKELETON_H
 #define ARTS_MCOP_DYNAMICSKELETON_H
 
+#include "arts_export.h"
+
 #include "object.h"
 
+/*
+ * BC - Status (2002-03-08): DynamicSkeletonBase, DynamicSkeleton
+ *
+ * Will be kept binary compatible (using d ptr).
+ */
 namespace Arts {
 
 class DynamicSkeletonData;
 
-class DynamicSkeletonBase {
+class ARTS_EXPORT DynamicSkeletonBase {
 private:
 	DynamicSkeletonData *d;
 
 protected:
-	DynamicSkeletonBase(Object_skel *skel, const std::string& interfacename,
-									   const std::string& interfacenameparent);
+	DynamicSkeletonBase();
+	/* <obsolete compatibility code> */
+	DynamicSkeletonBase(Object_skel *skel,
+			    const std::string& interfacename,
+			    const std::string& interfacenameparent);
+	/* </obsolete compatibility code> */
 	virtual ~DynamicSkeletonBase();
 
+	void _dsInit(Object_skel *skel, const std::string& interfacename,
+									   const std::string& interfacenameparent);
 	std::string _dsInterfaceName();
 	bool _dsIsCompatibleWith(const std::string& interfacename);
 	void _dsBuildMethodTable();
@@ -107,14 +120,13 @@
 	 * constructor
 	 */
 	DynamicSkeleton(const std::string& interface)
-	   : DynamicSkeletonBase(this, interface, Parent_skel::_interfaceNameSkel())
 	{
-		//
+		_dsInit(this, interface, Parent_skel::_interfaceNameSkel());
 	}
 
 	/**
 	 * getMethodDef returns a MethodDef structure for a given methodID - it
-	 * is quite usefull if you implement process
+	 * is quite useful if you implement process
 	 *
 	 * <pre>
 	 * void process(long methodID, Arts::Buffer *request, Arts::Buffer *result)
@@ -129,7 +141,7 @@
 	 * </pre>
 	 */
 	const MethodDef& getMethodDef(long methodID) {
-		return _dsGetMethodDef(methodID);
+		return this->_dsGetMethodDef(methodID);
 	}
 
 /*-- reimplemented from Arts::Object_skel: --*/
@@ -147,5 +159,5 @@
 	}
 };
 
-};
+}
 #endif /* ARTS_MCOP_DYNAMICSKELETON_H */
diff -ruN kdelibs-2.2.2.orig/arts/mcop/flowsystem.h kdelibs-2.2.2/arts/mcop/flowsystem.h
--- kdelibs-2.2.2.orig/arts/mcop/flowsystem.h	2000-11-22 20:17:17.000000000 +0300
+++ kdelibs-2.2.2/arts/mcop/flowsystem.h	2007-06-11 17:45:04.000000000 +0400
@@ -24,7 +24,7 @@
 #define FLOWSYSTEM_H
 
 #include "object.h"
-#include "core.h"
+#include "common.h"
 
 /*
  * BC - Status (2000-09-30): ScheduleNode, FlowSystem, FlowSystem_impl,
diff -ruN kdelibs-2.2.2.orig/arts/mcop/idlfilereg.cc kdelibs-2.2.2/arts/mcop/idlfilereg.cc
--- kdelibs-2.2.2.orig/arts/mcop/idlfilereg.cc	2000-05-18 02:48:20.000000000 +0400
+++ kdelibs-2.2.2/arts/mcop/idlfilereg.cc	2007-06-11 17:33:43.000000000 +0400
@@ -20,7 +20,7 @@
 
     */
 
-#include "core.h"
+#include "common.h"
 
 using namespace Arts;
 
diff -ruN kdelibs-2.2.2.orig/arts/mcop/ifacerepo_impl.cc kdelibs-2.2.2/arts/mcop/ifacerepo_impl.cc
--- kdelibs-2.2.2.orig/arts/mcop/ifacerepo_impl.cc	2001-04-24 15:35:16.000000000 +0400
+++ kdelibs-2.2.2/arts/mcop/ifacerepo_impl.cc	2007-06-11 17:33:43.000000000 +0400
@@ -156,7 +156,7 @@
 {
 	InterfaceDef def = queryInterfaceLocal(name);
 
-	if(def.name == "")
+	if(def.name.empty())
 	{
 		TraderQuery q;
 		q.supports("Type",name);
@@ -166,7 +166,7 @@
 		{
 			TraderOffer& offer = *i;
 
-			if(def.name == "")
+			if(def.name.empty())
 			{
 				vector<string> *types = offer.getProperty("TypeFile");
 				if(types->size() == 1)
@@ -174,7 +174,7 @@
 					const vector<string> *path = MCOPUtils::traderPath();
 
 					vector<string>::const_iterator pi = path->begin();
-					while(pi != path->end() && def.name == "")
+					while(pi != path->end() && def.name.empty())
 					{
 						string filename = *pi++ + "/" + types->front();
 
@@ -201,7 +201,7 @@
 		delete offers;
 	}
 
-	if(def.name == "")
+	if(def.name.empty())
 	{
 		arts_warning("InterfaceRepo: no information about the interface %s "
 					 "is known", name.c_str());
@@ -259,6 +259,8 @@
 				found = true;
 			}
 		}
+		if((*ii)->inheritedInterfaces.empty() && ((name == "Arts::Object") || (name == "object")) && ((*ii)->name != "Arts::Object"))
+			result->push_back((*ii)->name);
 	}
 
 	return result;
diff -ruN kdelibs-2.2.2.orig/arts/mcop/ifacerepo_impl.h kdelibs-2.2.2/arts/mcop/ifacerepo_impl.h
--- kdelibs-2.2.2.orig/arts/mcop/ifacerepo_impl.h	2001-04-18 17:47:25.000000000 +0400
+++ kdelibs-2.2.2/arts/mcop/ifacerepo_impl.h	2007-06-11 17:33:43.000000000 +0400
@@ -21,7 +21,7 @@
     */
 
 /*
- * BC - Status (2000-10-05): InterfaceRepo_impl
+ * BC - Status (2002-03-08): InterfaceRepo_impl
  *
  * This is an implementation class, and not kept binary compatible. It's
  * only here since the REGISTER_IMPLEMENTATION bootstrapping may not yet
@@ -32,7 +32,7 @@
 #ifndef IFACEREPO_H
 #define IFACEREPO_H
 
-#include "core.h"
+#include "common.h"
 #include <map>
 
 namespace Arts {
@@ -94,5 +94,5 @@
 	std::vector<std::string> *queryTypes();
 	std::vector<std::string> *queryEnums();
 };
-};
+}
 #endif /* IFACEREPO_H */
diff -ruN kdelibs-2.2.2.orig/arts/mcop/loopback.cc kdelibs-2.2.2/arts/mcop/loopback.cc
--- kdelibs-2.2.2.orig/arts/mcop/loopback.cc	2000-06-13 03:19:10.000000000 +0400
+++ kdelibs-2.2.2/arts/mcop/loopback.cc	2007-06-11 17:33:43.000000000 +0400
@@ -1,5 +1,5 @@
 #include "loopback.h"
-#include "core.h"
+#include "common.h"
 
 using namespace Arts;
 using namespace std;
diff -ruN kdelibs-2.2.2.orig/arts/mcop/reference.cc kdelibs-2.2.2/arts/mcop/reference.cc
--- kdelibs-2.2.2.orig/arts/mcop/reference.cc	2000-05-18 02:48:20.000000000 +0400
+++ kdelibs-2.2.2/arts/mcop/reference.cc	2007-06-11 17:33:43.000000000 +0400
@@ -17,7 +17,7 @@
     the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
     Boston, MA 02111-1307, USA.
 */
-#include "core.h"
+#include "common.h"
 
 using namespace Arts;
 
diff -ruN kdelibs-2.2.2.orig/arts/mcop/reference.h kdelibs-2.2.2/arts/mcop/reference.h
--- kdelibs-2.2.2.orig/arts/mcop/reference.h	2000-11-01 17:30:57.000000000 +0300
+++ kdelibs-2.2.2/arts/mcop/reference.h	2007-06-11 17:33:43.000000000 +0400
@@ -19,7 +19,7 @@
 */
 
 /*
- * BC - Status (2000-09-30): Reference, SubClass, Object, DynamicCast.
+ * BC - Status (2002-03-08): Reference, SubClass, Object, DynamicCast.
  *
  * Part of the public API. Must be kept binary compatible by NOT TOUCHING
  * AT ALL. Interaction with generated and written code.
@@ -33,10 +33,12 @@
 #include <string>
 #include <vector>
 
+#include "arts_export.h"
+
 namespace Arts {
 
 // Acts as a string or ObjectReference, but enables a different constructor
-class Reference {
+class ARTS_EXPORT Reference {
 private:
 	ObjectReference myref;
 	std::string mys;
@@ -75,7 +77,7 @@
 };
 
 // Acts as a string, but enables a different constructor
-class SubClass {
+class ARTS_EXPORT SubClass {
 private:
 	std::string mys;
 public:
@@ -97,7 +99,7 @@
 // no virtual table bloat.
 // Moreover, the virtual mechanism still works correctly thanks to the
 // _pool->base redirection.
-class Object {
+class ARTS_EXPORT Object {
 protected:
 	// Pool of common variables for a bunch a wrappers
 	class Pool {
@@ -334,7 +336,7 @@
 };
 
 // Enables a different constructor, that should do the cast
-class DynamicCast {
+class ARTS_EXPORT DynamicCast {
 private:
 	Object obj;
 public:
@@ -342,6 +344,6 @@
 	inline const Object& object() const {return obj;}
 };
 
-};
+}
 
 #endif
diff -ruN kdelibs-2.2.2.orig/arts/mcop/tmpglobalcomm.cc kdelibs-2.2.2/arts/mcop/tmpglobalcomm.cc
--- kdelibs-2.2.2.orig/arts/mcop/tmpglobalcomm.cc	2000-10-02 04:52:56.000000000 +0400
+++ kdelibs-2.2.2/arts/mcop/tmpglobalcomm.cc	2007-06-11 17:33:43.000000000 +0400
@@ -23,7 +23,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include "core.h"
+#include "common.h"
 #include "mcoputils.h"
 
 using namespace std;
@@ -79,4 +79,4 @@
 
 REGISTER_IMPLEMENTATION(TmpGlobalComm_impl);
 
-};
+}
diff -ruN kdelibs-2.2.2.orig/arts/mcop/trader_impl.cc kdelibs-2.2.2/arts/mcop/trader_impl.cc
--- kdelibs-2.2.2.orig/arts/mcop/trader_impl.cc	2001-04-28 22:07:03.000000000 +0400
+++ kdelibs-2.2.2/arts/mcop/trader_impl.cc	2007-06-11 17:33:43.000000000 +0400
@@ -1,7 +1,30 @@
-#include "core.h"
+    /*
+
+    Copyright (C) 2000-2002 Stefan Westerfeld
+                            stefan@space.twc.de
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+  
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+   
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+    Boston, MA 02111-1307, USA.
+
+    */
+
+#include "common.h"
 #include "debug.h"
 #include <iostream>
 #include <fstream>
+#include <algorithm>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
@@ -68,7 +91,7 @@
 	vector<string>* getProperty(const string& name);
 };
 
-};
+}
 
 // TraderQuery
 //----------------------------------------------------------------------------
@@ -175,6 +198,7 @@
 void TraderHelper::addDirectory(const string& directory, const string& iface,
 								map< pair<dev_t,ino_t>, bool > *dirsDone)
 {
+	bool created_dirs_done = false;
 	arts_debug("addDirectory(%s,%s)", directory.c_str(), iface.c_str());
 
 	if(!dirsDone)
@@ -185,6 +209,7 @@
 		struct stat st;
 		stat(directory.c_str(), &st);
 		(*dirsDone)[make_pair(st.st_dev, st.st_ino)] = true;
+		created_dirs_done = true;
 	}
 
 	DIR *dir = opendir(directory.c_str());
@@ -196,7 +221,7 @@
 		string currentEntry = directory + "/" + de->d_name;
 
 		string currentIface = iface;
-		if(iface != "") currentIface += "::";
+		if(!iface.empty()) currentIface += "::";
 		currentIface += de->d_name;
 
 		struct stat st;
@@ -223,10 +248,42 @@
 						new TraderOffer_impl(currentIface,currentEntry) );
 			}
 		}
-    }
+	}
+
+	if (created_dirs_done)
+		delete dirsDone;
+
 	closedir(dir);
 }
 
+static inline int getOfferPreference(TraderOffer offer)
+{
+	int result = 0;
+
+	vector<string> *p = offer.getProperty("Preference");
+	if(!p->empty())
+		result = atoi(p->front().c_str());
+	delete p;
+
+	return result;
+}
+
+static bool traderOfferCmp(TraderOffer offer1, TraderOffer offer2)
+{
+	int p1 = getOfferPreference(offer1);
+	int p2 = getOfferPreference(offer2);
+	
+	if(p1 > p2)
+		return true;
+	if(p1 < p2)
+		return false;
+
+	/* if the Preference= entry doesn't indicate which offer is better,
+	 * sort the offers by name to make the trader results at least
+	 * independant from the order they are read from the file system */
+	return offer1.interfaceName() < offer2.interfaceName();
+}
+
 vector<TraderOffer> *TraderHelper::doQuery(const
 											vector<TraderRestriction>& query)
 {
@@ -242,6 +299,10 @@
 			result->push_back(TraderOffer::_from_base(offer->_copy()));
 		}
 	}
+
+	/* sort trader query result by Preference= line for more than one result */
+	if(result->size() > 1)
+		sort(result->begin(), result->end(), traderOfferCmp);
 	return result;
 }
 
@@ -273,7 +334,7 @@
 
 static TraderShutdown traderShutdown;
 
-};
+}
 
 // Dispatcher function for reloading the trader data:
 void Dispatcher::reloadTraderData()
diff -ruN kdelibs-2.2.2.orig/arts/mcopidl/mcopidl.cc kdelibs-2.2.2/arts/mcopidl/mcopidl.cc
--- kdelibs-2.2.2.orig/arts/mcopidl/mcopidl.cc	2001-09-05 03:05:59.000000000 +0400
+++ kdelibs-2.2.2/arts/mcopidl/mcopidl.cc	2007-06-11 17:35:04.000000000 +0400
@@ -30,7 +30,7 @@
 #include <list>
 #include <stack>
 #include <ctype.h>
-#include "core.h"
+#include "common.h"
 #include "namespace.h"
 #include <iostream>
 
diff -ruN kdelibs-2.2.2.orig/arts/mcopidl/scanner.cc kdelibs-2.2.2/arts/mcopidl/scanner.cc
--- kdelibs-2.2.2.orig/arts/mcopidl/scanner.cc	2001-06-06 11:47:35.000000000 +0400
+++ kdelibs-2.2.2/arts/mcopidl/scanner.cc	2007-06-11 17:35:09.000000000 +0400
@@ -673,7 +673,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <ctype.h>
-#include "core.h"
+#include "common.h"
 
 using namespace std;
 using namespace Arts;
diff -ruN kdelibs-2.2.2.orig/arts/mcopidl/scanner.ll kdelibs-2.2.2/arts/mcopidl/scanner.ll
--- kdelibs-2.2.2.orig/arts/mcopidl/scanner.ll	2001-06-06 11:47:36.000000000 +0400
+++ kdelibs-2.2.2/arts/mcopidl/scanner.ll	2007-06-11 17:35:15.000000000 +0400
@@ -34,7 +34,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <ctype.h>
-#include "core.h"
+#include "common.h"
 
 using namespace std;
 using namespace Arts;
diff -ruN kdelibs-2.2.2.orig/arts/mcopidl/yacc.cc kdelibs-2.2.2/arts/mcopidl/yacc.cc
--- kdelibs-2.2.2.orig/arts/mcopidl/yacc.cc	2001-06-06 11:47:36.000000000 +0400
+++ kdelibs-2.2.2/arts/mcopidl/yacc.cc	2007-06-11 17:35:20.000000000 +0400
@@ -47,7 +47,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string>
-#include "core.h"
+#include "common.h"
 #include "namespace.h"
 
 using namespace std;
diff -ruN kdelibs-2.2.2.orig/arts/mcopidl/yacc.yy kdelibs-2.2.2/arts/mcopidl/yacc.yy
--- kdelibs-2.2.2.orig/arts/mcopidl/yacc.yy	2001-06-06 11:47:36.000000000 +0400
+++ kdelibs-2.2.2/arts/mcopidl/yacc.yy	2007-06-11 17:35:25.000000000 +0400
@@ -24,7 +24,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string>
-#include "core.h"
+#include "common.h"
 #include "namespace.h"
 
 using namespace std;
diff -ruN kdelibs-2.2.2.orig/arts/soundserver/artsversion.h kdelibs-2.2.2/arts/soundserver/artsversion.h
--- kdelibs-2.2.2.orig/arts/soundserver/artsversion.h	1970-01-01 03:00:00.000000000 +0300
+++ kdelibs-2.2.2/arts/soundserver/artsversion.h	2007-06-11 17:46:41.000000000 +0400
@@ -0,0 +1,31 @@
+    /*
+
+    Copyright (C) 2001 Stefan Westerfeld
+                       stefan@space.twc.de
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+  
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+   
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+    Boston, MA 02111-1307, USA.
+
+    */
+
+#ifndef ARTS_VERSION
+
+/* version information for all aRts utilities and programs */
+#define ARTS_MAJOR_VERSION                               (0)
+#define ARTS_MINOR_VERSION                               (6)
+#define ARTS_MICRO_VERSION                               (1)
+#define ARTS_VERSION									 ("0.6.1")
+
+#endif
diff -ruN kdelibs-2.2.2.orig/arts/soundserver/kmedia2.mcopclass kdelibs-2.2.2/arts/soundserver/kmedia2.mcopclass
--- kdelibs-2.2.2.orig/arts/soundserver/kmedia2.mcopclass	1970-01-01 03:00:00.000000000 +0300
+++ kdelibs-2.2.2/arts/soundserver/kmedia2.mcopclass	2007-06-11 17:46:41.000000000 +0400
@@ -0,0 +1,3 @@
+# this file was generated by the MCOP idl compiler - DO NOT EDIT
+Type=Arts::PlayObject_private,Arts::PlayObject,Arts::PlayObjectFactory,Arts::InputStream,Arts::FileInputStream,Arts::StdoutWriter,Arts::StreamPlayObject,Arts::PitchablePlayObject,Arts::PlayObjectFactoryV2,Arts::poTime
+TypeFile=kmedia2.mcoptype
Binary files kdelibs-2.2.2.orig/arts/soundserver/kmedia2.mcoptype and kdelibs-2.2.2/arts/soundserver/kmedia2.mcoptype differ
diff -ruN kdelibs-2.2.2.orig/arts/soundserver/soundserver.mcopclass kdelibs-2.2.2/arts/soundserver/soundserver.mcopclass
--- kdelibs-2.2.2.orig/arts/soundserver/soundserver.mcopclass	1970-01-01 03:00:00.000000000 +0300
+++ kdelibs-2.2.2/arts/soundserver/soundserver.mcopclass	2007-06-11 17:46:43.000000000 +0400
@@ -0,0 +1,3 @@
+# this file was generated by the MCOP idl compiler - DO NOT EDIT
+Type=Arts::SampleStorageEntry,Arts::SampleStorage,Arts::ByteSoundProducer,Arts::SimpleSoundServer,Arts::SoundServer,Arts::SoundServerV2,Arts::WavPlayObject
+TypeFile=soundserver.mcoptype
Binary files kdelibs-2.2.2.orig/arts/soundserver/soundserver.mcoptype and kdelibs-2.2.2/arts/soundserver/soundserver.mcoptype differ
diff -ruN kdelibs-2.2.2.orig/arts/tests/testremote.cc kdelibs-2.2.2/arts/tests/testremote.cc
--- kdelibs-2.2.2.orig/arts/tests/testremote.cc	2001-04-22 04:19:37.000000000 +0400
+++ kdelibs-2.2.2/arts/tests/testremote.cc	1970-01-01 03:00:00.000000000 +0300
@@ -1,176 +0,0 @@
-    /*
-
-    Copyright (C) 2000 Stefan Westerfeld stefan@space.twc.de
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-    Permission is also granted to link this program with the Qt
-    library, treating Qt like a library that normally accompanies the
-    operating system kernel, whether or not that is in fact the case.
-
-    */
-
-#include "remotetest.h"
-#include "value.h"
-#include "test.h"
-#include "connect.h"
-#include <iostream.h>
-#include <stdio.h>
-
-using namespace std;
-using namespace Arts;
-
-class RemoteTest_impl: virtual public RemoteTest_skel {
-private:
-	bool alive;
-
-public:
-	RemoteTest_impl()
-	{
-		alive = true;
-		_copy();
-	}
-	~RemoteTest_impl()
-	{
-		Dispatcher::the()->terminate();
-	}
-
-	Object createObject(const string& name)
-	{
-		return SubClass(name);
-	}
-	long fortyTwo()
-	{
-		return 42;
-	}
-	void die()
-	{
-		if(alive)
-		{
-			_release();
-			alive = false;
-		}
-	}
-};
-
-REGISTER_IMPLEMENTATION(RemoteTest_impl);
-
-/* name of the remote object - should be sufficiently unique */
-char objectName[60];
-
-struct TestRemote : public TestCase
-{
-	TESTCASE(TestRemote);
-
-	Arts::Dispatcher dispatcher;
-	RemoteTest remoteTest;
-
-	void setUp() {
-		string globalRef = "global:";
-		globalRef += objectName;
-
-		remoteTest = Arts::Reference(globalRef);
-	}
-	void tearDown() {
-		remoteTest = RemoteTest::null();
-	}
-
-	void process()
-	{
-		dispatcher.ioManager()->processOneEvent(false);
-	}
-
-
-	/* test whether the server is running, and we could connect ok */
-	TEST(connected) {
-		testEquals(false, remoteTest.isNull());
-	}
-
-	/* test method call */
-	TEST(fortyTwo) {
-		testEquals(42, remoteTest.fortyTwo());
-	}
-
-	/* test remote change notifications */
-	TEST(remoteChangeNotify) {
-		StringValue local;
-		local.value("local");
-		testEquals("local", local.value());
-
-		Object o = remoteTest.createObject("StringValue");
-		testAssert(!o.isNull());
-
-		StringValue remote = Arts::DynamicCast(o);
-		testAssert(!remote.isNull());
-		remote.value("remote");
-		testEquals("remote", remote.value());
-
-		connect(local,"value_changed",remote,"value");
-		local.value("transferme");
-
-		process();
-		sleep(1);	/* change notifications are asynchronous */
-
-		testEquals("transferme", local.value());
-		testEquals("transferme", remote.value());
-
-		disconnect(local,"value_changed",remote,"value");
-
-		local.value("notransfer");
-
-		testEquals("notransfer", local.value());
-		testEquals("transferme", remote.value());
-	}
-
-	/* terminate server */
-	TEST(die) {
-		remoteTest.die();
-		remoteTest = RemoteTest::null();
-		sleep(1);
-	}
-
-	/* check if server is dead now */
-	TEST(dead) {
-		testEquals(true, remoteTest.isNull());
-	}
-};
-
-TESTMAINFUNC(TestRemote,performTests);
-
-/*
- * this test case is a bit tricky because we need a client and a server
- *
- * we create the server in a fork()ed process, and then evaluate the test
- * inside the client
- */
-int main()
-{
-	/* create unique object name for test server/test client */
-	sprintf(objectName, "RemoteTest_%d_%ld", getpid(), time(0));
-
-	int pid = fork();
-	if(pid == 0)	/* child process - we play the server here */
-	{
-		Dispatcher dispatcher(0, Dispatcher::startUnixServer);
-		ObjectManager::the()->addGlobalReference(RemoteTest(), objectName);
-		dispatcher.run();
-		return 0;
-	}
-	else if(pid >= 0)	/* parent process - do the test here */
-	{
-		sleep(1);
-		return performTests();
-	}
-}
