Initial commit.
[CMakeLuaTailorHgBridge.git] / CMakeLua / Source / CursesDialog / cmCursesStandardIncludes.h
blob30496abd0279e2b0dded5ba4f1ece5e903f9a82d
1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmCursesStandardIncludes.h,v $
5 Language: C++
6 Date: $Date: 2007/08/27 13:01:14 $
7 Version: $Revision: 1.16 $
9 Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
10 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
16 =========================================================================*/
17 #ifndef cmCursesStandardIncludes_h
18 #define cmCursesStandardIncludes_h
19 #if defined(__sun__) && defined(__GNUC__)
20 #define _MSE_INT_H
21 #endif
23 #include <cmFormConfigure.h>
25 #if defined(__hpux)
26 # define _BOOL_DEFINED
27 # include <sys/time.h>
28 # define _XOPEN_SOURCE_EXTENDED
29 # include <curses.h>
30 # include <form.h>
31 # undef _XOPEN_SOURCE_EXTENDED
32 #else
33 /* figure out which curses.h to include */
34 # if defined(CURSES_HAVE_NCURSES_H)
35 # include <ncurses.h>
36 # elif defined(CURSES_HAVE_NCURSES_NCURSES_H)
37 # include <ncurses/ncurses.h>
38 # elif defined(CURSES_HAVE_NCURSES_CURSES_H)
39 # include <ncurses/curses.h>
40 # else
41 # include <curses.h>
42 # endif
44 # include <form.h>
45 #endif
47 // This is a hack to prevent warnings about these functions being
48 // declared but not referenced.
49 #if defined(__sgi) && !defined(__GNUC__)
50 class cmCursesStandardIncludesHack
52 public:
53 enum
55 Ref1 = sizeof(cfgetospeed(0)),
56 Ref2 = sizeof(cfgetispeed(0)),
57 Ref3 = sizeof(tcgetattr(0, 0)),
58 Ref4 = sizeof(tcsetattr(0, 0, 0)),
59 Ref5 = sizeof(cfsetospeed(0,0)),
60 Ref6 = sizeof(cfsetispeed(0,0))
63 #endif
65 #ifndef getmaxyx
66 #define getmaxyx(w,y,x) ((y) = getmaxy(w), (x) = getmaxx(w))
67 #endif
70 // on some machines move erase and clear conflict with stl
71 // so remove them from the namespace
72 inline void curses_move(unsigned int x, unsigned int y)
74 move(x,y);
77 inline void curses_clear()
79 erase();
80 clearok(stdscr, TRUE);
83 #undef move
84 #undef erase
85 #undef clear
88 #endif // cmCursesStandardIncludes_h