[Kst] extragear/graphics/kst/src

George Staikos staikos at kde.org
Wed Oct 18 06:43:20 CEST 2006


SVN commit 596645 by staikos:

we don't preserve BC anymore


 M  +7 -31     libkst/kstobject.cpp  
 M  +8 -13     libkst/kstobject.h  
 M  +5 -10     libkst/rwlock.h  
 M  +1 -1      libkstapp/kst2dplot.cpp  
 M  +4 -11     libkstapp/kstviewobject.cpp  
 M  +1 -3      libkstapp/kstviewobject.h  


--- trunk/extragear/graphics/kst/src/libkst/kstobject.cpp #596644:596645
@@ -17,28 +17,17 @@
 
 #include "kstobject.h"
 
-class KstObjectPrivate {
-  public:
-    KstObjectPrivate() {
-      _dirty = false;
-      _lastUpdate = KstObject::NO_CHANGE;
-    }
-
-    bool _dirty;
-    KstObject::UpdateType _lastUpdate;
-};
-
 static int i = 0;
 
 KstObject::KstObject()
-: KstShared(), QObject(), KstRWLock(), _lastUpdateCounter(0), d(new KstObjectPrivate) {
+: KstShared(), QObject(), KstRWLock(), _lastUpdateCounter(0) {
+  _dirty = false;
+  _lastUpdate = KstObject::NO_CHANGE;
   _tag = "Object" + QString::number(++i);
 }
 
 
 KstObject::~KstObject() {
-  delete d;
-  d = 0L;
 }
 
 
@@ -58,13 +47,6 @@
 }
 
 
-void KstObject::virtual_hook(int id, void *data) {
-  Q_UNUSED(id)
-  Q_UNUSED(data)
-  // id=0 v1.2.0 setDirty() was called.  data == 0 means false, else true
-}
-
-
 const QString& KstObject::tagName() const {
   return _tag;
 }
@@ -92,28 +74,22 @@
 
 
 KstObject::UpdateType KstObject::setLastUpdateResult(UpdateType result) {
-  return d->_lastUpdate = result;
+  return _lastUpdate = result;
 }
 
 
 KstObject::UpdateType KstObject::lastUpdateResult() const {
-  return d->_lastUpdate;
+  return _lastUpdate;
 }
 
 
 void KstObject::setDirty(bool dirty) {
-  d->_dirty = dirty;
-  virtual_hook(0, (void*)dirty);
+  _dirty = dirty;
 }
 
 
-void KstObject::setDirty() {
-  setDirty(true);
-}
-
-
 bool KstObject::dirty() const {
-  return d->_dirty;
+  return _dirty;
 }
 
 // vim: ts=2 sw=2 et
--- trunk/extragear/graphics/kst/src/libkst/kstobject.h #596644:596645
@@ -29,6 +29,11 @@
 
 class KstObjectPrivate;
 
+// NOTE: In order to preserve binary compatibility with plugins, you must
+//       update the plugin keys whenever you add, remove, or change member
+//       variables or virtual functions, or when you remove or change
+//       non-virtual functions.
+
 class KST_EXPORT KstObject : public KstShared, public QObject, public KstRWLock {
   public:
     KstObject();
@@ -52,13 +57,11 @@
     virtual bool deleteDependents();
 
     // @since 1.1.0
-    void setDirty();
+    virtual void setDirty(bool dirty = true);
     // @since 1.1.0
     bool dirty() const;
 
   protected:
-    // id=0 v1.2.0 setDirty() was called.  data == 0 means false, else true
-    virtual void virtual_hook(int id, void *data);
     int _lastUpdateCounter;
 
     // @since 1.1.0
@@ -66,18 +69,10 @@
     // @since 1.1.0
     UpdateType lastUpdateResult() const;
 
-    // @since 1.1.0
-    void setDirty(bool dirty);
-
   private:
     QString _tag;
-    KstObjectPrivate *d;
-
-    // NOTE: In order to preserve binary compatibility with plugins, you must
-    //       not add, remove, or change member variables or virtual functions.
-    //       You must also not remove or change non-virtual functions.  You can
-    //       add new variables to the KstObjectPrivate pointer if you need
-    //       them.  You can simulate virtual functions with the virtual_hook().
+    bool _dirty;
+    KstObject::UpdateType _lastUpdate;
 };
 
 typedef KstSharedPtr<KstObject> KstObjectPtr;
