Skip to content

Commit b792391

Browse files
committed
Initial commit
0 parents  commit b792391

18 files changed

+526
-0
lines changed

.clang-format

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
BasedOnStyle: Mozilla
3+
AllowAllArgumentsOnNextLine: false
4+
AlwaysBreakAfterDefinitionReturnType: None
5+
AlwaysBreakAfterReturnType: None
6+
BraceWrapping:
7+
AfterCaseLabel: false
8+
AfterClass: true
9+
AfterControlStatement: Never
10+
AfterEnum: true
11+
AfterFunction: true
12+
AfterNamespace: true
13+
AfterObjCDeclaration: false
14+
AfterStruct: true
15+
AfterUnion: true
16+
AfterExternBlock: true
17+
BeforeCatch: false
18+
BeforeElse: false
19+
BeforeLambdaBody: false
20+
BeforeWhile: false
21+
IndentBraces: false
22+
SplitEmptyFunction: true
23+
SplitEmptyRecord: false
24+
SplitEmptyNamespace: true
25+
BreakBeforeBraces: Custom
26+
BreakBeforeTernaryOperators: false
27+
BreakConstructorInitializers: AfterColon
28+
ColumnLimit: 200
29+
ConstructorInitializerIndentWidth: 4
30+
ContinuationIndentWidth: 4
31+
FixNamespaceComments: true
32+
IncludeBlocks: Merge
33+
IndentAccessModifiers: true
34+
IndentWidth: 4
35+
PackConstructorInitializers: Never
36+
PointerAlignment: Right
37+
SortIncludes: Never
38+
SortUsingDeclarations: false
39+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
40+
AllowAllConstructorInitializersOnNextLine: true
41+
AllowShortFunctionsOnASingleLine: InlineOnly
42+
SpaceInEmptyBlock: true
43+
PenaltyIndentedWhitespace: 100

.gitignore

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# This file is used to ignore files which are generated
2+
# ----------------------------------------------------------------------------
3+
4+
*~
5+
*.autosave
6+
*.a
7+
*.core
8+
*.moc
9+
*.o
10+
*.obj
11+
*.orig
12+
*.rej
13+
*.so
14+
*.so.*
15+
*_pch.h.cpp
16+
*_resource.rc
17+
*.qm
18+
.#*
19+
*.*#
20+
core
21+
!core/
22+
tags
23+
.DS_Store
24+
.directory
25+
*.debug
26+
Makefile*
27+
*.prl
28+
*.app
29+
moc_*.cpp
30+
ui_*.h
31+
qrc_*.cpp
32+
Thumbs.db
33+
*.res
34+
*.rc
35+
/.qmake.cache
36+
/.qmake.stash
37+
38+
# qtcreator generated files
39+
*.pro.user*
40+
*.user
41+
42+
# xemacs temporary files
43+
*.flc
44+
45+
# Vim temporary files
46+
.*.swp
47+
48+
# Visual Studio generated files
49+
*.ib_pdb_index
50+
*.idb
51+
*.ilk
52+
*.pdb
53+
*.sln
54+
*.suo
55+
*.vcproj
56+
*vcproj.*.*.user
57+
*.ncb
58+
*.sdf
59+
*.opensdf
60+
*.vcxproj
61+
*vcxproj.*
62+
63+
# MinGW generated files
64+
*.Debug
65+
*.Release
66+
67+
# Python byte code
68+
*.pyc
69+
70+
# Binaries
71+
# --------
72+
*.dll
73+
*.exe
74+

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "scratchcpp-render"]
2+
path = scratchcpp-render
3+
url = https://github.com/scratchcpp/scratchcpp-render

