#ifndef _STATE_DEF_INCLUDED

#define _STATE_DEF_INCLUDED

#include "object.def"

typedef struct state STATE;

typedef enum {
    DORMANT
,   OVERBOX
,   MOVING
,   EDITING
,   SIZING
,   CREATING
,   ALIGNING
,   PASTE_PENDING 
,   PASTEING
,   SELECTING
,   MOVE_PENDING
,   ACTION_ABORTED
,   KBD_MOVING
} STATE_ID;

#define H_SIZE( a )     (a>>2)
#define V_SIZE( a )     (a & 3)
#define SQUAREWIDTH 8
#define ACCELS 5

extern void       SetState( STATE_ID );
extern STATE_ID   GetState( void );
extern void       SetDefState( void );
extern void       NewState();
extern void       SetStateWnd( HWND );
extern void       FreeState();
extern void       SetBaseState( STATE_ID );

extern void       SetSize( RESIZE_ID );
extern BOOL       Sizing( char );
extern void       ResetSize( void ); 

extern void       SetPrevMouse( POINT );
extern POINT      GetPrevMouse( void );
  
extern HANDLE     GetAppWnd();
extern HANDLE     GetInst();
extern void       SetInst( HANDLE );
extern HANDLE     GetClientWnd();
extern void       SetClientWnd( HANDLE );

extern void       CreateMainObject();
extern void       DestroyMainObject();

extern OBJPTR     GetCurrObj();
extern void       CreateCurrObject();
extern void       DestroyCurrObject();
  
extern void       RestorePrevObject();
extern void       SaveObject();

extern void       SetObjects( void * );
extern void *     GetObjects();

extern void       SetErr( char * );
extern char *     GetErr();
extern unsigned char GetSizing();

extern void       SetOffset( POINT );
extern void       SetScrollRect( RECT );
extern RECT       GetScrollRect();
extern void       SetScrollConfig( SCR_CONFIG );
extern SCR_CONFIG GetScrollConfig();

extern OBJPTR     GetSelectEatom();
extern void       SetSelectEatom( OBJPTR );

extern BOOL       GetShift();
extern BOOL       GetControl();
extern void       SetKeyState( WORD );

extern void       ReportPending();

extern void       LoadAccel( int );
extern HWND       InheritState( HWND );
extern void       MouseAction( RECT * );
extern void       SetResizeGrid( unsigned, unsigned );
extern unsigned   GetResizeVInc( void );
extern unsigned   GetResizeHInc( void );
extern BOOL	  GetShowEatoms( void );
extern void	  SetShowEatoms( BOOL show );
#endif
