[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdenonbeta
From:       Nikolas Zimmermann <wildfox () kde ! org>
Date:       2005-08-26 0:37:01
Message-ID: 1125016621.666044.2891.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 453373 by wildfox:

EcmaInterface.cpp & EcmaInterface.h are now automatically generated using the new
IDLCodeGeneratorEcmaInterface.pm, which operatoes on all IDL files once, instead of
being called per idl (like done for the cpp & js code generator).

I hope I got the makefile rules right, it works for me at least (tm)

In theory, regression testing facilities should be back, though
some refcounting problem (at least I think so) makes new created
wrappers disappear out-of-context, instead of being cached further..

Let me investigate once again :-)


 M  +2 -2      kdom/Makefile.am  
 M  +1 -48     kdom/bindings/IDLCodeGeneratorJs.pm  
 M  +13 -1     kdom/bindings/Makefile.am  
 M  +2 -2      kdom/bindings/kdomidl.pl  
 _M            kdom/ecma (directory)  
 D             kdom/ecma/EcmaInterface.h  
 M  +6 -3      kdom/ecma/Makefile.am  
 M  +1 -1      ksvg2/Makefile.am  
 M  +14 -1     ksvg2/bindings/Makefile.am  
 _M            ksvg2/ecma (directory)  
 D             ksvg2/ecma/EcmaInterface.h  
 M  +5 -4      ksvg2/ecma/Makefile.am  


--- trunk/kdenonbeta/kdom/Makefile.am #453372:453373
@@ -1,8 +1,8 @@
 include $(top_srcdir)/admin/Doxyfile.am
 include $(top_srcdir)/kdom/Makefile.global
 
-SUBDIRS = css views core traversal range cache parser \
-		  ls xpointer xpath bindings events ecma . backends test
+SUBDIRS = css views traversal range cache parser ls xpointer \
+		  xpath bindings core events ecma . backends test
 # SUBDIRS = catalog xinclude kxmllint
 
 DOXYGEN_REFERENCES = bindings/cpp
--- trunk/kdenonbeta/kdom/bindings/IDLCodeGeneratorJs.pm #453372:453373
@@ -449,52 +449,6 @@
 	my $showTypeNS = $useModuleNS;
 	$showTypeNS =~ s/([A-Z]*)[A-Za-z:]*/$1/g;
 
-	my $useThisClass = 0; # Helper.
-
-	# - Add special 'inheritedFooBarCast' function
-	if($useLayerOnTop eq 0) { # Stubbed base implementation in kdom...
-		push(@implContent, "$implClass *${showTypeNS}::EcmaInterface::inherited" .
-						   $inheritedType . "Cast(const KJS::ObjectImp *bridge)\n{\n" .
-						   "\tQ_UNUSED(bridge);\n\treturn 0;\n}\n\n");
-	} elsif($parentsMax > 0) { # Reimplementation of kdom base hooks...
-		my $useType = "";
-		my $useTypeNS = "";
-
-		my $usableClasses = 0;
-
-		foreach(@{$dataNode->parents}) {
-			my %parentType = $codeGenerator->ExtractNamespace($_, 1, $useModuleNS);
-
-			# Single kdom parent class support only.
-			# No ksvg2/khtml2 class needs anything else.
-			if($parentType{'namespace'} =~ /^KDOM/) {
-				$useType = $parentType{'type'};
-				$useTypeNS = $parentType{'namespace'};
-
-				my $baseClass = $codeGenerator->FindTopBaseClass($useType);
-
-				# Only add it, if the topmost base of the handled class is not a base class
-				# (that filters out for instance: DocumentEvent) and if it's not one of our
-				# kdom/Ecma.cpp 'built-in' types (Node, Event, CSSRule, CSSValue -> skip them).
-				if(($baseClass ne "") and
-				   ($useType ne "Event") and ($useType ne "Node") and
-				   ($useType ne "CSSRule") and ($useType ne "CSSValue")) {
-				   $useThisClass = 1;
-				}
-
-				$usableClasses++; # No use, but safety.
-			}
-		}
-
-		die("Only supporting _one_ kdom parent class atm. Report it!!") if($usableClasses > 1);
-
-		if($useThisClass eq 1) {
-			push(@implContent, "${useTypeNS}::${useType}Impl *${showTypeNS}::EcmaInterface" .
-							   "::inherited${useType}Cast(const KJS::ObjectImp *bridge)\n{\n" .
-							   "\treturn ${useModuleNS}::to${inheritedType}(0, bridge);\n}\n\n");
-		}
-	}
-
 	# - Add all attributes in a hashtable definition
 	my $attributesMax = @{$dataNode->attributes};
 	my $hashSize = $attributesMax;
