view syl_generic.h @ 75:0083b2f7b3c7

Partially working implementation of List. Modified build scripts to allow use of other compilers. Fixed some bugs involving method implementations on different types returning different numbers of outputs. Added Fold to the 'builtins' in the comipler.
author Mike Pavone <pavone@retrodev.com>
date Tue, 06 Jul 2010 07:52:59 -0400
parents 76568becd6d6
children
line wrap: on
line source

#ifndef SYL_GENERIC_H_
#define SYL_GENERIC_H_

#include <gui/view.h>
#include "datum.h"
#include "structs.h"

class GenericView : public os::View
{
public:
	GenericView(const os::Rect& cFrame, const os::String& cTitle, datum * widget_datum, worker_instance * instance);
	void Paint(const os::Rect& cUpdateRect);
	void DefaultPaint(const os::Rect& cUpdateRect);
	void MouseMove( const os::Point& newPos, int code, uint32 buttons, os::Message* msg);
	void MouseDown( const os::Point& pos, uint32 buttons);
	void MouseUp( const os::Point& pos, uint32 buttons, os::Message* msg);
//	void MakeFocus(bool give_focus);
	void DoCallback(datum * worker, const os::Rect& rect, datum ** extra_params, int num_extra);
	void ResetCallbacks();
	datum * handler_dict;
private:
	void SetCallbacks();
	datum * widget_datum;
	datum * paint_worker;
	datum * mousemove_worker;
	datum * mousedown_worker;
	datum * mouseup_worker;
	worker_instance * instance;
};

typedef struct
{
	GenericView * view;
	os::Rect update_rect;
} generic_view_datum;

#endif //SYL_GENERIC_H_