X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=c%2B%2B%2Fcursesapp.h;h=9d7b8a3958c2dbbd7b0f96848e331db6c29b859c;hp=e3cbc04cc6745582c22cac697c1ce349b6b9a219;hb=a28e782d7794ddeec23e7cb212dc455f0d93dc22;hpb=f3eb40315f9e5eff503a172aed6d325b4e1f20c6 diff --git a/c++/cursesapp.h b/c++/cursesapp.h index e3cbc04c..9d7b8a39 100644 --- a/c++/cursesapp.h +++ b/c++/cursesapp.h @@ -1,6 +1,7 @@ // * This makes emacs happy -*-Mode: C++;-*- /**************************************************************************** - * Copyright (c) 1998-2005,2011 Free Software Foundation, Inc. * + * Copyright 2019,2020 Thomas E. Dickey * + * Copyright 1998-2005,2011 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,14 +32,25 @@ * Author: Juergen Pfeifer, 1997 * ****************************************************************************/ -// $Id: cursesapp.h,v 1.12 2011/09/17 22:12:10 tom Exp $ +// $Id: cursesapp.h,v 1.17 2020/08/29 16:22:03 juergen Exp $ #ifndef NCURSES_CURSESAPP_H_incl #define NCURSES_CURSESAPP_H_incl #include -class NCURSES_IMPEXP NCursesApplication { +#if (defined(_WIN32) || defined(_WIN64)) +# define NCURSES_CXX_MAIN_NAME cursespp_main +# define NCURSES_CXX_MAIN \ + int main(int argc, char *argv[]) { \ + return NCURSES_CXX_MAIN_NAME(argc, argv); \ + } +#else +# define NCURSES_CXX_MAIN_NAME main +#endif +NCURSES_CXX_IMPEXP int NCURSES_CXX_MAIN_NAME(int argc, char *argv[]); + +class NCURSES_CXX_IMPEXP NCursesApplication { public: typedef struct _slk_link { // This structure is used to maintain struct _slk_link* prev; // a stack of SLKs @@ -105,13 +117,13 @@ protected: { } + static NCursesWindow *&getTitleWindow(); + public: - virtual ~NCursesApplication(); + virtual ~NCursesApplication() THROWS(NCursesException); // Get a pointer to the current application object - static NCursesApplication* getApplication() { - return theApp; - } + static NCursesApplication* getApplication(); // This method runs the application and returns its exit value int operator()(void);