Skip to content

Commit d18b326

Browse files
committed
Update libscratchcpp to latest master
1 parent 063ff38 commit d18b326

20 files changed

+92
-182
lines changed

libscratchcpp

Submodule libscratchcpp updated 85 files

src/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ qt_add_qml_module(scratchcpp-render
7474
cputexturemanager.h
7575
effecttransform.cpp
7676
effecttransform.h
77-
blocks/penextension.cpp
78-
blocks/penextension.h
7977
blocks/penblocks.cpp
8078
blocks/penblocks.h
8179
)

src/blocks/penblocks.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,12 @@ const std::unordered_map<std::string, PenBlocks::ColorParam>
2626

2727
std::string PenBlocks::name() const
2828
{
29-
return "Pen";
29+
return "pen";
30+
}
31+
32+
std::string PenBlocks::description() const
33+
{
34+
return "Pen blocks";
3035
}
3136

3237
void PenBlocks::registerBlocks(IEngine *engine)

src/blocks/penblocks.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
#pragma once
44

55
#include <QColor>
6-
#include <scratchcpp/iblocksection.h>
6+
#include <scratchcpp/iextension.h>
77

88
namespace scratchcpprender
99
{
1010

1111
class SpriteModel;
1212
class PenState;
1313

14-
class PenBlocks : public libscratchcpp::IBlockSection
14+
class PenBlocks : public libscratchcpp::IExtension
1515
{
1616
public:
1717
enum Inputs
@@ -25,6 +25,7 @@ class PenBlocks : public libscratchcpp::IBlockSection
2525
};
2626

2727
std::string name() const override;
28+
std::string description() const override;
2829

2930
void registerBlocks(libscratchcpp::IEngine *engine) override;
3031

src/blocks/penextension.cpp

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

src/blocks/penextension.h

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

src/listmonitormodel.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ ListMonitorModel::ListMonitorModel(QObject *parent) :
1212
{
1313
}
1414

15-
ListMonitorModel::ListMonitorModel(libscratchcpp::IBlockSection *section, QObject *parent) :
16-
MonitorModel(section, parent)
15+
ListMonitorModel::ListMonitorModel(libscratchcpp::IExtension *extension, QObject *parent) :
16+
MonitorModel(extension, parent)
1717
{
1818
m_listModel = new ListMonitorListModel(this);
1919
}

src/listmonitormodel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class ListMonitorModel : public MonitorModel
2121

2222
public:
2323
ListMonitorModel(QObject *parent = nullptr);
24-
ListMonitorModel(libscratchcpp::IBlockSection *section, QObject *parent = nullptr);
24+
ListMonitorModel(libscratchcpp::IExtension *extension, QObject *parent = nullptr);
2525

2626
void onValueChanged(const libscratchcpp::VirtualMachine *vm) override;
2727

src/monitormodel.cpp

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#include <scratchcpp/monitor.h>
44
#include <scratchcpp/sprite.h>
5-
#include <scratchcpp/iblocksection.h>
5+
#include <scratchcpp/iextension.h>
66

77
#include "monitormodel.h"
88

@@ -13,14 +13,14 @@ MonitorModel::MonitorModel(QObject *parent) :
1313
{
1414
}
1515

16-
MonitorModel::MonitorModel(libscratchcpp::IBlockSection *section, QObject *parent) :
16+
MonitorModel::MonitorModel(libscratchcpp::IExtension *extension, QObject *parent) :
1717
QObject(parent)
1818
{
19-
if (!section)
19+
if (!extension)
2020
return;
2121

22-
// TODO: Get the color from the block section
23-
std::string name = section->name();
22+
// TODO: Get the color from the extension
23+
std::string name = extension->name();
2424
if (name == "Motion")
2525
m_color = QColor::fromString("#4C97FF");
2626
else if (name == "Looks")
@@ -69,6 +69,14 @@ void MonitorModel::onVisibleChanged(bool visible)
6969
emit visibleChanged();
7070
}
7171

72+
void MonitorModel::onXChanged(int x)
73+
{
74+
}
75+
76+
void MonitorModel::onYChanged(int y)
77+
{
78+
}
79+
7280
libscratchcpp::Monitor *MonitorModel::monitor() const
7381
{
7482
return m_monitor;

src/monitormodel.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
namespace libscratchcpp
1111
{
1212

13-
class IBlockSection;
13+
class IExtension;
1414

1515
}
1616

@@ -43,12 +43,14 @@ class MonitorModel
4343
Q_ENUM(Type)
4444

4545
MonitorModel(QObject *parent = nullptr);
46-
MonitorModel(libscratchcpp::IBlockSection *section, QObject *parent = nullptr);
46+
MonitorModel(libscratchcpp::IExtension *extension, QObject *parent = nullptr);
4747

4848
void init(libscratchcpp::Monitor *monitor) override final;
4949

5050
virtual void onValueChanged(const libscratchcpp::VirtualMachine *vm) override { }
5151
void onVisibleChanged(bool visible) override final;
52+
void onXChanged(int x) override final;
53+
void onYChanged(int y) override final;
5254

5355
libscratchcpp::Monitor *monitor() const;
5456

0 commit comments

Comments
 (0)