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

List:       kde-core-devel
Subject:    building kdegraphics/ksvg with gcc3.4
From:       Stanislav Karchebny <berk () upnet ! ru>
Date:       2004-04-24 20:46:01
Message-ID: 200404250246.01686.berk () upnet ! ru
[Download RAW message or body]

I had to do the following to build KSVG with gcc3.4

* As usual, patch two-stage template id lookup all around
* Remove circular dependency in ksvg_{lookup,bridge,scriptinterpreter}.h by 
introducing ksvg_cacheimpl.h and including it where appropriate.

The attached patch does all this (diff against latest CVS).
Is it ok to commit?

-- 
keep in touch. berkus.

Roey on #kde-devel: when I hear best of breed I tune out--it's too much a
buzzword. What I carry between my legs is best of breed. And like KDE, just
because it's less visible doesn't mean it gets less usage.

["kdegraphics-ksvg-gcc34.diff" (text/x-diff)]

Index: ecma/ksvg_bridge.h
===================================================================
RCS file: /home/kde/kdegraphics/ksvg/ecma/ksvg_bridge.h,v
retrieving revision 1.69
diff -u -p -u -w -r1.69 ksvg_bridge.h
--- ecma/ksvg_bridge.h	13 Oct 2003 20:24:12 -0000	1.69
+++ ecma/ksvg_bridge.h	24 Apr 2004 20:38:05 -0000
@@ -90,7 +90,7 @@ public:
 //			kdDebug(26004) << "KSVGBridge::put(), " << propertyName.qstring() << " Name: " \
<< classInfo()->className << " Object: " << m_impl << endl;  
 		// Try to see if we know this property (and need to take special action)
-		if(m_impl->put(exec, propertyName, value, attr))
+      if(this->m_impl->put(exec, propertyName, value, attr))
 			return;
 
 		// We don't -> set property in ObjectImp.
Index: ecma/ksvg_lookup.h
===================================================================
RCS file: /home/kde/kdegraphics/ksvg/ecma/ksvg_lookup.h,v
retrieving revision 1.41
diff -u -p -u -w -r1.41 ksvg_lookup.h
--- ecma/ksvg_lookup.h	17 Aug 2003 11:49:23 -0000	1.41
+++ ecma/ksvg_lookup.h	24 Apr 2004 20:38:05 -0000
@@ -25,7 +25,8 @@
 #include <kjs/lookup.h>
 #include <kjs/interpreter.h> // for ExecState
 
-class KSVGScriptInterpreter;
+#include "ksvg_bridge.h"
+#include "ksvg_scriptinterpreter.h"
 
 #define KSVG_GET_COMMON \
 public: \
Index: ecma/ksvg_scriptinterpreter.h
===================================================================
RCS file: /home/kde/kdegraphics/ksvg/ecma/ksvg_scriptinterpreter.h,v
retrieving revision 1.12
diff -u -p -u -w -r1.12 ksvg_scriptinterpreter.h
--- ecma/ksvg_scriptinterpreter.h	10 May 2003 09:32:50 -0000	1.12
+++ ecma/ksvg_scriptinterpreter.h	24 Apr 2004 20:38:05 -0000
@@ -23,8 +23,6 @@
 
 #include <qptrdict.h>
 
-#include "ksvg_bridge.h"
-
 namespace KJS
 {
 	class Value;
@@ -68,43 +66,6 @@ private:
 	QPtrDict<KJS::ObjectImp> m_domObjects;
 };
 
-// Lookup or create JS object around an existing "DOM Object"
-template<class DOMObj, class KJSDOMObj>
-inline KJS::Value cacheDOMObject(KJS::ExecState *exec, DOMObj *domObj)
-{
-	KJS::ObjectImp *ret;
-	if(!domObj)
-		return KJS::Null();
-
-	KSVGScriptInterpreter *interp = static_cast<KSVGScriptInterpreter \
                *>(exec->interpreter());
-	if((ret = interp->getDOMObject(domObj)))
-		return KJS::Value(ret);
-	else
-	{
-		ret = new KJSDOMObj(exec, domObj);
-		interp->putDOMObject(domObj, ret);
-		return KJS::Value(ret);
-	}
-}
-
-// Lookup or create singleton Impl object, and return a unique bridge object for it.
-// (Very much like KJS::cacheGlobalObject, which is for a singleton ObjectImp)
-// This one is mostly used for Constructor objects.
-template <class ClassCtor>
-inline KJS::Object cacheGlobalBridge(KJS::ExecState *exec, const KJS::Identifier \
                &propertyName)
