X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=c%2B%2B%2Fcursesm.h;h=413da764fec164dd8d37f545f3d9fad11833928c;hp=45b6c0cc73be5496d434773263b2779040cab51c;hb=3ef920d65fb2d4046096131d868ae8d4bba79d46;hpb=1d7867d33e6954be7c7121b1028ad6768f487752 diff --git a/c++/cursesm.h b/c++/cursesm.h index 45b6c0cc..413da764 100644 --- a/c++/cursesm.h +++ b/c++/cursesm.h @@ -1,6 +1,7 @@ // * This makes emacs happy -*-Mode: C++;-*- /**************************************************************************** - * Copyright (c) 1998-2011,2012 Free Software Foundation, Inc. * + * Copyright 2019,2020 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 +32,7 @@ * Author: Juergen Pfeifer, 1997 * ****************************************************************************/ -// $Id: cursesm.h,v 1.28 2012/06/08 17:43:56 Richard.Yao Exp $ +// $Id: cursesm.h,v 1.33 2020/02/02 23:34:34 tom Exp $ #ifndef NCURSES_CURSESM_H_incl #define NCURSES_CURSESM_H_incl 1 @@ -53,7 +54,7 @@ class NCURSES_IMPEXP NCursesMenuItem protected: ITEM *item; - inline void OnError (int err) const THROWS(NCursesMenuException) { + inline void OnError (int err) const THROW2(NCursesException const, NCursesMenuException) { if (err != E_OK) THROW(new NCursesMenuException (err)); } @@ -85,7 +86,7 @@ public: (void) rhs; } - virtual ~NCursesMenuItem (); + virtual ~NCursesMenuItem () THROWS(NCursesException); // Release the items memory inline const char* name () const { @@ -179,7 +180,7 @@ public: { } - virtual ~NCursesMenuCallbackItem(); + virtual ~NCursesMenuCallbackItem() THROWS(NCursesException); bool action(); }; @@ -253,7 +254,7 @@ protected: bool with_frame, bool autoDeleteItems); - inline void OnError (int err) const THROWS(NCursesMenuException) { + inline void OnError (int err) const THROW2(NCursesException const, NCursesMenuException) { if (err != E_OK) THROW(new NCursesMenuException (this, err)); } @@ -332,7 +333,7 @@ public: { } - virtual ~NCursesMenu (); + virtual ~NCursesMenu () THROWS(NCursesException); // Retrieve the menus subwindow inline NCursesWindow& subWindow() const { @@ -358,7 +359,7 @@ public: flag ? OnError (::post_menu(menu)) : OnError (::unpost_menu (menu)); } - // Get the numer of rows and columns for this menu + // Get the number of rows and columns for this menu inline void scale (int& mrows, int& mcols) const { OnError (::scale_menu (menu, &mrows, &mcols)); } @@ -606,7 +607,7 @@ public: OnError (::set_item_userptr (item, const_cast(reinterpret_cast(p_UserData)))); } - virtual ~NCursesUserItem() {} + virtual ~NCursesUserItem() THROWS(NCursesException) {} inline const T* UserData (void) const { return reinterpret_cast(::item_userptr (item)); @@ -632,7 +633,7 @@ protected: const T* p_UserData = STATIC_CAST(T*)(0)) : NCursesMenu(nlines,ncols,begin_y,begin_x) { if (menu) - set_user (const_cast(p_UserData)); + set_user (const_cast(reinterpret_cast(p_UserData))); } public: @@ -642,7 +643,7 @@ public: bool autoDelete_Items=FALSE) : NCursesMenu (Items, with_frame, autoDelete_Items) { if (menu) - set_user (const_cast(p_UserData)); + set_user (const_cast(reinterpret_cast(p_UserData))); }; NCursesUserMenu (NCursesMenuItem* Items[], @@ -654,19 +655,19 @@ public: bool with_frame=FALSE) : NCursesMenu (Items, nlines, ncols, begin_y, begin_x, with_frame) { if (menu) - set_user (const_cast(p_UserData)); + set_user (const_cast(reinterpret_cast(p_UserData))); }; - virtual ~NCursesUserMenu() { + virtual ~NCursesUserMenu() THROWS(NCursesException) { }; - inline T* UserData (void) const { + inline T* UserData (void) { return reinterpret_cast(get_user ()); }; inline virtual void setUserData (const T* p_UserData) { if (menu) - set_user (const_cast(p_UserData)); + set_user (const_cast(reinterpret_cast(p_UserData))); } };