summaryrefslogtreecommitdiffstats
path: root/Source/CursesDialog/ccmake.cxx
diff options
context:
space:
mode:
authorBerk Geveci <berk.geveci@kitware.com>2001-11-09 21:16:56 (GMT)
committerBerk Geveci <berk.geveci@kitware.com>2001-11-09 21:16:56 (GMT)
commit1efcd4d03543b265deb37d5754e06e0ce7954121 (patch)
tree376a1f4b6d68c089dbe65de8dccb91e51c98075d /Source/CursesDialog/ccmake.cxx
parent9320bc53d851665585872d6fe3b2ebbecdab3978 (diff)
downloadCMake-1efcd4d03543b265deb37d5754e06e0ce7954121.zip
CMake-1efcd4d03543b265deb37d5754e06e0ce7954121.tar.gz
CMake-1efcd4d03543b265deb37d5754e06e0ce7954121.tar.bz2
Renaming ccurses to ccmake.
Diffstat (limited to 'Source/CursesDialog/ccmake.cxx')
-rw-r--r--Source/CursesDialog/ccmake.cxx79
1 files changed, 79 insertions, 0 deletions
diff --git a/Source/CursesDialog/ccmake.cxx b/Source/CursesDialog/ccmake.cxx
new file mode 100644
index 0000000..dfb3526
--- /dev/null
+++ b/Source/CursesDialog/ccmake.cxx
@@ -0,0 +1,79 @@
+#include "cmCursesMainForm.h"
+#include "../cmCacheManager.h"
+#include "../cmSystemTools.h"
+
+#include <curses.h>
+#include <form.h>
+#include <signal.h>
+#include <sys/ioctl.h>
+
+static cmCursesMainForm* myform=0;
+
+void onsig(int sig)
+{
+ if (myform)
+ {
+ endwin();
+ WINDOW* w= initscr(); /* Initialization */
+ noecho(); /* Echo off */
+ cbreak(); /* nl- or cr not needed */
+ keypad(stdscr,TRUE); /* Use key symbols as
+ KEY_DOWN*/
+ refresh();
+ int x,y;
+ getmaxyx(w, y, x);
+ myform->SetWindow(w);
+ myform->Render(1,1,x,y);
+ myform->UpdateStatusBar();
+ }
+ signal(SIGWINCH, onsig);
+}
+
+int main(int argc, char** argv)
+{
+
+ if ( argc > 2 )
+ {
+ std::cerr << "Usage: " << argv[0] << " source_directory."
+ << std::endl;
+ return -1;
+ }
+
+ int newCache = false;
+ if (!cmCacheManager::GetInstance()->LoadCache(cmSystemTools::GetCurrentWorkingDirectory().c_str()))
+ {
+ newCache = true;
+ }
+
+
+ WINDOW* w=initscr(); /* Initialization */
+ noecho(); /* Echo off */
+ cbreak(); /* nl- or cr not needed */
+ keypad(stdscr,TRUE); /* Use key symbols as
+ KEY_DOWN*/
+
+ signal(SIGWINCH, onsig);
+
+ int x,y;
+ getmaxyx(w, y, x);
+ std::string whereCMake = cmSystemTools::GetProgramPath(argv[0]);
+ whereCMake += "/cmake";
+ if ( argc == 2 )
+ {
+
+ myform = new cmCursesMainForm(argv[1], whereCMake.c_str(), newCache);
+ }
+ else
+ {
+ myform = new cmCursesMainForm("", whereCMake.c_str(), newCache);
+ }
+ myform->InitializeUI(w);
+ myform->Render(1, 1, x, y);
+ myform->HandleInput();
+
+ // Need to clean-up better
+ endwin();
+ delete myform;
+ return 0;
+
+}