@@ -796,7 +750,7 @@
 						   "\n\t$implClass *test = $useModuleNS" . "::$toId(exec, bridge);" .
 						   "\n\tif(test)\n\t\treturn test;\n");
 
-		if(($useLayerOnTop eq 0) or (($useLayerOnTop eq 1) and ($useThisClass eq 1))) {
+		if($useLayerOnTop eq 0) {
 			push(@implContent, "\n\t${showNS}ScriptInterpreter *interpreter = " .
 							   "static_cast<${showNS}ScriptInterpreter *>(exec" .
 							   "->interpreter());\n\t${showNS}DocumentImpl *document = " .
@@ -835,7 +789,6 @@
 					   "return ${showNS}cacheDOMObject<" . $extractedType{'type'} . ", $implClass>(exec, this);\n}\n");
 
 	# - Add 'to...' function (always needed!)
-	# TODO: inherited* logic for special 'getDOMNode' / 'getDOMEvent' things...
 	push(@implContent, "\n$implClass *" . $useModuleNS . "::$toId(KJS::ExecState *" .
 					   "exec, const KJS::ObjectImp *bridge)\n{");
 
--- trunk/kdenonbeta/kdom/bindings/Makefile.am #453372:453373
@@ -1,3 +1,15 @@
 include $(top_srcdir)/kdom/Makefile.global
 
-SUBDIRS = cpp js
+SUBDIRS = . cpp js
+
+# kdom/ecma/EcmaInterface.cpp generation
+ecmainterface:
+	if [ ! -e $(top_builddir)/kdom/ecma/EcmaInterface.h ]; then \
+		/usr/bin/env perl -I$(top_srcdir)/kdom/bindings $(top_srcdir)/kdom/bindings/kdomidl.pl \
+		--generator ecmaInterface --outputdir $(top_builddir)/kdom/ecma \
+		--includedir $(top_srcdir)/kdom/bindings/idl \
+		--input $(top_srcdir)/kdom/bindings/idl/core/Node.idl \
+		--documentation empty ; \
+	fi
+
+all-local: ecmainterface
--- trunk/kdenonbeta/kdom/bindings/kdomidl.pl #453372:453373
@@ -35,10 +35,10 @@
 		  "                  [--includedir <directory>]* [--documentation <xml file>]\n" .
 		  "                  [--input <idl file>] [--ontop]?\n\n";
 
-	print " Possible values for --generator: 'cpp' / 'js'\n";
+	print " Possible values for --generator: 'cpp' / 'js' / 'ecmaInterface'\n";
 	print " You can specify multiple --includedir arguments.\n";
 	print " In projects using kdom, specify the optional --ontop flag.\n";
-	print " Use relative directory paths for --outputdir & --documentationFile.\n\n";
+	print " Use relative directory paths for --outputdir & --documentation.\n\n";
 
 	exit;
 }
** trunk/kdenonbeta/kdom/ecma #property changes
Name: svn:ignore
   - Makefile
Makefile.in
GlobalObject.lut.h
--- trunk/kdenonbeta/kdom/ecma/Makefile.am #453372:453373
@@ -1,20 +1,23 @@
 include $(top_srcdir)/kdom/Makefile.global
 
 INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/kdom -I$(top_srcdir)/kdom/core \
+		   -I$(top_srcdir)/kdom/range -I$(top_srcdir)/kdom/traversal \
+		   -I$(top_srcdir)/kdom/ls -I$(top_srcdir)/kdom/xpointer \
 		   -I$(top_srcdir)/kdom/css -I$(top_srcdir)/kdom/events \
+		   -I$(top_srcdir)/kdom/views -I$(top_srcdir)/kdom/xpath \
 		   -I$(top_builddir)/kdom/bindings/js $(all_includes)
 
 noinst_LTLIBRARIES = libkdomecma.la
-libkdomecma_la_SOURCES = Helper.cpp ScriptInterpreter.cpp GlobalObject.cpp Ecma.cpp
+libkdomecma_la_SOURCES = Helper.cpp ScriptInterpreter.cpp GlobalObject.cpp EcmaInterface.cpp Ecma.cpp
 libkdomecma_la_LDFLAGS = $(LIB_KJS) $(all_libraries)
 libkdomecma_la_METASOURCES = GlobalObject.moc
 
 myincludedir = $(includedir)/kdom/ecma
 myinclude_HEADERS = ScriptInterpreter.h Ecma.h DOMLookup.h GlobalObject.h
 
-# .lut.h generation.
-CLEANFILES = GlobalObject.lut.h
+CLEANFILES = GlobalObject.lut.h EcmaInterface.cpp EcmaInterface.h
 
+# GlobalObject.lut.h generation.
 CREATE_HASH_TABLE = $(top_srcdir)/kdom/scripts/create_hash_table
 
 GlobalObject.lut.h : $(srcdir)/GlobalObject.cpp $(CREATE_HASH_TABLE)
--- trunk/kdenonbeta/ksvg2/Makefile.am #453372:453373
@@ -3,7 +3,7 @@
 INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/ksvg2/impl -I$(top_srcdir)/ksvg2/css \
 		   -I$(top_srcdir)/ksvg2/misc $(all_includes)
 
-SUBDIRS = css impl misc events bindings ecma . test
+SUBDIRS = css misc events bindings impl ecma . test
 
 lib_LTLIBRARIES = libksvg2.la
 kde_module_LTLIBRARIES = libksvg2part.la
--- trunk/kdenonbeta/ksvg2/bindings/Makefile.am #453372:453373
@@ -1,3 +1,16 @@
 include $(top_srcdir)/ksvg2/Makefile.global
 
-SUBDIRS = cpp js
+SUBDIRS = . cpp js
+
+# ksvg2/ecma/EcmaInterface.cpp generation
+ecmainterface:
+	if [ ! -e $(top_builddir)/ksvg2/ecma/EcmaInterface.h ]; then \
+		/usr/bin/env perl -I$(top_srcdir)/kdom/bindings $(top_srcdir)/kdom/bindings/kdomidl.pl \
+		--generator ecmaInterface --outputdir $(top_builddir)/ksvg2/ecma \
+		--includedir $(top_srcdir)/kdom/bindings/idl \
+		--includedir $(top_srcdir)/ksvg2/bindings/idl \
+		--input $(top_srcdir)/ksvg2/bindings/idl/svg/SVGElement.idl \
+		--documentation empty --ontop ; \
+	fi
+
+all-local: ecmainterface
** trunk/kdenonbeta/ksvg2/ecma #property changes
Name: svn:ignore
   - Makefile
Makefile.in
GlobalObject.lut.h
--- trunk/kdenonbeta/ksvg2/ecma/Makefile.am #453372:453373
@@ -2,15 +2,16 @@
 
 INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/ksvg2 -I$(top_srcdir)/ksvg2/impl \
 		   -I$(top_srcdir)/ksvg2/events -I$(top_srcdir)/kdom/bindings/js \
-		   -I$(top_srcdir)/ksvg2/bindings/js $(all_includes)
+		   -I$(top_srcdir)/ksvg2/bindings/js -I$(top_srcdir)/ksvg2/bindings/js/svg \
+		   $(all_includes)
 
 noinst_LTLIBRARIES = libksvgecma.la
-libksvgecma_la_SOURCES = Ecma.cpp GlobalObject.cpp
+libksvgecma_la_SOURCES = GlobalObject.cpp EcmaInterface.cpp Ecma.cpp
 libksvgecma_la_LDFLAGS = $(LIB_KJS) $(all_libraries)
 
-# .lut.h generation.
-CLEANFILES = GlobalObject.lut.h
+CLEANFILES = GlobalObject.lut.h EcmaInterface.cpp EcmaInterface.h
 
+# GlobalObject.lut.h generation.
 CREATE_HASH_TABLE = $(top_srcdir)/kdom/scripts/create_hash_table
 
 GlobalObject.lut.h : $(srcdir)/GlobalObject.cpp $(CREATE_HASH_TABLE)
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic