From 1efcd4d03543b265deb37d5754e06e0ce7954121 Mon Sep 17 00:00:00 2001 From: Berk Geveci Date: Fri, 9 Nov 2001 16:16:56 -0500 Subject: Renaming ccurses to ccmake. --- Source/CursesDialog/CMakeLists.txt | 4 +- Source/CursesDialog/ccmake.cxx | 79 ++++++++++++++++++++++++++++++++++++++ Source/CursesDialog/ccurses.cxx | 79 -------------------------------------- 3 files changed, 81 insertions(+), 81 deletions(-) create mode 100644 Source/CursesDialog/ccmake.cxx delete mode 100644 Source/CursesDialog/ccurses.cxx diff --git a/Source/CursesDialog/CMakeLists.txt b/Source/CursesDialog/CMakeLists.txt index 391c9e2..8e12dca 100644 --- a/Source/CursesDialog/CMakeLists.txt +++ b/Source/CursesDialog/CMakeLists.txt @@ -10,7 +10,7 @@ SOURCE_FILES( CURSES_SRCS cmCursesPathWidget cmCursesStringWidget cmCursesWidget - ccurses + ccmake ) INCLUDE_DIRECTORIES(${CMake_SOURCE_DIR}/Source/CursesDialog/form) @@ -24,4 +24,4 @@ ENDIF(CURSES_EXTRA_LIBRARY) LINK_LIBRARIES(cmForm) -ADD_EXECUTABLE(ccurses CURSES_SRCS) \ No newline at end of file +ADD_EXECUTABLE(ccmake CURSES_SRCS) \ No newline at end of file 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 +#include +#include +#include + +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; + +} diff --git a/Source/CursesDialog/ccurses.cxx b/Source/CursesDialog/ccurses.cxx deleted file mode 100644 index dfb3526..0000000 --- a/Source/CursesDialog/ccurses.cxx +++ /dev/null @@ -1,79 +0,0 @@ -#include "cmCursesMainForm.h" -#include "../cmCacheManager.h" -#include "../cmSystemTools.h" - -#include -#include -#include -#include - -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; - -} -- cgit v0.12