Skip to content

Commit 3a90fe0

Browse files
authored
Merge pull request #72 from Prayag2/dev/svg
Fixes conflicts from #70
2 parents b12eca1 + 34a69a9 commit 3a90fe0

File tree

209 files changed

+4146
-4128
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

209 files changed

+4146
-4128
lines changed

.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
root = true
2+
3+
# Unix-style newlines with a newline ending every file
4+
[*]
5+
end_of_line = lf
6+
insert_final_newline = true
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
10+
[*.nix]
11+
indent_style = space
12+
indent_size = 2
13+
14+
[*.cpp,*.hpp,*.h]
15+
indent_style = space
16+
indent_size = 4

CMakeLists.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ set(CMAKE_AUTOUIC ON)
77
set(CMAKE_AUTOMOC ON)
88
set(CMAKE_AUTORCC ON)
99

10-
set(CMAKE_CXX_STANDARD 17)
10+
set(CMAKE_CXX_STANDARD 23)
1111
set(CMAKE_CXX_STANDARD_REQUIRED ON)
1212

1313

@@ -27,7 +27,7 @@ set(SRC_DIR ${CMAKE_SOURCE_DIR}/src)
2727
# Use globbing to recursively collect all source, header, and resource files from src/.
2828
file(GLOB_RECURSE SRC_FILES
2929
"${SRC_DIR}/*.cpp"
30-
"${SRC_DIR}/*.h"
30+
"${SRC_DIR}/*.hpp"
3131
"${SRC_DIR}/*.qrc"
3232
"${SRC_DIR}/*.qss"
3333
)
@@ -39,6 +39,9 @@ qt_add_executable(${PROJECT_NAME}
3939
MANUAL_FINALIZATION
4040
${PROJECT_SOURCES}
4141
)
42+
43+
add_subdirectory(deps)
44+
4245
qt_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES})
4346

4447
target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::OpenGLWidgets)
@@ -71,5 +74,3 @@ if (UNIX AND NOT APPLE)
7174
install(FILES assets/logo.svg DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/icons/hicolor/scalable/apps RENAME io.github.prayag2.Drawy.svg)
7275
install(FILES deploy/linux/io.github.prayag2.Drawy.metainfo.xml.in DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/metainfo/ RENAME io.github.prayag2.Drawy.metainfo.xml)
7376
endif()
74-
75-
qt_finalize_executable(${PROJECT_NAME})

deps/CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
include(FetchContent)
2+
3+
FetchContent_Declare(
4+
kanzi
5+
URL https://github.com/flanglet/kanzi-cpp/archive/refs/tags/2.4.0.zip
6+
URL_MD5 ec451cdab40362e9e4af8e5ca780a07d
7+
)
8+
9+
add_subdirectory(kanzi)
10+
11+
# find_package(tinyxml2 REQUIRED)
12+
# target_link_libraries(${PROJECT_NAME} PRIVATE tinyxml2::tinyxml2)

deps/kanzi/CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
message(STATUS "Fetching kanzi...")
2+
3+
FetchContent_GetProperties(kanzi)
4+
FetchContent_MakeAvailable(kanzi)
5+
6+
message(STATUS "kanzi_SOURCE_DIR=${kanzi_SOURCE_DIR}")
7+
8+
add_subdirectory(${kanzi_SOURCE_DIR}/src ${kanzi_BINARY_DIR})
9+
10+
target_link_libraries(drawy PRIVATE libkanzi)
11+
target_include_directories(drawy PRIVATE ${kanzi_SOURCE_DIR}/src)

flake.nix

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,13 @@
5757
src = ./.;
5858
hooks = {
5959
nixfmt-rfc-style.enable = true;
60-
mirrors-clang-format = {
61-
entry = "${pkgs.clang-tools}/bin/clang-format";
60+
clang-format = {
6261
enable = true;
62+
package = pkgs.clang-tools;
63+
types_or = pkgs.lib.mkForce [
64+
"c"
65+
"c++"
66+
];
6367
};
6468
};
6569
};

src/canvas/canvas.cpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
/*
2-
* Drawy - A simple brainstorming tool with an infinite canvas
3-
* Copyright (C) 2025 - Prayag Jain <[email protected]>
4-
*
5-
* This program is free software: you can redistribute it and/or modify
6-
* it under the terms of the GNU General Public License as published by
7-
* the Free Software Foundation, either version 3 of the License, or
8-
* (at your option) any later version.
9-
*
10-
* This program is distributed in the hope that it will be useful,
11-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13-
* GNU General Public License for more details.
14-
*
15-
* You should have received a copy of the GNU General Public License
16-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17-
*/
18-
19-
#include "canvas.h"
2+
* Drawy - A simple brainstorming tool with an infinite canvas
3+
* Copyright (C) 2025 - Prayag Jain <[email protected]>
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17+
*/
18+
19+
#include "canvas.hpp"
2020

2121
#include <QBuffer>
2222
#include <QResizeEvent>
Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
11
/*
2-
* Drawy - A simple brainstorming tool with an infinite canvas
3-
* Copyright (C) 2025 - Prayag Jain <[email protected]>
4-
*
5-
* This program is free software: you can redistribute it and/or modify
6-
* it under the terms of the GNU General Public License as published by
7-
* the Free Software Foundation, either version 3 of the License, or
8-
* (at your option) any later version.
9-
*
10-
* This program is distributed in the hope that it will be useful,
11-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13-
* GNU General Public License for more details.
14-
*
15-
* You should have received a copy of the GNU General Public License
16-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17-
*/
2+
* Drawy - A simple brainstorming tool with an infinite canvas
3+
* Copyright (C) 2025 - Prayag Jain <[email protected]>
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17+
*/
1818

19-
#ifndef CANVAS_H
20-
#define CANVAS_H
19+
#pragma once
2120

2221
#include <QPainter>
2322
#include <QWidget>
@@ -88,5 +87,3 @@ public slots:
8887
static void setImageData(QPixmap *const img, const QByteArray &arr);
8988
void resize();
9089
};
91-
92-
#endif // CANVAS_H

src/command/command.h

Lines changed: 0 additions & 30 deletions
This file was deleted.

src/command/command.hpp

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Drawy - A simple brainstorming tool with an infinite canvas
3+
* Copyright (C) 2025 - Prayag Jain <[email protected]>
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17+
*/
18+
19+
#pragma once
20+
21+
class ApplicationContext;
22+
23+
class Command {
24+
public:
25+
virtual void execute(ApplicationContext *context) = 0;
26+
virtual void undo(ApplicationContext *context) = 0;
27+
};

src/command/commandhistory.cpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
/*
2-
* Drawy - A simple brainstorming tool with an infinite canvas
3-
* Copyright (C) 2025 - Prayag Jain <[email protected]>
4-
*
5-
* This program is free software: you can redistribute it and/or modify
6-
* it under the terms of the GNU General Public License as published by
7-
* the Free Software Foundation, either version 3 of the License, or
8-
* (at your option) any later version.
9-
*
10-
* This program is distributed in the hope that it will be useful,
11-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13-
* GNU General Public License for more details.
14-
*
15-
* You should have received a copy of the GNU General Public License
16-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17-
*/
18-
19-
#include "commandhistory.h"
2+
* Drawy - A simple brainstorming tool with an infinite canvas
3+
* Copyright (C) 2025 - Prayag Jain <[email protected]>
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17+
*/
18+
19+
#include "commandhistory.hpp"
2020

2121
#include <QDebug>
2222

0 commit comments

Comments
 (0)