--- trunk/extragear/graphics/kst/src/libkst/rwlock.h #596644:596645
@@ -27,6 +27,11 @@
 #include "config.h"
 #include "kst_export.h"
 
+// NOTE: In order to preserve binary compatibility with plugins, you must
+//       update the plugin keys whenever you add, remove, or change member
+//       variables or virtual functions, or when you remove or change
+//       non-virtual functions.
+
 class KST_EXPORT KstRWLock {
   public:
     KstRWLock();
@@ -51,10 +56,6 @@
 
     mutable Qt::HANDLE _writeLocker;
     mutable QMap<Qt::HANDLE, int> _readLockers;
-
-    // NOTE: In order to preserve binary compatibility with plugins, you must
-    //       not add, remove, or change member variables or virtual functions.
-    //       You must also not remove or change non-virtual functions.
 };
 
 
@@ -64,9 +65,6 @@
     ~KstReadLocker() { _l->unlock(); }
   private:
     KstRWLock *_l;
-    // NOTE: In order to preserve binary compatibility with plugins, you must
-    //       not add, remove, or change member variables or virtual functions.
-    //       You must also not remove or change non-virtual functions.
 };
 
 
@@ -76,9 +74,6 @@
     ~KstWriteLocker() { _l->unlock(); }
   private:
     KstRWLock *_l;
-    // NOTE: In order to preserve binary compatibility with plugins, you must
-    //       not add, remove, or change member variables or virtual functions.
-    //       You must also not remove or change non-virtual functions.
 };
 
 #endif
--- trunk/extragear/graphics/kst/src/libkstapp/kst2dplot.cpp #596644:596645
@@ -2374,7 +2374,7 @@
   const QRect alignment(KST::alignment.limits(geometry()));
   updateDirtyFromLabels();
   if (wasDirty || sizeNew != _oldSize || alignment != _oldAlignment) {
-    forEachChild2<KstViewLabel>(&KstViewObject::setDirty); // FIXME: hack,remove
+    forEachChild(&KstViewObject::setDirty, true); // FIXME: hack,remove
     draw();
     recursively(&KstViewObject::updateFromAspect); // alignment may have changed
   }
--- trunk/extragear/graphics/kst/src/libkstapp/kstviewobject.cpp #596644:596645
@@ -1847,18 +1847,11 @@
 }
 
 
-// id=0 v1.2.0 setDirty() was called.  data == 0 means false, else true
-void KstViewObject::virtual_hook(int id, void *data) {
-  switch (id) {
-    case 0:
-      if (data) {
-        invalidateClipRegion();
-      }
-      break;
-    default:
-      break;
+void KstViewObject::setDirty(bool dirty) {
+  if (dirty) {
+    invalidateClipRegion();
   }
-  KstObject::virtual_hook(id, data);
+  KstObject::setDirty(dirty);
 }
 
 
--- trunk/extragear/graphics/kst/src/libkstapp/kstviewobject.h #596644:596645
@@ -253,6 +253,7 @@
     virtual bool paste(QMimeSource* source, KstViewObjectList *list = 0L);
     
     virtual KstGfxMouseHandler *createHandler();
+    void setDirty(bool = true);
 
   public slots:
     void paint(KstPainter& p, const QRegion& bounds);
@@ -295,9 +296,6 @@
     virtual KstHandlerFactoryMethod handlerFactory() const;
     virtual void writeBinary(QDataStream& str);
     virtual void readBinary(QDataStream& str);
-    // id=0 v1.2.0 setDirty() was called.  data == 0 means false, else true
-    virtual void virtual_hook(int id, void *data);
-    
     KstObject::UpdateType updateChildren(int counter);
     
     KstViewObjectList _children;


More information about the Kst mailing list