-{
-	KJS::ValueImp *obj = \
static_cast<KJS::ObjectImp*>(exec->interpreter()->globalObject().imp())->getDirect(propertyName);
                
-	if(obj)
-		return KJS::Object::dynamicCast(KJS::Value(obj));
-	else
-	{
-		ClassCtor* ctor = new ClassCtor(exec); // create the ClassCtor instance
-		KJS::Object newObject(new KSVGBridge<ClassCtor>(exec, ctor)); // create the bridge \
                around it
-		exec->interpreter()->globalObject().put(exec, propertyName, newObject, Internal);
-		return newObject;
-	}
-}
-
 #endif
 
 // vim:ts=4:noet
Index: impl/SVGAngleImpl.cc
===================================================================
RCS file: /home/kde/kdegraphics/ksvg/impl/SVGAngleImpl.cc,v
retrieving revision 1.21
diff -u -p -u -w -r1.21 SVGAngleImpl.cc
--- impl/SVGAngleImpl.cc	11 Nov 2003 21:35:07 -0000	1.21
+++ impl/SVGAngleImpl.cc	24 Apr 2004 20:38:05 -0000
@@ -29,6 +29,7 @@ using namespace KSVG;
 #include "SVGAngleImpl.lut.h"
 #include "ksvg_scriptinterpreter.h"
 #include "ksvg_bridge.h"
+#include "ksvg_cacheimpl.h"
 
 const double deg2rad = 0.017453292519943295769; // pi/180
 const double deg2grad = 400.0 / 360.0;
Index: impl/SVGColorImpl.cc
===================================================================
RCS file: /home/kde/kdegraphics/ksvg/impl/SVGColorImpl.cc,v
retrieving revision 1.33
diff -u -p -u -w -r1.33 SVGColorImpl.cc
--- impl/SVGColorImpl.cc	26 Mar 2004 20:21:56 -0000	1.33
+++ impl/SVGColorImpl.cc	24 Apr 2004 20:38:05 -0000
@@ -38,6 +38,7 @@ using namespace KSVG;
 #include "SVGColorImpl.lut.h"
 #include "ksvg_scriptinterpreter.h"
 #include "ksvg_bridge.h"
