X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=c%2B%2B%2Fcursesapp.h;h=0c4010a9e4f62395a4840adafe8d752664b52b12;hp=a3d0aaf3c3604b9167db5799478ab9d84b9dc816;hb=dafd158641767f37aa900c195aaa77b27da38500;hpb=97df2f335617625b7355c04e46175e316ef02544 diff --git a/c++/cursesapp.h b/c++/cursesapp.h index a3d0aaf3..0c4010a9 100644 --- a/c++/cursesapp.h +++ b/c++/cursesapp.h @@ -1,6 +1,7 @@ // * This makes emacs happy -*-Mode: C++;-*- /**************************************************************************** - * Copyright (c) 1998-2011,2019 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.13 2019/07/28 19:55:27 tom Exp $ +// $Id: cursesapp.h,v 1.16 2020/07/18 19:57:11 anonymous.maarten Exp $ #ifndef NCURSES_CURSESAPP_H_incl #define NCURSES_CURSESAPP_H_incl #include -class NCURSES_IMPEXP NCursesApplication { +#ifdef _WIN32 +# 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() 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);