diff options
author | Darrell Anderson <humanreadable@yahoo.com> | 2014-01-08 20:06:00 +0100 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2014-01-08 20:06:00 +0100 |
commit | 636f509299122d02087c6fd62e1e4a46dbd22026 (patch) | |
tree | 70e43efceeb5b00e7f19cdac8da44928bd2fb459 /korundum | |
parent | 719b61750c08343f530068ed4127623aeac71cf0 (diff) | |
download | tdebindings-636f509299122d02087c6fd62e1e4a46dbd22026.tar.gz tdebindings-636f509299122d02087c6fd62e1e4a46dbd22026.zip |
Rename many classes to avoid conflicts with KDE
Diffstat (limited to 'korundum')
-rw-r--r-- | korundum/README | 4 | ||||
-rw-r--r-- | korundum/bin/Makefile.am | 8 | ||||
-rw-r--r-- | korundum/rubylib/korundum/Makefile.am | 2 | ||||
-rw-r--r-- | korundum/rubylib/korundum/lib/Makefile.am | 2 | ||||
-rw-r--r-- | korundum/rubylib/korundum/lib/TDE/Korundum.rb (renamed from korundum/rubylib/korundum/lib/KDE/Korundum.rb) | 0 | ||||
-rw-r--r-- | korundum/rubylib/korundum/lib/TDE/Makefile.am (renamed from korundum/rubylib/korundum/lib/KDE/Makefile.am) | 2 | ||||
-rw-r--r-- | korundum/rubylib/korundum/lib/TDE/korundum.rb (renamed from korundum/rubylib/korundum/lib/KDE/korundum.rb) | 112 | ||||
-rw-r--r-- | korundum/rubylib/korundum/tdehandlers.cpp (renamed from korundum/rubylib/korundum/kdehandlers.cpp) | 206 |
8 files changed, 168 insertions, 168 deletions
diff --git a/korundum/README b/korundum/README index 51641222..2ddb3911 100644 --- a/korundum/README +++ b/korundum/README @@ -8,10 +8,10 @@ KDE Specific Infomation: The other KDE classes are in the KParts::, TDEIO:: or DOM:: namespaces, with the same names as their C++ counterparts. - - Use the 'rbkdeapi' script to introspect the Korundum api from the command + - Use the 'rbtdeapi' script to introspect the Korundum api from the command line. For example: - $ rbkdeapi KDE::Action + $ rbtdeapi KDE::Action Will list all the methods in the KDE::Action class. There are currently (as at KDE 3.3 beta 2) 977 classes/30841 methods in the Smoke library diff --git a/korundum/bin/Makefile.am b/korundum/bin/Makefile.am index ef682c09..92beb014 100644 --- a/korundum/bin/Makefile.am +++ b/korundum/bin/Makefile.am @@ -7,7 +7,7 @@ krubyinit_SOURCES = krubyinit.cpp krubyinit_LDADD = $(LIB_KDE) $(RUBY_LIBRUBYARG) $(top_builddir)/smoke/tde/libsmoketde.la $(top_builddir)/qtruby/rubylib/qtruby/libqtrubyinternal.la install-exec-local: - @-rm -f $(DESTDIR)$(bindir)/rbkdeapi - @$(LN_S) rbqtapi $(DESTDIR)$(bindir)/rbkdeapi - @-rm -f $(DESTDIR)$(bindir)/rbkdesh - @$(LN_S) rbqtsh $(DESTDIR)$(bindir)/rbkdesh + @-rm -f $(DESTDIR)$(bindir)/rbtdeapi + @$(LN_S) rbqtapi $(DESTDIR)$(bindir)/rbtdeapi + @-rm -f $(DESTDIR)$(bindir)/rbtdesh + @$(LN_S) rbqtsh $(DESTDIR)$(bindir)/rbtdesh diff --git a/korundum/rubylib/korundum/Makefile.am b/korundum/rubylib/korundum/Makefile.am index 85797c62..70a05dd5 100644 --- a/korundum/rubylib/korundum/Makefile.am +++ b/korundum/rubylib/korundum/Makefile.am @@ -4,7 +4,7 @@ rubylibdir = $(RUBY_ARCHDIR) rubylib_LTLIBRARIES = korundum.la korundum_la_LDFLAGS = -module $(all_libraries) -version-info 0:0:0 korundum_la_METASOURCES = AUTO -korundum_la_SOURCES = Korundum.cpp kdehandlers.cpp +korundum_la_SOURCES = Korundum.cpp tdehandlers.cpp korundum_la_LIBADD = $(LIB_KDE) $(top_builddir)/smoke/tde/libsmoketde.la $(top_builddir)/qtruby/rubylib/qtruby/libqtrubyinternal.la SUBDIRS = lib diff --git a/korundum/rubylib/korundum/lib/Makefile.am b/korundum/rubylib/korundum/lib/Makefile.am index fba7d258..c951a717 100644 --- a/korundum/rubylib/korundum/lib/Makefile.am +++ b/korundum/rubylib/korundum/lib/Makefile.am @@ -1 +1 @@ -SUBDIRS = KDE +SUBDIRS = TDE diff --git a/korundum/rubylib/korundum/lib/KDE/Korundum.rb b/korundum/rubylib/korundum/lib/TDE/Korundum.rb index 101d3e30..101d3e30 100644 --- a/korundum/rubylib/korundum/lib/KDE/Korundum.rb +++ b/korundum/rubylib/korundum/lib/TDE/Korundum.rb diff --git a/korundum/rubylib/korundum/lib/KDE/Makefile.am b/korundum/rubylib/korundum/lib/TDE/Makefile.am index e69bcb05..c01c10df 100644 --- a/korundum/rubylib/korundum/lib/KDE/Makefile.am +++ b/korundum/rubylib/korundum/lib/TDE/Makefile.am @@ -1,4 +1,4 @@ -kderubylibdir = $(RUBY_RUBYLIBDIR)/KDE +kderubylibdir = $(RUBY_RUBYLIBDIR)/TDE kderubylib_DATA = korundum.rb rubylibdir = $(RUBY_RUBYLIBDIR) diff --git a/korundum/rubylib/korundum/lib/KDE/korundum.rb b/korundum/rubylib/korundum/lib/TDE/korundum.rb index 87e3be87..043aa643 100644 --- a/korundum/rubylib/korundum/lib/KDE/korundum.rb +++ b/korundum/rubylib/korundum/lib/TDE/korundum.rb @@ -1,6 +1,6 @@ =begin /*************************************************************************** - Korundum.rb - KDE specific ruby runtime, dcop etc. + Korundum.rb - TDE specific ruby runtime, dcop etc. ------------------- begin : Sun Sep 28 2003 copyright : (C) 2003-2006 by Richard Dale @@ -21,21 +21,21 @@ module KDE DCOPMeta = {} # An entry for each dcop signal or slot - # Example + # Example # int foobar(TQString,bool) # :name is 'foobar' # :full_name is 'foobar(TQString,bool)' # :arg_types is 'TQString,bool' # :reply_type is 'int' DCOPMember = Struct.new :name, :full_name, :arg_types, :reply_type - + # If the class with the 'k_dcop' slots declaration is not a subclass of DCOPObject, # then 'dcop_object' holds a instance of DCOPObject for the class to use as a # proxy. For subclasses of DCOPObject, 'dcop_object' will always be nil class DCOPMetaInfo attr_accessor :dcop_object, :changed attr_reader :k_dcop_signals, :k_dcop - + def initialize(aClass) DCOPMeta[aClass.name] = self @dcop_object = nil @@ -43,7 +43,7 @@ module KDE @k_dcop = {} @changed = false end - + def add_signals(signal_list) signal_list.each do |signal| signal = DCOPClient.normalizeFunctionSignature(signal) @@ -55,7 +55,7 @@ module KDE end end end - + def add_slots(slot_list) slot_list.each do |slot| if slot =~ /^([\w,<>:]*)\s+([^\s]*)\((.*)\)/ @@ -103,21 +103,21 @@ module KDE if fun == 'functions()' or fun == 'interfaces()' return super end - + slots = DCOPMeta[@client.class.name].k_dcop dcop_slot = slots[fun.sub(/\(.*/, '')] if dcop_slot.nil? # Can't find an entry for the slot being called? This shouldn't happen.. return false end - + replyType << dcop_slot.reply_type - KDE::dcop_process( @client, - dcop_slot.name, - TQt::Internal::getMocArguments(fun), + KDE::dcop_process( @client, + dcop_slot.name, + TQt::Internal::getMocArguments(fun), data, - replyType, - (replyType == 'void' or replyType == 'ASYNC') ? nil : TQt::Internal::getMocArguments(replyType), + replyType, + (replyType == 'void' or replyType == 'ASYNC') ? nil : TQt::Internal::getMocArguments(replyType), replyData ) end @@ -130,24 +130,24 @@ module KDE funcs = super() return funcs + @functions end - + def functions=(funcs) @functions = funcs end - - # If a ruby class has 'k_dcop' slots declarations, but isn't a + + # If a ruby class has 'k_dcop' slots declarations, but isn't a # subclass of DCOPObject, then keep an instance of it def client=(obj) @client = obj end - + def inspect str = super if @functions != nil str.sub(/>$/, " objId=%s, functions=Array (%d element(s))>" % [objId.inspect, functions.length]) end end - + def pretty_print(pp) str = to_s if @functions != nil @@ -157,16 +157,16 @@ module KDE end # If a class contains a k_dcop slots list declaration, then create a DCOPObject - # associated with it + # associated with it def KDE.createDCOPObject(instance) meta = DCOPMeta[instance.class.name] return nil if meta.nil? if meta.dcop_object.nil? or meta.changed funcs = [] - meta.k_dcop.each_value do |value| + meta.k_dcop.each_value do |value| sig = value.reply_type + ' ' + value.name + '(' + value.arg_types + ')' - funcs << sig + funcs << sig end meta.changed = false if instance.kind_of? DCOPObject @@ -186,7 +186,7 @@ module KDE return meta.dcop_object end - + class DCOPRef < TQt::Base def method_missing(*k) # Enables DCOPRef calls to be made like this: @@ -203,13 +203,13 @@ module KDE method = k[0].id2name # Make 'parrot.age = 7' a synonym for 'parrot.setAge(7)' method = 'set' + method[0,1].upcase + method[1,method.length].sub("=", "") if method =~ /.*[^-+%\/|]=$/ - + # If the method name contains underscores, convert to camel case - while method =~ /([^_]*)_(.)(.*)/ + while method =~ /([^_]*)_(.)(.*)/ method = $1 + $2.upcase + $3 end - - # Get the functions() for this dcop ref and + + # Get the functions() for this dcop ref and # cache method_name => full_type_signature in a hash if @functions.nil? @functions = {} @@ -226,7 +226,7 @@ module KDE # Remove any arg names args.gsub!(/ \w*/, "") end - + # Make thing? a synonym for isThing() or hasThing() if name =~ /^(is|has)(.)(.*)/ predicate = $2.downcase + $3 + '?' @@ -234,12 +234,12 @@ module KDE @functions[predicate] = return_type + " " + name + args end end - + if @functions[name].nil? @functions[name] = return_type + " " + name + args else # If a function name is overloaded, just keep a single name entry in - # the hash, not all the full type signatures. Then leave dcopTypeNames() + # the hash, not all the full type signatures. Then leave dcopTypeNames() # to try and resolve the ambiguous call from the ruby arg types passed. @functions.delete(name) @functions[name] = name @@ -247,7 +247,7 @@ module KDE end end end - + method = @functions[method] if method.nil? tqWarning( "DCOPRef: call #{k[0].id2name}() not found" ) @@ -257,7 +257,7 @@ module KDE return callExt(method, *dcopArgs) end end - + def dcopTypeNames(*k) typeNames = "(" k.each do |arg| @@ -281,7 +281,7 @@ module KDE typeNames << ")" return typeNames end - + def call(fun, *k) k << NoEventLoop << -1 callExt(fun, *k) @@ -307,8 +307,8 @@ module KDE tqWarning( "DCOPRef: call #{fun} invalid format, expecting '<function_name>(<args>)'" ) return end - return KDE::dcop_call( self, - full_name, + return KDE::dcop_call( self, + full_name, TQt::Internal::getMocArguments(full_name), *k ) end @@ -330,8 +330,8 @@ module KDE tqWarning( "DCOPRef: send #{sig} invalid format, expecting '<function_name>(<args>)'" ) return end - return KDE::dcop_send( self, - fun, + return KDE::dcop_send( self, + fun, TQt::Internal::getMocArguments(sig), *k ) end @@ -349,7 +349,7 @@ module KDE str = super str.sub(/>$/, " app=%s, obj=%s>" % [app.inspect, obj.inspect]) end - + def pretty_print(pp) str = to_s pp.text str.sub(/>$/, "\n app=%s,\n obj=%s>" % [app.inspect, obj.inspect]) @@ -359,7 +359,7 @@ module KDE method_missing(:type, *args) end end - + def CmdLineArgs::init(*k) if k.length > 0 if k[0].kind_of? Array @@ -374,7 +374,7 @@ module KDE super end end - + # A sane alternative to the strange looking C++ template version, # this takes a variable number of ruby args as classes to restore def MainWindow::kRestoreMainWindows(*k) @@ -410,10 +410,10 @@ module KDE end return str end - + def pretty_print(pp) str = to_s - str.sub!(/>$/, "\n appName=%s,\n copyrightStatement=%s,\n programName=%s,\n version=%s,\n shortDescription=%s,\n homepage=%s,\n bugAddress=%s>" % + str.sub!(/>$/, "\n appName=%s,\n copyrightStatement=%s,\n programName=%s,\n version=%s,\n shortDescription=%s,\n homepage=%s,\n bugAddress=%s>" % [appName.inspect, copyrightStatement.inspect, programName.inspect, version.inspect, shortDescription.inspect, homepage.inspect, bugAddress.inspect] ) length = authors.length @@ -431,17 +431,17 @@ module KDE pp.text str end end - + class AboutPerson def inspect str = super - str.sub(/>$/, " emailAddress=%s, name=%s, task=%s, webAddress=%s>" % + str.sub(/>$/, " emailAddress=%s, name=%s, task=%s, webAddress=%s>" % [emailAddress.inspect, name.inspect, task.inspect, webAddress.inspect] ) end - + def pretty_print(pp) str = to_s - pp.text str.sub(/>$/, "\n emailAddress=%s,\n name=%s,\n task=%s,\n webAddress=%s>" % + pp.text str.sub(/>$/, "\n emailAddress=%s,\n name=%s,\n task=%s,\n webAddress=%s>" % [emailAddress.inspect, name.inspect, task.inspect, webAddress.inspect] ) end @@ -449,17 +449,17 @@ module KDE method_missing(:name, *args) end end - + class AboutTranslator def inspect str = super - str.sub(/>$/, " emailAddress=%s, name=%s>" % + str.sub(/>$/, " emailAddress=%s, name=%s>" % [emailAddress.inspect, name.inspect] ) end - + def pretty_print(pp) str = to_s - pp.text str.sub(/>$/, "\n emailAddress=%s,\n name=%s>" % + pp.text str.sub(/>$/, "\n emailAddress=%s,\n name=%s>" % [emailAddress.inspect, name.inspect] ) end @@ -485,13 +485,13 @@ module KDE method_missing(:name, *args) end end - + class Application def initialize(*k) super $kapp = self end - + # Delete the underlying C++ instance after exec returns # Otherwise, rb_gc_call_finalizer_at_exit() can delete # stuff that KDE::Application still needs for its cleanup. @@ -637,7 +637,7 @@ module KDE end str.sub!(/,?$/, ">") end - + def pretty_print(pp) str = to_s str.sub!(/>$/, "") @@ -832,13 +832,13 @@ module KDE method_missing(:id, *args) end end - + class Service def inspect str = super str.sub(/>$/, " library=%s, type=%s, name=%s>" % [library.inspect, type.inspect, name.inspect]) end - + def pretty_print(pp) str = to_s pp.text str.sub(/>$/, "\n library=%s,\n type=%s,\n name=%s>" % [library.inspect, type.inspect, name.inspect]) @@ -972,7 +972,7 @@ module KDE super $kapp = self end - + # Delete the underlying C++ instance after exec returns # Otherwise, rb_gc_call_finalizer_at_exit() can delete # stuff that KDE::Application still needs for its cleanup. @@ -994,7 +994,7 @@ module KDE str = super str.sub(/>$/, " url=%s, protocol=%s, host=%s, port=%d>" % [url.inspect, protocol.inspect, host.inspect, port]) end - + def pretty_print(pp) str = to_s pp.text str.sub(/>$/, "\n url=%s,\n protocol=%s,\n host=%s,\n port=%d>" % [url.inspect, protocol.inspect, host.inspect, port]) diff --git a/korundum/rubylib/korundum/kdehandlers.cpp b/korundum/rubylib/korundum/tdehandlers.cpp index 12af6baf..f4707824 100644 --- a/korundum/rubylib/korundum/kdehandlers.cpp +++ b/korundum/rubylib/korundum/tdehandlers.cpp @@ -116,7 +116,7 @@ kde_resolve_classname(Smoke * smoke, int classId, void * ptr) return "DOM::Notation"; } } - + return smoke->binding->className(classId); } @@ -124,7 +124,7 @@ kde_resolve_classname(Smoke * smoke, int classId, void * ptr) void marshall_TQCStringList(Marshall *m) { switch(m->action()) { - case Marshall::FromVALUE: + case Marshall::FromVALUE: { VALUE list = *(m->var()); if (TYPE(list) != T_ARRAY) { @@ -155,7 +155,7 @@ void marshall_TQCStringList(Marshall *m) { } break; } - case Marshall::ToVALUE: + case Marshall::ToVALUE: { QCStringList *stringlist = static_cast<QCStringList *>(m->item().s_voidp); if(!stringlist) { @@ -189,7 +189,7 @@ void marshall_TQCStringList(Marshall *m) { void marshall_TDECmdLineOptions(Marshall *m) { switch(m->action()) { - case Marshall::FromVALUE: + case Marshall::FromVALUE: { VALUE optionslist = *(m->var()); if (optionslist == Qnil @@ -201,9 +201,9 @@ void marshall_TDECmdLineOptions(Marshall *m) { } // Allocate 'length + 1' entries, to include an all NULLs last entry - TDECmdLineOptions *cmdLineOptions = (TDECmdLineOptions *) calloc( RARRAY_LEN(optionslist) + 1, + TDECmdLineOptions *cmdLineOptions = (TDECmdLineOptions *) calloc( RARRAY_LEN(optionslist) + 1, sizeof(struct TDECmdLineOptions) ); - + VALUE options; long i; for(i = 0; i < RARRAY_LEN(optionslist); i++) { @@ -219,7 +219,7 @@ void marshall_TDECmdLineOptions(Marshall *m) { cmdLineOptions[i].description = 0; cmdLineOptions[i].def = 0; - + m->item().s_voidp = cmdLineOptions; m->next(); /* @@ -231,11 +231,11 @@ void marshall_TDECmdLineOptions(Marshall *m) { rb_ary_push(options, rb_str_new2(cmdLineOptions[i].description)); rb_ary_push(options, rb_str_new2(cmdLineOptions[i].def)); rb_ary_push(optionslist, options); - } + } */ } break; - case Marshall::ToVALUE: + case Marshall::ToVALUE: { } break; @@ -296,9 +296,9 @@ void marshall_WIdList(Marshall *m) { it != valuelist->end(); ++it) rb_ary_push(av, LONG2NUM(*it)); - + *(m->var()) = av; - + if(m->cleanup()) delete valuelist; } @@ -311,11 +311,11 @@ void marshall_WIdList(Marshall *m) { void marshall_KMimeTypeList(Marshall *m) { switch(m->action()) { - case Marshall::FromVALUE: + case Marshall::FromVALUE: { } break; - case Marshall::ToVALUE: + case Marshall::ToVALUE: { KMimeType::List *offerList = (KMimeType::List*)m->item().s_voidp; if(!offerList) { @@ -342,8 +342,8 @@ void marshall_KMimeTypeList(Marshall *m) { rb_ary_push(av, obj); } - *(m->var()) = av; - + *(m->var()) = av; + if(m->cleanup()) delete offerList; } @@ -356,11 +356,11 @@ void marshall_KMimeTypeList(Marshall *m) { void marshall_KMimeTypePtr(Marshall *m) { switch(m->action()) { - case Marshall::FromVALUE: + case Marshall::FromVALUE: { } break; - case Marshall::ToVALUE: + case Marshall::ToVALUE: { KMimeType::Ptr ptr(*(KMimeType::Ptr*)m->item().s_voidp); if(ptr == 0) { @@ -368,7 +368,7 @@ void marshall_KMimeTypePtr(Marshall *m) { break; } KMimeType * mimeType = new KMimeType(*(KMimeType*)ptr); - + VALUE obj = getPointerObject(mimeType); if(obj == Qnil) { smokeruby_object * o = ALLOC(smokeruby_object); @@ -379,8 +379,8 @@ void marshall_KMimeTypePtr(Marshall *m) { obj = set_obj_info("KDE::MimeType", o); } - *(m->var()) = obj; - + *(m->var()) = obj; + if(m->cleanup()) ; } @@ -393,11 +393,11 @@ void marshall_KMimeTypePtr(Marshall *m) { void marshall_KServicePtr(Marshall *m) { switch(m->action()) { - case Marshall::FromVALUE: + case Marshall::FromVALUE: { } break; - case Marshall::ToVALUE: + case Marshall::ToVALUE: { TDESharedPtr<KService> *ptr = new TDESharedPtr<KService>(*(TDESharedPtr<KService>*)m->item().s_voidp); if(ptr == 0) { @@ -405,7 +405,7 @@ void marshall_KServicePtr(Marshall *m) { break; } KService * service = ptr->data(); - + VALUE obj = getPointerObject(service); if(obj == Qnil) { smokeruby_object * o = ALLOC(smokeruby_object); @@ -416,8 +416,8 @@ void marshall_KServicePtr(Marshall *m) { obj = set_obj_info("KDE::Service", o); } - *(m->var()) = obj; - + *(m->var()) = obj; + if(m->cleanup()) ; } @@ -430,11 +430,11 @@ void marshall_KServicePtr(Marshall *m) { void marshall_KServiceList(Marshall *m) { switch(m->action()) { - case Marshall::FromVALUE: + case Marshall::FromVALUE: { } break; - case Marshall::ToVALUE: + case Marshall::ToVALUE: { KService::List *offerList = (KService::List*)m->item().s_voidp; if(!offerList) { @@ -462,8 +462,8 @@ void marshall_KServiceList(Marshall *m) { rb_ary_push(av, obj); } - *(m->var()) = av; - + *(m->var()) = av; + if(m->cleanup()) delete offerList; } @@ -476,11 +476,11 @@ void marshall_KServiceList(Marshall *m) { void marshall_KServiceGroupPtr(Marshall *m) { switch(m->action()) { - case Marshall::FromVALUE: + case Marshall::FromVALUE: { } break; - case Marshall::ToVALUE: + case Marshall::ToVALUE: { KServiceGroup::Ptr ptr(*(KServiceGroup::Ptr*)m->item().s_voidp); if(ptr == 0) { @@ -499,8 +499,8 @@ void marshall_KServiceGroupPtr(Marshall *m) { obj = set_obj_info("KDE::ServiceGroup", o); } - *(m->var()) = obj; - + *(m->var()) = obj; + if(m->cleanup()) ; } @@ -513,11 +513,11 @@ void marshall_KServiceGroupPtr(Marshall *m) { void marshall_KServiceTypeList(Marshall *m) { switch(m->action()) { - case Marshall::FromVALUE: + case Marshall::FromVALUE: { } break; - case Marshall::ToVALUE: + case Marshall::ToVALUE: { KServiceType::List *offerList = (KServiceType::List*)m->item().s_voidp; if(!offerList) { @@ -544,8 +544,8 @@ void marshall_KServiceTypeList(Marshall *m) { rb_ary_push(av, obj); } - *(m->var()) = av; - + *(m->var()) = av; + if(m->cleanup()) delete offerList; } @@ -558,11 +558,11 @@ void marshall_KServiceTypeList(Marshall *m) { void marshall_KServiceGroupList(Marshall *m) { switch(m->action()) { - case Marshall::FromVALUE: + case Marshall::FromVALUE: { } break; - case Marshall::ToVALUE: + case Marshall::ToVALUE: { KServiceGroup::List *offerList = (KServiceGroup::List*)m->item().s_voidp; if(!offerList) { @@ -600,12 +600,12 @@ void marshall_KServiceGroupList(Marshall *m) { obj = set_obj_info("KDE::ServiceGroup", o); } } - + rb_ary_push(av, obj); } - *(m->var()) = av; - + *(m->var()) = av; + if(m->cleanup()) delete offerList; } @@ -619,11 +619,11 @@ void marshall_KServiceGroupList(Marshall *m) { #if TDE_VERSION >= 0x030200 void marshall_KMountPointList(Marshall *m) { switch(m->action()) { - case Marshall::FromVALUE: + case Marshall::FromVALUE: { } break; - case Marshall::ToVALUE: + case Marshall::ToVALUE: { KMountPoint::List *list = (KMountPoint::List*)m->item().s_voidp; if(!list) { @@ -650,8 +650,8 @@ void marshall_KMountPointList(Marshall *m) { rb_ary_push(av, obj); } - *(m->var()) = av; - + *(m->var()) = av; + if(m->cleanup()) delete list; } @@ -664,11 +664,11 @@ void marshall_KMountPointList(Marshall *m) { void marshall_KPluginInfoList(Marshall *m) { switch(m->action()) { - case Marshall::FromVALUE: + case Marshall::FromVALUE: { - } + } break; - case Marshall::ToVALUE: + case Marshall::ToVALUE: { KPluginInfo::List *valuelist = (KPluginInfo::List*)m->item().s_voidp; if(!valuelist) { @@ -706,7 +706,7 @@ void marshall_KPluginInfoList(Marshall *m) { if(m->cleanup()) delete valuelist; else - *(m->var()) = av; + *(m->var()) = av; } break; default: @@ -718,11 +718,11 @@ void marshall_KPluginInfoList(Marshall *m) { void marshall_TDEActionPtrList(Marshall *m) { switch(m->action()) { - case Marshall::FromVALUE: + case Marshall::FromVALUE: { - } + } break; - case Marshall::ToVALUE: + case Marshall::ToVALUE: { TDEActionPtrList *valuelist = (TDEActionPtrList*)m->item().s_voidp; if (!valuelist) { @@ -737,7 +737,7 @@ void marshall_TDEActionPtrList(Marshall *m) { for ( TDEActionPtrList::Iterator it = valuelist->begin(); it != valuelist->end(); - ++it ) + ++it ) { void *p = (*it); @@ -761,7 +761,7 @@ void marshall_TDEActionPtrList(Marshall *m) { if (m->cleanup()) delete valuelist; else - *(m->var()) = av; + *(m->var()) = av; } break; default: @@ -772,11 +772,11 @@ void marshall_TDEActionPtrList(Marshall *m) { void marshall_TDETraderOfferList(Marshall *m) { switch(m->action()) { - case Marshall::FromVALUE: + case Marshall::FromVALUE: { } break; - case Marshall::ToVALUE: + case Marshall::ToVALUE: { TDETrader::OfferList *offerList = (TDETrader::OfferList*)m->item().s_voidp; if(!offerList) { @@ -804,8 +804,8 @@ void marshall_TDETraderOfferList(Marshall *m) { rb_ary_push(av, obj); } - *(m->var()) = av; - + *(m->var()) = av; + if(m->cleanup()) delete offerList; } @@ -818,7 +818,7 @@ void marshall_TDETraderOfferList(Marshall *m) { void marshall_KURLList(Marshall *m) { switch(m->action()) { - case Marshall::FromVALUE: + case Marshall::FromVALUE: { VALUE list = *(m->var()); if (TYPE(list) != T_ARRAY) { @@ -851,7 +851,7 @@ void marshall_KURLList(Marshall *m) { const char * className = m->smoke()->binding->className(ix); for ( KURL::List::Iterator it = kurllist->begin(); it != kurllist->end(); - ++it ) + ++it ) { void *p = new KURL(*it); VALUE obj = getPointerObject(p); @@ -865,13 +865,13 @@ void marshall_KURLList(Marshall *m) { } rb_ary_push(list, obj); } - + if(m->cleanup()) { delete kurllist; } - } + } break; - case Marshall::ToVALUE: + case Marshall::ToVALUE: { KURL::List *kurllist = (KURL::List*)m->item().s_voidp; if(!kurllist) { @@ -902,7 +902,7 @@ void marshall_KURLList(Marshall *m) { } *(m->var()) = av; - + if(m->cleanup()) { delete kurllist; } @@ -923,13 +923,13 @@ void marshall_UDSEntryList(Marshall *m) { m->item().s_voidp = 0; break; } - + TDEIO::UDSEntryList *cpplist = new TDEIO::UDSEntryList; - + for(long i = 0; i < RARRAY_LEN(list); i++) { VALUE item = rb_ary_entry(list, i); TDEIO::UDSEntry *cppsublist = new TDEIO::UDSEntry; - + for (int j = 0; j < RARRAY_LEN(item); j++) { VALUE subitem = rb_ary_entry(item, j); smokeruby_object *o = value_obj_info(subitem); @@ -939,7 +939,7 @@ void marshall_UDSEntryList(Marshall *m) { ptr = o->smoke->cast(ptr, o->classId, o->smoke->idClass("TDEIO::UDSAtom")); cppsublist->append(*(TDEIO::UDSAtom*)ptr); } - + cpplist->append(*cppsublist); } @@ -961,14 +961,14 @@ void marshall_UDSEntryList(Marshall *m) { for ( TDEIO::UDSEntryList::Iterator it = valuelist->begin(); it != valuelist->end(); - ++it ) + ++it ) { TDEIO::UDSEntry * udsentry = &(*it); VALUE subav = rb_ary_new(); for ( TDEIO::UDSEntry::Iterator it = udsentry->begin(); it != udsentry->end(); - ++it ) + ++it ) { void * p = &(*it); VALUE obj = getPointerObject(p); @@ -980,13 +980,13 @@ void marshall_UDSEntryList(Marshall *m) { o->allocated = false; obj = set_obj_info("TDEIO::UDSAtom", o); } - + rb_ary_push(subav, obj); } - + rb_ary_push(av, subav); } - + *(m->var()) = av; } break; @@ -1215,34 +1215,34 @@ void marshall_Map(Marshall *m) { m->item().s_voidp = 0; break; } - + TQMap<Key,Value> * map = new TQMap<Key,Value>; - + // Convert the ruby hash to an array of key/value arrays VALUE temp = rb_funcall(hash, rb_intern("to_a"), 0); for (long i = 0; i < RARRAY_LEN(temp); i++) { VALUE key = rb_ary_entry(rb_ary_entry(temp, i), 0); VALUE value = rb_ary_entry(rb_ary_entry(temp, i), 1); - + smokeruby_object *o = value_obj_info(key); if( !o || !o->ptr) continue; void * key_ptr = o->ptr; key_ptr = o->smoke->cast(key_ptr, o->classId, o->smoke->idClass(KeySTR)); - + o = value_obj_info(value); if( !o || !o->ptr) continue; void * val_ptr = o->ptr; val_ptr = o->smoke->cast(val_ptr, o->classId, o->smoke->idClass(ValueSTR)); - + (*map)[(Key)*(Key*)key_ptr] = (Value)*(Value*)val_ptr; } - + m->item().s_voidp = map; m->next(); - + if(m->cleanup()) delete map; } @@ -1254,21 +1254,21 @@ void marshall_Map(Marshall *m) { *(m->var()) = Qnil; break; } - + VALUE hv = rb_hash_new(); - + int key_ix = m->smoke()->idClass(KeySTR); const char * key_className = m->smoke()->binding->className(key_ix); - + int val_ix = m->smoke()->idClass(ValueSTR); const char * val_className = m->smoke()->binding->className(val_ix); - + ItemMapIterator it; for (it = map->begin(); it != map->end(); ++it) { void *key_p = new Key(it.key()); VALUE key_obj = getPointerObject(key_p); smokeruby_object * o; - + if (key_obj == Qnil) { o = ALLOC(smokeruby_object); o->classId = m->smoke()->idClass(KeySTR); @@ -1277,10 +1277,10 @@ void marshall_Map(Marshall *m) { o->allocated = true; key_obj = set_obj_info(key_className, o); } - + void *val_p = new Value(it.data()); VALUE value_obj = getPointerObject(val_p); - + if (value_obj == Qnil) { o = ALLOC(smokeruby_object); o->classId = m->smoke()->idClass(ValueSTR); @@ -1289,13 +1289,13 @@ void marshall_Map(Marshall *m) { o->allocated = true; value_obj = set_obj_info(val_className, o); } - + rb_hash_aset(hv, key_obj, value_obj); } - + *(m->var()) = hv; m->next(); - + if(m->cleanup()) delete map; } @@ -1320,28 +1320,28 @@ void marshall_TQMapTQCStringDCOPRef(Marshall *m) { m->item().s_voidp = 0; break; } - + TQMap<TQCString,DCOPRef> * map = new TQMap<TQCString,DCOPRef>; - + // Convert the ruby hash to an array of key/value arrays VALUE temp = rb_funcall(hash, rb_intern("to_a"), 0); for (long i = 0; i < RARRAY_LEN(temp); i++) { VALUE key = rb_ary_entry(rb_ary_entry(temp, i), 0); VALUE value = rb_ary_entry(rb_ary_entry(temp, i), 1); - + smokeruby_object *o = value_obj_info(value); if( !o || !o->ptr) continue; void * ptr = o->ptr; ptr = o->smoke->cast(ptr, o->classId, o->smoke->idClass("DCOPRef")); - + (*map)[TQCString(StringValuePtr(key))] = (DCOPRef)*(DCOPRef*)ptr; } - + m->item().s_voidp = map; m->next(); - + if(m->cleanup()) delete map; } @@ -1353,14 +1353,14 @@ void marshall_TQMapTQCStringDCOPRef(Marshall *m) { *(m->var()) = Qnil; break; } - + VALUE hv = rb_hash_new(); - + TQMap<TQCString,DCOPRef>::Iterator it; for (it = map->begin(); it != map->end(); ++it) { void *p = new DCOPRef(it.data()); VALUE obj = getPointerObject(p); - + if (obj == Qnil) { smokeruby_object * o = ALLOC(smokeruby_object); o->classId = m->smoke()->idClass("DCOPRef"); @@ -1369,13 +1369,13 @@ void marshall_TQMapTQCStringDCOPRef(Marshall *m) { o->allocated = true; obj = set_obj_info("KDE::DCOPRef", o); } - + rb_hash_aset(hv, rb_str_new2((const char *) it.key()), obj); } - + *(m->var()) = hv; m->next(); - + if(m->cleanup()) delete map; } |