Updated includes to more closely match upstream cursespp

This commit is contained in:
casey langen 2018-12-20 18:39:39 -08:00
parent 6e15a895aa
commit 2113875212
22 changed files with 24 additions and 97 deletions

View File

@ -34,6 +34,7 @@
#include <stdafx.h>
#include <cursespp/curses_config.h>
#include <cursespp/App.h>
#include <cursespp/Colors.h>
#include <cursespp/ILayout.h>
@ -41,7 +42,7 @@
#include <cursespp/Window.h>
#include <cursespp/Text.h>
#include <cursespp/Screen.h>
#include <algorithm>
#include <thread>
#ifdef WIN32

View File

@ -111,6 +111,7 @@ void AppLayout::SetPadding(size_t t, size_t l, size_t b, size_t r) {
this->paddingL = l;
this->paddingB = b;
this->paddingR = r;
this->Layout();
}
cursespp::IWindowPtr AppLayout::GetFocus() {

View File

@ -37,7 +37,6 @@
#include <cursespp/Screen.h>
#include <cursespp/Colors.h>
#include <cursespp/Text.h>
#include <cursespp/Checkbox.h>
using namespace cursespp;

View File

@ -39,6 +39,7 @@
#include <cursespp/Colors.h>
#include <cursespp/Screen.h>
#include <cursespp/Text.h>
#include <core/i18n/Locale.h>
using namespace cursespp;

View File

@ -34,6 +34,7 @@
#include <stdafx.h>
#include <climits>
#include <algorithm>
#include <cursespp/LayoutBase.h>
#include <cursespp/Colors.h>

View File

@ -33,6 +33,8 @@
//////////////////////////////////////////////////////////////////////////////
#include <stdafx.h>
#include <algorithm>
#include <functional>
#include <cursespp/ListOverlay.h>
#include <cursespp/Scrollbar.h>
#include <cursespp/Colors.h>

View File

@ -33,6 +33,7 @@
//////////////////////////////////////////////////////////////////////////////
#include <stdafx.h>
#include <algorithm>
#include <cursespp/Text.h>
#include <cursespp/MultiLineEntry.h>

View File

@ -39,8 +39,6 @@
#include <cursespp/Screen.h>
#include <cursespp/Colors.h>
#include <core/debug.h>
using namespace cursespp;
static const size_t INVALID_INDEX = (size_t) -1;

View File

@ -33,6 +33,7 @@
//////////////////////////////////////////////////////////////////////////////
#include <stdafx.h>
#include <algorithm>
#include <cursespp/Scrollbar.h>
using namespace cursespp;

View File

@ -80,13 +80,13 @@ EntryPtr SimpleScrollAdapter::GetEntry(cursespp::ScrollableWindow* window, size_
if (window && selectable) {
SingleLineEntry* single = static_cast<SingleLineEntry*>(entry.get());
single->SetAttrs(Color(Color::Default));
if (index == window->GetScrollPosition().logicalIndex) {
if (index == window->GetScrollPosition().logicalIndex) {
single->SetAttrs(Color(Color::ListItemHighlighted));
}
}
}
return entry;
}
}
std::string SimpleScrollAdapter::StringAt(size_t index) {
auto entry = this->entries.at(index);

View File

@ -33,6 +33,7 @@
//////////////////////////////////////////////////////////////////////////////
#include <stdafx.h>
#include <cursespp/curses_config.h>
#include <cursespp/Text.h>
#include <math.h>

View File

@ -32,8 +32,6 @@
//
//////////////////////////////////////////////////////////////////////////////
#pragma once
#include <stdafx.h>
#include <cursespp/Win32Util.h>
#include <Windows.h>

View File

@ -36,6 +36,7 @@
#include <cursespp/curses_config.h>
#include <string>
#include <vector>
namespace cursespp {
class Color {

View File

@ -1,84 +0,0 @@
//////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2007-2017 musikcube team
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// * Neither the name of the author nor the names of other contributors may
// be used to endorse or promote products derived from this software
// without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
//////////////////////////////////////////////////////////////////////////////
#pragma once
#include <f8n/str/util.h>
#include <cursespp/InputOverlay.h>
namespace cursespp {
template <typename T>
struct NumberValidator : public InputOverlay::IValidator {
using Formatter = std::function<std::string(T)>;
NumberValidator(T minimum, T maximum, Formatter formatter)
: minimum(minimum), maximum(maximum), formatter(formatter) {
}
virtual bool IsValid(const std::string& input) const override {
try {
double result = std::stod(input);
if (bounded(minimum, maximum) && (result < minimum || result > maximum)) {
return false;
}
}
catch (std::invalid_argument) {
return false;
}
return true;
}
virtual const std::string ErrorMessage() const override {
if (bounded(minimum, maximum)) {
std::string result = _TSTR("validator_dialog_number_parse_bounded_error");
f8n::str::replace(result, "{{minimum}}", formatter(minimum));
f8n::str::replace(result, "{{maximum}}", formatter(maximum));
return result;
}
return _TSTR("validator_dialog_number_parse_error");
}
static bool bounded(T minimum, T maximum) {
return
minimum != std::numeric_limits<T>::min() &&
maximum != std::numeric_limits<T>::max();
}
Formatter formatter;
T minimum, maximum;
};
}

View File

@ -36,6 +36,7 @@
#include <cursespp/curses_config.h>
#include <cursespp/IScrollAdapter.h>
#include <functional>
#include <deque>
namespace cursespp {

View File

@ -37,6 +37,7 @@
#include <cursespp/IKeyHandler.h>
#include <cursespp/Window.h>
#include <cursespp/Text.h>
#include <functional>
namespace cursespp {
class ShortcutsWindow :

View File

@ -36,6 +36,7 @@
#include <cursespp/curses_config.h>
#include <cursespp/ScrollAdapterBase.h>
#include <sigslot/sigslot.h>
#include <deque>
namespace cursespp {

View File

@ -34,6 +34,9 @@
#pragma once
#include <string>
#include <vector>
namespace cursespp {
namespace text {
enum TextAlign {

View File

@ -39,6 +39,7 @@
#include <cursespp/IInput.h>
#include <cursespp/IKeyHandler.h>
#include <sigslot/sigslot.h>
#include <vector>
namespace cursespp {
class TextInput :

View File

@ -36,6 +36,9 @@
#ifdef WIN32
#include <Windows.h>
#include <string>
namespace cursespp {
namespace win32 {
void InterceptWndProc();

View File

@ -268,7 +268,6 @@ xcopy "$(SolutionDir)src\3rdparty\bin\win32\font\*.ttf" "$(TargetDir)fonts\" /Y
<ClInclude Include="cursespp\cursespp\ListOverlay.h" />
<ClInclude Include="cursespp\cursespp\ListWindow.h" />
<ClInclude Include="cursespp\cursespp\MultiLineEntry.h" />
<ClInclude Include="cursespp\cursespp\NumberValidator.h" />
<ClInclude Include="cursespp\cursespp\OverlayBase.h" />
<ClInclude Include="cursespp\cursespp\OverlayStack.h" />
<ClInclude Include="cursespp\cursespp\Screen.h" />

View File

@ -358,9 +358,6 @@
<ClInclude Include="cursespp\cursespp\MultiLineEntry.h">
<Filter>cursespp\include</Filter>
</ClInclude>
<ClInclude Include="cursespp\cursespp\NumberValidator.h">
<Filter>cursespp\include</Filter>
</ClInclude>
<ClInclude Include="cursespp\cursespp\OverlayBase.h">
<Filter>cursespp\include</Filter>
</ClInclude>