X-Git-Url: http://ncurses.scripts.mit.edu/?a=blobdiff_plain;f=c%2B%2B%2Fcursesapp.h;h=1296f374e984b37defad524b4444652830d16dd8;hb=493e2f7b3fc309879f561a094fdfc15e5304b3d6;hp=a09a3b636ec05de38c6b7d51984288a8b9ed7c73;hpb=47d2fb4537d9ad5bb14f4810561a327930ca4280;p=ncurses.git diff --git a/c++/cursesapp.h b/c++/cursesapp.h index a09a3b63..1296f374 100644 --- a/c++/cursesapp.h +++ b/c++/cursesapp.h @@ -1,6 +1,6 @@ // * This makes emacs happy -*-Mode: C++;-*- /**************************************************************************** - * Copyright 2019,2020 Thomas E. Dickey * + * Copyright 2019-2020,2021 Thomas E. Dickey * * Copyright 1998-2005,2011 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -32,14 +32,25 @@ * Author: Juergen Pfeifer, 1997 * ****************************************************************************/ -// $Id: cursesapp.h,v 1.14 2020/02/02 23:34:34 tom Exp $ +// $Id: cursesapp.h,v 1.18 2021/06/17 21:26:02 tom 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 @@ -106,13 +117,13 @@ protected: { } + static NCursesWindow *&getTitleWindow(); + public: 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); @@ -176,5 +187,5 @@ public: } }; - + #endif /* NCURSES_CURSESAPP_H_incl */