summaryrefslogtreecommitdiffstats
path: root/Source/CursesDialog
diff options
context:
space:
mode:
Diffstat (limited to 'Source/CursesDialog')
-rw-r--r--Source/CursesDialog/cmCursesBoolWidget.cxx4
-rw-r--r--Source/CursesDialog/cmCursesCacheEntryComposite.cxx11
-rw-r--r--Source/CursesDialog/cmCursesDummyWidget.cxx4
-rw-r--r--Source/CursesDialog/cmCursesFilePathWidget.cxx4
-rw-r--r--Source/CursesDialog/cmCursesMainForm.cxx32
-rw-r--r--Source/CursesDialog/cmCursesMainForm.h4
-rw-r--r--Source/CursesDialog/cmCursesOptionsWidget.cxx4
-rw-r--r--Source/CursesDialog/cmCursesPathWidget.cxx6
-rw-r--r--Source/CursesDialog/cmCursesStringWidget.cxx4
-rw-r--r--Source/CursesDialog/cmCursesWidget.h6
10 files changed, 41 insertions, 38 deletions
diff --git a/Source/CursesDialog/cmCursesBoolWidget.cxx b/Source/CursesDialog/cmCursesBoolWidget.cxx
index 5268a5d..80a5b5b 100644
--- a/Source/CursesDialog/cmCursesBoolWidget.cxx
+++ b/Source/CursesDialog/cmCursesBoolWidget.cxx
@@ -3,7 +3,7 @@
#include "cmCursesBoolWidget.h"
#include "cmCursesWidget.h"
-#include "cmState.h"
+#include "cmStateTypes.h"
#include <string>
@@ -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..5539fbe 100644
--- a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx
+++ b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx
@@ -10,6 +10,7 @@
#include "cmCursesStringWidget.h"
#include "cmCursesWidget.h"
#include "cmState.h"
+#include "cmStateTypes.h"
#include "cmSystemTools.h"
#include "cmake.h"
@@ -47,7 +48,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 +56,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 +84,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..da0478a 100644
--- a/Source/CursesDialog/cmCursesDummyWidget.cxx
+++ b/Source/CursesDialog/cmCursesDummyWidget.cxx
@@ -3,13 +3,13 @@
#include "cmCursesDummyWidget.h"
#include "cmCursesWidget.h"
-#include "cmState.h"
+#include "cmStateTypes.h"
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..518da4f 100644
--- a/Source/CursesDialog/cmCursesFilePathWidget.cxx
+++ b/Source/CursesDialog/cmCursesFilePathWidget.cxx
@@ -3,11 +3,11 @@
#include "cmCursesFilePathWidget.h"
#include "cmCursesPathWidget.h"
-#include "cmState.h"
+#include "cmStateTypes.h"
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..ebd35f3 100644
--- a/Source/CursesDialog/cmCursesMainForm.cxx
+++ b/Source/CursesDialog/cmCursesMainForm.cxx
@@ -12,6 +12,7 @@
#include "cmCursesStringWidget.h"
#include "cmCursesWidget.h"
#include "cmState.h"
+#include "cmStateTypes.h"
#include "cmSystemTools.h"
#include "cmVersion.h"
#include "cmake.h"
@@ -106,10 +107,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 +131,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 +149,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 +250,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 +706,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 +722,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..d891ea0 100644
--- a/Source/CursesDialog/cmCursesMainForm.h
+++ b/Source/CursesDialog/cmCursesMainForm.h
@@ -7,7 +7,7 @@
#include "cmCursesForm.h"
#include "cmCursesStandardIncludes.h"
-#include "cmState.h"
+#include "cmStateTypes.h"
#include <stddef.h>
#include <string>
@@ -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..d26a98f 100644
--- a/Source/CursesDialog/cmCursesOptionsWidget.cxx
+++ b/Source/CursesDialog/cmCursesOptionsWidget.cxx
@@ -3,7 +3,7 @@
#include "cmCursesOptionsWidget.h"
#include "cmCursesWidget.h"
-#include "cmState.h"
+#include "cmStateTypes.h"
#define ctrl(z) ((z)&037)
@@ -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..05c3279 100644
--- a/Source/CursesDialog/cmCursesPathWidget.cxx
+++ b/Source/CursesDialog/cmCursesPathWidget.cxx
@@ -4,7 +4,7 @@
#include "cmCursesMainForm.h"
#include "cmCursesStringWidget.h"
-#include "cmState.h"
+#include "cmStateTypes.h"
#include "cmSystemTools.h"
#include <vector>
@@ -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..eabc642 100644
--- a/Source/CursesDialog/cmCursesStringWidget.cxx
+++ b/Source/CursesDialog/cmCursesStringWidget.cxx
@@ -6,7 +6,7 @@
#include "cmCursesMainForm.h"
#include "cmCursesStandardIncludes.h"
#include "cmCursesWidget.h"
-#include "cmState.h"
+#include "cmStateTypes.h"
#include <stdio.h>
#include <string.h>
@@ -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..d226dd7 100644
--- a/Source/CursesDialog/cmCursesWidget.h
+++ b/Source/CursesDialog/cmCursesWidget.h
@@ -6,7 +6,7 @@
#include <cmConfigure.h> // IWYU pragma: keep
#include "cmCursesStandardIncludes.h"
-#include "cmState.h"
+#include "cmStateTypes.h"
#include <string>
@@ -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