CMakeLists.txt

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
cmake_minimum_required(VERSION 3.16)
2+
3+
project(scratchcpp-player VERSION 0.1 LANGUAGES CXX)
4+
5+
set(CMAKE_AUTOMOC ON)
6+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
7+
8+
find_package(Qt6 6.6 COMPONENTS Quick QuickControls2 REQUIRED)
9+
10+
add_subdirectory(src)
11+
add_subdirectory(res)
12+
13+
set_target_properties(appscratchcpp-player PROPERTIES
14+
MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com
15+
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
16+
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
17+
MACOSX_BUNDLE TRUE
18+
WIN32_EXECUTABLE TRUE
19+
)
20+
21+
target_compile_definitions(appscratchcpp-player
22+
PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
23+
target_link_libraries(appscratchcpp-player
24+
PRIVATE Qt6::Quick Qt6::QuickControls2)
25+
26+
set(SCRATCHCPPRENDER_BUILD_UNIT_TESTS OFF)
27+
add_subdirectory(scratchcpp-render)
28+
target_link_libraries(appscratchcpp-player PRIVATE scratchcpp-render scratchcpp-renderplugin)

README.md

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
<!-- Improved compatibility of back to top link: See: https://github.com/othneildrew/Best-README-Template/pull/73 -->
2+
<a name="readme-top"></a>
3+
4+
<!-- PROJECT SHIELDS -->
5+
<!--
6+
*** I'm using markdown "reference style" links for readability.
7+
*** Reference links are enclosed in brackets [ ] instead of parentheses ( ).
8+
*** See the bottom of this document for the declaration of the reference variables
9+
*** for contributors-url, forks-url, etc. This is an optional, concise syntax you may use.
10+
*** https://www.markdownguide.org/basic-syntax/#reference-style-links
11+
-->
12+
[![Contributors][contributors-shield]][contributors-url]
13+
[![Forks][forks-shield]][forks-url]
14+
[![Stargazers][stars-shield]][stars-url]
15+
[![Issues][issues-shield]][issues-url]
16+
[![MIT License][license-shield]][license-url]
17+
18+
19+
20+
<!-- PROJECT LOGO -->
21+
<br />
22+
<div align="center">
23+
<!-- TODO: Add logo: <a href="https://github.com/scratchcpp/scratchcpp-player">
24+
<img src="images/logo.png" alt="Logo" width="80" height="80">
25+
</a> -->
26+
27+
<h3 align="center">ScratchCPP Player</h3>
28+
29+
<p align="center">
30+
ScratchCPP is an application which runs Scratch projects, written in C++ and QML.
31+
It uses the <a href="https://github.com/scratchcpp/scratchcpp-render">scratchcpp-render</a> library for rendering,
32+
which uses <a href="https://github.com/scratchcpp/libscratchcpp">libscratchcpp</a> to parse and run Scratch projects.
33+
<br />
34+
<!-- TODO: Add link to documentation: <a href="https://github.com/scratchcpp/scratchcpp-player"><strong>Explore the docs »</strong></a>
35+
<br /> -->
36+
<br />
37+
<a href="https://github.com/scratchcpp/scratchcpp-player/issues">Report Bug</a>
38+
·
39+
<a href="https://github.com/scratchcpp/scratchcpp-player/issues">Request Feature</a>
40+
</p>
41+
</div>
42+
43+
44+
45+
<!-- TABLE OF CONTENTS -->
46+
<details>
47+
<summary>Table of Contents</summary>
48+
<ol>
49+
<li>
50+
<a href="#about-the-project">About The Project</a>
51+
</li>
52+
<li>
53+
<a href="#getting-started">Getting Started</a>
54+
</li>
55+
<li><a href="#usage">Usage</a></li>
56+
<li><a href="#roadmap">Roadmap</a></li>
57+
<li><a href="#contributing">Contributing</a></li>
58+
<li><a href="#license">License</a></li>
59+
</ol>
60+
</details>
61+
62+
63+
64+
<!-- ABOUT THE PROJECT -->
65+
## About The Project
66+
67+
**ScratchCPP** is an ongoing project to build a fast and lightweight Scratch project player.
68+
It might not be as fast as TurboWarp (yet), but the main goal is to develop a project player
69+
that is **lightweight**.
70+
71+
Scratch requires a web browser to run and web browsers typically require a lot of resources (memory).
72+
The ScratchCPP project player doesn't depend on a web browsers and uses less memory.
73+
74+
## NOTE
75+
This application is still in development and it doesn't run most Scratch projects correctly.
76+
77+
<p align="right">(<a href="#readme-top">back to top</a>)</p>
78+
79+
80+
81+
<!-- GETTING STARTED -->
82+
## Getting Started
83+
84+
We're working on the documentation, it'll be available soon.
85+
<!-- TODO: Add link to documentation -->
86+
87+
<p align="right">(<a href="#readme-top">back to top</a>)</p>
88+
89+
90+
91+
<!-- USAGE EXAMPLES -->
92+
## Usage
93+
The UI is very simple to use. Paste the project URL in the text box and press the `Load` button.
94+
When the project loads, click on the green flag button to run it.
95+
96+
<p align="right">(<a href="#readme-top">back to top</a>)</p>
97+
98+
99+
100+
<!-- ROADMAP -->
101+
## Roadmap
102+
103+
- [x] Loading from URL
104+
- [ ] Loading from a local file (path to the file can be used as a URL until this is implemented)
105+
- [x] Green flag button
106+
- [x] Stop button
107+
- [ ] Turbo mode
108+
- [ ] FPS options
109+
- [ ] Stage size options
110+
- [ ] HQ pen
111+
- [ ] Mute sounds
112+
- [ ] Theme options (light/dark mode, accent color, etc.)
113+
114+
See the [open issues](https://github.com/scratchcpp/scratchcpp-player/issues) for a full list of proposed features (and known issues).
115+
116+
<p align="right">(<a href="#readme-top">back to top</a>)</p>
117+
118+
119+
120+
<!-- CONTRIBUTING -->
121+
## Contributing
122+
123+
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.
124+
125+
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
126+
Don't forget to give the project a star! Thanks again!
127+
128+
1. Fork the Project
129+
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
130+
3. Format changed source files (`clang-format src/some_file.cpp`)
131+
4. Commit your Changes (`git add -A && git commit -m 'Add some AmazingFeature'`)
132+
5. Push to the Branch (`git push origin feature/AmazingFeature`)
133+
6. Open a Pull Request
134+
135+
<p align="right">(<a href="#readme-top">back to top</a>)</p>
136+
137+
138+
139+
<!-- LICENSE -->
140+
## License
141+
142+
Distributed under the GNU General Public License. See [LICENSE](LICENSE) for more information.
143+
144+
<p align="right">(<a href="#readme-top">back to top</a>)</p>
145+
146+
147+
148+
<!-- MARKDOWN LINKS & IMAGES -->
149+
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
150+
[contributors-shield]: https://img.shields.io/github/contributors/scratchcpp/scratchcpp-player.svg?style=for-the-badge
151+
[contributors-url]: https://github.com/scratchcpp/scratchcpp-player/graphs/contributors
152+
[forks-shield]: https://img.shields.io/github/forks/scratchcpp/scratchcpp-player.svg?style=for-the-badge
153+
[forks-url]: https://github.com/scratchcpp/scratchcpp-player/network/members
154+
[stars-shield]: https://img.shields.io/github/stars/scratchcpp/scratchcpp-player.svg?style=for-the-badge
155+
[stars-url]: https://github.com/scratchcpp/scratchcpp-player/stargazers
156+
[issues-shield]: https://img.shields.io/github/issues/scratchcpp/scratchcpp-player.svg?style=for-the-badge
157+
[issues-url]: https://github.com/scratchcpp/scratchcpp-player/issues
158+
[license-shield]: https://img.shields.io/github/license/scratchcpp/scratchcpp-player.svg?style=for-the-badge
159+
[license-url]: https://github.com/scratchcpp/scratchcpp-player/blob/master/LICENSE

res/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
add_subdirectory(icons)

res/icons/CMakeLists.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
qt_add_resources(
2+
appscratchcpp-player "icon_theme"
3+
PREFIX "/icons/scratchcpp"
4+
FILES
5+
index.theme
6+
)
7+
8+
qt_add_resources(
9+
appscratchcpp-player "icons"
10+
PREFIX "/icons/scratchcpp/32x32"
11+
FILES
12+
green_flag.svg
13+
stop.svg
14+
)

res/icons/green_flag.svg

Lines changed: 1 addition & 0 deletions
Loading

res/icons/index.theme

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[Icon Theme]
2+
Name=scratchcpp
3+
Comment=ScratchCPP icon theme
4+
5+
Directories=32x32
6+
7+
[32x32]
8+
Size=32
9+
Type=Scalable

res/icons/stop.svg

Lines changed: 9 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)