[rkward-cvs] rkward/rkward/plugin rkcomponent.h,1.3,1.4 rkcomponentproperties.h,1.10,1.11 rkplugin.cpp,1.20,1.21 rkstandardcomponent.cpp,1.2,1.3 rkstandardcomponent.h,1.2,1.3

Thomas Friedrichsmeier tfry at users.sourceforge.net
Tue Feb 28 23:15:48 UTC 2006


Update of /cvsroot/rkward/rkward/rkward/plugin
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29467/rkward/plugin

Modified Files:
	rkcomponent.h rkcomponentproperties.h rkplugin.cpp 
	rkstandardcomponent.cpp rkstandardcomponent.h 
Log Message:
Continued conceptual work on components. Brain needs a rest, now...

Index: rkplugin.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugin/rkplugin.cpp,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** rkplugin.cpp	27 Feb 2006 17:25:42 -0000	1.20
--- rkplugin.cpp	28 Feb 2006 23:15:46 -0000	1.21
***************
*** 645,649 ****
  /* why don't we do the update right here? Two reasons:
  	- several widgets may be updating in a chain, an each will emit a change signal. However, we only want to update once.
! 	- some widgets may be in a bad state, if the change-event was due to an RObject being deleted. These widgets should get a change to update before we try to get values from them */
  	update_timer->start (0, true);
  }
--- 645,649 ----
  /* why don't we do the update right here? Two reasons:
  	- several widgets may be updating in a chain, an each will emit a change signal. However, we only want to update once.
! 	- some widgets may be in a bad state, if the change-event was due to an RObject being deleted. These widgets should get a chance to update before we try to get values from them */
  	update_timer->start (0, true);
  }

Index: rkcomponentproperties.h
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugin/rkcomponentproperties.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** rkcomponentproperties.h	20 Feb 2006 22:54:00 -0000	1.10
--- rkcomponentproperties.h	28 Feb 2006 23:15:46 -0000	1.11
***************
*** 289,293 ****
--- 289,298 ----
  /** special type of RKComponentProperty used to contain R code. All stand-alone RKComponents have this. The great thing about this, is that code can be made available to embedding RKComponents by just fetching the component.code.preprocess (or .calculate, .printout, .cleanup) value */
  class RKComponentPropertyCode : public RKComponentPropertyBase {
+ 	Q_OBJECT
  public:
+ /** constructor */
+ 	RKComponentPropertyCode (QObject *parent, bool required);
+ /** destructor */
+ 	~RKComponentPropertyCode ();
  /** the preprocess code */
  	QString preprocess ();
***************
*** 298,301 ****
--- 303,319 ----
  /** the cleanup code */
  	QString cleanup ();
+ 
+ 	void setPreprocess (const QString &code);
+ 	void setCalculate (const QString &code);
+ 	void setPrintout (const QString &code);
+ 	void setCleanup (const QString &code);
+ 
+ /** Sets all code to null strings and satisfied to false */
+ 	void reset ();
+ private:
+ 	bool have_preprocess;
+ 	bool have_calculate;
+ 	bool have_printout;
+ 	bool have_cleanup;
  };
  

Index: rkstandardcomponent.h
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugin/rkstandardcomponent.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** rkstandardcomponent.h	21 Feb 2006 13:26:19 -0000	1.2
--- rkstandardcomponent.h	28 Feb 2006 23:15:46 -0000	1.3
***************
*** 23,39 ****
  #include <qdom.h>
  
! /** The standard type of component (i.e. stand-alone), previously known as "plugin" */
  class RKStandardComponent : public RKComponent {
  public:
! 	RKStandardComponent ();
  	~RKStandardComponent ();
  };
  
