/********************************************************************
This file is part of the abs 0.907 distribution.  abs is a spreadsheet
with graphical user interface.

Copyright (C) 1998-2001  André Bertin (Andre.Bertin@ping.be) 

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version if in the same spirit as version 2.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

Concact: abs@pi.be
         http://home.pi.be/bertin/abs.shtml

*********************************************************************/


























#ifndef FINITE_STATE_H
#define FINITE_STATE_H




























































































































































































#define START    0
#define BTN1DOWN 1
#define BTN1MOVE 2
#define BTN1UP   3
#define BTN2DOWN 4
#define BTN2MOVE 5
#define BTN2UP   6
#define BTN3DOWN 7
#define BTN3MOVE 8
#define BTN3UP   9
#define POINTERMOVE 10


#define EVENT_DRAW 1
#define EVENT_COLINDEX 2
#define EVENT_ROWINDEX 3
#define EVENT_CORNER 4


#define StBatch -1
#define StUndefine 0
#define StUndefined 0
#define StCell 1
#define StBorder 2
#define StSelection 10
#define StGrap 3
#define StBrush 4
#define StPopup 20
#define StChart 30
#define StDrawing 40



#define SELECTING 100
#define EDITING   200
#define MODIFIED  300


#define StFree 1
#define StRight 5



#define CREATE_CHART 1
#define END_CREATE_CHART 2
#define SELECT_CHART 3


#define StLinindex 1
#define StColindex 2
#define StCorner 3


#define StOn 1
#define StDown 2
#define StUp 3
#define StMotion 4
#define StShift 5		


#define READYEDITDRAWING    1
#define STARTCREATEDRAWING  2
#define CREATINGDRAWING     3
#define ENDCREATEDRAWING  4
#define EDITINGDRAWING      5
#define StLine 1
#define StRect 2
#define StArc 3
#define StCircle 4
#define StButton 5

struct _State
  {
    int l1;
    int l2;
    int l3;
    int l4;
    int l5;
    int l6;			
    int downx;
    int downy;			
    int movex;
    int movey;			
    int upx;
    int upy;			
    int downr;
    int downc;
    int mover;
    int movec;
    int upr;
    int upc;
    int row;			
    int col;			
  };

typedef struct _State State;

extern State *FS;		

extern int state_init ();
extern int state_print (char *message);
extern int state_reset_levels ();
#endif 
