From b5f21900ebeef0eaa7f628206b6c82de23f44605 Mon Sep 17 00:00:00 2001 From: jmsgrogan Date: Fri, 20 Jan 2023 08:07:09 +0000 Subject: [PATCH] Fix up build. --- apps/notes_tk/audio_editor/AudioEditorView.cpp | 1 - apps/notes_tk/canvas/CanvasCommandSelectorView.cpp | 2 -- apps/notes_tk/canvas/CanvasDrawingArea.cpp | 2 +- apps/notes_tk/canvas/CanvasView.cpp | 6 ------ apps/notes_tk/image_editor/ImageEditorView.cpp | 1 - apps/notes_tk/image_editor/ImageViewWidget.cpp | 3 +-- apps/notes_tk/mesh_viewer/MeshViewerView.cpp | 4 +--- apps/notes_tk/text_editor/TextEditorView.cpp | 5 +---- apps/notes_tk/web_client/WebClientView.cpp | 1 - src/base/network/CMakeLists.txt | 3 +++ src/base/network/client/win32/WinInetClient.cpp | 0 src/base/network/client/win32/WinInetClient.h | 0 src/rendering/visual_elements/nodes/TextNode.cpp | 6 +++--- src/ui/ui_controls/Button.cpp | 4 ++-- test/graphics/TestD2dRendering.cpp | 4 ++-- test/graphics/TestDirectXRendering.cpp | 4 ++-- 16 files changed, 16 insertions(+), 30 deletions(-) create mode 100644 src/base/network/client/win32/WinInetClient.cpp create mode 100644 src/base/network/client/win32/WinInetClient.h diff --git a/apps/notes_tk/audio_editor/AudioEditorView.cpp b/apps/notes_tk/audio_editor/AudioEditorView.cpp index 1bd2cba..d234cf7 100644 --- a/apps/notes_tk/audio_editor/AudioEditorView.cpp +++ b/apps/notes_tk/audio_editor/AudioEditorView.cpp @@ -8,7 +8,6 @@ AudioEditorView::AudioEditorView() { auto label = Label::Create(); label->setLabel("audio Editor"); - label->setBackground(ThemeToken::SystemToken::Primary); label->setMargin(1); addWidget(std::move(label)); } diff --git a/apps/notes_tk/canvas/CanvasCommandSelectorView.cpp b/apps/notes_tk/canvas/CanvasCommandSelectorView.cpp index 7f4b599..cf50087 100644 --- a/apps/notes_tk/canvas/CanvasCommandSelectorView.cpp +++ b/apps/notes_tk/canvas/CanvasCommandSelectorView.cpp @@ -15,7 +15,6 @@ CanvasCommandSelectorView::CanvasCommandSelectorView() onCommandSelected(CanvasDrawCommand::CIRCLE); }; circle_button->setLabel("Circle"); - circle_button->setBackground(ThemeToken::SystemToken::Primary); circle_button->setMargin(2); circle_button->setOnClickFunction(on_circle_click); @@ -24,7 +23,6 @@ CanvasCommandSelectorView::CanvasCommandSelectorView() }; auto line_button = Button::Create(); line_button->setLabel("Line"); - line_button->setBackground(ThemeToken::SystemToken::Primary); line_button->setMargin(2); line_button->setOnClickFunction(on_line_click); diff --git a/apps/notes_tk/canvas/CanvasDrawingArea.cpp b/apps/notes_tk/canvas/CanvasDrawingArea.cpp index 779ae70..c18d653 100644 --- a/apps/notes_tk/canvas/CanvasDrawingArea.cpp +++ b/apps/notes_tk/canvas/CanvasDrawingArea.cpp @@ -15,7 +15,7 @@ void CanvasDrawingArea::addShapeAt(unsigned x, unsigned y) { if (mActiveDrawingCommand == CanvasDrawCommand::CIRCLE) { - auto circle = std::make_unique(DiscretePoint(x, y), 5); + auto circle = std::make_unique(Transform(DiscretePoint(x, y)), 5); circle->setFillColor(Color(255, 0, 0)); circle->setName("CanvasDrawingArea_CircleNode"); diff --git a/apps/notes_tk/canvas/CanvasView.cpp b/apps/notes_tk/canvas/CanvasView.cpp index 6ef3e0d..3dd447c 100644 --- a/apps/notes_tk/canvas/CanvasView.cpp +++ b/apps/notes_tk/canvas/CanvasView.cpp @@ -36,11 +36,9 @@ void CanvasView::initialize() { auto label = Label::Create(); label->setLabel("Canvas"); - label->setBackground(ThemeToken::SystemToken::Secondary); label->setMargin(1); auto controls = std::make_unique(); - controls->setBackground(ThemeToken::SystemToken::Background); controls->setMargin(1); auto on_draw_command_changed = [this](CanvasDrawCommand command){ @@ -49,7 +47,6 @@ void CanvasView::initialize() controls->setCommandSelectedCallback(on_draw_command_changed); auto drawing_area = std::make_unique(); - drawing_area->setBackground(ThemeToken::SystemToken::Background); drawing_area->setMargin(1); mDrawingArea = drawing_area.get(); @@ -77,17 +74,14 @@ std::unique_ptr CanvasView::initializeCacheButtons() { auto saveButton = Button::Create(); saveButton->setLabel("Save"); - saveButton->setBackground(ThemeToken::SystemToken::Primary); saveButton->setMargin(2); auto clearButton = Button::Create(); clearButton->setLabel("Clear"); - clearButton->setBackground(ThemeToken::SystemToken::Primary); clearButton->setMargin(2); auto loadButton = Button::Create(); loadButton->setLabel("Load"); - loadButton->setBackground(ThemeToken::SystemToken::Primary); loadButton->setMargin(2); auto buttonSpacer = VerticalSpacer::Create(); diff --git a/apps/notes_tk/image_editor/ImageEditorView.cpp b/apps/notes_tk/image_editor/ImageEditorView.cpp index e97e026..ca20ef0 100644 --- a/apps/notes_tk/image_editor/ImageEditorView.cpp +++ b/apps/notes_tk/image_editor/ImageEditorView.cpp @@ -12,7 +12,6 @@ ImageEditorView::ImageEditorView() { auto label = Label::Create(); label->setLabel("Image Editor"); - label->setBackground(ThemeToken::SystemToken::Primary); label->setMargin(1); auto image_widget = std::make_unique(); diff --git a/apps/notes_tk/image_editor/ImageViewWidget.cpp b/apps/notes_tk/image_editor/ImageViewWidget.cpp index e93b575..6e922f7 100644 --- a/apps/notes_tk/image_editor/ImageViewWidget.cpp +++ b/apps/notes_tk/image_editor/ImageViewWidget.cpp @@ -20,7 +20,7 @@ void ImageViewWidget::doPaint(const PaintEvent* event) if (!mGridNode) { - mGridNode = std::make_unique(mLocation); + mGridNode = std::make_unique(Transform(mLocation)); mGridNode->setName(mName + "_GridNode"); mGridNode->setNumX(mNumX); mGridNode->setNumY(mNumY); @@ -35,7 +35,6 @@ void ImageViewWidget::doPaint(const PaintEvent* event) if (mTransformDirty) { - mGridNode->setLocation(mLocation); mGridNode->setWidth(mSize.mWidth); mGridNode->setHeight(mSize.mHeight); } diff --git a/apps/notes_tk/mesh_viewer/MeshViewerView.cpp b/apps/notes_tk/mesh_viewer/MeshViewerView.cpp index c466b62..bcf6d0a 100644 --- a/apps/notes_tk/mesh_viewer/MeshViewerView.cpp +++ b/apps/notes_tk/mesh_viewer/MeshViewerView.cpp @@ -23,7 +23,6 @@ MeshViewerView::~MeshViewerView() MeshViewerView::MeshViewerView() { mName = "MeshViewerView"; - mBackground = ThemeToken::SystemToken::Background; } void MeshViewerView::doPaint(const PaintEvent* event) @@ -35,7 +34,7 @@ void MeshViewerView::doPaint(const PaintEvent* event) if (!mMeshNode) { - mMeshNode = std::make_unique(mLocation); + mMeshNode = std::make_unique(Transform(mLocation)); mMeshNode->setName(mName + "_MeshNode"); mMeshNode->setWidth(mSize.mWidth); @@ -48,7 +47,6 @@ void MeshViewerView::doPaint(const PaintEvent* event) if (mTransformDirty) { - mMeshNode->setLocation(mLocation); mMeshNode->setWidth(mSize.mWidth); mMeshNode->setHeight(mSize.mHeight); } diff --git a/apps/notes_tk/text_editor/TextEditorView.cpp b/apps/notes_tk/text_editor/TextEditorView.cpp index d8d0465..8dffbc8 100644 --- a/apps/notes_tk/text_editor/TextEditorView.cpp +++ b/apps/notes_tk/text_editor/TextEditorView.cpp @@ -25,7 +25,6 @@ void TextEditorView::initialize() { auto label = Label::Create(); label->setLabel("Text Editor"); - label->setBackground(ThemeToken::SystemToken::Secondary); label->setMargin(1); auto textBox = TextBox::Create(); @@ -34,7 +33,7 @@ void TextEditorView::initialize() auto saveButton = Button::Create(); saveButton->setLabel("Save"); - saveButton->setBackground(ThemeToken::SystemToken::Primary); + saveButton->setBackground(Theme::Sys::Color::Primary); saveButton->setMargin(2); auto onSave = [this](Widget* self){ if(this && mController && mTextBox) @@ -47,7 +46,6 @@ void TextEditorView::initialize() auto clearButton = Button::Create(); clearButton->setLabel("Clear"); - clearButton->setBackground(ThemeToken::SystemToken::Primary); clearButton->setMargin(2); auto onClear = [this](Widget* self){ if(this && mController && mTextBox) @@ -60,7 +58,6 @@ void TextEditorView::initialize() auto loadButton = Button::Create(); loadButton->setLabel("Load"); - loadButton->setBackground(ThemeToken::SystemToken::Primary); loadButton->setMargin(2); auto onLoad = [this](Widget* self){ if(this && mController && mTextBox) diff --git a/apps/notes_tk/web_client/WebClientView.cpp b/apps/notes_tk/web_client/WebClientView.cpp index 58123bd..92c9b6f 100644 --- a/apps/notes_tk/web_client/WebClientView.cpp +++ b/apps/notes_tk/web_client/WebClientView.cpp @@ -10,7 +10,6 @@ WebClientView::WebClientView() { auto label = Label::Create(); label->setLabel("Web Client"); - label->setBackground(ThemeToken::SystemToken::Secondary); label->setMargin(1); addWidget(std::move(label)); } diff --git a/src/base/network/CMakeLists.txt b/src/base/network/CMakeLists.txt index 6450b3c..c29b173 100644 --- a/src/base/network/CMakeLists.txt +++ b/src/base/network/CMakeLists.txt @@ -18,6 +18,8 @@ list(APPEND platform_INCLUDES server/win32/Win32WebResponse.cpp server/win32/Win32Buffer.h server/win32/Win32Buffer.cpp + client/win32/WinInetClient.h + client/win32/WinInetClient.cpp ) list(APPEND platform_LIBS Httpapi.lib) endif() @@ -43,6 +45,7 @@ target_include_directories(${MODULE_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/sockets ${CMAKE_CURRENT_SOURCE_DIR}/web ${CMAKE_CURRENT_SOURCE_DIR}/server/win32 + ${CMAKE_CURRENT_SOURCE_DIR}/client/win32 ) set_target_properties( ${MODULE_NAME} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON ) target_link_libraries( ${MODULE_NAME} PUBLIC core ${platform_LIBS}) diff --git a/src/base/network/client/win32/WinInetClient.cpp b/src/base/network/client/win32/WinInetClient.cpp new file mode 100644 index 0000000..e69de29 diff --git a/src/base/network/client/win32/WinInetClient.h b/src/base/network/client/win32/WinInetClient.h new file mode 100644 index 0000000..e69de29 diff --git a/src/rendering/visual_elements/nodes/TextNode.cpp b/src/rendering/visual_elements/nodes/TextNode.cpp index 46cdf25..fa7576e 100644 --- a/src/rendering/visual_elements/nodes/TextNode.cpp +++ b/src/rendering/visual_elements/nodes/TextNode.cpp @@ -167,9 +167,9 @@ void TextNode::update(SceneInfo* sceneInfo) if (mTransformIsDirty) { //mTextItem->updateTransform({mLocation}); - //mTextItem->setTextWidth(mWidth); - //mTextItem->setTextHeight(mHeight); - //mTransformIsDirty = false; + mTextItem->setTextWidth(mWidth); + mTextItem->setTextHeight(mHeight); + mTransformIsDirty = false; } if (mMaterialIsDirty) diff --git a/src/ui/ui_controls/Button.cpp b/src/ui/ui_controls/Button.cpp index c9a6464..8986134 100644 --- a/src/ui/ui_controls/Button.cpp +++ b/src/ui/ui_controls/Button.cpp @@ -220,7 +220,7 @@ void Button::updateLabel(const PaintEvent* event) { if (!mTextNode) { - mTextNode = TextNode::Create(mLabel, Transform({ mSize.mWidth /2.0, mSize.mHeight / 2.0 })); + mTextNode = TextNode::Create(mLabel, Transform()); mTextNode->setName(mName + "_TextNode"); mTextNode->setContent(mLabel); mTextNode->setWidth(mSize.mWidth); @@ -255,7 +255,7 @@ void Button::updateIcon(const PaintEvent* event) { if (!mIconNode && mIcon != Resource::Icon::Svg::NONE) { - mIconNode = std::make_unique(Transform()); + mIconNode = std::make_unique(Transform(Point(15.0, 8.0), 0.5, 0.5)); mIconNode->setName(mName + "_IconNode"); mIconNode->setSvgContent(MediaResourceManager::getSvgIconNode(mIcon)); mRootNode->addChild(mIconNode.get()); diff --git a/test/graphics/TestD2dRendering.cpp b/test/graphics/TestD2dRendering.cpp index 55db059..2484046 100644 --- a/test/graphics/TestD2dRendering.cpp +++ b/test/graphics/TestD2dRendering.cpp @@ -18,10 +18,10 @@ TEST_CASE(TestD2dRendering, "graphics") auto gui_app = TestCaseRunner::getInstance().getTestApplication(); auto scene = gui_app->getMainWindowScene(); - auto rect = std::make_unique(Point(10, 10), 200.0, 200.0); + auto rect = std::make_unique(Transform(Point(10, 10)), 200.0, 200.0); scene->addNode(rect.get()); - auto text_node = std::make_unique("Test2", Point(100, 100)); + auto text_node = std::make_unique("Test2", Transform(Point(100, 100))); scene->addNode(text_node.get()); scene->update(); diff --git a/test/graphics/TestDirectXRendering.cpp b/test/graphics/TestDirectXRendering.cpp index b11dfa7..517d1ca 100644 --- a/test/graphics/TestDirectXRendering.cpp +++ b/test/graphics/TestDirectXRendering.cpp @@ -25,11 +25,11 @@ TEST_CASE(TestDirectXRendering, "graphics") auto scene = drawing_context->getScene(); auto mesh = MeshPrimitives::buildRectangleAsTriMesh(); - auto mesh_node = std::make_unique(DiscretePoint(0, 0)); + auto mesh_node = std::make_unique(Transform(DiscretePoint(0, 0))); mesh_node->setMesh(mesh.get()); scene->addNode(mesh_node.get()); - auto text_node = std::make_unique("Test", DiscretePoint(100, 100)); + auto text_node = std::make_unique("Test", Transform(DiscretePoint(100, 100))); scene->addNode(text_node.get()); scene->update();