diff options
author | Stephen Kelly <steveire@gmail.com> | 2016-10-18 19:28:47 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2016-10-19 13:40:58 (GMT) |
commit | 2fe3e55d53989c909be595b00a4749b75886accf (patch) | |
tree | 2e4c856f1f992f20acc39659901a28ef6b7ec98a /Source/CursesDialog | |
parent | a49751fb2eed0ca6415b243c35b23201b8060597 (diff) | |
download | CMake-2fe3e55d53989c909be595b00a4749b75886accf.zip CMake-2fe3e55d53989c909be595b00a4749b75886accf.tar.gz CMake-2fe3e55d53989c909be595b00a4749b75886accf.tar.bz2 |
cmState: Move CacheEntryType enum to separate namespace
Port dependent code to the change.
Diffstat (limited to 'Source/CursesDialog')
-rw-r--r-- | Source/CursesDialog/cmCursesBoolWidget.cxx | 2 | ||||
-rw-r--r-- | Source/CursesDialog/cmCursesCacheEntryComposite.cxx | 10 | ||||
-rw-r--r-- | Source/CursesDialog/cmCursesDummyWidget.cxx | 2 | ||||
-rw-r--r-- | Source/CursesDialog/cmCursesFilePathWidget.cxx | 2 | ||||
-rw-r--r-- | Source/CursesDialog/cmCursesMainForm.cxx | 31 | ||||
-rw-r--r-- | Source/CursesDialog/cmCursesMainForm.h | 2 | ||||
-rw-r--r-- | Source/CursesDialog/cmCursesOptionsWidget.cxx | 2 | ||||
-rw-r--r-- | Source/CursesDialog/cmCursesPathWidget.cxx | 4 | ||||
-rw-r--r-- | Source/CursesDialog/cmCursesStringWidget.cxx | 2 | ||||
-rw-r--r-- | Source/CursesDialog/cmCursesWidget.h | 4 |
10 files changed, 31 insertions, 30 deletions
diff --git a/Source/CursesDialog/cmCursesBoolWidget.cxx b/Source/CursesDialog/cmCursesBoolWidget.cxx index 5268a5d..3b81c65 100644 --- a/Source/CursesDialog/cmCursesBoolWidget.cxx +++ b/Source/CursesDialog/cmCursesBoolWidget.cxx @@ -11,7 +11,7 @@ cmCursesBoolWidget::cmCursesBoolWidget(int width, int height, int left, int top) : cmCursesWidget(width, height, left, top) { - this->Type = cmState::BOOL; + this->Type = cmStateEnums::BOOL; set_field_fore(this->Field, A_NORMAL); set_field_back(this->Field, A_STANDOUT); field_opts_off(this->Field, O_STATIC); diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx index 93785e0..46c0d0c 100644 --- a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx +++ b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx @@ -47,7 +47,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( const char* value = cm->GetState()->GetCacheEntryValue(key); assert(value); switch (cm->GetState()->GetCacheEntryType(key)) { - case cmState::BOOL: + case cmStateEnums::BOOL: this->Entry = new cmCursesBoolWidget(this->EntryWidth, 1, 1, 1); if (cmSystemTools::IsOn(value)) { static_cast<cmCursesBoolWidget*>(this->Entry)->SetValueAsBool(true); @@ -55,15 +55,15 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( static_cast<cmCursesBoolWidget*>(this->Entry)->SetValueAsBool(false); } break; - case cmState::PATH: + case cmStateEnums::PATH: this->Entry = new cmCursesPathWidget(this->EntryWidth, 1, 1, 1); static_cast<cmCursesPathWidget*>(this->Entry)->SetString(value); break; - case cmState::FILEPATH: + case cmStateEnums::FILEPATH: this->Entry = new cmCursesFilePathWidget(this->EntryWidth, 1, 1, 1); static_cast<cmCursesFilePathWidget*>(this->Entry)->SetString(value); break; - case cmState::STRING: { + case cmStateEnums::STRING: { const char* stringsProp = cm->GetState()->GetCacheEntryProperty(key, "STRINGS"); if (stringsProp) { @@ -83,7 +83,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( } break; } - case cmState::UNINITIALIZED: + case cmStateEnums::UNINITIALIZED: cmSystemTools::Error("Found an undefined variable: ", key.c_str()); break; default: diff --git a/Source/CursesDialog/cmCursesDummyWidget.cxx b/Source/CursesDialog/cmCursesDummyWidget.cxx index 61d07e2..b5a1daa 100644 --- a/Source/CursesDialog/cmCursesDummyWidget.cxx +++ b/Source/CursesDialog/cmCursesDummyWidget.cxx @@ -9,7 +9,7 @@ cmCursesDummyWidget::cmCursesDummyWidget(int width, int height, int left, int top) : cmCursesWidget(width, height, left, top) { - this->Type = cmState::INTERNAL; + this->Type = cmStateEnums::INTERNAL; } bool cmCursesDummyWidget::HandleInput(int& /*key*/, cmCursesMainForm* /*fm*/, diff --git a/Source/CursesDialog/cmCursesFilePathWidget.cxx b/Source/CursesDialog/cmCursesFilePathWidget.cxx index 670c50f..ee5f2d7 100644 --- a/Source/CursesDialog/cmCursesFilePathWidget.cxx +++ b/Source/CursesDialog/cmCursesFilePathWidget.cxx @@ -9,5 +9,5 @@ cmCursesFilePathWidget::cmCursesFilePathWidget(int width, int height, int left, int top) : cmCursesPathWidget(width, height, left, top) { - this->Type = cmState::FILEPATH; + this->Type = cmStateEnums::FILEPATH; } diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index 0c3d29d..0db0200 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -106,10 +106,10 @@ void cmCursesMainForm::InitializeUI() for (std::vector<std::string>::const_iterator it = cacheKeys.begin(); it != cacheKeys.end(); ++it) { - cmState::CacheEntryType t = + cmStateEnums::CacheEntryType t = this->CMakeInstance->GetState()->GetCacheEntryType(*it); - if (t != cmState::INTERNAL && t != cmState::STATIC && - t != cmState::UNINITIALIZED) { + if (t != cmStateEnums::INTERNAL && t != cmStateEnums::STATIC && + t != cmStateEnums::UNINITIALIZED) { ++count; } } @@ -130,10 +130,10 @@ void cmCursesMainForm::InitializeUI() for (std::vector<std::string>::const_iterator it = cacheKeys.begin(); it != cacheKeys.end(); ++it) { std::string key = *it; - cmState::CacheEntryType t = + cmStateEnums::CacheEntryType t = this->CMakeInstance->GetState()->GetCacheEntryType(*it); - if (t == cmState::INTERNAL || t == cmState::STATIC || - t == cmState::UNINITIALIZED) { + if (t == cmStateEnums::INTERNAL || t == cmStateEnums::STATIC || + t == cmStateEnums::UNINITIALIZED) { continue; } @@ -148,10 +148,10 @@ void cmCursesMainForm::InitializeUI() for (std::vector<std::string>::const_iterator it = cacheKeys.begin(); it != cacheKeys.end(); ++it) { std::string key = *it; - cmState::CacheEntryType t = + cmStateEnums::CacheEntryType t = this->CMakeInstance->GetState()->GetCacheEntryType(*it); - if (t == cmState::INTERNAL || t == cmState::STATIC || - t == cmState::UNINITIALIZED) { + if (t == cmStateEnums::INTERNAL || t == cmStateEnums::STATIC || + t == cmStateEnums::UNINITIALIZED) { continue; } @@ -249,8 +249,9 @@ void cmCursesMainForm::Render(int left, int top, int width, int height) cmCursesWidget* cw = reinterpret_cast<cmCursesWidget*>(field_userptr(currentField)); // If in edit mode, get out of it - if (cw->GetType() == cmState::STRING || cw->GetType() == cmState::PATH || - cw->GetType() == cmState::FILEPATH) { + if (cw->GetType() == cmStateEnums::STRING || + cw->GetType() == cmStateEnums::PATH || + cw->GetType() == cmStateEnums::FILEPATH) { cmCursesStringWidget* sw = static_cast<cmCursesStringWidget*>(cw); sw->SetInEdit(false); } @@ -704,7 +705,7 @@ void cmCursesMainForm::FillCacheManagerFromUI() std::string newValue = (*this->Entries)[i]->Entry->GetValue(); std::string fixedOldValue; std::string fixedNewValue; - cmState::CacheEntryType t = + cmStateEnums::CacheEntryType t = this->CMakeInstance->GetState()->GetCacheEntryType(cacheKey); this->FixValue(t, oldValue, fixedOldValue); this->FixValue(t, newValue, fixedNewValue); @@ -720,14 +721,14 @@ void cmCursesMainForm::FillCacheManagerFromUI() } } -void cmCursesMainForm::FixValue(cmState::CacheEntryType type, +void cmCursesMainForm::FixValue(cmStateEnums::CacheEntryType type, const std::string& in, std::string& out) const { out = in.substr(0, in.find_last_not_of(' ') + 1); - if (type == cmState::PATH || type == cmState::FILEPATH) { + if (type == cmStateEnums::PATH || type == cmStateEnums::FILEPATH) { cmSystemTools::ConvertToUnixSlashes(out); } - if (type == cmState::BOOL) { + if (type == cmStateEnums::BOOL) { if (cmSystemTools::IsOff(out.c_str())) { out = "OFF"; } else { diff --git a/Source/CursesDialog/cmCursesMainForm.h b/Source/CursesDialog/cmCursesMainForm.h index 4bf452d..10ae960 100644 --- a/Source/CursesDialog/cmCursesMainForm.h +++ b/Source/CursesDialog/cmCursesMainForm.h @@ -110,7 +110,7 @@ protected: // cache. void FillCacheManagerFromUI(); // Fix formatting of values to a consistent form. - void FixValue(cmState::CacheEntryType type, const std::string& in, + void FixValue(cmStateEnums::CacheEntryType type, const std::string& in, std::string& out) const; // Re-post the existing fields. Used to toggle between // normal and advanced modes. Render() should be called diff --git a/Source/CursesDialog/cmCursesOptionsWidget.cxx b/Source/CursesDialog/cmCursesOptionsWidget.cxx index e23a82d..1b752a6 100644 --- a/Source/CursesDialog/cmCursesOptionsWidget.cxx +++ b/Source/CursesDialog/cmCursesOptionsWidget.cxx @@ -11,7 +11,7 @@ cmCursesOptionsWidget::cmCursesOptionsWidget(int width, int height, int left, int top) : cmCursesWidget(width, height, left, top) { - this->Type = cmState::BOOL; // this is a bit of a hack + this->Type = cmStateEnums::BOOL; // this is a bit of a hack // there is no option type, and string type causes ccmake to cast // the widget into a string widget at some point. BOOL is safe for // now. diff --git a/Source/CursesDialog/cmCursesPathWidget.cxx b/Source/CursesDialog/cmCursesPathWidget.cxx index d208598..3f96436 100644 --- a/Source/CursesDialog/cmCursesPathWidget.cxx +++ b/Source/CursesDialog/cmCursesPathWidget.cxx @@ -13,7 +13,7 @@ cmCursesPathWidget::cmCursesPathWidget(int width, int height, int left, int top) : cmCursesStringWidget(width, height, left, top) { - this->Type = cmState::PATH; + this->Type = cmStateEnums::PATH; this->Cycle = false; this->CurrentIndex = 0; } @@ -50,7 +50,7 @@ void cmCursesPathWidget::OnTab(cmCursesMainForm* fm, WINDOW* w) std::vector<std::string> dirs; cmSystemTools::SimpleGlob(glob, dirs, - (this->Type == cmState::PATH ? -1 : 0)); + (this->Type == cmStateEnums::PATH ? -1 : 0)); if (this->CurrentIndex < dirs.size()) { cstr = dirs[this->CurrentIndex]; } diff --git a/Source/CursesDialog/cmCursesStringWidget.cxx b/Source/CursesDialog/cmCursesStringWidget.cxx index f068f67..0f67d23 100644 --- a/Source/CursesDialog/cmCursesStringWidget.cxx +++ b/Source/CursesDialog/cmCursesStringWidget.cxx @@ -21,7 +21,7 @@ cmCursesStringWidget::cmCursesStringWidget(int width, int height, int left, : cmCursesWidget(width, height, left, top) { this->InEdit = false; - this->Type = cmState::STRING; + this->Type = cmStateEnums::STRING; set_field_fore(this->Field, A_NORMAL); set_field_back(this->Field, A_STANDOUT); field_opts_off(this->Field, O_STATIC); diff --git a/Source/CursesDialog/cmCursesWidget.h b/Source/CursesDialog/cmCursesWidget.h index bb26cf6..1ef4ab2 100644 --- a/Source/CursesDialog/cmCursesWidget.h +++ b/Source/CursesDialog/cmCursesWidget.h @@ -41,7 +41,7 @@ public: /** * Get the type of the widget (STRING, PATH etc...) */ - cmState::CacheEntryType GetType() { return this->Type; } + cmStateEnums::CacheEntryType GetType() { return this->Type; } /** * If there are any, print the widget specific commands @@ -62,7 +62,7 @@ protected: cmCursesWidget(const cmCursesWidget& from); void operator=(const cmCursesWidget&); - cmState::CacheEntryType Type; + cmStateEnums::CacheEntryType Type; std::string Value; FIELD* Field; // The page in the main form this widget is in |