X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=c%2B%2B%2Fcursesp.h;h=1eb90e9535484ca7c54b3c2e3e6fccec50dbbb9f;hp=9b63d6d671bfd6be7ad516a991c31a8f1db311f6;hb=265e45e43e9917e8b9ecc2bf9d23867a3ede2ecd;hpb=11ca5f62994c7a14c4e500510bd242e1e721f8be diff --git a/c++/cursesp.h b/c++/cursesp.h index 9b63d6d6..1eb90e95 100644 --- a/c++/cursesp.h +++ b/c++/cursesp.h @@ -1,6 +1,8 @@ // * This makes emacs happy -*-Mode: C++;-*- +// vile:cppmode /**************************************************************************** - * Copyright (c) 1998-2007,2008 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 * @@ -34,7 +36,7 @@ #ifndef NCURSES_CURSESP_H_incl #define NCURSES_CURSESP_H_incl 1 -// $Id: cursesp.h,v 1.29 2008/08/16 17:20:23 tom Exp $ +// $Id: cursesp.h,v 1.35 2021/04/17 18:11:08 tom Exp $ #include @@ -42,7 +44,7 @@ extern "C" { # include } -class NCURSES_IMPEXP NCursesPanel +class NCURSES_CXX_IMPEXP NCursesPanel : public NCursesWindow { protected: @@ -86,7 +88,7 @@ protected: return result; } - void OnError (int err) const THROWS(NCursesPanelException) + void OnError (int err) const THROW2(NCursesException const, NCursesPanelException) { if (err==ERR) THROW(new NCursesPanelException (this, err)); @@ -131,7 +133,7 @@ public: { } - virtual ~NCursesPanel(); + virtual ~NCursesPanel() THROWS(NCursesException); // basic manipulation inline void hide() @@ -236,22 +238,23 @@ public: : NCursesPanel (nlines, ncols, begin_y, begin_x) { if (p) - set_user (const_cast(p_UserData)); + set_user (const_cast(reinterpret_cast + (p_UserData))); }; // This creates an user panel of the requested size with associated // user data pointed to by p_UserData. - NCursesUserPanel(const T* p_UserData = STATIC_CAST(T*)(0)) : NCursesPanel() + explicit NCursesUserPanel(const T* p_UserData = STATIC_CAST(T*)(0)) : NCursesPanel() { if (p) - set_user(const_cast(p_UserData)); + set_user(const_cast(reinterpret_cast(p_UserData))); }; // This creates an user panel associated with the ::stdscr and user data // pointed to by p_UserData. - virtual ~NCursesUserPanel() {}; + virtual ~NCursesUserPanel() THROWS(NCursesException) {}; - T* UserData (void) const + T* UserData (void) { return reinterpret_cast(get_user ()); }; @@ -260,7 +263,7 @@ public: virtual void setUserData (const T* p_UserData) { if (p) - set_user (const_cast(p_UserData)); + set_user (const_cast(reinterpret_cast(p_UserData))); } // Associate the user panel with the user data pointed to by p_UserData. };