+#include "ksvg_cacheimpl.h"
 
 SVGColorImpl::SVGColorImpl(SVGElementImpl *object) : m_object(object)
 {
Index: impl/SVGGradientElementImpl.cc
===================================================================
RCS file: /home/kde/kdegraphics/ksvg/impl/SVGGradientElementImpl.cc,v
retrieving revision 1.82
diff -u -p -u -w -r1.82 SVGGradientElementImpl.cc
--- impl/SVGGradientElementImpl.cc	29 Oct 2003 13:26:16 -0000	1.82
+++ impl/SVGGradientElementImpl.cc	24 Apr 2004 20:38:05 -0000
@@ -39,6 +39,7 @@ using namespace KSVG;
 #include "ksvg_scriptinterpreter.h"
 #include "ksvg_bridge.h"
 #include "ksvg_ecma.h"
+#include "ksvg_cacheimpl.h"
 
 SVGGradientElementImpl::SVGGradientElementImpl(DOM::ElementImpl *impl) : \
SVGElementImpl(impl), SVGURIReferenceImpl(), SVGExternalResourcesRequiredImpl(), \
SVGStylableImpl(this), SVGPaintServerImpl()  {
Index: impl/SVGHelperImpl.h
===================================================================
RCS file: /home/kde/kdegraphics/ksvg/impl/SVGHelperImpl.h,v
retrieving revision 1.22
diff -u -p -u -w -r1.22 SVGHelperImpl.h
--- impl/SVGHelperImpl.h	27 Aug 2003 20:08:25 -0000	1.22
+++ impl/SVGHelperImpl.h	24 Apr 2004 20:38:05 -0000
@@ -23,6 +23,7 @@
 
 #include <dom/dom_element.h>
 
+#include "SVGElementImpl.h"
 #include "SVGLengthImpl.h"
 
 #include "ksvg_lookup.h"
@@ -32,11 +33,10 @@ class QString;
 
 namespace KSVG
 {
-
-class SVGElementImpl;
 class SVGStringListImpl;
 class SVGTransformListImpl;
 class SVGAnimatedLengthListImpl;
+
 class SVGHelperImpl
 {
 public:
@@ -56,7 +56,7 @@ public:
 		{
 			T *cast = dynamic_cast<T \
*>(element->ownerDoc()->getElementFromHandle(node.handle()));  if(cast)
-				cast->putValueProperty(element->ownerDoc()->ecmaEngine()->globalExec(), token, \
KJS::String(value), Internal); \
+				cast->putValueProperty(element->ownerDoc()->ecmaEngine()->globalExec(), token, \
KJS::String(value), KJS::Internal);  }
 	}
 
Index: impl/SVGLengthImpl.cc
===================================================================
RCS file: /home/kde/kdegraphics/ksvg/impl/SVGLengthImpl.cc,v
retrieving revision 1.99
diff -u -p -u -w -r1.99 SVGLengthImpl.cc
--- impl/SVGLengthImpl.cc	26 Mar 2004 20:21:56 -0000	1.99
+++ impl/SVGLengthImpl.cc	24 Apr 2004 20:38:05 -0000
@@ -45,6 +45,7 @@ using namespace KSVG;
 #include "SVGLengthImpl.lut.h"
 #include "ksvg_scriptinterpreter.h"
 #include "ksvg_bridge.h"
+#include "ksvg_cacheimpl.h"
 
 // keep track of textual description of the unit type
 QString UnitText[] =
Index: impl/SVGMarkerElementImpl.cc
===================================================================
RCS file: /home/kde/kdegraphics/ksvg/impl/SVGMarkerElementImpl.cc,v
retrieving revision 1.66
diff -u -p -u -w -r1.66 SVGMarkerElementImpl.cc
--- impl/SVGMarkerElementImpl.cc	26 Mar 2004 20:21:56 -0000	1.66
+++ impl/SVGMarkerElementImpl.cc	24 Apr 2004 20:38:05 -0000
@@ -44,6 +44,7 @@ using namespace KSVG;
 #include "ksvg_scriptinterpreter.h"
 #include "ksvg_bridge.h"
 #include "ksvg_ecma.h"
+#include "ksvg_cacheimpl.h"
 
 SVGMarkerElementImpl::SVGMarkerElementImpl(DOM::ElementImpl *impl) : \
SVGContainerImpl(impl), SVGLangSpaceImpl(), SVGExternalResourcesRequiredImpl(), \
SVGStylableImpl(this), SVGFitToViewBoxImpl()  {
Index: impl/SVGPaintImpl.cc
===================================================================
RCS file: /home/kde/kdegraphics/ksvg/impl/SVGPaintImpl.cc,v
retrieving revision 1.21
diff -u -p -u -w -r1.21 SVGPaintImpl.cc
--- impl/SVGPaintImpl.cc	10 Jul 2003 15:47:56 -0000	1.21
+++ impl/SVGPaintImpl.cc	24 Apr 2004 20:38:05 -0000
@@ -30,6 +30,7 @@ using namespace KSVG;
 #include "SVGPaintImpl.lut.h"
 #include "ksvg_scriptinterpreter.h"
 #include "ksvg_bridge.h"
+#include "ksvg_cacheimpl.h"
 
 SVGPaintImpl::SVGPaintImpl(SVGElementImpl *object) : SVGColorImpl(object)
 {
Index: impl/SVGPathSegImpl.cc
===================================================================
RCS file: /home/kde/kdegraphics/ksvg/impl/SVGPathSegImpl.cc,v
retrieving revision 1.23
diff -u -p -u -w -r1.23 SVGPathSegImpl.cc
--- impl/SVGPathSegImpl.cc	9 Dec 2003 13:42:26 -0000	1.23
+++ impl/SVGPathSegImpl.cc	24 Apr 2004 20:38:05 -0000
@@ -26,6 +26,7 @@ using namespace KSVG;
 
 #include "SVGPathSegImpl.lut.h"
 #include "ksvg_scriptinterpreter.h"
+#include "ksvg_cacheimpl.h"
 
 SVGPathSegImpl::SVGPathSegImpl()
 {
Index: impl/SVGPreserveAspectRatioImpl.cc
===================================================================
RCS file: /home/kde/kdegraphics/ksvg/impl/SVGPreserveAspectRatioImpl.cc,v
retrieving revision 1.37
diff -u -p -u -w -r1.37 SVGPreserveAspectRatioImpl.cc
--- impl/SVGPreserveAspectRatioImpl.cc	21 Aug 2003 20:02:54 -0000	1.37
+++ impl/SVGPreserveAspectRatioImpl.cc	24 Apr 2004 20:38:05 -0000
@@ -34,6 +34,7 @@ using namespace KSVG;
 #include "SVGPreserveAspectRatioImpl.lut.h"
 #include "ksvg_scriptinterpreter.h"
 #include "ksvg_bridge.h"
+#include "ksvg_cacheimpl.h"
 
 SVGPreserveAspectRatioImpl::SVGPreserveAspectRatioImpl()
 {
Index: impl/SVGTextContentElementImpl.cc
===================================================================
RCS file: /home/kde/kdegraphics/ksvg/impl/SVGTextContentElementImpl.cc,v
retrieving revision 1.36
diff -u -p -u -w -r1.36 SVGTextContentElementImpl.cc
--- impl/SVGTextContentElementImpl.cc	2 Oct 2003 20:08:32 -0000	1.36
+++ impl/SVGTextContentElementImpl.cc	24 Apr 2004 20:38:05 -0000
@@ -34,6 +34,7 @@ using namespace KSVG;
 
 #include "SVGTextContentElementImpl.lut.h"
 #include "ksvg_scriptinterpreter.h"
+#include "ksvg_cacheimpl.h"
 
 SVGTextContentElementImpl::SVGTextContentElementImpl(DOM::ElementImpl *impl) : \
SVGShapeImpl(impl), SVGTestsImpl(), SVGLangSpaceImpl(), \
SVGExternalResourcesRequiredImpl(), SVGStylableImpl(this)  {
Index: impl/SVGTextPathElementImpl.cc
===================================================================
RCS file: /home/kde/kdegraphics/ksvg/impl/SVGTextPathElementImpl.cc,v
retrieving revision 1.23
diff -u -p -u -w -r1.23 SVGTextPathElementImpl.cc
--- impl/SVGTextPathElementImpl.cc	12 Oct 2003 13:23:27 -0000	1.23
+++ impl/SVGTextPathElementImpl.cc	24 Apr 2004 20:38:05 -0000
@@ -34,6 +34,7 @@ using namespace KSVG;
 #include "SVGTextPathElementImpl.lut.h"
 #include "ksvg_scriptinterpreter.h"
 #include "ksvg_ecma.h"
+#include "ksvg_cacheimpl.h"
 
 SVGTextPathElementImpl::SVGTextPathElementImpl(DOM::ElementImpl *impl) : \
SVGTextContentElementImpl(impl), SVGURIReferenceImpl()  {
Index: impl/SVGTransformImpl.cc
===================================================================
RCS file: /home/kde/kdegraphics/ksvg/impl/SVGTransformImpl.cc,v
retrieving revision 1.35
diff -u -p -u -w -r1.35 SVGTransformImpl.cc
--- impl/SVGTransformImpl.cc	21 Aug 2003 20:02:55 -0000	1.35
+++ impl/SVGTransformImpl.cc	24 Apr 2004 20:38:05 -0000
@@ -31,6 +31,7 @@ using namespace KSVG;
 #include "SVGTransformImpl.lut.h"
 #include "ksvg_scriptinterpreter.h"
 #include "ksvg_bridge.h"
+#include "ksvg_cacheimpl.h"
 
 SVGTransformImpl::SVGTransformImpl()
 {
Index: impl/SVGZoomAndPanImpl.cc
===================================================================
RCS file: /home/kde/kdegraphics/ksvg/impl/SVGZoomAndPanImpl.cc,v
retrieving revision 1.23
diff -u -p -u -w -r1.23 SVGZoomAndPanImpl.cc
--- impl/SVGZoomAndPanImpl.cc	10 May 2003 16:10:03 -0000	1.23
+++ impl/SVGZoomAndPanImpl.cc	24 Apr 2004 20:38:05 -0000
@@ -28,6 +28,7 @@ using namespace KSVG;
 #include "SVGZoomAndPanImpl.lut.h"
 #include "ksvg_scriptinterpreter.h"
 #include "ksvg_bridge.h"
+#include "ksvg_cacheimpl.h"
 
 SVGZoomAndPanImpl::SVGZoomAndPanImpl()
 {
Index: impl/generateddata.cpp
===================================================================
RCS file: /home/kde/kdegraphics/ksvg/impl/generateddata.cpp,v
retrieving revision 1.134
diff -u -p -u -w -r1.134 generateddata.cpp
--- impl/generateddata.cpp	22 Nov 2003 10:57:10 -0000	1.134
+++ impl/generateddata.cpp	24 Apr 2004 20:38:06 -0000
@@ -161,6 +161,8 @@
 using namespace KSVG;
 using namespace KJS;
 
+#include "ksvg_cacheimpl.h"
+
 // For all classes with generated data: the ClassInfo
 const DOM::DOMString SVGAElementImpl::s_tagName = "a";
 const ClassInfo SVGAElementImpl::s_classInfo = \
                {"KSVG::SVGAElementImpl",0,&SVGAElementImpl::s_hashTable,0};
Index: test/external/SVGTestWidget.cc
===================================================================
RCS file: /home/kde/kdegraphics/ksvg/test/external/SVGTestWidget.cc,v
retrieving revision 1.8
diff -u -p -u -w -r1.8 SVGTestWidget.cc
--- test/external/SVGTestWidget.cc	7 Dec 2003 16:13:06 -0000	1.8
+++ test/external/SVGTestWidget.cc	24 Apr 2004 20:38:06 -0000
@@ -9,6 +9,7 @@
 #include "SVGSVGElement.h"
 #include "SVGEventImpl.h"
 #include "KSVGCanvas.h"
+#include "CanvasItem.h"
 #include <kcursor.h>
 
 using namespace KSVG;
--- /dev/null	1970-01-01 05:00:00.000000000 +0500
+++ ecma/ksvg_cacheimpl.h	2004-04-25 01:50:41.650097808 +0600
@@ -0,0 +1,65 @@
+/*
+    Copyright (C) 2002-2003 KSVG Team
+   This file is part of the KDE project
+
+    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 KSVGCacheImpl_H
+#define KSVGCacheImpl_H
+
+#include "ksvg_scriptinterpreter.h"
+
+// Lookup or create JS object around an existing "DOM Object"
+template<class DOMObj, class KJSDOMObj>
+inline KJS::Value cacheDOMObject(KJS::ExecState *exec, DOMObj *domObj)
+{
+   KJS::ObjectImp *ret;
+   if(!domObj)
+      return KJS::Null();
+
+   KSVGScriptInterpreter *interp = static_cast<KSVGScriptInterpreter \
*>(exec->interpreter()); +   if((ret = interp->getDOMObject(domObj)))
+      return KJS::Value(ret);
+   else
+   {
+      ret = new KJSDOMObj(exec, domObj);
+      interp->putDOMObject(domObj, ret);
+      return KJS::Value(ret);
+   }
+}
+
+// Lookup or create singleton Impl object, and return a unique bridge object for it.
+// (Very much like KJS::cacheGlobalObject, which is for a singleton ObjectImp)
+// This one is mostly used for Constructor objects.
+template <class ClassCtor>
+inline KJS::Object cacheGlobalBridge(KJS::ExecState *exec, const KJS::Identifier \
&propertyName) +{
+   KJS::ValueImp *obj = \
static_cast<KJS::ObjectImp*>(exec->interpreter()->globalObject().imp())->getDirect(propertyName);
 +   if(obj)
+      return KJS::Object::dynamicCast(KJS::Value(obj));
+   else
+   {
+      ClassCtor* ctor = new ClassCtor(exec); // create the ClassCtor instance
+      KJS::Object newObject(new KSVGBridge<ClassCtor>(exec, ctor)); // create the \
bridge around it +      exec->interpreter()->globalObject().put(exec, propertyName, \
newObject, KJS::Internal); +      return newObject;
+   }
+}
+
+#endif
+
+// vim:ts=4:noet



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

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