! /** A helper class used to build and initialize an RKComponent. Most importantly this will keep track of the properties yet to be connected. Used at least by RKStandardComponent. */
  class RKComponentBuilder {
  public:
! 	RKComponentBuilder (RKComponent *parent);
  	~RKComponentBuilder ();
! 	void buildElement (const QDomElement &element);
  	void makeConnections ();
  private:
--- 23,67 ----
  #include <qdom.h>
  
! /** The standard type of component (i.e. stand-alone), previously known as "plugin". This is the type of component described by an XML-file */
  class RKStandardComponent : public RKComponent {
+ 	Q_OBJECT
  public:
! /** constructor.
! @param parent_component Parent component (or 0, if this is going to be a top-level component)
! @param parent_widget Parent widget (typically 0, if this is going to be a top-level component)
! @param filename Filename of the XML-file to construct this component from */
! 	RKStandardComponent (RKComponent *parent_component, QWidget *parent_widget, const QString &filename);
! /** destructor */
  	~RKStandardComponent ();
+ // TODO: should these be moved to a separate RKStandardComponentGUI-class?
+ public slots:
+ 	void ok ();
+ 	void back ();
+ 	void cancel ();
+ 	void toggleCode ();
+ 	void switchInterfaces ();
+ 	void help ();
+ private:
+ /** The property holding the generated code. TODO: maybe, de facto, this property should be controlled (but not owned) by the scriptbackend. This way, we'd need less twisted logic inside this class. */
+ 	RKComponentPropertyCode *code;
+ 	QString filename;
  };
  
! /** A helper class used to build and initialize an RKComponent. Most importantly this will keep track of the properties yet to be connected. Used at least by RKStandardComponent.
! 
! Notes: How does building work?
! - Builder builds the components. Simple components are built by the same builder. For embedded components, a sub-builder is invoked.
! - Simple components register their (property) connection wishes to the the builder during construction
! - Builder takes care of connecting properties
! 
! Important: For built components with non-zero parent components should call parent_component->addChild () to register them! As an exception, this may be omitted for passive components (e.g. layouting components) that do not specify an id
! 
! Reminder to the twisted brain: Typically inside a standard-component, *all* child components, even if nested in layouting components, etc. have the same standard-component as parent! Only embedded full-fledged components are a truely separate unit!
! */
  class RKComponentBuilder {
  public:
! 	RKComponentBuilder (RKComponent *parent_component, QWidget *parent_widget);
  	~RKComponentBuilder ();
! 	void buildElement (QWidget *parent, const QDomElement &element);
  	void makeConnections ();
  private:

Index: rkstandardcomponent.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugin/rkstandardcomponent.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** rkstandardcomponent.cpp	21 Feb 2006 13:26:19 -0000	1.2
--- rkstandardcomponent.cpp	28 Feb 2006 23:15:46 -0000	1.3
***************
*** 21,23 ****
  
  
! //#include "rkstandardcomponent.moc"
--- 21,23 ----
  
  
! #include "rkstandardcomponent.moc"

Index: rkcomponent.h
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugin/rkcomponent.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** rkcomponent.h	20 Feb 2006 22:54:00 -0000	1.3
--- rkcomponent.h	28 Feb 2006 23:15:45 -0000	1.4
***************
*** 66,72 ****
  	Q_OBJECT
  public:
! /** constructor
! @param parent The parent RKComponent (also used as the parent widget). If 0, this RKComponent will be a top-level component/widget */
! 	RKComponent (RKComponent *parent);
  /** destructor */
  	virtual ~RKComponent ();
--- 66,73 ----
  	Q_OBJECT
  public:
! /** constructor.
! @param parent_component The parent RKComponent. If 0, this RKComponent will be a top-level component
! @param parent_widget The parent QWidget. This may be the same as the parent_component or a different specific widget.. If 0, this RKComponent will be represented by a top-level widget */
! 	RKComponent (RKComponent *parent_component, QWidget *parent_widget);
  /** destructor */
  	virtual ~RKComponent ();
***************
*** 91,95 ****
  
  /** The parent of this component. Should be notified, whenever isSatisfied () or isReady ()-state changed. */
! 	RKComponent *parent () { return _parent; };
  
  /** check whether the component is satisfied (such as after a value change or requireness change). If statisfied state has changed, and silent==false, notfies parent. TODO: maybe statisfaction-state should be made a property as well! */
--- 92,96 ----
  
  /** The parent of this component. Should be notified, whenever isSatisfied () or isReady ()-state changed. */
! 	RKComponent *parentComponent () { return _parent; };
  
  /** check whether the component is satisfied (such as after a value change or requireness change). If statisfied state has changed, and silent==false, notfies parent. TODO: maybe statisfaction-state should be made a property as well! */





More information about the rkward-tracker mailing list