/*

Some stuff I need to build a layout engine...

*/

#ifndef _LAYOUT
#define _LAYOUT

#include <stdlib.h>

class minimax	// Order now, by dialing the number on your screen!
{
	public:		BPoint	mini;
				BPoint	maxi;
				float	weight;
				
				minimax(int minx=0,int miny=0,
						int maxx=65536,int maxy=65536,
						float wght=1);
				minimax(BPoint min,BPoint max,float wght=1);
};


class MView : public  BView
{
	public:	BRect	lastsize;

	public:		minimax	mpm;		// something to store my sizes in
				long	flags;		// for indication of HGroup, VGroup, etc.

	
	public:		MView();
				virtual void	AttachedToWindow()
								{
									SetViewColor(Parent()->ViewColor());
								};
								
				virtual	minimax	layoutprefs()=0;
				virtual BRect	layout(BRect rect)=0;
				virtual void	FrameResized(float width, float height);
};


typedef struct
{
	MView	*kid;
	int		kidnum;
}  sortstruct;

#define M_POPUP_SELECTED 	(0x01000000)
#define M_CHECKBOX_SELECTED	(0x02000000)
#define M_BUTTON_SELECTED 	(0x03000000)
#define M_RADIO_SELECTED 	(0x04000000)

#define M_PLAYBW_SELECTED 	(0x05000000)
#define M_PLAYFW_SELECTED 	(0x06000000)
#define M_FFWD_SELECTED 	(0x07000000)
#define M_REW_SELECTED 		(0x08000000)
#define M_STOP_SELECTED 	(0x09000000)
#define M_EJECT_SELECTED 	(0x0A000000)

#endif