X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=c%2B%2B%2Fcursesf.h;h=ea1aaf0d1536f0f8eba2bb855760e57a8f252d47;hp=fe1f1aa90a18876fb7739e61faab4ac53a766547;hb=81304798ee736c467839c779c9ca5dca48db7bea;hpb=acc28c6418f43cbf15187f2f1fd9a562d5d96535 diff --git a/c++/cursesf.h b/c++/cursesf.h index fe1f1aa9..ea1aaf0d 100644 --- a/c++/cursesf.h +++ b/c++/cursesf.h @@ -1,6 +1,8 @@ // * This makes emacs happy -*-Mode: C++;-*- +// vile:cppmode /**************************************************************************** - * Copyright (c) 1998-2012,2014 Free Software Foundation, Inc. * + * Copyright 2019-2020,2021 Thomas E. Dickey * + * Copyright 1998-2012,2014 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 * @@ -31,7 +33,7 @@ * Author: Juergen Pfeifer, 1997 * ****************************************************************************/ -// $Id: cursesf.h,v 1.32 2014/08/09 22:06:11 Adam.Jiang Exp $ +// $Id: cursesf.h,v 1.38 2021/04/17 18:11:08 tom Exp $ #ifndef NCURSES_CURSESF_H_incl #define NCURSES_CURSESF_H_incl 1 @@ -47,14 +49,14 @@ extern "C" { } // // ------------------------------------------------------------------------- -// The abstract base class for buitin and user defined Fieldtypes. +// The abstract base class for builtin and user defined Fieldtypes. // ------------------------------------------------------------------------- // -class NCURSES_IMPEXP NCursesFormField; // forward declaration +class NCURSES_CXX_IMPEXP NCursesFormField; // forward declaration // Class to represent builtin field types as well as C++ written new // fieldtypes (see classes UserDefineFieldType... -class NCURSES_IMPEXP NCursesFieldType +class NCURSES_CXX_IMPEXP NCursesFieldType { friend class NCursesFormField; @@ -100,7 +102,7 @@ public: // The class representing a forms field, wrapping the lowlevel FIELD struct // ------------------------------------------------------------------------- // -class NCURSES_IMPEXP NCursesFormField +class NCURSES_CXX_IMPEXP NCursesFormField { friend class NCursesForm; @@ -151,7 +153,7 @@ public: { } - virtual ~NCursesFormField (); + virtual ~NCursesFormField () THROWS(NCursesException); // Duplicate the field at a new position inline NCursesFormField* dup(int first_row, int first_col) @@ -337,7 +339,7 @@ extern "C" { // The class representing a form, wrapping the lowlevel FORM struct // ------------------------------------------------------------------------- // -class NCURSES_IMPEXP NCursesForm : public NCursesPanel +class NCURSES_CXX_IMPEXP NCursesForm : public NCursesPanel { protected: FORM* form; // the lowlevel structure @@ -470,7 +472,7 @@ public: { } - virtual ~NCursesForm(); + virtual ~NCursesForm() THROWS(NCursesException); // Set the default attributes for the form virtual void setDefaultAttributes(); @@ -628,7 +630,7 @@ public: // data belongs to some class T. Use T as template argument // to create a UserField. // ------------------------------------------------------------------------- -template class NCURSES_IMPEXP NCursesUserField : public NCursesFormField +template class NCURSES_CXX_IMPEXP NCursesUserField : public NCursesFormField { public: NCursesUserField (int rows, @@ -645,7 +647,7 @@ public: OnError(::set_field_userptr(field, STATIC_CAST(void *)(p_UserData))); } - virtual ~NCursesUserField() {}; + virtual ~NCursesUserField() THROWS(NCursesException) {}; inline const T* UserData (void) const { return reinterpret_cast(::field_userptr (field)); @@ -661,7 +663,7 @@ public: // The same mechanism is used to attach user data to a form // ------------------------------------------------------------------------- // -template class NCURSES_IMPEXP NCursesUserForm : public NCursesForm +template class NCURSES_CXX_IMPEXP NCursesUserForm : public NCursesForm { protected: // 'Internal' constructor, builds an object without association to a @@ -702,7 +704,7 @@ public: (p_UserData))); }; - virtual ~NCursesUserForm() { + virtual ~NCursesUserForm() THROWS(NCursesException) { }; inline T* UserData (void) { @@ -720,7 +722,7 @@ public: // Builtin Fieldtypes // ------------------------------------------------------------------------- // -class NCURSES_IMPEXP Alpha_Field : public NCursesFieldType +class NCURSES_CXX_IMPEXP Alpha_Field : public NCursesFieldType { private: int min_field_width; @@ -730,13 +732,13 @@ private: } public: - Alpha_Field(int width) + explicit Alpha_Field(int width) : NCursesFieldType(TYPE_ALPHA), min_field_width(width) { } }; -class NCURSES_IMPEXP Alphanumeric_Field : public NCursesFieldType +class NCURSES_CXX_IMPEXP Alphanumeric_Field : public NCursesFieldType { private: int min_field_width; @@ -746,13 +748,13 @@ private: } public: - Alphanumeric_Field(int width) + explicit Alphanumeric_Field(int width) : NCursesFieldType(TYPE_ALNUM), min_field_width(width) { } }; -class NCURSES_IMPEXP Integer_Field : public NCursesFieldType +class NCURSES_CXX_IMPEXP Integer_Field : public NCursesFieldType { private: int precision; @@ -770,7 +772,7 @@ public: } }; -class NCURSES_IMPEXP Numeric_Field : public NCursesFieldType +class NCURSES_CXX_IMPEXP Numeric_Field : public NCursesFieldType { private: int precision; @@ -788,7 +790,7 @@ public: } }; -class NCURSES_IMPEXP Regular_Expression_Field : public NCursesFieldType +class NCURSES_CXX_IMPEXP Regular_Expression_Field : public NCursesFieldType { private: char* regex; @@ -804,7 +806,7 @@ private: } public: - Regular_Expression_Field(const char *expr) + explicit Regular_Expression_Field(const char *expr) : NCursesFieldType(TYPE_REGEXP), regex(NULL) { @@ -833,7 +835,7 @@ public: } }; -class NCURSES_IMPEXP Enumeration_Field : public NCursesFieldType +class NCURSES_CXX_IMPEXP Enumeration_Field : public NCursesFieldType { private: const char** list; @@ -872,7 +874,7 @@ public: } }; -class NCURSES_IMPEXP IPV4_Address_Field : public NCursesFieldType +class NCURSES_CXX_IMPEXP IPV4_Address_Field : public NCursesFieldType { private: void set(NCursesFormField& f) { @@ -895,7 +897,7 @@ extern "C" { // Abstract base class for User-Defined Fieldtypes // ------------------------------------------------------------------------- // -class NCURSES_IMPEXP UserDefinedFieldType : public NCursesFieldType +class NCURSES_CXX_IMPEXP UserDefinedFieldType : public NCursesFieldType { friend class UDF_Init; // Internal helper to set up statics private: @@ -924,8 +926,7 @@ protected: virtual bool char_check (int c) = 0; public: - UserDefinedFieldType() : NCursesFieldType(generic_fieldtype) { - } + UserDefinedFieldType(); }; extern "C" { @@ -938,7 +939,7 @@ extern "C" { // Abstract base class for User-Defined Fieldtypes with Choice functions // ------------------------------------------------------------------------- // -class NCURSES_IMPEXP UserDefinedFieldType_With_Choice : public UserDefinedFieldType +class NCURSES_CXX_IMPEXP UserDefinedFieldType_With_Choice : public UserDefinedFieldType { friend class UDF_Init; // Internal helper to set up statics private: @@ -961,9 +962,7 @@ protected: virtual bool previous(NCursesFormField& f) = 0; public: - UserDefinedFieldType_With_Choice() { - fieldtype = generic_fieldtype_with_choice; - } + UserDefinedFieldType_With_Choice(); }; #endif /* NCURSES_CURSESF_H_incl */