-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'Areas-and-comments-part-2'
- Loading branch information
Showing
47 changed files
with
824 additions
and
280 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) | |
|
||
project( | ||
"ponc" | ||
VERSION 0.5.2 | ||
VERSION 0.5.3 | ||
LANGUAGES CXX | ||
) | ||
|
||
|
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,62 @@ | ||
/** | ||
* PONC @link https://github.com/qoala101/ponc @endlink | ||
* @author Volodymyr Hromakov (4y5t6r@gmail.com) | ||
* @copyright Copyright (c) 2023, MIT License | ||
*/ | ||
|
||
#ifndef VH_PONC_COREUI_AREA_CREATOR_H_ | ||
#define VH_PONC_COREUI_AREA_CREATOR_H_ | ||
|
||
#include <imgui.h> | ||
#include <imgui_node_editor.h> | ||
|
||
#include <optional> | ||
|
||
#include "core_area.h" | ||
#include "core_id_generator.h" | ||
#include "coreui_event.h" | ||
#include "cpp_safe_ptr.h" | ||
|
||
namespace vh::ponc::coreui { | ||
/// | ||
class Diagram; | ||
|
||
/// | ||
class AreaCreator { | ||
public: | ||
/// | ||
AreaCreator(cpp::SafePtr<Diagram> parent_diagram, | ||
cpp::SafePtr<core::IdGenerator> id_generator); | ||
|
||
/// | ||
auto IsCreating() const -> bool; | ||
/// | ||
auto StartCreateAreaAt(const ImVec2 &start_pos) -> Event &; | ||
/// | ||
void ResizeAreaTo(const ImVec2 &pos); | ||
/// | ||
void AcceptCreateArea(); | ||
/// | ||
auto DiscardCreateArea() -> Event &; | ||
|
||
private: | ||
/// | ||
struct Area { | ||
/// | ||
core::AreaId id{}; | ||
/// | ||
ImVec2 start_pos{}; | ||
}; | ||
|
||
/// | ||
cpp::SafePtr<Diagram> parent_diagram_; | ||
/// | ||
cpp::SafePtr<core::IdGenerator> id_generator_; | ||
/// | ||
cpp::SafeOwner safe_owner_{}; | ||
/// | ||
std::optional<Area> area_{}; | ||
}; | ||
} // namespace vh::ponc::coreui | ||
|
||
#endif // VH_PONC_COREUI_AREA_CREATOR_H_ |
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,30 @@ | ||
/** | ||
* PONC @link https://github.com/qoala101/ponc @endlink | ||
* @author Volodymyr Hromakov (4y5t6r@gmail.com) | ||
* @copyright Copyright (c) 2023, MIT License | ||
*/ | ||
|
||
#ifndef VH_PONC_DRAW_AREA_CREATOR_H_ | ||
#define VH_PONC_DRAW_AREA_CREATOR_H_ | ||
|
||
#include "coreui_area_creator.h" | ||
|
||
namespace vh::ponc::draw { | ||
/// | ||
class AreaCreator { | ||
public: | ||
/// | ||
void Draw(coreui::AreaCreator &area_creator); | ||
|
||
private: | ||
/// | ||
void Reset(); | ||
|
||
/// | ||
bool right_mouse_clicked_{}; | ||
/// | ||
bool right_mouse_dragged_{}; | ||
}; | ||
} // namespace vh::ponc::draw | ||
|
||
#endif // VH_PONC_DRAW_AREA_CREATOR_H_ |
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,37 @@ | ||
/** | ||
* PONC @link https://github.com/qoala101/ponc @endlink | ||
* @author Volodymyr Hromakov (4y5t6r@gmail.com) | ||
* @copyright Copyright (c) 2023, MIT License | ||
*/ | ||
|
||
#ifndef VH_PONC_DRAW_AREA_POPUP_H_ | ||
#define VH_PONC_DRAW_AREA_POPUP_H_ | ||
|
||
#include <vector> | ||
|
||
#include "core_area.h" | ||
#include "coreui_diagram.h" | ||
#include "cpp_callbacks.h" | ||
#include "draw_string_buffer.h" | ||
|
||
namespace vh::ponc::draw { | ||
/// | ||
class AreaPopup { | ||
public: | ||
/// | ||
struct Callbacks { | ||
/// | ||
cpp::Query<bool> was_just_opened{}; | ||
}; | ||
|
||
/// | ||
void Draw(const std::vector<core::AreaId> &selected_areas, | ||
coreui::Diagram &diagram, const Callbacks &callbacks); | ||
|
||
private: | ||
/// | ||
StringBuffer rename_buffer_{}; | ||
}; | ||
} // namespace vh::ponc::draw | ||
|
||
#endif // VH_PONC_DRAW_AREA_POPUP_H_ |
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,20 @@ | ||
/** | ||
* PONC @link https://github.com/qoala101/ponc @endlink | ||
* @author Volodymyr Hromakov (4y5t6r@gmail.com) | ||
* @copyright Copyright (c) 2023, MIT License | ||
*/ | ||
|
||
#ifndef VH_PONC_DRAW_RENAME_WIDGET_H_ | ||
#define VH_PONC_DRAW_RENAME_WIDGET_H_ | ||
|
||
#include <string_view> | ||
|
||
#include "draw_string_buffer.h" | ||
|
||
namespace vh::ponc::draw { | ||
/// | ||
auto DrawRenameWidget(std::string_view label, StringBuffer &name_buffer) | ||
-> bool; | ||
} // namespace vh::ponc::draw | ||
|
||
#endif // VH_PONC_DRAW_RENAME_WIDGET_H_ |
Oops, something went wrong.