#ifndef _cfl_intern_
#define _cfl_intern_
/*
 * interne Definitionen der CFLib
*/
#include "cflib.h"

#ifndef __PUREC__
#define cdecl
#endif

/* ein paar nicht-standard AES-Messages */
#ifndef WM_SHADED
#define WM_SHADED			0x5758
#define WM_UNSHADED		0x5759
#define WF_SHADE			0x575D
#endif

#ifndef SC_CHANGED
#define SC_CHANGED		80
#endif

#ifndef SM_M_SPECIAL
#define SM_M_SPECIAL		101
#endif

#define K_SHIFT			(K_RSHIFT|K_LSHIFT)

/* ob_state */
#ifndef FLAG11
#define FLAG11		 0x0800
#define FLAG12		 0x1000
#define FLAG13		 0x2000
#define FLAG14		 0x4000
#define FLAG15		 0x5000
#endif

/* vst_alignment() */
#ifndef TA_LEFT
#define TA_LEFT			0
#define TA_CENTER			1
#define TA_TOP          5
#endif

/* boolean */
#ifdef TRUE
#undef TRUE
#undef FALSE
#endif

#define TRUE	1
#define FALSE	0

#ifdef __MINT__
/* ist in osbind.h komisch definiert. */
typedef struct 
{
	unsigned char	*unshift;
	unsigned char	*shift;
	unsigned char	*capslock;
} KEYTAB;
#endif

/* lib-interne globale Variablen */
extern int	cf_vdi_handle;
extern int	cf_font_anz;
extern int	cf_msg_cb;
extern int	cf_magxPC;

extern void	*cf_malloc(long size, char *who, int global);

/* cicon.c */
extern CICON *fix_cicon(CICONBLK *cicnblk, int screen_planes, int handle);


/* form_do.c */
#define FMD_BACKWARD 1
#define FMD_FORWARD	2

extern int	edit_valid(OBJECT *tree, int obj);
extern int	find_edit(OBJECT *tree, int obj, int mode);
extern int 	cf_objc_find(OBJECT *tree, int start, int depth, int x, int y);
extern int 	find_shortcut(OBJECT *tree, int kstate, int kreturn);
extern int 	cf_form_keybd(OBJECT *tree, int edit_obj, int kstate, int *kreturn, int *next_obj);
extern void cf_objc_edit(OBJECT *tree, int obj, int kreturn, int *idx, int mode, int kstate, int *ctrl);


/* mdial.c */
extern void handle_mdial_msg(int *msg);


/* userdef.c */
extern OBJECT	*cf_ascii_tab;
extern OBJECT	*cf_alert_box;

extern void init_userdef(void);
extern void term_userdef(void);


/* pure lib */
#ifndef __MINT__
#define min(a,b)    (((a) < (b)) ? (a) : (b))
#define max(a,b)    (((a) > (b)) ? (a) : (b))
extern int rc_intersect(GRECT *r1, GRECT *r2);
extern void vqt_real_extent(int handle, int x, int y, char *string, int extent[]);
#endif


#endif
