ncurses 6.2 - patch 20200425
[ncurses.git] / form / form.priv.h
index 38dd8caa263e2922cf73ad259788b14e02098440..53c717c637c13076668441de5bd1ea65927773fb 100644 (file)
@@ -1,5 +1,6 @@
 /****************************************************************************
- * Copyright (c) 1998-2009,2012 Free Software Foundation, Inc.              *
+ * Copyright 2018-2019,2020 Thomas E. Dickey                                *
+ * Copyright 1998-2016,2017 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            *
  *   Author:  Juergen Pfeifer, 1995,1997                                    *
  ****************************************************************************/
 
-/* $Id: form.priv.h,v 0.33 2012/03/11 00:37:46 tom Exp $ */
+/* $Id: form.priv.h,v 0.45 2020/02/02 23:34:34 tom Exp $ */
 
 #ifndef FORM_PRIV_H
 #define FORM_PRIV_H 1
 /* *INDENT-OFF*/
 #include "curses.priv.h"
+
+#define NCURSES_OPAQUE_FORM  0
+
 #include "mf_common.h"
 
 #if USE_WIDEC_SUPPORT
@@ -125,6 +129,8 @@ extern NCURSES_EXPORT_VAR(FIELDTYPE *) _nc_Default_FieldType;
 #define Single_Line_Field(field) \
    (((field)->rows + (field)->nrow) == 1)
 
+#define Field_Has_Option(f,o)      ((((unsigned)(f)->opts) & o) != 0)
+
 /* Logic to determine whether or not a field is selectable */
 #define Field_Is_Selectable(f)     (((unsigned)((f)->opts) & O_SELECTABLE)==O_SELECTABLE)
 #define Field_Is_Not_Selectable(f) (((unsigned)((f)->opts) & O_SELECTABLE)!=O_SELECTABLE)
@@ -146,7 +152,7 @@ TypeArgument;
                        O_NL_OVERLOAD  |\
                        O_BS_OVERLOAD   )
 
-#define ALL_FIELD_OPTS (Field_Options)( \
+#define STD_FIELD_OPTS (Field_Options)( \
                        O_VISIBLE |\
                        O_ACTIVE  |\
                        O_PUBLIC  |\
@@ -156,7 +162,14 @@ TypeArgument;
                        O_AUTOSKIP|\
                        O_NULLOK  |\
                        O_PASSOK  |\
-                       O_STATIC   )
+                       O_STATIC)
+
+#define ALL_FIELD_OPTS (Field_Options)( \
+                       STD_FIELD_OPTS |\
+                       O_DYNAMIC_JUSTIFY |\
+                       O_NO_LEFT_STRIP |\
+                       O_EDGE_INSERT_STAY |\
+                       O_INPUT_LIMIT)
 
 #define C_BLANK ' '
 #define is_blank(c) ((c)==C_BLANK)
@@ -177,6 +190,7 @@ 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*);
+extern NCURSES_EXPORT(void) _nc_Unset_Current_Field(FORM *form);
 
 #if NCURSES_INTEROP_FUNCS
 extern NCURSES_EXPORT(FIELDTYPE *) _nc_TYPE_INTEGER(void);
@@ -214,11 +228,11 @@ extern NCURSES_EXPORT(wchar_t *) _nc_Widen_String(char *, int *);
 
 #ifdef TRACE
 
-#define returnField(code)      TRACE_RETURN(code,field)
-#define returnFieldPtr(code)   TRACE_RETURN(code,field_ptr)
-#define returnForm(code)       TRACE_RETURN(code,form)
-#define returnFieldType(code)  TRACE_RETURN(code,field_type)
-#define returnFormHook(code)   TRACE_RETURN(code,form_hook)
+#define returnField(code)      TRACE_RETURN1(code,field)
+#define returnFieldPtr(code)   TRACE_RETURN1(code,field_ptr)
+#define returnForm(code)       TRACE_RETURN1(code,form)
+#define returnFieldType(code)  TRACE_RETURN1(code,field_type)
+#define returnFormHook(code)   TRACE_RETURN1(code,form_hook)
 
 extern NCURSES_EXPORT(FIELD **)            _nc_retrace_field_ptr (FIELD **);
 extern NCURSES_EXPORT(FIELD *)     _nc_retrace_field (FIELD *);