]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - form/form.priv.h
ncurses 5.4
[ncurses.git] / form / form.priv.h
index b08d70d6e359708262fa96319e8fad59d8607809..11d382c0c1ea0a6cee26a1aeab4388bf9840be8c 100644 (file)
@@ -1,24 +1,36 @@
-/*-----------------------------------------------------------------------------+
-|           The ncurses form library is  Copyright (C) 1995-1997               |
-|             by Juergen Pfeifer <Juergen.Pfeifer@T-Online.de>                 |
-|                          All Rights Reserved.                                |
-|                                                                              |
-| Permission to use, copy, modify, and distribute this software and its        |
-| documentation for any purpose and without fee is hereby granted, provided    |
-| that the above copyright notice appear in all copies and that both that      |
-| copyright notice and this permission notice appear in supporting             |
-| documentation, and that the name of the above listed copyright holder(s) not |
-| be used in advertising or publicity pertaining to distribution of the        |
-| software without specific, written prior permission.                         | 
-|                                                                              |
-| THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO  |
-| THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT-  |
-| NESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR   |
-| ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RE- |
-| SULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, |
-| NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH    |
-| THE USE OR PERFORMANCE OF THIS SOFTWARE.                                     |
-+-----------------------------------------------------------------------------*/
+/****************************************************************************
+ * Copyright (c) 1998-2002,2003 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            *
+ * "Software"), to deal in the Software without restriction, including      *
+ * without limitation the rights to use, copy, modify, merge, publish,      *
+ * distribute, distribute with modifications, sublicense, and/or sell       *
+ * copies of the Software, and to permit persons to whom the Software is    *
+ * furnished to do so, subject to the following conditions:                 *
+ *                                                                          *
+ * The above copyright notice and this permission notice shall be included  *
+ * in all copies or substantial portions of the Software.                   *
+ *                                                                          *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
+ *                                                                          *
+ * Except as contained in this notice, the name(s) of the above copyright   *
+ * holders shall not be used in advertising or otherwise to promote the     *
+ * sale, use or other dealings in this Software without prior written       *
+ * authorization.                                                           *
+ ****************************************************************************/
+
+/****************************************************************************
+ *   Author:  Juergen Pfeifer, 1995,1997                                    *
+ ****************************************************************************/
+
+/* $Id: form.priv.h,v 0.11 2003/11/08 20:38:51 tom Exp $ */
 
 #include "mf_common.h"
 #include "form.h"
 
 #include "mf_common.h"
 #include "form.h"
@@ -30,7 +42,7 @@
 
 /* field status values */
 #define _CHANGED         (0x01) /* Field has been changed                 */
 
 /* field status values */
 #define _CHANGED         (0x01) /* Field has been changed                 */
-#define _NEWTOP          (0x02) /* Vertical scrolling occured             */
+#define _NEWTOP          (0x02) /* Vertical scrolling occurred            */
 #define _NEWPAGE        (0x04) /* field begins new page of form          */
 #define _MAY_GROW        (0x08) /* dynamic field may still grow           */
 
 #define _NEWPAGE        (0x04) /* field begins new page of form          */
 #define _MAY_GROW        (0x08) /* dynamic field may still grow           */
 
 #define _LINKED_TYPE     (0x01) /* Type is a linked type                  */
 #define _HAS_ARGS        (0x02) /* Type has arguments                     */
 #define _HAS_CHOICE      (0x04) /* Type has choice methods                */
 #define _LINKED_TYPE     (0x01) /* Type is a linked type                  */
 #define _HAS_ARGS        (0x02) /* Type has arguments                     */
 #define _HAS_CHOICE      (0x04) /* Type has choice methods                */
-#define _RESIDENT        (0x08) /* Type is builtin                        */
+#define _RESIDENT        (0x08) /* Type is built-in                       */
+
+/* This are the field options required to be a selectable field in field
+   navigation requests */
+#define O_SELECTABLE (O_ACTIVE | O_VISIBLE)
 
 /* If form is NULL replace form argument by default-form */
 #define Normalize_Form(form)  ((form)=(form)?(form):_nc_Default_Form)
 
 /* If form is NULL replace form argument by default-form */
 #define Normalize_Form(form)  ((form)=(form)?(form):_nc_Default_Form)
@@ -61,6 +77,9 @@
 #define Single_Line_Field(field) \
    (((field)->rows + (field)->nrow) == 1)
 
 #define Single_Line_Field(field) \
    (((field)->rows + (field)->nrow) == 1)
 
+/* Logic to determine whether or not a field is selectable */
+#define Field_Is_Selectable(f)     (((f)->opts & O_SELECTABLE)==O_SELECTABLE)
+#define Field_Is_Not_Selectable(f) (((f)->opts & O_SELECTABLE)!=O_SELECTABLE)
 
 typedef struct typearg {
   struct typearg *left;
 
 typedef struct typearg {
   struct typearg *left;
@@ -92,3 +111,20 @@ typedef struct typearg {
 
 #define C_BLANK ' '
 #define is_blank(c) ((c)==C_BLANK)
 
 #define C_BLANK ' '
 #define is_blank(c) ((c)==C_BLANK)
+
+extern NCURSES_EXPORT_VAR(const FIELDTYPE *) _nc_Default_FieldType;
+
+extern NCURSES_EXPORT(TypeArgument *) _nc_Make_Argument (const FIELDTYPE*,va_list*,int*);
+extern NCURSES_EXPORT(TypeArgument *) _nc_Copy_Argument (const FIELDTYPE*,const TypeArgument*, int*);
+extern NCURSES_EXPORT(void) _nc_Free_Argument (const FIELDTYPE*,TypeArgument*);
+extern NCURSES_EXPORT(bool) _nc_Copy_Type (FIELD*, FIELD const *);
+extern NCURSES_EXPORT(void) _nc_Free_Type (FIELD *);
+
+extern NCURSES_EXPORT(int) _nc_Synchronize_Attributes (FIELD*);
+extern NCURSES_EXPORT(int) _nc_Synchronize_Options (FIELD*,Field_Options);
+extern NCURSES_EXPORT(int) _nc_Set_Form_Page (FORM*,int,FIELD*);
+extern NCURSES_EXPORT(int) _nc_Refresh_Current_Field (FORM*);
+extern NCURSES_EXPORT(FIELD *) _nc_First_Active_Field (FORM*);
+extern NCURSES_EXPORT(bool) _nc_Internal_Validation (FORM*);
+extern NCURSES_EXPORT(int) _nc_Set_Current_Field (FORM*,FIELD*);
+extern NCURSES_EXPORT(int) _nc_Position_Form_Cursor (FORM*);