X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=form%2Fform.h;h=05a7861af887ab29fc180ba39c91d077105eb4b4;hp=a4691a86e8e726196927a475d924ba9fe5e38352;hb=cfd9c6f8e5af24820fefbb789b7345d93b8ed837;hpb=55ccd2b959766810cf7db8d1c4462f338ce0afc8 diff --git a/form/form.h b/form/form.h index a4691a86..05a7861a 100644 --- a/form/form.h +++ b/form/form.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2003,2004 Free Software Foundation, Inc. * + * Copyright (c) 1998-2014,2015 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -30,10 +30,11 @@ * Author: Juergen Pfeifer, 1995,1997 * ****************************************************************************/ -/* $Id: form.h,v 0.20 2004/12/04 22:22:10 tom Exp $ */ +/* $Id: form.h,v 0.25 2015/11/28 20:13:39 Leon.Winter Exp $ */ #ifndef FORM_H #define FORM_H +/* *INDENT-OFF*/ #include #include @@ -105,34 +106,13 @@ typedef struct fieldnode { NCURSES_FIELD_INTERNALS } FIELD; - /************** - * FIELDTYPE * - **************/ - -typedef struct typenode { - unsigned short status; /* flags */ - long ref; /* reference count */ - struct typenode * left; /* ptr to operand for | */ - struct typenode * right; /* ptr to operand for | */ - - void* (*makearg)(va_list *); /* make fieldtype arg */ - void* (*copyarg)(const void *); /* copy fieldtype arg */ - void (*freearg)(void *); /* free fieldtype arg */ - - bool (*fcheck)(FIELD *,const void *); /* field validation */ - bool (*ccheck)(int,const void *); /* character validation */ - - bool (*next)(FIELD *,const void *); /* enumerate next value */ - bool (*prev)(FIELD *,const void *); /* enumerate prev value */ - -} FIELDTYPE; /********* * FORM * *********/ typedef struct formnode { - unsigned short status; /* flags */ + unsigned short status; /* flags */ short rows; /* size in rows */ short cols; /* size in cols */ int currow; /* current row in field window */ @@ -158,6 +138,49 @@ typedef struct formnode { } FORM; + + /************** + * FIELDTYPE * + **************/ + +typedef struct typenode { + unsigned short status; /* flags */ + long ref; /* reference count */ + struct typenode * left; /* ptr to operand for | */ + struct typenode * right; /* ptr to operand for | */ + + void* (*makearg)(va_list *); /* make fieldtype arg */ + void* (*copyarg)(const void *); /* copy fieldtype arg */ + void (*freearg)(void *); /* free fieldtype arg */ + +#if NCURSES_INTEROP_FUNCS + union { + bool (*ofcheck)(FIELD *,const void *); /* field validation */ + bool (*gfcheck)(FORM*,FIELD *,const void*); /* generic field validation */ + } fieldcheck; + union { + bool (*occheck)(int,const void *); /* character validation */ + bool (*gccheck)(int,FORM*, + FIELD*,const void*); /* generic char validation */ + } charcheck; + union { + bool (*onext)(FIELD *,const void *); /* enumerate next value */ + bool (*gnext)(FORM*,FIELD*,const void*); /* generic enumerate next */ + } enum_next; + union { + bool (*oprev)(FIELD *,const void *); /* enumerate prev value */ + bool (*gprev)(FORM*,FIELD*,const void*); /* generic enumerate prev */ + } enum_prev; + void* (*genericarg)(void*); /* Alternate Arg method */ +#else + bool (*fcheck)(FIELD *,const void *); /* field validation */ + bool (*ccheck)(int,const void *); /* character validation */ + + bool (*next)(FIELD *,const void *); /* enumerate next value */ + bool (*prev)(FIELD *,const void *); /* enumerate prev value */ +#endif +} FIELDTYPE; + typedef void (*Form_Hook)(FORM *); /*************************** @@ -181,6 +204,8 @@ typedef void (*Form_Hook)(FORM *); #define O_NULLOK (0x0080U) #define O_PASSOK (0x0100U) #define O_STATIC (0x0200U) +#define O_DYNAMIC_JUSTIFY (0x0400U) /* ncurses extension */ +#define O_NO_LEFT_STRIP (0x0800U) /* ncurses extension */ /* form options */ #define O_NL_OVERLOAD (0x0001U) @@ -278,13 +303,6 @@ extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_REGEXP; ************************************/ extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_IPV4; /* Internet IP Version 4 address */ - /*********************** - * Default objects * - ***********************/ -extern NCURSES_EXPORT_VAR(FORM *) _nc_Default_Form; -extern NCURSES_EXPORT_VAR(FIELD *) _nc_Default_Field; - - /*********************** * FIELDTYPE routines * ***********************/ @@ -381,6 +399,9 @@ extern NCURSES_EXPORT(int) post_form (FORM *); extern NCURSES_EXPORT(int) unpost_form (FORM *); extern NCURSES_EXPORT(int) pos_form_cursor (FORM *); extern NCURSES_EXPORT(int) form_driver (FORM *,int); +# if NCURSES_WIDECHAR +extern NCURSES_EXPORT(int) form_driver_w (FORM *,int,wchar_t); +# endif extern NCURSES_EXPORT(int) set_form_userptr (FORM *,void *); extern NCURSES_EXPORT(int) set_form_opts (FORM *,Form_Options); extern NCURSES_EXPORT(int) form_opts_on (FORM *,Form_Options); @@ -396,8 +417,13 @@ extern NCURSES_EXPORT(Form_Options) form_opts (const FORM *); extern NCURSES_EXPORT(bool) data_ahead (const FORM *); extern NCURSES_EXPORT(bool) data_behind (const FORM *); +#if NCURSES_SP_FUNCS +extern NCURSES_EXPORT(FORM *) NCURSES_SP_NAME(new_form) (SCREEN*, FIELD **); +#endif + #ifdef __cplusplus } #endif +/* *INDENT-ON*/ -#endif /* FORM_H */ +#endif /* FORM_H */