[Kst] branches/work/kst/1.6/kst/src

Andrew Walker arwalker at sumusltd.com
Wed Nov 28 01:48:08 CET 2007


SVN commit 742438 by arwalker:

first draft of group for javaScript functionality

 M  +2 -1      extensions/js/Makefile.am  
 M  +1 -1      extensions/js/bind_collection.cpp  
 A             extensions/js/bind_group.cpp   [License: GPL (v2+)]
 A             extensions/js/bind_group.h   [License: GPL (v2+)]
 M  +2 -1      extensions/js/classindex.xml  
 M  +2 -0      extensions/js/js.cpp  
 M  +11 -0     libkstapp/kstviewobject.cpp  
 M  +6 -6      libkstapp/kstviewobject.h  


--- branches/work/kst/1.6/kst/src/extensions/js/Makefile.am #742437:742438
@@ -95,7 +95,8 @@
 			    bind_arrow.cpp \
 			    bind_line.cpp \
 			    bind_file.cpp \
-			    bind_elog.cpp
+			    bind_elog.cpp \
+			    bind_group.cpp
 
 #			    js_dataobject.cpp \
 #			    bind_jsdataobject.cpp
--- branches/work/kst/1.6/kst/src/extensions/js/bind_collection.cpp #742437:742438
@@ -135,7 +135,7 @@
       return (this->*collectionProperties[i].get)(exec);
     }
   }
-  
+
   KJS::Value v = extract(exec, propertyName);
   if (v.type() != KJS::UndefinedType) {
     return v;
--- branches/work/kst/1.6/kst/src/extensions/js/classindex.xml #742437:742438
@@ -5,7 +5,6 @@
   <class name="Box" file="bind_box"/>
   <class name="Collection" file="bind_collection"/>
   <class name="ColorSequence" file="bind_colorsequence"/>
-  <!--class name="CubicBezier" file="bind_cubicbezier"/-->
   <class name="CurveCollection" file="bind_curvecollection"/>
   <class name="Curve" file="bind_curve"/>
   <class name="DataMatrix" file="bind_datamatrix"/>
@@ -23,8 +22,10 @@
   <class name="Equation" file="bind_equation"/>
   <class name="ExtensionCollection" file="bind_extensioncollection"/>
   <class name="Extension" file="bind_extension"/>
+  <class name="Group" file="bind_group"/>
   <class name="HistogramCollection" file="bind_histogramcollection"/>
   <class name="Histogram" file="bind_histogram"/>
+  <class name="Image" file="bind_image"/>
   <class name="Kst" file="bind_kst"/>
   <class name="Label" file="bind_label"/>
   <class name="Legend" file="bind_legend"/>
--- branches/work/kst/1.6/kst/src/extensions/js/js.cpp #742437:742438
@@ -55,6 +55,7 @@
 #include "bind_ellipse.h"
 #include "bind_elog.h"
 #include "bind_file.h"
+#include "bind_group.h"
 #include "bind_histogram.h"
 #include "bind_image.h"
 #include "bind_jsdataobject.h"
@@ -209,6 +210,7 @@
   new KstBindCurve(exec, &globalObj);
   new KstBindImage(exec, &globalObj);
 
+  new KstBindGroup(exec, &globalObj);
   new KstBindPlot(exec, &globalObj);
   new KstBindLine(exec, &globalObj);
   new KstBindLabel(exec, &globalObj);
--- branches/work/kst/1.6/kst/src/libkstapp/kstviewobject.cpp #742437:742438
@@ -963,6 +963,17 @@
 }
 
 
+void KstViewObject::modifyGeometry(const QRect& rect) {
+  QRect geomOld = _geom;
+
+  _geom = rect;
+  updateAspectPos();
+  for (KstViewObjectList::Iterator i = _children.begin(); i != _children.end(); ++i) {
+    (*i)->updateAspect();
+  }
+}
+
+
 void KstViewObject::setFocus(bool focus) {
   _focus = focus;
 }
--- branches/work/kst/1.6/kst/src/libkstapp/kstviewobject.h #742437:742438
@@ -81,18 +81,20 @@
     virtual bool onGrid() const;
     virtual void setOnGrid(bool on_grid);
 
+    virtual void move(const QPoint& to);
+    virtual QPoint position() const;
     virtual void resize(const QSize& size);
+    virtual QSize size() const;
+    virtual void modifyGeometry(const QRect& rect);
+
     virtual void resizeForPrint(const QSize& size);
     virtual void revertForPrint();
     virtual void resizeFromAspect(double x, double y, double w, double h);
-    virtual QSize size() const;
     virtual void internalAlignment(KstPainter& p, QRect& plotRegion);
-    virtual QPoint position() const;
     virtual const QRect& geometry() const;
     const KstAspectRatio& aspectRatio() const;
     virtual QRect surroundingGeometry() const;
-    // This is, by definition, the contents not including decoration. (borders
-    // etc)
+    // This is, by definition, the contents not including decoration. (borders etc.)
     virtual QRect contentsRect() const;
     virtual void setContentsRect(const QRect& rect);
 
@@ -101,8 +103,6 @@
     virtual double verticalSizeFactor();
     virtual double horizontalSizeFactor();
 
-    virtual void move(const QPoint& to);
-
     // Draw a focus highlight
     virtual void setFocus(bool focus);
     virtual bool focused() const;


More information about the Kst mailing list