[ create a new paste ] login | about

Link: http://codepad.org/0fr9ZZRh    [ raw code | fork ]

C++, pasted on Oct 26:
namespace Model
{
	class Image;
	class ImageSeekList;
}

/* VC is view and controller. */
struct Model::Image:System::Model<SimpleVC>
{
	virtual const Vector3d &GetSize(void)const = 0;
	virtual void SetSize(const Vector3d&) = 0;
	virtual const ScanLine &GetScanLine(void)const = 0;
	virtual void SetScanLine(const ScanLine &) = 0;
	/* Other Members */
	/*         .            */
	/*         .            */
	/*         .            */
};

class Model::ImageSeekList:public Image
{
	/* Private Members */
public:
	/* Override Member */
	const Vector3d &GetSize(void)const{/* ... */}
	void SetSize(const Vector3d&){/* ... */};
	Shared<const ScanLine> GetScanLine(void)const{/* ... */}
	void SetScanLine(Shared<ScanLine>){/* ... */}
	/* Other Override */
	/*         .            */
	/*         .            */
	/*         .            */

	/* Extend Member */
	Shared<const ImageList> SetImageList(void)const{/* ... */}
	void SetImageList(Shared<ImageList>){/* ... */}
	bool Next(void){/* ... */}
	bool Previous(void){/* ... */}
	bool Jump(size_t index){/* ... */}
	/* Other Members */
	/*         .            */
	/*         .            */
	/*         .            */
};

namespace Model
{
	class Application;
}
class Model::Application:public System::Model<SimpleVC>
{
	/* Private Members */
public:
	Shared<const ImageSeekList> GetSlide(void)const{/* ... */}
	void SetSlide(Shared<const ImageSeekList>){/* ... */}
};

namespace Controller
{
	class Application;
}
class Controler::Application:public SimpleVC
{	
	share<Model::Application> model;

	View::Widget widget;
	View::Image preview;
	View::ToolBar bar;
	View::Icon next,previous;
public:
	Application(share<Model::Application> model):
		model(model),

		/* Set parent widget and model  */
		preview(&widget,model.GetSlide()),
		bar(&widget),
		next(&bar),
		previous(&bar)
	{
		/* Visual setting */
		/* Model data load */

		/* Register event */
		next.Acttion() += Event<void(void)>(this,&Application::Next);
		previous.Acttion() += Event<void(void)>(this,&Application::Previous);
	}
	
	void Next(void)
	{
		model.GetSlide().Next();	/* Update slide */
	}

	void Previous(void)
	{
		model.GetSlide().Previous();	/* Update slide */
	}

	void Update(void)	/* Update model */
	{
		preview.SetModel(model.GetSlide());
	}
};


Create a new paste based on this one


Comments: