-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6645933
commit 633ecfb
Showing
17 changed files
with
336 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// Copyright (c) 2024 Darby Johnston | ||
// All rights reserved. | ||
|
||
#include "Export.h" | ||
|
||
namespace toucan | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// Copyright (c) 2024 Darby Johnston | ||
// All rights reserved. | ||
|
||
#pragma once | ||
|
||
namespace toucan | ||
{ | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// Copyright (c) 2024 Darby Johnston | ||
// All rights reserved. | ||
|
||
#include "ExportTool.h" | ||
|
||
namespace toucan | ||
{ | ||
void ExportWidget::_init( | ||
const std::shared_ptr<dtk::Context>& context, | ||
const std::shared_ptr<dtk::IWidget>& parent) | ||
{ | ||
IWidget::_init(context, "toucan::ExportWidget", parent); | ||
|
||
_layout = dtk::VerticalLayout::create(context, shared_from_this()); | ||
} | ||
|
||
ExportWidget::~ExportWidget() | ||
{} | ||
|
||
std::shared_ptr<ExportWidget> ExportWidget::create( | ||
const std::shared_ptr<dtk::Context>& context, | ||
const std::shared_ptr<dtk::IWidget>& parent) | ||
{ | ||
auto out = std::shared_ptr<ExportWidget>(new ExportWidget); | ||
out->_init(context, parent); | ||
return out; | ||
} | ||
|
||
void ExportWidget::setGeometry(const dtk::Box2I& value) | ||
{ | ||
IWidget::setGeometry(value); | ||
_layout->setGeometry(value); | ||
} | ||
|
||
void ExportWidget::sizeHintEvent(const dtk::SizeHintEvent& event) | ||
{ | ||
IWidget::sizeHintEvent(event); | ||
_setSizeHint(_layout->getSizeHint()); | ||
} | ||
|
||
void ExportTool::_init( | ||
const std::shared_ptr<dtk::Context>& context, | ||
const std::shared_ptr<App>& app, | ||
const std::shared_ptr<dtk::IWidget>& parent) | ||
{ | ||
IToolWidget::_init(context, app, "toucan::ExportTool", "Export", parent); | ||
|
||
_layout = dtk::VerticalLayout::create(context, shared_from_this()); | ||
_layout->setSpacingRole(dtk::SizeRole::None); | ||
} | ||
|
||
ExportTool::~ExportTool() | ||
{} | ||
|
||
std::shared_ptr<ExportTool> ExportTool::create( | ||
const std::shared_ptr<dtk::Context>& context, | ||
const std::shared_ptr<App>& app, | ||
const std::shared_ptr<dtk::IWidget>& parent) | ||
{ | ||
auto out = std::shared_ptr<ExportTool>(new ExportTool); | ||
out->_init(context, app, parent); | ||
return out; | ||
} | ||
|
||
void ExportTool::setGeometry(const dtk::Box2I& value) | ||
{ | ||
IToolWidget::setGeometry(value); | ||
_layout->setGeometry(value); | ||
} | ||
|
||
void ExportTool::sizeHintEvent(const dtk::SizeHintEvent& event) | ||
{ | ||
IToolWidget::sizeHintEvent(event); | ||
_setSizeHint(_layout->getSizeHint()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// Copyright (c) 2024 Darby Johnston | ||
// All rights reserved. | ||
|
||
#pragma once | ||
|
||
#include "IToolWidget.h" | ||
|
||
#include <dtk/ui/RowLayout.h> | ||
|
||
namespace toucan | ||
{ | ||
class ExportWidget : public dtk::IWidget | ||
{ | ||
protected: | ||
void _init( | ||
const std::shared_ptr<dtk::Context>&, | ||
const std::shared_ptr<IWidget>& parent); | ||
|
||
public: | ||
virtual ~ExportWidget(); | ||
|
||
static std::shared_ptr<ExportWidget> create( | ||
const std::shared_ptr<dtk::Context>&, | ||
const std::shared_ptr<IWidget>& parent = nullptr); | ||
|
||
void setGeometry(const dtk::Box2I&) override; | ||
void sizeHintEvent(const dtk::SizeHintEvent&) override; | ||
|
||
private: | ||
std::shared_ptr<dtk::VerticalLayout> _layout; | ||
}; | ||
|
||
class ExportTool : public IToolWidget | ||
{ | ||
protected: | ||
void _init( | ||
const std::shared_ptr<dtk::Context>&, | ||
const std::shared_ptr<App>&, | ||
const std::shared_ptr<IWidget>& parent); | ||
|
||
public: | ||
virtual ~ExportTool(); | ||
|
||
static std::shared_ptr<ExportTool> create( | ||
const std::shared_ptr<dtk::Context>&, | ||
const std::shared_ptr<App>&, | ||
const std::shared_ptr<IWidget>& parent = nullptr); | ||
|
||
void setGeometry(const dtk::Box2I&) override; | ||
void sizeHintEvent(const dtk::SizeHintEvent&) override; | ||
|
||
private: | ||
std::shared_ptr<dtk::VerticalLayout> _layout; | ||
std::shared_ptr<ExportWidget> _widget; | ||
}; | ||
} | ||
|
Oops, something went wrong.