[Kde-bindings] KDE/kdebindings/csharp
Arno Rehn
kde at arnorehn.de
Mon Nov 24 21:51:17 UTC 2008
SVN commit 888575 by arnorehn:
* Put the KSharedPtr marshaller in marshall_macros_kde.h
* Remove deprecated Nepomuk marshallers.
CCMAIL: kde-bindings at kde.org
M +4 -0 kimono/ChangeLog
M +3 -70 kimono/src/kdehandlers.cpp
A kimono/src/marshall_macros_kde.h [License: UNKNOWN]
M +0 -10 nepomuk/src/nepomukhandlers.cpp
M +1 -1 plasma/CMakeLists.txt
M +5 -1 plasma/src/plasmahandlers.cpp
--- trunk/KDE/kdebindings/csharp/kimono/ChangeLog #888574:888575
@@ -1,3 +1,7 @@
+2008-11-24 Arno Rehn <arno at arnorehn.de>
+
+ * Put the KSharedPtr marshaller in marshall_macros_kde.h
+
2008-10-29 Arno Rehn <arno at arnorehn.de>
* Don't let KIO::SlaveBase redirect SIGXCPU, since it's needed by
--- trunk/KDE/kdebindings/csharp/kimono/src/kdehandlers.cpp #888574:888575
@@ -49,78 +49,11 @@
#include <kurl.h>
#include <kuser.h>
-#define DEF_KSHAREDPTR_MARSHALLER(Item) namespace { char Item##STR[] = #Item; } \
- Marshall::HandlerFn marshall_KSharedPtr_##Item = marshall_KSharedPtr<Item,Item##STR>;
+#include "marshall_macros_kde.h"
-template<class Item, const char *ItemSTR>
-void marshall_KSharedPtr(Marshall *m) {
- switch(m->action()) {
- case Marshall::FromObject:
- {
- if (m->var().s_class == 0) {
- m->item().s_class = 0;
- (*FreeGCHandle)(m->var().s_class);
- return;
- }
+DEF_KSHAREDPTR_MARSHALLER(KSharedConfig, KSharedConfig)
+DEF_KSHAREDPTR_MARSHALLER(KMimeType, KMimeType)
- smokeqyoto_object *o = (smokeqyoto_object*) (*GetSmokeObject)(m->var().s_class);
- if (o == 0 || o->ptr == 0) {
- if (m->type().isRef()) {
- m->unsupported();
- }
- m->item().s_class = 0;
- break;
- }
- m->item().s_class = new KSharedPtr<Item>((Item*) o->ptr);
- (*FreeGCHandle)(m->var().s_class);
- break;
- }
- case Marshall::ToObject:
- {
- if (m->item().s_voidp == 0) {
- m->var().s_voidp = 0;
- break;
- }
-
- KSharedPtr<Item> *ptr = new KSharedPtr<Item>(*(KSharedPtr<Item>*)m->item().s_voidp);
- if (ptr == 0) {
- m->var().s_voidp = 0;
- break;
- }
- Item * config = ptr->data();
-
- void * obj = (*GetInstance)(config, true);
- if(obj != 0) {
- m->var().s_voidp = obj;
- break;
- }
-
- Smoke::ModuleIndex id = m->smoke()->findClass(ItemSTR);
- smokeqyoto_object * o = alloc_smokeqyoto_object(false, id.smoke, id.index, config);
- const char *resolved = qyoto_modules[id.smoke].resolve_classname(o);
- obj = (*CreateInstance)(resolved, o);
- if (do_debug & qtdb_calls) {
- printf("allocating %s %p -> %p\n", ItemSTR, o->ptr, (void*)obj);
- }
-
- if (m->type().isStack()) {
-// o->allocated = true;
- // Keep a mapping of the pointer so that it is only wrapped once
- mapPointer(obj, o, o->classId, 0);
- }
-
- m->var().s_class = obj;
- break;
- }
- default:
- m->unsupported();
- break;
- }
-}
-
-DEF_KSHAREDPTR_MARSHALLER(KSharedConfig)
-DEF_KSHAREDPTR_MARSHALLER(KMimeType)
-
DEF_LIST_MARSHALLER( KActionList, QList<KAction*>, KAction )
DEF_LIST_MARSHALLER( KActionCollectionList, QList<KActionCollection*>, KActionCollection )
DEF_LIST_MARSHALLER( KAutoSaveFileList, QList<KAutoSaveFile*>, KAutoSaveFile )
--- trunk/KDE/kdebindings/csharp/nepomuk/src/nepomukhandlers.cpp #888574:888575
@@ -21,18 +21,12 @@
#include <nepomuk/class.h>
#include <nepomuk/property.h>
-#include <nepomuk/query.h>
-#include <nepomuk/queryserviceclient.h>
#include <nepomuk/resource.h>
-#include <nepomuk/result.h>
#include <nepomuk/tag.h>
-#include <nepomuk/term.h>
#include <nepomuk/variant.h>
DEF_VALUELIST_MARSHALLER( NepomukResourceList, QList<Nepomuk::Resource>, Nepomuk::Resource )
DEF_VALUELIST_MARSHALLER( NepomukTagList, QList<Nepomuk::Tag>, Nepomuk::Tag )
-DEF_VALUELIST_MARSHALLER( NepomukSearchResultList, QList<Nepomuk::Search::Result>, Nepomuk::Search::Result )
-DEF_VALUELIST_MARSHALLER( NepomukSearchTermList, QList<Nepomuk::Search::Term>, Nepomuk::Search::Term )
DEF_VALUELIST_MARSHALLER( NepomukTypesClassList, QList<Nepomuk::Types::Class>, Nepomuk::Types::Class )
DEF_VALUELIST_MARSHALLER( NepomukTypesPropertyList, QList<Nepomuk::Types::Property>, Nepomuk::Types::Property )
@@ -41,10 +35,6 @@
{ "QList<Nepomuk::Resource>&", marshall_NepomukResourceList },
{ "QList<Nepomuk::Tag>", marshall_NepomukTagList },
{ "QList<Nepomuk::Tag>&", marshall_NepomukTagList },
- { "QList<Nepomuk::Search::Result>", marshall_NepomukSearchResultList },
- { "QList<Nepomuk::Search::Result>&", marshall_NepomukSearchResultList },
- { "QList<Nepomuk::Search::Term>", marshall_NepomukSearchTermList },
- { "QList<Nepomuk::Search::Term>&", marshall_NepomukSearchTermList },
{ "QList<Nepomuk::Types::Class>", marshall_NepomukTypesClassList },
{ "QList<Nepomuk::Types::Class>&", marshall_NepomukTypesClassList },
{ "QList<Nepomuk::Types::Property>", marshall_NepomukTypesPropertyList },
--- trunk/KDE/kdebindings/csharp/plasma/CMakeLists.txt #888574:888575
@@ -22,7 +22,7 @@
src/PlasmaScriptengineKimono_DataEngine.cs)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/smoke
- ${CMAKE_CURRENT_SOURCE_DIR}/../qyoto/src ${QT_INCLUDES})
+ ${CMAKE_CURRENT_SOURCE_DIR}/../qyoto/src ${CMAKE_CURRENT_SOURCE_DIR}/../kimono/src ${QT_INCLUDES})
LINK_DIRECTORIES (${LIBRARY_OUTPUT_PATH})
ADD_LIBRARY(plasma-sharp MODULE ${SRC_CPP})
ADD_DEPENDENCIES(plasma-sharp smokeplasma kde-dotnet)
--- trunk/KDE/kdebindings/csharp/plasma/src/plasmahandlers.cpp #888574:888575
@@ -18,6 +18,7 @@
#include <qyoto.h>
#include <smokeqyoto.h>
#include <marshall_macros.h>
+#include <marshall_macros_kde.h>
#include <plasma/packagestructure.h>
#include <plasma/containment.h>
@@ -115,12 +116,15 @@
DEF_LIST_MARSHALLER( PlasmaContainmentList, QList<Plasma::Containment*>, Plasma::Containment )
DEF_LIST_MARSHALLER( PlasmaAppletList, QList<Plasma::Applet*>, Plasma::Applet )
+DEF_KSHAREDPTR_MARSHALLER(Plasma::PackageStructure, Plasma__PackageStructure)
+
// DEF_HASH_MARSHALLER( QHashQStringApplet, Plasma::Applet )
// DEF_HASH_MARSHALLER( QHashQStringDataContainer, Plasma::DataContainer )
//DEF_HASH_MARSHALLER( QHashQStringDataEngine, Plasma::DataEngine )
TypeHandler Plasma_handlers[] = {
-// { "Plasma::PackageStructure::Ptr", marshall_PackageStructurePtr },
+ { "Plasma::PackageStructure::Ptr", marshall_KSharedPtr_Plasma__PackageStructure },
+ { "KSharedPtr<Plasma::PackageStructure>", marshall_KSharedPtr_Plasma__PackageStructure },
{ "QHash<QString,QVariant>", marshall_QHashQStringQVariant },
{ "QHash<QString,QVariant>&", marshall_QHashQStringQVariant },
{ "Plasma::DataEngine::Data", marshall_QHashQStringQVariant },
More information about the Kde-bindings
mailing list